![]() |
Speeduino
|
#include <Arduino.h>#include <HardwareTimer.h>#include <HardwareSerial.h>#include "STM32RTC.h"#include <SPI.h>#include "stm32f4xx_ll_tim.h"Go to the source code of this file.
Macros | |
| #define | CORE_STM32 |
| #define | TS_SERIAL_BUFFER_SIZE 517 |
| #define | FPU_MAX_SIZE 32 |
| #define | word(h, l) (((h) << 8) | (l)) |
| #define | BOARD_MAX_DIGITAL_PINS NUM_DIGITAL_PINS |
| #define | BOARD_MAX_IO_PINS NUM_DIGITAL_PINS |
| #define | PWM_FAN_AVAILABLE |
| #define | LED_BUILTIN PA7 |
| #define | RTC_LIB_H "STM32RTC.h" |
| #define | INJ_CHANNELS 4 |
| #define | IGN_CHANNELS 5 |
| #define | FUEL1_COUNTER (TIM3)->CNT |
| #define | FUEL2_COUNTER (TIM3)->CNT |
| #define | FUEL3_COUNTER (TIM3)->CNT |
| #define | FUEL4_COUNTER (TIM3)->CNT |
| #define | FUEL1_COMPARE (TIM3)->CCR1 |
| #define | FUEL2_COMPARE (TIM3)->CCR2 |
| #define | FUEL3_COMPARE (TIM3)->CCR3 |
| #define | FUEL4_COMPARE (TIM3)->CCR4 |
| #define | IGN1_COUNTER (TIM2)->CNT |
| #define | IGN2_COUNTER (TIM2)->CNT |
| #define | IGN3_COUNTER (TIM2)->CNT |
| #define | IGN4_COUNTER (TIM2)->CNT |
| #define | IGN1_COMPARE (TIM2)->CCR1 |
| #define | IGN2_COMPARE (TIM2)->CCR2 |
| #define | IGN3_COMPARE (TIM2)->CCR3 |
| #define | IGN4_COMPARE (TIM2)->CCR4 |
| #define | FUEL5_COUNTER (TIM5)->CNT |
| #define | FUEL6_COUNTER (TIM5)->CNT |
| #define | FUEL7_COUNTER (TIM5)->CNT |
| #define | FUEL8_COUNTER (TIM5)->CNT |
| #define | FUEL5_COMPARE (TIM5)->CCR1 |
| #define | FUEL6_COMPARE (TIM5)->CCR2 |
| #define | FUEL7_COMPARE (TIM5)->CCR3 |
| #define | FUEL8_COMPARE (TIM5)->CCR4 |
| #define | IGN5_COUNTER (TIM4)->CNT |
| #define | IGN6_COUNTER (TIM4)->CNT |
| #define | IGN7_COUNTER (TIM4)->CNT |
| #define | IGN8_COUNTER (TIM4)->CNT |
| #define | IGN5_COMPARE (TIM4)->CCR1 |
| #define | IGN6_COMPARE (TIM4)->CCR2 |
| #define | IGN7_COMPARE (TIM4)->CCR3 |
| #define | IGN8_COMPARE (TIM4)->CCR4 |
| #define | ENABLE_BOOST_TIMER() (TIM1)->SR = ~TIM_FLAG_CC2; (TIM1)->DIER |= TIM_DIER_CC2IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define | DISABLE_BOOST_TIMER() (TIM1)->DIER &= ~TIM_DIER_CC2IE |
| #define | ENABLE_VVT_TIMER() (TIM1)->SR = ~TIM_FLAG_CC3; (TIM1)->DIER |= TIM_DIER_CC3IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define | DISABLE_VVT_TIMER() (TIM1)->DIER &= ~TIM_DIER_CC3IE |
| #define | ENABLE_FAN_TIMER() (TIM1)->SR = ~TIM_FLAG_CC1; (TIM1)->DIER |= TIM_DIER_CC1IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define | DISABLE_FAN_TIMER() (TIM1)->DIER &= ~TIM_DIER_CC1IE |
| #define | BOOST_TIMER_COMPARE (TIM1)->CCR2 |
| #define | BOOST_TIMER_COUNTER (TIM1)->CNT |
| #define | VVT_TIMER_COMPARE (TIM1)->CCR3 |
| #define | VVT_TIMER_COUNTER (TIM1)->CNT |
| #define | FAN_TIMER_COMPARE (TIM1)->CCR1 |
| #define | FAN_TIMER_COUNTER (TIM1)->CNT |
| #define | IDLE_COUNTER (TIM1)->CNT |
| #define | IDLE_COMPARE (TIM1)->CCR4 |
| #define | IDLE_TIMER_ENABLE() (TIM1)->SR = ~TIM_FLAG_CC4; (TIM1)->DIER |= TIM_DIER_CC4IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define | IDLE_TIMER_DISABLE() (TIM1)->DIER &= ~TIM_DIER_CC4IE |
| #define | SECONDARY_SERIAL_T HardwareSerial |
Typedefs | |
| using | COMPARE_TYPE = uint16_t |
| The timer overflow type. | |
| using | boardInputPin_t = inputPin_t |
| using | boardOutputPin_t = outputPin_t |
Functions | |
| static constexpr COMPARE_TYPE | uS_TO_TIMER_COMPARE (uint32_t micros) |
| Converts a given number of uS into the required number of timer ticks until that time has passed. | |
| static constexpr uint32_t | ticksToMicros (COMPARE_TYPE ticks) |
| Convert timer ticks to µS. | |
| char * | sbrk (int incr) |
| uint32_t | digitalPinToInterrupt (uint32_t Interrupt_pin) |
| static bool | pinIsReserved (uint8_t pin) |
| static void | FUEL1_TIMER_ENABLE (void) |
| static void | FUEL2_TIMER_ENABLE (void) |
| static void | FUEL3_TIMER_ENABLE (void) |
| static void | FUEL4_TIMER_ENABLE (void) |
| static void | FUEL1_TIMER_DISABLE (void) |
| static void | FUEL2_TIMER_DISABLE (void) |
| static void | FUEL3_TIMER_DISABLE (void) |
| static void | FUEL4_TIMER_DISABLE (void) |
| static void | IGN1_TIMER_ENABLE (void) |
| static void | IGN2_TIMER_ENABLE (void) |
| static void | IGN3_TIMER_ENABLE (void) |
| static void | IGN4_TIMER_ENABLE (void) |
| static void | IGN1_TIMER_DISABLE (void) |
| static void | IGN2_TIMER_DISABLE (void) |
| static void | IGN3_TIMER_DISABLE (void) |
| static void | IGN4_TIMER_DISABLE (void) |
| static void | FUEL5_TIMER_ENABLE (void) |
| static void | FUEL6_TIMER_ENABLE (void) |
| static void | FUEL7_TIMER_ENABLE (void) |
| static void | FUEL8_TIMER_ENABLE (void) |
| static void | FUEL5_TIMER_DISABLE (void) |
| static void | FUEL6_TIMER_DISABLE (void) |
| static void | FUEL7_TIMER_DISABLE (void) |
| static void | FUEL8_TIMER_DISABLE (void) |
| static void | IGN5_TIMER_ENABLE (void) |
| static void | IGN6_TIMER_ENABLE (void) |
| static void | IGN7_TIMER_ENABLE (void) |
| static void | IGN8_TIMER_ENABLE (void) |
| static void | IGN5_TIMER_DISABLE (void) |
| static void | IGN6_TIMER_DISABLE (void) |
| static void | IGN7_TIMER_DISABLE (void) |
| static void | IGN8_TIMER_DISABLE (void) |
Variables | |
| constexpr uint32_t | TIMER_RESOLUTION = 4U |
| The timer tick length in µS. | |
| constexpr uint16_t | BLOCKING_FACTOR = 121 |
| constexpr uint16_t | TABLE_BLOCKING_FACTOR = 64 |
| STM32RTC & | rtc |
| constexpr uint8_t | ANALOG_PINS [NUM_ANALOG_INPUTS-1] = { _ANALOG_PINS_A0_A14 } |
| Analog pin mapping. | |
| constexpr uint8_t | SERIAL_BUFFER_THRESHOLD = 0U |
| When the serial buffer is filled to greater than this threshold value, the serial processing operations will be performed more urgently in order to avoid it overflowing. | |
| #define BOARD_MAX_DIGITAL_PINS NUM_DIGITAL_PINS |
| #define BOARD_MAX_IO_PINS NUM_DIGITAL_PINS |
| #define BOOST_TIMER_COMPARE (TIM1)->CCR2 |
| #define BOOST_TIMER_COUNTER (TIM1)->CNT |
| #define CORE_STM32 |
DO NOT INCLUDE DIRECTLY - should be included via board_definition.h
| #define DISABLE_BOOST_TIMER | ( | ) | (TIM1)->DIER &= ~TIM_DIER_CC2IE |
| #define DISABLE_FAN_TIMER | ( | ) | (TIM1)->DIER &= ~TIM_DIER_CC1IE |
| #define DISABLE_VVT_TIMER | ( | ) | (TIM1)->DIER &= ~TIM_DIER_CC3IE |
| #define ENABLE_BOOST_TIMER | ( | ) | (TIM1)->SR = ~TIM_FLAG_CC2; (TIM1)->DIER |= TIM_DIER_CC2IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define ENABLE_FAN_TIMER | ( | ) | (TIM1)->SR = ~TIM_FLAG_CC1; (TIM1)->DIER |= TIM_DIER_CC1IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define ENABLE_VVT_TIMER | ( | ) | (TIM1)->SR = ~TIM_FLAG_CC3; (TIM1)->DIER |= TIM_DIER_CC3IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define FAN_TIMER_COMPARE (TIM1)->CCR1 |
| #define FAN_TIMER_COUNTER (TIM1)->CNT |
| #define FPU_MAX_SIZE 32 |
| #define FUEL1_COMPARE (TIM3)->CCR1 |
| #define FUEL1_COUNTER (TIM3)->CNT |
| #define FUEL2_COMPARE (TIM3)->CCR2 |
| #define FUEL2_COUNTER (TIM3)->CNT |
| #define FUEL3_COMPARE (TIM3)->CCR3 |
| #define FUEL3_COUNTER (TIM3)->CNT |
| #define FUEL4_COMPARE (TIM3)->CCR4 |
| #define FUEL4_COUNTER (TIM3)->CNT |
| #define FUEL5_COMPARE (TIM5)->CCR1 |
| #define FUEL5_COUNTER (TIM5)->CNT |
| #define FUEL6_COMPARE (TIM5)->CCR2 |
| #define FUEL6_COUNTER (TIM5)->CNT |
| #define FUEL7_COMPARE (TIM5)->CCR3 |
| #define FUEL7_COUNTER (TIM5)->CNT |
| #define FUEL8_COMPARE (TIM5)->CCR4 |
| #define FUEL8_COUNTER (TIM5)->CNT |
| #define IDLE_COMPARE (TIM1)->CCR4 |
| #define IDLE_COUNTER (TIM1)->CNT |
| #define IDLE_TIMER_DISABLE | ( | ) | (TIM1)->DIER &= ~TIM_DIER_CC4IE |
| #define IDLE_TIMER_ENABLE | ( | ) | (TIM1)->SR = ~TIM_FLAG_CC4; (TIM1)->DIER |= TIM_DIER_CC4IE; (TIM1)->CR1 |= TIM_CR1_CEN; |
| #define IGN1_COMPARE (TIM2)->CCR1 |
| #define IGN1_COUNTER (TIM2)->CNT |
| #define IGN2_COMPARE (TIM2)->CCR2 |
| #define IGN2_COUNTER (TIM2)->CNT |
| #define IGN3_COMPARE (TIM2)->CCR3 |
| #define IGN3_COUNTER (TIM2)->CNT |
| #define IGN4_COMPARE (TIM2)->CCR4 |
| #define IGN4_COUNTER (TIM2)->CNT |
| #define IGN5_COMPARE (TIM4)->CCR1 |
| #define IGN5_COUNTER (TIM4)->CNT |
| #define IGN6_COMPARE (TIM4)->CCR2 |
| #define IGN6_COUNTER (TIM4)->CNT |
| #define IGN7_COMPARE (TIM4)->CCR3 |
| #define IGN7_COUNTER (TIM4)->CNT |
| #define IGN8_COMPARE (TIM4)->CCR4 |
| #define IGN8_COUNTER (TIM4)->CNT |
| #define IGN_CHANNELS 5 |
| #define INJ_CHANNELS 4 |
| #define LED_BUILTIN PA7 |
| #define PWM_FAN_AVAILABLE |
| #define RTC_LIB_H "STM32RTC.h" |
| #define SECONDARY_SERIAL_T HardwareSerial |
| #define TS_SERIAL_BUFFER_SIZE 517 |
| #define VVT_TIMER_COMPARE (TIM1)->CCR3 |
| #define VVT_TIMER_COUNTER (TIM1)->CNT |
| #define word | ( | h, | |
| l | |||
| ) | (((h) << 8) | (l)) |
| using boardInputPin_t = inputPin_t |
| using boardOutputPin_t = outputPin_t |
| using COMPARE_TYPE = uint16_t |
The timer overflow type.
On some boards timers can overflow at less than the timer register width
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| char * sbrk | ( | int | incr | ) |
|
staticconstexpr |
Convert timer ticks to µS.
|
staticconstexpr |
Converts a given number of uS into the required number of timer ticks until that time has passed.
|
constexpr |
Analog pin mapping.
|
constexpr |
|
extern |
|
constexpr |
When the serial buffer is filled to greater than this threshold value, the serial processing operations will be performed more urgently in order to avoid it overflowing.
|
constexpr |
|
constexpr |
The timer tick length in µS.