Speeduino
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
board_stm32_official.h File Reference
#include <Arduino.h>
#include <HardwareTimer.h>
#include <HardwareSerial.h>
#include "STM32RTC.h"
#include <SPI.h>
#include "stm32f4xx_ll_tim.h"
#include <EEPROM_LIB_H>

Go to the source code of this file.

Macros

#define CORE_STM32
 
#define COMPARE_TYPE   uint16_t
 
#define SERIAL_BUFFER_SIZE   517
 
#define FPU_MAX_SIZE   32
 
#define TIMER_RESOLUTION   4
 
#define word(h, l)   (((h) << 8) | (l))
 
#define BOARD_MAX_DIGITAL_PINS   NUM_DIGITAL_PINS
 
#define BOARD_MAX_IO_PINS   NUM_DIGITAL_PINS
 
#define pinIsReserved(pin)   ( ((pin) == PA11) || ((pin) == PA12) || ((pin) == PB3) || ((pin) == PB4) || ((pin) == PB5) || ((pin) == PB0) )
 
#define PWM_FAN_AVAILABLE
 
#define BOARD_MAX_ADC_PINS   NUM_ANALOG_INPUTS-1
 
#define LED_BUILTIN   PA7
 
#define EEPROM_LIB_H   "src/SPIAsEEPROM/SPIAsEEPROM.h"
 
#define RTC_LIB_H   "STM32RTC.h"
 
#define MAX_TIMER_PERIOD   262140UL
 
#define uS_TO_TIMER_COMPARE(uS1)   ((uS1) >> 2)
 
#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

typedef uint16_t eeprom_address_t
 

Functions

charsbrk (int incr)
 
