distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::board Namespace Reference

Board-related code of distortos project. More...

Enumerations

enum  { b1ButtonIndex }
 
enum  { ld3LedIndex, ld4LedIndex, ld5LedIndex, ld6LedIndex }
 

Functions

void lowLevelInitialization ()
 Low level board initialization. More...
 

Variables

constexpr size_t totalButtons {DISTORTOS_BOARD_TOTAL_BUTTONS}
 total number of buttons on the board More...
 
const chip::ChipInputPin buttons [totalButtons]
 array with all button objects More...
 
constexpr size_t totalLeds {DISTORTOS_BOARD_TOTAL_LEDS}
 total number of LEDs on the board More...
 
constexpr size_t orangeLedIndex {ld3LedIndex}
 alternative index of LD3 LED (orange) More...
 
constexpr size_t greenLedIndex {ld4LedIndex}
 alternative index of LD4 LED (green) More...
 
constexpr size_t redLedIndex {ld5LedIndex}
 alternative index of LD5 LED (red) More...
 
constexpr size_t blueLedIndex {ld6LedIndex}
 alternative index of LD6 LED (blue) More...
 
chip::ChipOutputPin leds [totalLeds]
 array with all LED objects More...
 

Detailed Description

Board-related code of distortos project.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
b1ButtonIndex 

index of B1 button

◆ anonymous enum

anonymous enum
Enumerator
ld3LedIndex 

index of LD3 LED (orange)

ld4LedIndex 

index of LD4 LED (green)

ld5LedIndex 

index of LD5 LED (red)

ld6LedIndex 

index of LD6 LED (blue)

Function Documentation

◆ lowLevelInitialization()

void distortos::board::lowLevelInitialization ( )

Low level board initialization.

This function is called before constructors for global and static objects from __libc_init_array() via address in distortosPreinitArray[].

Note
Use of this function is optional - it may be left undefined, in which case it will not be called.

Low level board initialization.

This function is called before constructors for global and static objects from __libc_init_array() via address in distortosPreinitArray[].

Low level board initialization.

  1. Initializes main instance of system's Scheduler;
  2. Initializes main thread with its group;
  3. Starts idle thread;
  4. Initializes main instance of Mutex used for malloc() and free() locking;
  5. Initializes main instance of DeferredThreadDeleter (only if CONFIG_THREAD_DETACH_ENABLE option is enabled);

This function is called before constructors for global and static objects from __libc_init_array() via address in distortosPreinitArray[].

Todo:
error handling?
Todo:
error handling?
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ blueLedIndex

constexpr size_t distortos::board::blueLedIndex {ld6LedIndex}

alternative index of LD6 LED (blue)

◆ buttons

const chip::ChipInputPin distortos::board::buttons
Initial value:
{
chip::ChipInputPin{chip::Pin::pa0, chip::PinPull::none, false},
}

array with all button objects

◆ greenLedIndex

constexpr size_t distortos::board::greenLedIndex {ld4LedIndex}

alternative index of LD4 LED (green)

◆ leds

chip::ChipOutputPin distortos::board::leds
Initial value:
{
chip::ChipOutputPin{chip::Pin::pd13, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
chip::ChipOutputPin{chip::Pin::pd12, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
chip::ChipOutputPin{chip::Pin::pd14, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
chip::ChipOutputPin{chip::Pin::pd15, false, chip::PinOutputSpeed::low, chip::PinPull::none, false, false},
}

array with all LED objects

◆ orangeLedIndex

constexpr size_t distortos::board::orangeLedIndex {ld3LedIndex}

alternative index of LD3 LED (orange)

◆ redLedIndex

constexpr size_t distortos::board::redLedIndex {ld5LedIndex}

alternative index of LD5 LED (red)

◆ totalButtons

constexpr size_t distortos::board::totalButtons {DISTORTOS_BOARD_TOTAL_BUTTONS}

total number of buttons on the board

◆ totalLeds

constexpr size_t distortos::board::totalLeds {DISTORTOS_BOARD_TOTAL_LEDS}

total number of LEDs on the board