API Reference
The ALP SDK's public surface lives under include/alp/. Every header is C99-compatible and Doxygen-documented; this page summarises what each one provides.
Conventions
All public APIs follow the same shape:
// Open a peripheral
alp_<class>_t *handle = alp_<class>_open(&(alp_<class>_config_t){ ... });
if (handle == NULL) {
int err = alp_last_error(); // ALP_ERR_NOSUPPORT, OUT_OF_RANGE, ...
}
// Operate
alp_err_t rc = alp_<class>_<op>(handle, ...);
// Close
alp_<class>_close(handle);
- Handles are opaque pointers returned by
_open().NULLindicates failure. alp_last_error()is a thread-local diagnostic. Read it whenever_open()returnsNULLor*_opreturns an error.- Instance IDs (
E1M_I2C0,E1M_PWM3, …) come from<alp/e1m_pinout.h>and are portable across every E1M-conformant SoM. alp_err_tis an integer;ALP_OK == 0. Failure codes are documented per-call but use a small common set (see Architecture).
Headers
Peripherals
| Header | Page | What it provides |
|---|---|---|
<alp/peripheral.h> | Peripheral | I²C, SPI, GPIO, UART — the four core bus classes |
<alp/pwm.h> | PWM | PWM channels |
<alp/adc.h> | ADC | Analog-to-digital sampling, streaming, filters |
<alp/counter.h> | Counter | Counters + quadrature encoder |
<alp/i2s.h> | I²S | I²S / SAI audio bus |
<alp/can.h> | CAN | CAN / CAN-FD |
<alp/rtc.h> | RTC | Real-time clock |
<alp/wdt.h> | WDT | Watchdog timer |
<alp/usb.h> | USB | USB 2.0 / 3.0 |
Audio / camera / display
| Header | Page | What it provides |
|---|---|---|
<alp/audio.h> | Audio | PDM in + I²S out, ALP-default DSP chain |
<alp/camera.h> | Camera | MIPI CSI / parallel camera, ISP |
<alp/display.h> | Display | Display subsystem (raw) |
<alp/gui.h> | GUI | LVGL re-export with ALP defaults |
Inference
| Header | Page | What it provides |
|---|---|---|
<alp/inference.h> | Inference | NPU dispatcher (Ethos-U / DRP-AI / DEEPX / CPU) |
<alp/dsp.h> | DSP | FIR/IIR/FFT chains over CMSIS-DSP |
Connectivity & security
| Header | Page | What it provides |
|---|---|---|
<alp/iot.h> | IoT | Wi-Fi station + MQTT |
<alp/ble.h> | BLE | BLE 5.4 peripheral + central |
<alp/security.h> | Security | MbedTLS PSA Crypto (hash / AEAD / TRNG) |
System
| Header | Page | What it provides |
|---|---|---|
<alp/rpc.h> | RPC | Framed RPC over OpenAMP/RPMsg (heterogeneous IPC) |
<alp/mproc.h> | Mproc | Raw mailbox / shared mem / hwsem primitives |
<alp/hw_info.h> | HW Info | EEPROM manifest + BOARD_ID ADC |
<alp/power.h> | Power | System power modes |
<alp/storage.h> | Storage | Block storage, optional inline AES |
Capability / portability
| Header | What it provides |
|---|---|
<alp/soc_caps.h> | (generated) Active-SoC capability constants used by *_open(). |
<alp/e1m_pinout.h> | E1M-spec instance IDs + portability bounds (E1M_<CLASS>_COUNT). |
<alp/boards/<carrier>.h> | Carrier-feature names (e.g. EVK pin map). |
Generated headers
| Header | What it provides |
|---|---|
<alp/system_ipc.h> | Endpoint IDs, addresses, mailbox channel macros — emitted from board.yaml's ipc: block. Both halves of a heterogeneous project #include it. |
<alp_hw_info_build.h> | ALP_HW_BUILD_* macros baked from board.yaml's som: / carrier: blocks. |
Chip drivers
50+ drivers under <alp/chips/...> — opt-in via board.yaml's chips: array. Each driver follows the same shape: <chip>_init(&ctx, bus, ...) → per-feature getters / setters. Driver names use the chip's natural manufacturer name (lsm6dso_*, ssd1306_*, gd32g553_*); the alp_ prefix is reserved for SDK-level abstractions.
ABI stability
Every public header is annotated [ABI-STABLE] or [ABI-EXPERIMENTAL] at the file-level Doxygen block. The SDK ships an ABI snapshot + a pr-abi-snapshot.yml CI job that blocks merges which change the binary surface without an explicit bump. Stable headers carry that contract until the next major bump; experimental headers (e.g. <alp/gpu2d.h>, the wave-2 <alp/dsp.h> chain types, <alp/power.h>'s mode setter) reserve the right to evolve pre-v1.0.
Pin your SDK to a specific commit if you depend on an experimental surface. See docs/abi-stability.md for the policy.
Per-row implementation status
Some headers are surface-only on certain (OS × SoM) combinations — the call returns NULL + ALP_ERR_NOSUPPORT. The authoritative per-row status lives in the SDK repo:
docs/os-support-matrix.md— which backend, which OS, which SoMdocs/test-plan.md— HW-verified (✅) vs code-merged-pending (🟡) vs not-started (⏳)
Doxygen
The full Doxygen-rendered reference is available in the SDK repo at docs/doxygen/. Build locally with doxygen Doxyfile.
Where next
<alp/peripheral.h>— the most-used header (GPIO / I²C / SPI / UART)- Chip catalogue
- Examples