Skip to main content

AC792N_Develop_Board Peripheral Mapping

This document describes the mapping between the AC792N_Develop_Board (AC792N / WL83) hardware peripherals and the Tuya TKL layer software peripheral ports.

The pin data here comes from the vendor SDK's board files and headers, not from a schematic. No schematic ships with the repository, so whether a pin is bonded out on the package, and whether the board already uses it for something else, still has to be confirmed against the version-matched schematic. Items marked "not registered" or "unverified" are not usable capabilities.

Pin naming and numberingโ€‹

JieLi names a pin IO_PORT<port letter>_<number>, and that name is already a number:

#define IO_GROUP_NUM 16
#define IO_PORTA_07 (IO_GROUP_NUM * 0 + 7) /* = 7 */
#define IO_PORTD_07 (IO_GROUP_NUM * 3 + 7) /* = 55 */

Port A occupies 0โ€“15, B 16โ€“31, and so on โ€” the same flat layout as Tuya's TUYA_GPIO_NUM_E. So PA7 is software pin 7.

ADC channels are a separate namespace: ADC_IO_CH_PD00 is channel 0, which is not the same numbering as the GPIO pin PD0.

GPIOโ€‹

  • Port widths are not uniform (from the masks in asm/gpio.h):

    PortWidthPin range
    A160โ€“15
    B1616โ€“31
    C1432โ€“45 (PC14 / PC15 do not exist)
    D1648โ€“63
    E1664โ€“79
    F680โ€“85
    FUSB296 (DPA), 97 (DMA)
    HUSB2112 (DPB), 113 (DMB)

    So 46, 47, 86โ€“95 and 98โ€“111 are not valid pins; R (128/129) and V (144/145) sit above IO_MAX_NUM and are outside this numbering.

  • Tuya's TKL GPIO numbering stops at TUYA_GPIO_NUM_MAX (64), so only ports Aโ€“D (pins 0โ€“63) are reachable through TKL.

Board pinFunctionSoftware pinSoftware port
PA0 โ€“ PD15GPIOTUYA_GPIO_NUM_0 โ€“ TUYA_GPIO_NUM_63/

Interruptsโ€‹

  • This chip has a real per-pin external interrupt (exti_init); the number of pins is not limited by an event table.
  • Only rising and falling edges are supported; there is no both-edges or level-triggered mode.
  • The TKL upper bound still applies: interrupts can only be registered for pins 0โ€“63.

Electrical modesโ€‹

  • Pull-up / pull-down: only the 10K tap is available (the vendor header marks 100K / 1M as unsupported on this part).
  • Open-drain output: not available; tkl_gpio_init returns OPRT_NOT_SUPPORTED.

ADCโ€‹

  • One ADC unit (TUYA_ADC_NUM_0), 10 bit, 3.3 V reference.
  • 16 external analog channels:
Board pinSoftware channelSoftware port
PD0ch_0 (K1 button)TUYA_ADC_NUM_0
PD1ch_1TUYA_ADC_NUM_0
PD6ch_2TUYA_ADC_NUM_0
PD7ch_3TUYA_ADC_NUM_0
PD8ch_4TUYA_ADC_NUM_0
PD9ch_5TUYA_ADC_NUM_0
PD10ch_6TUYA_ADC_NUM_0
PE4ch_7TUYA_ADC_NUM_0
PE5ch_8TUYA_ADC_NUM_0
PE6ch_9TUYA_ADC_NUM_0
PE7ch_10TUYA_ADC_NUM_0
PE8ch_11TUYA_ADC_NUM_0
PE9ch_12TUYA_ADC_NUM_0
PC13ch_13TUYA_ADC_NUM_0
DPch_14TUYA_ADC_NUM_0
DMch_15TUYA_ADC_NUM_0
  • The on-board K1 button sits on the PD0 (ADC channel 0) resistor ladder, with a pressed range of 0โ€“96 raw.
  • PD1 is also the log UART TX pin, so PD0/PD1 should not be repurposed as plain GPIO.
  • Temperature and tkl_adc_ioctl are not implemented and return OPRT_NOT_SUPPORTED.

