|
|
|
@ -10,8 +10,11 @@
|
|
|
|
|
* **Detailed Description :**
|
|
|
|
|
* This the timer interface and belongs to the interface layer
|
|
|
|
|
*
|
|
|
|
|
* @todo
|
|
|
|
|
* - 19.12.2021 : Should we check for a 32 to 16 bit overflow situation.
|
|
|
|
|
* @todo Following functions are to be implmented :
|
|
|
|
|
* timerSetHz
|
|
|
|
|
* timerSetMs
|
|
|
|
|
* timerSetNs
|
|
|
|
|
* timerSetPs
|
|
|
|
|
**************************************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -24,9 +27,11 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
#include "hardwareDescription.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*! Emun of possible Timer Errors */
|
|
|
|
|
typedef enum {
|
|
|
|
|
functionNotSupported,
|
|
|
|
|
prescalerOutOfRange
|
|
|
|
|
functionNotSupported, /*!< This Funtion is not awailable on this **HARDWARE** */
|
|
|
|
|
prescalerOutOfRange /*!< Set prescaler value exeeds the Register's **HARDWARE** size */
|
|
|
|
|
} timerError_t;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
@ -41,12 +46,21 @@ typedef enum {
|
|
|
|
|
onePulse
|
|
|
|
|
} timerMode_t;
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* Reset the timer to its default state.
|
|
|
|
|
*/
|
|
|
|
|
void timerReset(timerNo_t timer);
|
|
|
|
|
void timerActivateBus(timerNo_t timer);
|
|
|
|
|
void timerEnable(timerNo_t timer);
|
|
|
|
|
void timerDisable(timerNo_t timer);
|
|
|
|
|
void timerSetMode(timerNo_t timer, timerMode_t mode);
|
|
|
|
|
void timerSetCountDirection(timerNo_t timer, timerCountDirection_t direction);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* Sets the given timer's prescaler value.
|
|
|
|
|
* This fucntion will also check if the entered prascaler value exeeds the register size.
|
|
|
|
|
* If violated the prescalerOutOfRange Error will be generated.
|
|
|
|
|
*/
|
|
|
|
|
void timerSetPrescaler(timerNo_t timer, uint32_t prescaler);
|
|
|
|
|
void timerSetPostscaler(timerNo_t timer, uint32_t postscaler);
|
|
|
|
|
void timerSetAutoReload(timerNo_t timer, uint32_t reload);
|
|
|
|
@ -56,6 +70,7 @@ void timerClearCounter(timerNo_t timer);
|
|
|
|
|
|
|
|
|
|
/* Second stage configuration */
|
|
|
|
|
void timerInit(timerNo_t timer, uint32_t prescaler, uint32_t period, timerCountDirection_t direction, timerMode_t mode);
|
|
|
|
|
|
|
|
|
|
void timerSetHz(timerNo_t timer, uint16_t hz);
|
|
|
|
|
void timerSetMs(timerNo_t timer, uint16_t ms);
|
|
|
|
|
void timerSetNs(timerNo_t timer, uint16_t ns);
|
|
|
|
|