First, What Is It
- API: functions the SDK exposes to applications. This column is sourced from the SDK public headers (
drivers/lhal/include,components/*) and organizes 1800+ APIs by component. - Universal pattern: almost every driver API follows "get device handle → init → operate → handle result", see Kernel & System APIs.
- Descriptions: based on the SDK header doxygen comments and driver implementations; Chinese pages use Chinese descriptions, English pages use the English originals.
Chip scope
This column targets the Ai-M61 / Ai-M62 (BL616/BL618). In the SDK, BL616CL corresponds to the Ai-Thinker Ai-M64 series; its exclusive peripherals (e.g., touch v2, ADC v2, PEC, DSI, video decode, DMA2D) are marked with "(Ai-M64 only)" and are not supported by Ai-M61/Ai-M62.
API Category Index
| Category | Contents | Page |
|---|---|---|
| Kernel & System | device handle, interrupt, clock, reset, timer, multi-core sync | Kernel & System APIs |
| Basic Peripherals | GPIO/UART/SPI/I2C/ADC/PWM/Timer/DMA/Flash, etc. | Basic Peripheral APIs |
| Multimedia | display (DBI/DSI/DVP/OSD/touch) and audio/video (I2S/AUADC/AUDAC/CAM/MJPEG) | Multimedia APIs |
| Security & Encryption | AES/SHA/PKA/TRNG/ECDSA/DSA security engines | Security & Encryption APIs |
| System, Storage & Upgrade | MTD/EasyFlash, FATFS/LittleFS, coredump, OTA | System, Storage & Upgrade APIs |
| FreeRTOS | tasks, queues, semaphores, mutexes, event groups, timers | FreeRTOS APIs |
| WiFi & Network | wifi_mgmr, fhost, lwIP socket | WiFi & Network APIs |
| BLE | controller, host stack, GAP/GATT/connection | BLE APIs |
| Shell & Logging | serial shell, bflog levels | Shell & Logging APIs |
Usage Pattern (Learn One, Apply to All)
/* 1. Get the device handle */
struct bflb_device_s *dev = bflb_device_get_by_name("uart0");
/* 2. Init (mode/parameters/rate) */
bflb_uart_init(dev, config);
/* 3. Operate (read/write/start/stop) */
/* 4. Handle result/status */Common Exam & Interview Questions
Why does every SDK API start with bflb_device_get_by_name?
The device model maps "device name → handle (address/IRQ/operation table)"; driver APIs work through the handle, so changing instances or chips keeps the code style stable.
How to quickly find the API for a peripheral?
The API prefix is the peripheral name (GPIO is bflb_gpio_*, UART is bflb_uart_*, Wi-Fi is wifi_mgmr_*, BLE is bt_*); locate the category here, then check the header file.
Have questions?
For any other questions, visit the unified Q&A and discussion board: Ai-Thinker Discussions