UARTโ€‹

  • The log port is SDK UART0: TX = PD1, RX = PE11.
  • This board has no separate service UART (JIELI_BOARD_HAS_SERVICE_UART = n), so TAL CLI and logging share the same uart0 โ€” console output and CLI input go through one physical port.
  • The baud rate comes from CONFIG_JIELI_UART_LOG_BAUDRATE; the default is 115200 (the vendor header's 1000000 is rewritten during staging).
  • TKL logical TUYA_UART_NUM_0 maps to SDK uart0; logical TUYA_UART_NUM_1 maps to SDK uart2, but uart2 is not registered by the current board profile (TCFG_UART2_ENABLE is only defined under USE_UART_DEVICE_TEST_DEMO), so logical UART1 is unavailable at run time.
Board pinFunctionSoftware pinSoftware port
PD1UART0_TX (log + CLI)TUYA_UART0_TXTUYA_UART_NUM_0
PE11UART0_RX (log + CLI)TUYA_UART0_RXTUYA_UART_NUM_0
  • PE11 = 75, which is outside the TKL GPIO range 0โ€“63, so it can only be configured on the vendor side and is not reachable through tkl_gpio_*.
  • Receive is driven by the vendor's interrupt event callback: the ISR only posts a semaphore and a task performs dev_read.
  • TX interrupt, hardware flow control, tkl_uart_wait_for_data and tkl_uart_ioctl are not implemented.

IICโ€‹

  • The chip provides hardware IIC and software-emulated IIC. The vendor demo_hello board file defines three buses, all behind USE_IIC_TEST_DEMO, which is off:
DeviceTypeBoard pins
iic0hardware IICSCL PA4, SDA PA5
iic1hardware IICSCL PA6, SDA PA7
iic2software IICSCL PA6, SDA PA7

Current state: not registered, so tkl_i2c_init returns OPRT_NOT_SUPPORTED at run time and ENABLE_I2C is undeclared. Enabling it requires registering the device in the board profile with pins confirmed against the schematic.

PWMโ€‹

  • The vendor board file defines pwm1, behind USE_PWM_TEST_DEMO, which is off:
    • timer-PWM remap pin: PA4 (TIMER2)
    • MCPWM channels: all -1 (unused)
  • This chip supports multi-channel PWM (each channel's pin is fixed in the board's remap table).

Current state: not registered; ENABLE_PWM is undeclared.

TIMERโ€‹

  • The TKL timer is built on the vendor's microsecond timer service; it needs no board registration and no pin.
  • Callbacks run in the SDK's timer task, not in the interrupt (call_in_irq = 0), so a callback may safely stop or deinit its own timer. The cost is that callback latency is a scheduler tick.
  • tkl_timer_get returns microseconds elapsed since the timer was started.

SPIโ€‹

  • Three SPI controllers. The vendor board file defines spi1 / spi2, both behind their USE_SPI_*_TEST_DEMO switch, which is off.
  • spi1 (master example): CLK PA4, DO PA5, DI PA6, CS -1 (software driven).

Current state: not registered; ENABLE_SPI is undeclared.

The adapter implements synchronous master transfers (8-bit, MSB first). Slave mode, interrupt completion callbacks, status queries and ioctl all return OPRT_NOT_SUPPORTED.

MIPI-DSI displayโ€‹

  • The board carries a MIPI-DSI panel, model MIPI_480x800_ST7701S.
  • Board control pins: reset PB0, backlight PB1 (from the board facts).
  • This path is used by the display TDD and does not go through the GPIO/SPI TKL interfaces.

Resources already in use on this boardโ€‹

Avoid these when adding a peripheral:

PinUse
PD1Log output (SDK UART0 TX)
PE11Log / CLI input (SDK UART0 RX)
PD0K1 button (ADC channel 0)
PB0Display reset
PB1Display backlight
PA4 / PA5 / PA6 / PA7Declared as IIC / PWM / SPI in vendor examples (not registered, not checked against a schematic)

Current TuyaOpen support stateโ€‹

PeripheralTKL implementationCapability declaredUsable at run time
GPIO (incl. IRQ, pulls)yesENABLE_GPIOyes (0โ€“63; PC14/PC15 do not exist)
ADCyesENABLE_ADCyes (ADC0, 10 bit, 16 channels)
UARTyesENABLE_UARTyes (logical UART0 = uart0, PD1 / PE11; logical UART1 not registered)
TIMERyesENABLE_TIMERyes
IICyesnot declaredno: no device registered by the board
PWMyesnot declaredno: no device registered by the board
SPIyesnot declaredno: no device registered by the board
MIPI-DSIyes (this chip only)declared through board display factsyes (not exposed through TKL peripheral APIs)
pinmuxyes (this chip only)not declaredimplemented but undeclared: ENABLE_PINMUX has no chip dimension, so declaring it would misrepresent wl82