codeair_drivers – CodeAIR Drivers

CodeAIR Drivers Module

Provides low-level hardware access and utilities for the CodeAIR platform.

codeair.codeair_drivers.btn_was_pressed(num)[source]

Check if a button was pressed.

Parameters

num (int) – The button number (0 for BTN_0, 1 for BTN_1).

Returns

True if the button was pressed, False otherwise.

Return type

bool

codeair.codeair_drivers.cam_reset()[source]

Perform a software reset of the camera.

codeair.codeair_drivers.console_bytes(data)[source]

Write raw binary data to the console.

Parameters

data (bytes) – The binary data to write.

codeair.codeair_drivers.crc32(init_crc, buffer)[source]

Calculate the CRC32 checksum.

Parameters
  • init_crc (int) – The initial CRC value.

  • buffer (bytes) – The data buffer to calculate the checksum for.

Returns

The CRC32 checksum.

Return type

int

codeair.codeair_drivers.debug_uart_config(baudrate)[source]

Configure the debug UART port.

Parameters

baudrate (int) – The baud rate for the UART.

codeair.codeair_drivers.debug_uart_in()[source]

Receive data from the debug UART port.

Returns

The received data, or an empty bytes object if no data is available.

Return type

bytes

codeair.codeair_drivers.debug_uart_out(text)[source]

Send text to the debug UART port.

Parameters

text (str) – The text to send.

codeair.codeair_drivers.enable_btn_isr()[source]

Enable button interrupts for BTN_0 and BTN_1.

codeair.codeair_drivers.runtime_us()[source]

Get the runtime in microseconds since the system started.

Returns

The runtime in microseconds.

Return type

int

codeair.codeair_drivers.sys_info()[source]

Print system diagnostic information to the console.

codeair.codeair_drivers.version()[source]

Retrieve the version of the CodeAIR drivers module.

Returns

The version number of the module.

Return type

int

Download Source