SDK for TESAIoT Dev Kit
API reference & tutorials (ModusToolbox)
Loading...
Searching...
No Matches
Peripherals at a glance
Variant
mtb-mpy and mtb-only

The C-side tables on this page apply to both packages. The MicroPython tables are marked and render only in the mtb-mpy set, because the mtb-only package ships no mod*.c binding file at all — see Variant matrix.

What this page is

The lookup page for the peripheral surface: every call, what it returns, and the BSP_HAS_* flag that decides whether it exists. The chapters explain why*; this page exists so you do not have to read them twice.

Two scope facts constrain everything below, and both are worth stating before the first table:

  • This package ships exactly one BSP — bsps/TARGET_KIT_PSE84_AI/. Every #ifdef USE_KIT_PSE84_EVAL_EPC2 branch in the sensor and GPIO sources is compiled out here and cannot be reached from this package.
  • The peripheral bindings are template source, not a prebuilt archive. Nothing in sdk/docs/ describes them, because they are not in any shipped .a. That is why this section is a tutorial plus this table, and not an nm-derived API dump.

The BSP flags, as this board sets them

bsps/TARGET_KIT_PSE84_AI/bsp_features.mk is the only board file in the package. Unset flags default to 0 in bento_libs/claw/common/shared/include/bsp_feature_flags.h.

Flag Value here Line What it gates
BSP_HAS_BMI270 1 :12 IMU driver + the bmi270 sub-module
BSP_HAS_BMM350 1 :13 magnetometer + bmm350_diag / bmm350_debug
BSP_HAS_DPS368 1 :16 barometer
BSP_HAS_SHT40 1 :17 humidity/temperature
BSP_HAS_RADAR 1 :18 the three radar calls (CM55 BGT60TR13C task)
BSP_HAS_QWA309_BASEBOARD 1 :25 pots, buttons, rgbmatrix, header, can, shield
BSP_HAS_CAPSENSE 1 :32 CapSense 4000T over I2C
BSP_HAS_POTENTIOMETER 1 :34 the SAR pot path
BSP_HAS_ARDUINO_HEADER 1 :58 the QWA309 expansion header
ENABLE_PAGE_GPIO_RGB 1 :76 the on-screen GPIO and RGB matrix page
ENABLE_PAGE_MOTOR_CTRL 0 :77 the Motor Shield v2 page — off by default
Warning
A value must be a bare 1 or 0 with no trailing whitespace. The consuming Makefiles compare with ifeq ($(VAR),1), which is whitespace-sensitive, so a trailing space silently drops the feature with no error anywhere. The file says so itself at bsp_features.mk:28-30. Recorded as Appendix X #23 — Appendix X — Traps and anti-patterns.

Pins, buses and addresses

Everything on the sensor bus is SCB0 I2C on P8.0 SCL / P8.1 SDA (sensor_i2c.c:99-100). SCB0 is shared with the OPTIGA Trust M PAL, which is why the lock in J1 — The sensor bus and its lock is not optional.

Device Address Bus Owned by Header
BMI270 IMU 0x68 SCB0 I2C CM33_NS sensor_bmi270.h:16
BMM350 magnetometer 0x15 I3C (CYBSP_I3C_SCL/SDA) CM33_NS sensor_bmm350.h:20
DPS368 barometer 0x77 SCB0 I2C CM33_NS sensor_dps368.h:16
SHT40 humidity 0x44 SCB0 I2C CM33_NS sensor_sht40.h:17
CapSense 4000T 0x08 display/touch bus on a QWA309 board CM55 sensor_capsense.h:20
DFR0522 RGB matrix 0x10 header bus CM55 mod_rgbmatrix.c:6-13
BGT60TR13C radar — SPI CM55 tesaiot-radar/radar_task.h

Board I/O that is not on a bus:

Signal Pin(s) Note
RGB LED red / blue / green P20.6 / P20.5 / P20.4 TCPWM0 group 1, lines 265 / 264 / 263 (modgpio.c:159-166)
LED1, LED2 CYBSP_USER_LED1/2 no TCPWM route — bit-bang only
USER button CYBSP_USER_BTN1 reported as "SW2" (modgpio.c:53-58)
QWA309 SW4 / SW5 P17.5 / P17.7 active-low, MCU pull-ups (mod_qwa309_buttons.c:67-68)
Single pot (sensors.pot) P15[1] SAR GPIO channel 0, MTB HAL, scaled against 3.3 V (sensor_potentiometer.c:6-19)
QWA309 VR1..VR4 (pots) P15.4..P15.7 AutAnalog SAR GPIO channels 4..7 — not in knob order
QWA309 header GPIO P13.0, P13.3, P13.4, P13.5, P13.6, P13.7 logical index 0..5
QWA309 header PWM P13.3 (P13.4 = complement) TCPWM0 counter 5
QWA309 header UART P15.0 RX / P15.1 TX SCB9, 115200 8N1
Note
P17.5 is also the USB-host VBUS enable. Buttons and the USB joystick are mutually exclusive on this base board; the first buttons_hw_init() takes the pin for input (mod_qwa309_buttons.c:16-22).

