Namespace hal::micromod::v1
Namespace List > hal > micromod > v1
Public Functions
Public Functions Documentation
function a0
Driver for adc pin 0.
hal::adc & hal::micromod::v1::a0 ()
Returns:
hal::adc& - Statically allocated analog pin driver.
function a1
Driver for adc pin 1.
hal::adc & hal::micromod::v1::a1 ()
Returns:
hal::adc& - Statically allocated analog pin driver.
function battery
Driver for battery analog signal which is 1/3rd of the VIN voltage.
hal::adc & hal::micromod::v1::battery ()
Returns:
hal::adc& - Statically allocated battery analog pin driver.
function can
Driver for the can bus.
hal::can & hal::micromod::v1::can ()
Returns:
hal::can& - statically allocated can driver
function console
Console serial interface.
hal::serial & hal::micromod::v1::console (
std::span< hal::byte > p_receive_buffer
)
The console does not have to implement an actual serial communication protocol like, uart or rs232. It can be implemented with anything such as usb, i2c and spi, or something different. It just needs to follow the hal::serial interface for writing, reading bytes from the console.
Parameters:
p_receive_buffer
- The size of the receive buffer for the serial port. Note that subsequent calls to the function will ignore this parameter, thus the first call will set the receive buffer size. Ensure that the lifetime of the buffer is equal to or exceeds the lifetime of the console serial port.
Returns:
hal::serial& - serial interface to the console
function d0
Driver for dac pin 0.
hal::dac & hal::micromod::v1::d0 ()
Returns:
hal::dac& - Statically allocated dac pin driver.
function d1
Driver for dac pin 1.
hal::dac & hal::micromod::v1::d1 ()
Returns:
hal::dac& - Statically allocated dac pin driver.
function enter_power_saving_mode
Enter power savings mode for your processor.
void hal::micromod::v1::enter_power_saving_mode ()
Generally needs an interrupt to wake up the device from sleep
function i2c
Driver for the main i2c bus.
hal::i2c & hal::micromod::v1::i2c ()
Returns:
hal::i2c& - Statically allocated i2c driver.
function i2c1
Driver for the alternative i2c bus 1.
hal::i2c & hal::micromod::v1::i2c1 ()
Returns:
hal::i2c& - Statically allocated i2c driver.
function i2c_interrupt_pin
Driver for i2c interrupt pin.
hal::interrupt_pin & hal::micromod::v1::i2c_interrupt_pin ()
NOTE: that this pin can be used as an interrupt pin for both or either i2c buss.
Returns:
hal::interrupt_pin& - Statically allocated interrupt pin driver.
function initialize_platform
Initialize the system.
void hal::micromod::v1::initialize_platform ()
Should be the first API called at the start of main. Typically sets up .data and .bss, heap sections if applicable, interrupt service routine handler and anything else necessary for code to function on the MCU.
function input_g0
hal::input_pin & hal::micromod::v1::input_g0 ()
function input_g1
hal::input_pin & hal::micromod::v1::input_g1 ()
function input_g10
hal::input_pin & hal::micromod::v1::input_g10 ()
function input_g2
hal::input_pin & hal::micromod::v1::input_g2 ()
function input_g3
hal::input_pin & hal::micromod::v1::input_g3 ()
function input_g4
hal::input_pin & hal::micromod::v1::input_g4 ()
function input_g5
hal::input_pin & hal::micromod::v1::input_g5 ()
function input_g6
hal::input_pin & hal::micromod::v1::input_g6 ()
function input_g7
hal::input_pin & hal::micromod::v1::input_g7 ()
function input_g8
hal::input_pin & hal::micromod::v1::input_g8 ()
function input_g9
hal::input_pin & hal::micromod::v1::input_g9 ()
function interrupt_g0
hal::interrupt_pin & hal::micromod::v1::interrupt_g0 ()
function interrupt_g1
hal::interrupt_pin & hal::micromod::v1::interrupt_g1 ()
function interrupt_g10
hal::interrupt_pin & hal::micromod::v1::interrupt_g10 ()
function interrupt_g2
hal::interrupt_pin & hal::micromod::v1::interrupt_g2 ()
function interrupt_g3
hal::interrupt_pin & hal::micromod::v1::interrupt_g3 ()
function interrupt_g4
hal::interrupt_pin & hal::micromod::v1::interrupt_g4 ()
function interrupt_g5
hal::interrupt_pin & hal::micromod::v1::interrupt_g5 ()
function interrupt_g6
hal::interrupt_pin & hal::micromod::v1::interrupt_g6 ()
function interrupt_g7
hal::interrupt_pin & hal::micromod::v1::interrupt_g7 ()
function interrupt_g8
hal::interrupt_pin & hal::micromod::v1::interrupt_g8 ()
function interrupt_g9
hal::interrupt_pin & hal::micromod::v1::interrupt_g9 ()
function led
Driver for the board LED output pin.
hal::output_pin & hal::micromod::v1::led ()
If this output pin level is called with TRUE, the LED must be ON. If this output pin level is called with FALSE, the LED must be OFF.
Returns:
hal::output_pin& - Statically allocated output pin driver connected to the LED.
function output_g0
hal::output_pin & hal::micromod::v1::output_g0 ()
function output_g1
hal::output_pin & hal::micromod::v1::output_g1 ()
function output_g10
hal::output_pin & hal::micromod::v1::output_g10 ()
function output_g2
hal::output_pin & hal::micromod::v1::output_g2 ()
function output_g3
hal::output_pin & hal::micromod::v1::output_g3 ()
function output_g4
hal::output_pin & hal::micromod::v1::output_g4 ()
function output_g5
hal::output_pin & hal::micromod::v1::output_g5 ()
function output_g6
hal::output_pin & hal::micromod::v1::output_g6 ()
function output_g7
hal::output_pin & hal::micromod::v1::output_g7 ()
function output_g8
hal::output_pin & hal::micromod::v1::output_g8 ()
function output_g9
hal::output_pin & hal::micromod::v1::output_g9 ()
function pwm0
Driver for pwm pin 0.
hal::pwm & hal::micromod::v1::pwm0 ()
Returns:
hal::pwm& - Statically allocated pwm pin driver.
function pwm1
Driver for pwm pin 1.
hal::pwm & hal::micromod::v1::pwm1 ()
Returns:
hal::pwm& - Statically allocated pwm pin driver.
function reset
Resets the microcontroller, restarting the program in the process.
void hal::micromod::v1::reset ()
If the application is executed as a program or process on operating system then this function should exit() with the code TBD which will alert the spawner process to rerun the command.
This function must not return.
function spi
Driver for the main spi bus.
hal::spi & hal::micromod::v1::spi ()
NOTE: in future iterations of this API, there will exist an sdio port used for talking to SD cards. This port is shared with the future sdio port. Take care to not use this along with the sdio port in the same application as they will conflict with each other resulting in undefined behavior.
Returns:
function spi1
Driver for the alternative spi port 1.
hal::spi & hal::micromod::v1::spi1 ()
Returns:
function spi_interrupt_pin
Driver for spi interrupt pin.
hal::interrupt_pin & hal::micromod::v1::spi_interrupt_pin ()
NOTE: that this pin can be used as an interrupt pin for both or either spi ports.
Returns:
function system_timer
Get core system timer driver.
hal::timer & hal::micromod::v1::system_timer ()
Usually used as the system timer for the RTOS
Returns:
hal::timer& - reference to the timer
function uart1
Driver for uart 1 port.
hal::serial & hal::micromod::v1::uart1 (
std::span< hal::byte > p_receive_buffer
)
Parameters:
p_receive_buffer
- The size of the receive buffer for the serial port. Note that subsequent calls to the function will ignore this parameter, thus the first call will set the receive buffer size. Ensure that the lifetime of the buffer is equal to or exceeds the lifetime of the uart port.
Returns:
function uart2
Driver for uart 0 port.
hal::serial & hal::micromod::v1::uart2 (
std::span< hal::byte > p_receive_buffer
)
Parameters:
p_receive_buffer
- The size of the receive buffer for the serial port. Note that subsequent calls to the function will ignore this parameter, thus the first call will set the receive buffer size. Ensure that the lifetime of the buffer is equal to or exceeds the lifetime of the uart port.
Returns:
function uptime_clock
steady clock to measures the cycles the processor has been up.
hal::steady_clock & hal::micromod::v1::uptime_clock ()
Returns:
hal::steady_clock& - system uptime steady clock.
The documentation for this class was generated from the following file libraries/include/libhal-micromod/micromod.hpp