nanoFramework.Iot.Device.Es7243e 1.0.8

Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Es7243e --version 1.0.8
                    
NuGet\Install-Package nanoFramework.Iot.Device.Es7243e -Version 1.0.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Es7243e" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Es7243e" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Es7243e" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Es7243e --version 1.0.8
                    
#r "nuget: nanoFramework.Iot.Device.Es7243e, 1.0.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Es7243e@1.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Es7243e&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Es7243e&version=1.0.8
                    
Install as a Cake Tool

ES7243E - Audio ADC (microphone capture codec)

The Everest Semiconductor ES7243E is a low-power audio ADC used on many ESP32 audio boards (ESP-BOX, ESP32-S3-Korvo, LyraT). It digitizes analog microphone inputs and outputs the captured audio as an I2S PCM stream.

This binding covers the I2C control plane only. It configures the codec (clocking, serial data format, microphone gain, mute and power state). The captured PCM audio samples are streamed out over I2S using System.Device.I2s and are not handled by this binding.

The register sequences are ported from the Espressif esp_codec_dev component and must be validated on real hardware if different from the ESP32-S3 Box Lite. The default I2C address (typically 0x10 or 0x11) and the exact serial-format bit mapping depend on your board wiring - confirm against the schematic and codec datasheet.

Documentation

Audio path on the ESP32-S3-BOX-Lite

Signal Pin Purpose
I2C SCL GPIO18 Codec register control clock
I2C SDA GPIO8 Codec register control data
I2S DSIN GPIO16 Capture samples from the ES7243E into the ESP32
I2S DOUT GPIO15 Playback samples out of the ESP32 to the ES8156
I2S WS / LRCLK GPIO47 Word select / left-right clock

The I2C bus carries register configuration only (sample rate, data format, mic gain, mute, power). No audio samples travel over I2C. The actual PCM audio streams over I2S.

Usage

Important: I2C pins for the ESP32 must be properly set up before creating the I2cDevice. For this, make sure you install the nanoFramework.Hardware.Esp32 NuGet and use the Configuration class to configure the pins:

using Iot.Device.Es7243e;
using nanoFramework.Hardware.Esp32;
using System;
using System.Device.I2c;
using System.Device.I2s;

// Setup ESP32-S3-BOX-Lite I2C control bus (SDA = GPIO8, SCL = GPIO18).
Configuration.SetPinFunction(8, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(18, DeviceFunction.I2C1_CLOCK);

I2cConnectionSettings settings = new I2cConnectionSettings(1, Es7243e.DefaultI2cAddress);
I2cDevice i2cDevice = new I2cDevice(settings);

Es7243e adc = new Es7243e(i2cDevice);

// Setup the ESP32 I2S receiver first so MCLK/BCLK/WS are running before the codec is configured.
// ESP32-S3-BOX-Lite I2S pin-out: BCLK = GPIO17, WS = GPIO47, DSIN = GPIO16, MCLK = GPIO2.
Configuration.SetPinFunction(17, DeviceFunction.I2S1_BCK);
Configuration.SetPinFunction(47, DeviceFunction.I2S1_WS);
Configuration.SetPinFunction(16, DeviceFunction.I2S1_MDATA_IN);
Configuration.SetPinFunction(2, DeviceFunction.I2S1_MCK);

I2sDevice i2s = new I2sDevice(new I2sConnectionSettings(1)
{
    Mode = I2sMode.Master | I2sMode.Rx,
    CommunicationFormat = I2sCommunicationFormat.I2S,
    ChannelFormat = I2sChannelFormat.RightLeft,
    BitsPerSample = I2sBitsPerSample.Bit16,
    SampleRate = 16_000,
});

// Bring the codec up and start capturing. Initialize() already puts the ES7243E into 16-bit I2S
// mode; set the mic gain after Start() (which resets it to a low value).
adc.Initialize();
adc.Start();
adc.SetMicGain(Es7243e.MaxMicGain);

// Read a block of audio and compute a simple peak amplitude. When you speak or tap near the
// microphones the reported value rises above the idle noise floor, confirming the ES7243E is
// configured correctly and streaming over I2S.
SpanByte buffer = new byte[1024];
i2s.Read(buffer);

int peak = 0;
for (int i = 0; i + 1 < buffer.Length; i += 2)
{
    short sample = (short)(buffer[i] | (buffer[i + 1] << 8));
    int magnitude = sample < 0 ? -sample : sample;
    if (magnitude > peak)
    {
        peak = magnitude;
    }
}

Debug.WriteLine($"Peak amplitude = {peak}");

The full sample loops the I2S read so you can watch the peak amplitude react to sound in real time.

For other targets (STM32, etc.) use the preset hardware I2C pins (no SetPinFunction call needed).

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.8 85 7/13/2026
1.0.1 99 7/8/2026