Speeduino
Loading...
Searching...
No Matches
board_definition.h
Go to the documentation of this file.
1#pragma once
2
10#include <stdint.h>
11#include <Arduino.h>
12#include "type_traits.h"
13
21void initBoard(uint32_t baudRate);
22
28void boardInitPins(void);
29
31uint16_t freeRam(void);
32
34void doSystemReset(void);
35
38
40uint8_t getSystemTemp(void);
41
42struct statuses;
43
56uint16_t getEepromWriteBlockSize(const statuses &current);
57
58// Include a specific header for a board.
59#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
60 #include "board_avr2560.h"
61#elif defined(CORE_TEENSY)
62 #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
63 #include "board_teensy35.h"
64 #elif defined(__IMXRT1062__)
65 #include "board_teensy41.h"
66 #endif
67#elif defined(STM32_MCU_SERIES) || defined(ARDUINO_ARCH_STM32) || defined(STM32)
68 #include "board_stm32_official.h"
69#elif defined(__SAME51J19A__)
70 #include "board_same51.h"
71// Allow external injection of the board definition via compiler flags
72#elif defined(EXTERNAL_BOARD_H)
73 #include EXTERNAL_BOARD_H
74#else
75 #error Incorrect board selected. Please select the correct board (Usually Mega 2560) and upload again
76#endif
77
78#if defined(RTC_ENABLED)
80void boardInitRTC(void);
81#endif
82
83// It is important that we cast this to the actual overflow limit of the timer.
84// The compare variables type can be wider than the timer overflow.
85#define SET_COMPARE(compare, value) (compare) = (COMPARE_TYPE)(value)
86
89
EEPROMClass EEPROM_t
Definition board_avr2560.h:63
static constexpr uint32_t ticksToMicros(COMPARE_TYPE ticks)
Convert timer ticks to µS.
Definition board_avr2560.h:49
uint8_t getSystemTemp(void)
Get the board temp for display in TunerStudio (optional)
constexpr uint32_t MAX_TIMER_PERIOD
The longest period of time (in uS) that the timer can permit.
Definition board_definition.h:91
uint16_t getEepromWriteBlockSize(const statuses &current)
The maximum number of write operations that will be performed in one go.
EEPROM_t & getEEPROM(void)
Access the EEPROM singleton.
void boardInitPins(void)
Pin specific initialisation (optional - can be empty)
void jumpToBootloader(void)
Trigger the boot loader (optional)
void initBoard(uint32_t baudRate)
Initialise the board, including USB comms.
void doSystemReset(void)
Reset the board (optional)
uint16_t freeRam(void)
Calculate free RAM for display in TunerStudio.
Definition type_traits.h:27
The status struct with current values for all 'live' variables.
Definition statuses.h:24
Minimal polyfill for the standard library type traits, since it isn't available with avr-gcc.