uint32_t digitalPinToInterrupt (uint32_t Interrupt_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

STM32RTCrtc
 
InternalSTM32F4_EEPROM_Class EEPROM
 

Macro Definition Documentation

◆ BOARD_MAX_ADC_PINS

#define BOARD_MAX_ADC_PINS   NUM_ANALOG_INPUTS-1

◆ BOARD_MAX_DIGITAL_PINS

#define BOARD_MAX_DIGITAL_PINS   NUM_DIGITAL_PINS

◆ BOARD_MAX_IO_PINS

#define BOARD_MAX_IO_PINS   NUM_DIGITAL_PINS

◆ BOOST_TIMER_COMPARE

#define BOOST_TIMER_COMPARE   (TIM1)->CCR2

◆ BOOST_TIMER_COUNTER

#define BOOST_TIMER_COUNTER   (TIM1)->CNT

◆ COMPARE_TYPE

#define COMPARE_TYPE   uint16_t

◆ CORE_STM32

#define CORE_STM32

DO NOT INCLUDE DIRECTLY - should be included via board_definition.h

◆ DISABLE_BOOST_TIMER

#define DISABLE_BOOST_TIMER ( )    (TIM1)->DIER &= ~TIM_DIER_CC2IE

◆ DISABLE_FAN_TIMER

#define DISABLE_FAN_TIMER ( )    (TIM1)->DIER &= ~TIM_DIER_CC1IE

◆ DISABLE_VVT_TIMER

#define DISABLE_VVT_TIMER ( )    (TIM1)->DIER &= ~TIM_DIER_CC3IE

◆ EEPROM_LIB_H

#define EEPROM_LIB_H   "src/SPIAsEEPROM/SPIAsEEPROM.h"

◆ ENABLE_BOOST_TIMER

#define ENABLE_BOOST_TIMER ( )    (TIM1)->SR = ~TIM_FLAG_CC2; (TIM1)->DIER |= TIM_DIER_CC2IE; (TIM1)->CR1 |= TIM_CR1_CEN;

◆ ENABLE_FAN_TIMER

#define ENABLE_FAN_TIMER ( )    (TIM1)->SR = ~TIM_FLAG_CC1; (TIM1)->DIER |= TIM_DIER_CC1IE; (TIM1)->CR1 |= TIM_CR1_CEN;

◆ ENABLE_VVT_TIMER

#define ENABLE_VVT_TIMER ( )    (TIM1)->SR = ~TIM_FLAG_CC3; (TIM1)->DIER |= TIM_DIER_CC3IE; (TIM1)->CR1 |= TIM_CR1_CEN;

◆ FAN_TIMER_COMPARE

#define FAN_TIMER_COMPARE   (TIM1)->CCR1

◆ FAN_TIMER_COUNTER

#define FAN_TIMER_COUNTER   (TIM1)->CNT

◆ FPU_MAX_SIZE

#define FPU_MAX_SIZE   32

◆ FUEL1_COMPARE

#define FUEL1_COMPARE   (TIM3)->CCR1

◆ FUEL1_COUNTER

#define FUEL1_COUNTER   (TIM3)->CNT

◆ FUEL2_COMPARE

#define FUEL2_COMPARE   (TIM3)->CCR2

◆ FUEL2_COUNTER

#define FUEL2_COUNTER   (TIM3)->CNT

◆ FUEL3_COMPARE

#define FUEL3_COMPARE   (TIM3)->CCR3

◆ FUEL3_COUNTER

#define FUEL3_COUNTER   (TIM3)->CNT

◆ FUEL4_COMPARE

#define FUEL4_COMPARE   (TIM3)->CCR4

◆ FUEL4_COUNTER

#define FUEL4_COUNTER   (TIM3)->CNT

◆ FUEL5_COMPARE

#define FUEL5_COMPARE   (TIM5)->CCR1

◆ FUEL5_COUNTER

#define FUEL5_COUNTER   (TIM5)->CNT

◆ FUEL6_COMPARE

#define FUEL6_COMPARE   (TIM5)->CCR2

◆ FUEL6_COUNTER

#define FUEL6_COUNTER   (TIM5)->CNT

◆ FUEL7_COMPARE

#define FUEL7_COMPARE   (TIM5)->CCR3

◆ FUEL7_COUNTER

#define FUEL7_COUNTER   (TIM5)->CNT

◆ FUEL8_COMPARE

#define FUEL8_COMPARE   (TIM5)->CCR4

◆ FUEL8_COUNTER

#define FUEL8_COUNTER   (TIM5)->CNT

◆ IDLE_COMPARE

#define IDLE_COMPARE   (TIM1)->CCR4

◆ IDLE_COUNTER

#define IDLE_COUNTER   (TIM1)->CNT

◆ IDLE_TIMER_DISABLE

#define IDLE_TIMER_DISABLE ( )    (TIM1)->DIER &= ~TIM_DIER_CC4IE

◆ IDLE_TIMER_ENABLE

#define IDLE_TIMER_ENABLE ( )    (TIM1)->SR = ~TIM_FLAG_CC4; (TIM1)->DIER |= TIM_DIER_CC4IE; (TIM1)->CR1 |= TIM_CR1_CEN;

◆ IGN1_COMPARE

#define IGN1_COMPARE   (TIM2)->CCR1

◆ IGN1_COUNTER

#define IGN1_COUNTER   (TIM2)->CNT

◆ IGN2_COMPARE

#define IGN2_COMPARE   (TIM2)->CCR2

◆ IGN2_COUNTER

#define IGN2_COUNTER   (TIM2)->CNT

◆ IGN3_COMPARE

#define IGN3_COMPARE   (TIM2)->CCR3

◆ IGN3_COUNTER

#define IGN3_COUNTER   (TIM2)->CNT

◆ IGN4_COMPARE

#define IGN4_COMPARE   (TIM2)->CCR4

◆ IGN4_COUNTER

#define IGN4_COUNTER   (TIM2)->CNT

◆ IGN5_COMPARE

#define IGN5_COMPARE   (TIM4)->CCR1

◆ IGN5_COUNTER

#define IGN5_COUNTER   (TIM4)->CNT

◆ IGN6_COMPARE

#define IGN6_COMPARE   (TIM4)->CCR2

◆ IGN6_COUNTER

#define IGN6_COUNTER   (TIM4)->CNT

◆ IGN7_COMPARE

#define IGN7_COMPARE   (TIM4)->CCR3

◆ IGN7_COUNTER

#define IGN7_COUNTER   (TIM4)->CNT

◆ IGN8_COMPARE

#define IGN8_COMPARE   (TIM4)->CCR4

◆ IGN8_COUNTER

#define IGN8_COUNTER   (TIM4)->CNT

◆ IGN_CHANNELS

#define IGN_CHANNELS   5

◆ INJ_CHANNELS

#define INJ_CHANNELS   4

◆ LED_BUILTIN

#define LED_BUILTIN   PA7

◆ MAX_TIMER_PERIOD

#define MAX_TIMER_PERIOD   262140UL

◆ pinIsReserved

#define pinIsReserved (   pin)    ( ((pin) == PA11) || ((pin) == PA12) || ((pin) == PB3) || ((pin) == PB4) || ((pin) == PB5) || ((pin) == PB0) )

◆ PWM_FAN_AVAILABLE

#define PWM_FAN_AVAILABLE

◆ RTC_LIB_H

#define RTC_LIB_H   "STM32RTC.h"

◆ SECONDARY_SERIAL_T

#define SECONDARY_SERIAL_T   HardwareSerial

◆ SERIAL_BUFFER_SIZE

#define SERIAL_BUFFER_SIZE   517

◆ TIMER_RESOLUTION

#define TIMER_RESOLUTION   4

◆ uS_TO_TIMER_COMPARE

#define uS_TO_TIMER_COMPARE (   uS1)    ((uS1) >> 2)

◆ VVT_TIMER_COMPARE

#define VVT_TIMER_COMPARE   (TIM1)->CCR3

◆ VVT_TIMER_COUNTER

#define VVT_TIMER_COUNTER   (TIM1)->CNT

◆ word

#define word (   h,
  l 
)    (((h) << 8) | (l))

