Bring-up 5: Peripherals and AI
The final stage brings up the hardware your product actually uses โ GPIO, buses, audio, display, Bluetooth โ and then runs the AI application on top of the now-solid base. Do this last: a peripheral bug is easy to find once system, storage, network, and cloud already work.
Goalโ
Your product's peripherals work through TuyaOpen, and an AI application such as your_chat_bot runs end to end (voice in, cloud reasoning, voice/display out).
Files to implementโ
Implement only what your product needs.
| File | Enables |
|---|---|
tkl_gpio.c / tkl_pinmux.c | GPIO and pin multiplexing |
tkl_i2c.c / tkl_spi.c | I2C and SPI buses (sensors, displays, codecs) |
tkl_pwm.c / tkl_adc.c / tkl_dac.c | PWM, ADC, DAC |
tkl_i2s.c | I2S audio โ microphone capture and speaker playback |
tkl_disp.c (or mcu8080 / rgb / qspi) | Display panel interface |
tkl_bluetooth.c | BLE โ provisioning and BLE peripherals |
tkl_kws.c / tkl_vad.c | Wake-word spotting and voice activity detection |
tkl_ota.c | OTA firmware update |
Detailsโ
- Audio is the AI prerequisite.
your_chat_botneeds working I2S capture and playback; bring uptkl_i2s.cand verify a microphone-to-speaker loopback before adding the cloud AI layer. - Display is needed only for on-device AI UIs; pick the interface your panel uses (
mcu8080,rgb, orqspi). - Wake word.
tkl_kws.c/tkl_vad.clet the device wake on a keyword; supply the model files for your platform. - Validate peripherals individually with the peripheral examples before composing them into the app.
- The on-device AI stack itself (modes, agent, UI) is reused โ see the Component Framework; you only provide the hardware via these adapters.
Verifyโ
Run the relevant peripheral examples (GPIO, I2C, audio) and confirm each works. Then build apps/tuya.ai/your_chat_bot, and confirm a full voice round-trip: speak โ ASR โ cloud reply โ TTS playback (and display, if present). That completes the platform port.
See alsoโ
- Component Framework โ the on-device AI stack you run on top
- Multimodal data flow โ how audio/vision reach the cloud
- Supported peripherals
- Bring Your Chip to TuyaOpen