The C entry points (both packages)

These are the names an mtb-only developer calls directly, and the names the MicroPython bindings call underneath on mtb-mpy.

Family Entry points File
Bus sensor_i2c_init :88, sensor_i2c_lock(ms) :168, sensor_i2c_unlock :175, sensor_i2c_is_init :181, sensor_i2c_write_reg :215, sensor_i2c_read_reg :240, sensor_i2c_scan :317 sensor_i2c.c
BMI270 bmi270_read_chip_id :65, bmi270_init :195, bmi270_read_accel :218, bmi270_read_gyro :235, bmi270_read_temperature :252 sensor_bmi270.c
BMM350 bmm350_init :391, bmm350_reinit :539, bmm350_debug_read :559, bmm350_read_xyz :703, bmm350_cal_update :739, bmm350_cal_reset :766, bmm350_heading_from_xy :791, bmm350_read_heading :829, bmm350_diagnose :863 sensor_bmm350.c
DPS368 dps368_read_product_id :97, dps368_init :101, dps368_read_temperature :228, dps368_read_pressure :246, dps368_read_both :273 sensor_dps368.c
SHT40 sht40_init :40, sht40_read_temperature :107, sht40_read_humidity :111, sht40_read_both :116, sht40_read_serial :120 sensor_sht40.c
Potentiometer potentiometer_init :26, potentiometer_read_raw :61, potentiometer_read_percent :72, potentiometer_read_voltage :82 sensor_potentiometer.c
CapSense one API, two backends — see The CapSense fork: one API, two backends sensor_capsense.h
Auto-push sensor_auto_get_bmi270 :1498, sensor_auto_task_create :1513, sensor_auto_start :1583, sensor_auto_stop :1591, sensor_auto_is_running :1601, sensor_auto_set_rate :1605, sensor_auto_get_rate :1611, sensor_auto_set_mask :1615, sensor_auto_get_mask :1619, sensor_auto_enable :1623, sensor_auto_disable :1627, sensor_auto_get_push_count :1631 sensor_auto_task.c
CM55 poll cm55_sensor_poll_init :34, cm55_sensor_poll_tick :37, cm55_capsense_tick :46, cm55_sensor_poll_status :49, cm55_pot_read_all :54, cm55_sensor_poll_diag :57 cm55_sensor_poll.h
Radar (CM55) tesaiot_radar_task :96, tesaiot_radar_recover_stats :114, tesaiot_radar_loop_stats :129, radar_ai_frame_next :147; state tesaiot_radar_presence_detected :72, tesaiot_radar_current_energy :77, tesaiot_radar_initialized :82 radar_task.h

The sensor sources live in bento_libs/claw/common/mpy/; cm55_sensor_poll.h is under proj_cm55/modules/cm55_sensor_poll/; the radar sources are under bento_libs/claw/kit-pse84-ai/libraries/tesaiot-radar/.

Variant matrix

mtb-mpy mtb-only
bento_libs/claw/common/mpy/ 53 files — every mod*.c plus the drivers 19 files — the sensor_*.c/.h drivers only
bento_libs/claw/kit-tesaiot-pse84-ai/mpy/ all six kit modules directory absent
sensors, gpio modules yes no — no binding layer is compiled
pots, buttons, rgbmatrix, header, can, shield yes no
Sensor drivers (sensor_i2c, BMI270, BMM350, DPS368, SHT40, pot) yes, called by the bindings yes, called by your code
sensor_auto_task yes yes — and it owns one extra boot step, see J3 — The auto-push task and the sensor hub
CM55 poll + radar task yes yes
Chapters J1 — The sensor bus and its lock, J2, J3 — The auto-push task and the sensor hub, J4, J5, J6 — Radar J1 — The sensor bus and its lock, J3 — The auto-push task and the sensor hub, J6 — Radar
Note
A packaging gap, reported not papered over. The mtb-only package ships sensor_capsense.c (direct I2C) but not sensor_capsense_ipc.c or capsense.mk. On a QWA309 board the 4000T sits on the CM55-owned display bus, so the direct backend reads the wrong bus. An mtb-only developer who calls capsense_read() today gets that backend. Detail and workaround in The CapSense fork: one API, two backends.

Two calls you may have seen elsewhere — neither is here

  • sensors.snapshot() is registered only inside #ifdef USE_KIT_PSE84_EVAL_EPC2 (modsensors.c:1330-1332). This package ships no Eva BSP, so the call does not exist on any board you can build from it. Do not write code against it.
  • sensors.light() appears in an older example corpus outside this package. It exists in no module table in this tree. It is documentation drift, and this section does not carry it forward.