The hub module

Board-level singleton exposing every on-hub peripheral. Provided by the C firmware — the .pyi stub in stubs/hub.pyi is what Pyright and this documentation consume.

Top-level members

Name

Description

hub.ports

Physical ports A–D plus wrapped built-in devices (LED, accelerometer, gyro). See Ports.

hub.led

Built-in RGB LED as a lpf2.devices.hub_led. See Hub LED.

hub.accelerometer

Built-in accelerometer as a lpf2.devices.accelerometer.

hub.gyro

Built-in gyroscope as a lpf2.devices.gyroscope.

hub.imu

Fused IMU attitude, gyro and accel. See IMU.

hub.buttons

5-way + power button API. See Buttons.

hub.lcd

LCD panel + LVGL init. See LCD.

hub.i2c

Shared internal I2C bus (Grove connector + on-board peripherals). machine.I2C-compatible API. See I2C (Grove connector).

hub.board

Board-specific pin/SD constants. See Board constants.

hub.log

Firmware log level control.

hub.powerOff()

Immediate hardware power-off.

hub.on()

Event decorator injected by the on-device program runner (setup / loop).

hub.set_framed_output() / hub.raw_write()

C-level stdout framing hook used by the host protocol. See Host protocol framing.

Reference

Full generated API: hub.