sys_kernel module

sys_kernel.BLOCKED: int
sys_kernel.DELETED: int
sys_kernel.INVALID: int
sys_kernel.READY: int
sys_kernel.RUNNING: int
sys_kernel.SUSPENDED: int
sys_kernel.battery_charging() bool
sys_kernel.firmware_version() str
sys_kernel.freertos_sleep(ms: int) None
sys_kernel.hardware_version() str
class sys_kernel.heap_kind_stats

Not exposed in the API, used by heap_stats

largest_free_block: int

Size of the largest free block in the heap. This is the largest malloc-able size.

total_allocated_bytes: int

Total bytes allocated to data in the heap.

total_free_bytes: int

Total free bytes in the heap. Equivalent to multi_free_heap_size().

class sys_kernel.heap_stats
dma: heap_kind_stats

Heap stats for DMA-capable memory (i.e. not external ram)

general: heap_kind_stats

Heap stats for general memory

sys_kernel.i2c_scan() list[int]
class sys_kernel.scheduler_snapshot

A snapshot of the FreeRTOS scheduler state. Will not update dynamically, instead needs to be re-created by calling scheduler_snapshot() again.

tasks: list[sys_kernel.task]

a list of tasks

total_runtime: int

The total run time since boot as defined by the FreeRTOS run time stats clock

class sys_kernel.task

Not exposed in the API, used by scheduler_snapshot

core_affinity: int

bitmask of where this task is allowed to be scheduled. Bit 0 is core 0, bit 1 is core 1. The value 0b11 (3) means the task is allowed to run on any core.

name: str

Name of the task

number: int

The FreeRTOS task number

run_time: int

The run time allocated to this task so far, as defined by the FreeRTOS run time stats clock. The units are arbitrary and should only be used comparatively against other task runtimes, and the global total runtime value from scheduler_stats.

stack_left: int

High water mark of stack usage by task, ie. highest ever recorded use of stack. The units seem arbitrary.

state: int

One of RUNNING, READY, BLOCKED, SUSPENDED, DELETED, INVALID

sys_kernel.usb_connected() bool
sys_kernel.usb_console_active() bool