Typedef Documentation

◆ eeprom_address_t

Function Documentation

◆ digitalPinToInterrupt()

uint32_t digitalPinToInterrupt ( uint32_t  Interrupt_pin)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FUEL1_TIMER_DISABLE()

static void FUEL1_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL1_TIMER_ENABLE()

static void FUEL1_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL2_TIMER_DISABLE()

static void FUEL2_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL2_TIMER_ENABLE()

static void FUEL2_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL3_TIMER_DISABLE()

static void FUEL3_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL3_TIMER_ENABLE()

static void FUEL3_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL4_TIMER_DISABLE()

static void FUEL4_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL4_TIMER_ENABLE()

static void FUEL4_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL5_TIMER_DISABLE()

static void FUEL5_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL5_TIMER_ENABLE()

static void FUEL5_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL6_TIMER_DISABLE()

static void FUEL6_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL6_TIMER_ENABLE()

static void FUEL6_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL7_TIMER_DISABLE()

static void FUEL7_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL7_TIMER_ENABLE()

static void FUEL7_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL8_TIMER_DISABLE()

static void FUEL8_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ FUEL8_TIMER_ENABLE()

static void FUEL8_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN1_TIMER_DISABLE()

static void IGN1_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN1_TIMER_ENABLE()

static void IGN1_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN2_TIMER_DISABLE()

static void IGN2_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN2_TIMER_ENABLE()

static void IGN2_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN3_TIMER_DISABLE()

static void IGN3_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN3_TIMER_ENABLE()

static void IGN3_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN4_TIMER_DISABLE()

static void IGN4_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN4_TIMER_ENABLE()

static void IGN4_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN5_TIMER_DISABLE()

static void IGN5_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN5_TIMER_ENABLE()

static void IGN5_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN6_TIMER_DISABLE()

static void IGN6_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN6_TIMER_ENABLE()

static void IGN6_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN7_TIMER_DISABLE()

static void IGN7_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN7_TIMER_ENABLE()

static void IGN7_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN8_TIMER_DISABLE()

static void IGN8_TIMER_DISABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ IGN8_TIMER_ENABLE()

static void IGN8_TIMER_ENABLE ( void  )
inlinestatic
Here is the call graph for this function:

◆ sbrk()

char * sbrk ( int  incr)

Variable Documentation

◆ EEPROM

◆ rtc

STM32RTC& rtc
extern