STM32F302x8 DEV¶
Below are the devices that are interal to the STM32F302x8 MCU. As such these devices are implemented directly for the STM32F302x8.
IWDG¶
RTC¶
-
class EVT::core::DEV::RTCf302x8 : public EVT::core::DEV::RTC¶
RTC implementation that makes use of the on-board real time clock on the STM32f302x8.
The onboard RTC can be kept up to date with a coin cell battery.
Public Functions
-
virtual void getTime(EVT::core::time::TimeStamp &time)¶
Get the current time as determined by the real time clock.
- Parameters
time – [out] The time struct to populate
-
virtual void getTime(EVT::core::time::TimeStamp &time)¶
Timer¶
-
class EVT::core::DEV::Timerf302x8 : public EVT::core::DEV::Timer¶
Implementation of the Timer class for the f302x8 uC.
Public Functions
-
explicit Timerf302x8(TIM_TypeDef *timerPeripheral, uint32_t clockPeriod)¶
Will initialize the timer device on the STM with the given period and the given IRQ Handler that triggers with the given period.
Starts the timer
- Parameters
timerPeripheral[in] – The timer peripheral to configure. Possible options for this board are TIM2, TIM15, TIM16, TIM17. It is up to the user to verify that resource conflicts do not occur.
timerPeripheral – [in] The timer to use
clockPeriod – [in] the clock period in ms. An interrupt will be triggered at that frequency.
-
virtual void startTimer(void (*irqHandler)(void *htim)) override¶
Starts the given timer and registers the given interrupt pointer to trigger when the timer overflows.
- Parameters
irqHandler – [in] The IRQ Handler function pointer. Sets a new interrupt handler function
-
virtual void startTimer() override¶
Starts the given timer using the IRQ Handler already assigned to that timer.
-
virtual void stopTimer() override¶
Stops the current timer from running.
Does not complete its current counting sequence.
-
virtual void reloadTimer() override¶
Resets the timer counter.
-
virtual void setPeriod(uint32_t clockPeriod)¶
Set the clock period for the timer.
Will stop the timer, re-initialize the device with the updated period. You must call startTimer again to continue timer operation.
- Parameters
clockPeriod – [in] the clock period in ms. An interrupt will be triggered at that frequency.
-
explicit Timerf302x8(TIM_TypeDef *timerPeripheral, uint32_t clockPeriod)¶