SYSTIMER: SYSTIMER.h Source File

Arduino SYSTIMER

SYSTIMER.h
Go to the documentation of this file.
00001 
00067 /***********************************************************************************************************************
00068  * HEADER FILES
00069  **********************************************************************************************************************/
00070 
00071 #ifndef SYSTIMER_H
00072 #define SYSTIMER_H
00073 
00074 #include "xmc_common.h"
00075 #include <DAVE_Common.h>
00076 #include "systimer_conf.h"
00077 
00078 /**********************************************************************************************************************
00079  * MACROS
00080  **********************************************************************************************************************/
00081 
00082 #if (!((XMC_LIB_MAJOR_VERSION == 2U) && \
00083        (XMC_LIB_MINOR_VERSION >= 0U) && \
00084        (XMC_LIB_PATCH_VERSION >= 0U)))
00085 #error "SYSTIMER requires XMC Peripheral Library v2.0.0 or higher"
00086 #endif
00087 
00088 /**********************************************************************************************************************
00089  * ENUMS
00090  **********************************************************************************************************************/
00091 
00100 typedef enum SYSTIMER_STATUS
00101 {
00102   SYSTIMER_STATUS_SUCCESS = 0U, 
00103   SYSTIMER_STATUS_FAILURE  
00104 } SYSTIMER_STATUS_t;
00105 
00109 typedef enum SYSTIMER_STATE
00110 {
00111   SYSTIMER_STATE_NOT_INITIALIZED = 0U, 
00112   SYSTIMER_STATE_RUNNING, 
00113   SYSTIMER_STATE_STOPPED 
00114 } SYSTIMER_STATE_t;
00115 
00119 typedef enum SYSTIMER_MODE
00120 {
00121   SYSTIMER_MODE_ONE_SHOT = 0U, 
00122   SYSTIMER_MODE_PERIODIC 
00123 } SYSTIMER_MODE_t;
00124 
00129 /**********************************************************************************************************************
00130 * DATA STRUCTURES
00131 **********************************************************************************************************************/
00140 typedef void (*SYSTIMER_CALLBACK_t)(void *args);
00141 
00146 typedef struct SYSTIMER
00147 {
00148   bool init_status; 
00149 } SYSTIMER_t;
00154 /***********************************************************************************************************************
00155  * API Prototypes
00156  **********************************************************************************************************************/
00157 
00158 /* Support for C++ codebase */
00159 #ifdef __cplusplus
00160 extern "C" {
00161 #endif
00162 
00195 DAVE_APP_VERSION_t SYSTIMER_GetAppVersion(void);
00196 
00233  SYSTIMER_STATUS_t SYSTIMER_Init(SYSTIMER_t *handle);
00234 
00302 uint32_t SYSTIMER_CreateTimer
00303 (
00304   uint32_t period,
00305   SYSTIMER_MODE_t mode,
00306   SYSTIMER_CALLBACK_t callback,
00307   void  *args
00308 );
00309 
00364 SYSTIMER_STATUS_t SYSTIMER_StartTimer(uint32_t id);
00365 
00434 SYSTIMER_STATUS_t SYSTIMER_StopTimer(uint32_t id);
00435 
00518 SYSTIMER_STATUS_t SYSTIMER_RestartTimer(uint32_t id, uint32_t microsec);
00519 
00600 SYSTIMER_STATUS_t SYSTIMER_DeleteTimer(uint32_t id);
00601 
00659 uint32_t SYSTIMER_GetTime(void);
00660 
00721 uint32_t SYSTIMER_GetTickCount(void);
00722 
00803 SYSTIMER_STATE_t SYSTIMER_GetTimerState(uint32_t id);
00804 
00809 /* Support for C++ codebase */
00810 #ifdef __cplusplus
00811 }
00812 #endif
00813 
00814 /* Inclusion of APP extern file */
00815 #include "systimer_extern.h"
00816 
00817 #endif /* SYSTIMER_H */