Speeduino
Loading...
Searching...
No Matches
Macros | Functions | Variables
board_definition.h File Reference

Inclusion of board specific header files and board related definitions. More...

#include <stdint.h>
#include <Arduino.h>
#include "type_traits.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SET_COMPARE(compare, value)   (compare) = (COMPARE_TYPE)(value)
 

Functions

void initBoard (uint32_t baudRate)
 Initialise the board, including USB comms.
 
void boardInitPins (void)
 Pin specific initialisation (optional - can be empty)
 
uint16_t freeRam (void)
 Calculate free RAM for display in TunerStudio.
 
void doSystemReset (void)
 Reset the board (optional)
 
void jumpToBootloader (void)
 Trigger the boot loader (optional)
 
uint8_t getSystemTemp (void)
 Get the board temp for display in TunerStudio (optional)
 
uint16_t getEepromWriteBlockSize (const statuses &current)
 The maximum number of write operations that will be performed in one go.
 
EEPROM_tgetEEPROM (void)
 Access the EEPROM singleton.
 

Variables

constexpr uint32_t MAX_TIMER_PERIOD = ticksToMicros((numeric_limits<COMPARE_TYPE>::max)())
 The longest period of time (in uS) that the timer can permit.
 

Detailed Description

Inclusion of board specific header files and board related definitions.

Note
This file should be named "board.h", but one of the STM32 Arduino implementations has a <board.h> include. Which picks up this file instead of the intended file :-(

Macro Definition Documentation

◆ SET_COMPARE

#define SET_COMPARE (   compare,
  value 
)    (compare) = (COMPARE_TYPE)(value)

Function Documentation

◆ boardInitPins()

void boardInitPins ( void  )

Pin specific initialisation (optional - can be empty)

This is called after the pins are assigned and therefore after initBoard()

Here is the caller graph for this function:

◆ doSystemReset()

void doSystemReset ( void  )

Reset the board (optional)

Here is the caller graph for this function:

◆ freeRam()

uint16_t freeRam ( void  )

Calculate free RAM for display in TunerStudio.

Here is the caller graph for this function:

◆ getEEPROM()

EEPROM_t & getEEPROM ( void  )

Access the EEPROM singleton.

Here is the caller graph for this function:

◆ getEepromWriteBlockSize()

uint16_t getEepromWriteBlockSize ( const statuses current)

The maximum number of write operations that will be performed in one go.

If this number is too large, we will kill system responsiveness since EEPROM writes are slow. E.g. Each write takes ~3ms on the AVR

This is board specific, since EEPROM write speed is dependent on the EEPROM type and CPU speed.

Parameters
currentSo the function can scale the number of writes based on system state
Returns
uint8_t The maximum number of writes.
Here is the caller graph for this function:

◆ getSystemTemp()

uint8_t getSystemTemp ( void  )

Get the board temp for display in TunerStudio (optional)

Here is the caller graph for this function:

◆ initBoard()

void initBoard ( uint32_t  baudRate)

Initialise the board, including USB comms.

This is called after the tune is loaded from EEPROM, but before pins are assigned.

Parameters
baudRateThe Serial comms baud rate
Here is the caller graph for this function:

◆ jumpToBootloader()

void jumpToBootloader ( void  )

Trigger the boot loader (optional)

Here is the caller graph for this function:

Variable Documentation

◆ MAX_TIMER_PERIOD

constexpr uint32_t MAX_TIMER_PERIOD = ticksToMicros((numeric_limits<COMPARE_TYPE>::max)())
constexpr

The longest period of time (in uS) that the timer can permit.