Source code for codeair.codeair_drivers

"""CodeAIR Drivers Module

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


[docs]def version(): """Retrieve the version of the CodeAIR drivers module. Returns: int: The version number of the module. """ # Implemented in C pass
[docs]def enable_btn_isr(): """Enable button interrupts for BTN_0 and BTN_1.""" # Implemented in C pass
[docs]def btn_was_pressed(num): """Check if a button was pressed. Args: num (int): The button number (0 for BTN_0, 1 for BTN_1). Returns: bool: `True` if the button was pressed, `False` otherwise. """ # Implemented in C pass
[docs]def runtime_us(): """Get the runtime in microseconds since the system started. Returns: int: The runtime in microseconds. """ # Implemented in C pass
[docs]def console_bytes(data): """Write raw binary data to the console. Args: data (bytes): The binary data to write. """ # Implemented in C pass
[docs]def crc32(init_crc, buffer): """Calculate the CRC32 checksum. Args: init_crc (int): The initial CRC value. buffer (bytes): The data buffer to calculate the checksum for. Returns: int: The CRC32 checksum. """ # Implemented in C pass
[docs]def sys_info(): """Print system diagnostic information to the console.""" # Implemented in C pass
[docs]def debug_uart_out(text): """Send text to the debug UART port. Args: text (str): The text to send. """ # Implemented in C pass
[docs]def debug_uart_in(): """Receive data from the debug UART port. Returns: bytes: The received data, or an empty bytes object if no data is available. """ # Implemented in C pass
[docs]def debug_uart_config(baudrate): """Configure the debug UART port. Args: baudrate (int): The baud rate for the UART. """ # Implemented in C pass
[docs]def cam_reset(): """Perform a software reset of the camera.""" # Implemented in C pass