Hardware reference

Mikronix runs on the Waveshare ESP32-C6 2.06" AMOLED board (esp32-c6-amoled206) as its primary machine. Every driver is register-level -- no vendor blobs, no RTOS shim under the drivers.

The board

Waveshare ESP32-C6 2.06" AMOLED (ESP32-C6-MINI-1 module):

Board config: sys/arch/esp32/esp32_c6_amoled206/GENERIC

Display -- SH8601

The SH8601 is a QSPI AMOLED display controller. Mikronix drives it at the register level -- no vendor SDK dependency. The framebuffer driver (fb0) accepts raw RGB565 frames; the console renders through the vt buffer into row stripes.

Reference: Waveshare BSP sys/arch/esp32/components/ (read-only)

Touch -- FT5x06

Property Value
Interface QSPI (GPSPI2)
Resolution 410 x 502 pixels
Color depth 16-bit RGB565
Backlight reg 0x51, 0-255
Driver file sys/arch/esp32/drivers/display_esp32.c
Header sys/mnx/display.h
Console 51x31, font_8x16/Spleen, vt buffer, row stripes

The FT5x06 driver is compiled in but not listed in the board's GENERIC config. Add a device ft5x06 line to bring it in.

Power -- AXP2101 (PMIC)

Property Value
Bus I2C (addr 0x38)
Protocol FT5x06 touch controller
Driver file sys/dev/input/ft5x06.c
Status compiled in GENERIC, not probed at boot

The PMIC powers the I2C clients behind it. Without a battery the PMIC is power-gated and NACKs -- the kernel reports "probe says absent", which is the honest bus answer.

Clock -- PCF85063 (RTC)

Property Value
Bus I2C (addr 0x34)
CHIP_ID 0x4A
Fuel gauge reg 0xA4, 12-bit
ADC VBUS/VBUS/VSYS/TDIE (reg 0x30)
Read format `bat=<c d -> vbat=<mV> vbus=<mV> vsys=<mV> tdie=<C*10> ok=<0 1>`
Driver file sys/dev/power/axp2101.c

Seven BCD registers read from 0x04 (SEC) -- seconds, minutes, hours, days, weekdays, months, years (2000+offset). Probe requires the bus alive; behind the PMIC power tree it reads garbage without a battery.

Audio -- ES8311

Property Value
Bus I2C (addr 0x51)
Registers 7 BCD regs from SEC (0x04)
Mode CTRL1=0x00 (normal, no software reset)
Date range 2000 + year register
Driver file sys/dev/rtc/pcf85063.c

The ES8311 handles audio output; the ES7210 is the I2C microphone. Both are compiled in but not listed in GENERIC.

Additional drivers (compiled in GENERIC)

Property Value
Bus I2C (control) / PDM (audio)
Role Audio codec (ADC + DAC)
Microphone ES7210 (I2C)
Driver file sys/dev/audio/es8311.c
Status compiled in GENERIC, not probed at boot

Add a device <name> line to the board's GENERIC to bring one in. Boot-gating works: drv_<name>=0 disables it at boot.

Kernel driver sources

Driver Device Bus Status
drvtouchft5x06 input1 I2C not probed
drvimuqmi8658 imu0 I2C not probed
drvaudioes8311 sound0 I2C/PDM not probed
drvaudioes7210 mic0 I2C not probed
drveepromnvs eeprom0 NVS not probed
drvledgpio led0 GPIO not probed
drvbuttonesp32c6 button0 GPIO not probed
drvwdtesp32 watchdog0 watchdog not probed

Adding a new driver

  1. Create sys/dev/<subsystem>/<name>.c (KNF, BSD 2-clause header,
  2. $Mnx$ tag).

  3. Define struct driver drv_<name> with .class, .level, .init,
  4. .probe -- leave .name NULL for classN auto-naming.

  5. probe(): cheap presence check (I2C ACK / WHOAMI).
  6. init(): configure hardware, dev_register() the node.

  7. Add device <name> to the board's GENERIC in dependency order
  8. (after its bus driver).

  9. Boot-gating comes free: drv_<name>=0 disables it at boot.

ESP32-C6 TRM

The ESP32-C6 Technical Reference Manual is the primary hardware reference for register definitions, memory map, and peripheral layouts. Source: Espressif.

Reference priority for hardware: ESP32-C6 TRM > Waveshare BSP (sys/arch/esp32/components/) > component datasheets (SH8601, FT5x06, AXP2101, PCF85063, ES8311).

Subsystem Path
GPIO sys/dev/gpio/gpio_esp32.c
I2C sys/dev/i2c/i2c_esp32.c
Display (SH8601) sys/arch/esp32/drivers/display_esp32.c
Audio (I2S/ES8311) sys/arch/esp32/drivers/audio_esp32.c
I2S sys/arch/esp32/drivers/i2s_esp32.c
WiFi sys/arch/esp32/drivers/wifi_esp32.c
Bluetooth sys/arch/esp32/drivers/bt_esp32.c
802.15.4 sys/arch/esp32/drivers/ieee802154_esp32.c
EEPROM/NVS sys/arch/esp32/drivers/eeprom_esp32.c
Watchdog sys/arch/esp32/drivers/watchdog_esp32.c
Socket sys/arch/esp32/drivers/socket_esp32.c