Autodrone
Multi-Domain Vehicle
drv_system.h File Reference

This file contains all the basic functions to run the timing of the system as well as initialize the system. More...

Go to the source code of this file.

Macros

#define FRAME_COUNT   1000
 
#define COUNT_500HZ   2
 
#define COUNT_200HZ   5
 
#define COUNT_100HZ   10
 
#define COUNT_50HZ   20
 
#define COUNT_10HZ   100
 
#define COUNT_5HZ   200
 
#define COUNT_1HZ   1000
 

Functions

void systemInit (void)
 Initializes system. More...
 
void SystemClock_Config (void)
 
void delayMicroseconds (uint32_t us)
 Delay in microseconds. More...
 
void delay (uint32_t ms)
 Delay in milliseconds. More...
 
uint32_t micros (void)
 Gets system time in microseconds. More...
 
uint32_t millis (void)
 Gets system time in milliseconds. More...
 
void SysTick_Handler (void)
 This function handles System tick timer. More...
 

Variables

uint16_t frameCounter
 
semaphore_t frame_1000Hz
 
semaphore_t frame_500Hz
 
semaphore_t frame_200Hz
 
semaphore_t frame_100Hz
 
semaphore_t frame_50Hz
 
semaphore_t frame_10Hz
 
semaphore_t frame_5Hz
 
semaphore_t frame_1Hz
 
uint32_t deltaTime1000Hz
 
uint32_t executionTime1000Hz
 
uint32_t previous1000HzTime
 
uint32_t deltaTime500Hz
 
uint32_t executionTime500Hz
 
uint32_t previous500HzTime
 
uint32_t deltaTime200Hz
 
uint32_t executionTime200Hz
 
uint32_t previous200HzTime
 
uint32_t deltaTime100Hz
 
uint32_t executionTime100Hz
 
uint32_t previous100HzTime
 
uint32_t deltaTime50Hz
 
uint32_t executionTime50Hz
 
uint32_t previous50HzTime
 
uint32_t deltaTime10Hz
 
uint32_t executionTime10Hz
 
uint32_t previous10HzTime
 
uint32_t deltaTime5Hz
 
uint32_t executionTime5Hz
 
uint32_t previous5HzTime
 
uint32_t deltaTime1Hz
 
uint32_t executionTime1Hz
 
uint32_t previous1HzTime
 
float dt500Hz
 
float dt100Hz
 
semaphore_t systemReady
 
semaphore_t execUp
 

Detailed Description

This file contains all the basic functions to run the timing of the system as well as initialize the system.

Author
Jeremy Wolfe
Date
03 MAR 2022

Macro Definition Documentation

◆ COUNT_100HZ

#define COUNT_100HZ   10

◆ COUNT_10HZ

#define COUNT_10HZ   100

◆ COUNT_1HZ

#define COUNT_1HZ   1000

◆ COUNT_200HZ

#define COUNT_200HZ   5

◆ COUNT_500HZ

#define COUNT_500HZ   2

◆ COUNT_50HZ

#define COUNT_50HZ   20

◆ COUNT_5HZ

#define COUNT_5HZ   200

◆ FRAME_COUNT

#define FRAME_COUNT   1000

Function Documentation

◆ delay()

void delay ( uint32_t  ms)

Delay in milliseconds.

Returns
Void.

◆ delayMicroseconds()

void delayMicroseconds ( uint32_t  us)

Delay in microseconds.

Returns
Void.

◆ micros()

uint32_t micros ( void  )

Gets system time in microseconds.

This can be called from within IRQ Handlers, so uses LDREX/STREX.
If a higher priority IRQ or DMA or anything happens the STREX will fail
and restart the loop. Otherwise the same number that was read is harmlessly
written back.
Returns
uint32_t Time in microseconds.

◆ millis()

uint32_t millis ( void  )

Gets system time in milliseconds.

Returns
uint32_t Time in milliseconds.

◆ SystemClock_Config()

void SystemClock_Config ( void  )

◆ systemInit()

void systemInit ( void  )

Initializes system.

Returns
Void.

◆ SysTick_Handler()

void SysTick_Handler ( void  )

This function handles System tick timer.

Variable Documentation

◆ deltaTime1000Hz

uint32_t deltaTime1000Hz
extern

◆ deltaTime100Hz

uint32_t deltaTime100Hz
extern

◆ deltaTime10Hz

uint32_t deltaTime10Hz
extern

◆ deltaTime1Hz

uint32_t deltaTime1Hz
extern

◆ deltaTime200Hz

uint32_t deltaTime200Hz
extern

◆ deltaTime500Hz

uint32_t deltaTime500Hz
extern

◆ deltaTime50Hz

uint32_t deltaTime50Hz
extern

◆ deltaTime5Hz

uint32_t deltaTime5Hz
extern

◆ dt100Hz

float dt100Hz

◆ dt500Hz

float dt500Hz
extern

◆ execUp

semaphore_t execUp
extern

◆ executionTime1000Hz

uint32_t executionTime1000Hz

◆ executionTime100Hz

uint32_t executionTime100Hz

◆ executionTime10Hz

uint32_t executionTime10Hz

◆ executionTime1Hz

uint32_t executionTime1Hz

◆ executionTime200Hz

uint32_t executionTime200Hz

◆ executionTime500Hz

uint32_t executionTime500Hz

◆ executionTime50Hz

uint32_t executionTime50Hz

◆ executionTime5Hz

uint32_t executionTime5Hz

◆ frame_1000Hz

semaphore_t frame_1000Hz
extern

◆ frame_100Hz

semaphore_t frame_100Hz
extern

◆ frame_10Hz

semaphore_t frame_10Hz
extern

◆ frame_1Hz

semaphore_t frame_1Hz
extern

◆ frame_200Hz

semaphore_t frame_200Hz
extern

◆ frame_500Hz

semaphore_t frame_500Hz
extern

◆ frame_50Hz

semaphore_t frame_50Hz
extern

◆ frame_5Hz

semaphore_t frame_5Hz
extern

◆ frameCounter

uint16_t frameCounter
extern

◆ previous1000HzTime

uint32_t previous1000HzTime

◆ previous100HzTime

uint32_t previous100HzTime

◆ previous10HzTime

uint32_t previous10HzTime

◆ previous1HzTime

uint32_t previous1HzTime

◆ previous200HzTime

uint32_t previous200HzTime

◆ previous500HzTime

uint32_t previous500HzTime

◆ previous50HzTime

uint32_t previous50HzTime

◆ previous5HzTime

uint32_t previous5HzTime

◆ systemReady

semaphore_t systemReady
extern