28 #ifndef SYSTEM_CORE_INC_DRIVERS_TIMER_OC_TIMER_H_ 29 #define SYSTEM_CORE_INC_DRIVERS_TIMER_OC_TIMER_H_ 32 #define DRIVER_NAME TIMER 46 oC_TIMER_Mode_Periodic = oC_TIMER_LLD_Mode_PeriodicTimer ,
47 oC_TIMER_Mode_InputEdgeCount = oC_TIMER_LLD_Mode_InputEdgeCount ,
48 oC_TIMER_Mode_InputEdgeTime = oC_TIMER_LLD_Mode_InputEdgeTime ,
49 oC_TIMER_Mode_RTC = oC_TIMER_LLD_Mode_RealTimeClock ,
50 oC_TIMER_Mode_PWM = oC_TIMER_LLD_Mode_PWM
55 oC_TIMER_PwmState_Low = oC_TIMER_LLD_PwmState_Low ,
56 oC_TIMER_PwmState_High = oC_TIMER_LLD_PwmState_High ,
57 } oC_TIMER_PwmState_t;
61 oC_TIMER_InputTrigger_RisingEdge = oC_TIMER_LLD_Trigger_RisingEdge ,
62 oC_TIMER_InputTrigger_FallingEdge = oC_TIMER_LLD_Trigger_FallingEdge ,
63 oC_TIMER_InputTrigger_BothEdges = oC_TIMER_LLD_Trigger_Both ,
64 } oC_TIMER_InputTrigger_t;
68 oC_TIMER_CountDirection_DoesntMatter = oC_TIMER_LLD_CountDirection_DoesntMatter ,
69 oC_TIMER_CountDirection_Up = oC_TIMER_LLD_CountDirection_Up ,
70 oC_TIMER_CountDirection_Down = oC_TIMER_LLD_CountDirection_Down
71 } oC_TIMER_CountDirection_t;
73 typedef oC_TIMER_LLD_EventHandler_t oC_TIMER_EventHandler_t;
75 typedef oC_TIMER_LLD_EventFlags_t oC_TIMER_EventFlags_t;
80 oC_Time_t MaximumTimeForWait;
83 uint64_t MaximumValue;
85 oC_TIMER_EventFlags_t EventFlags;
86 oC_TIMER_EventHandler_t EventHandler;
88 oC_TIMER_CountDirection_t CountDirection;
92 oC_TIMER_PwmState_t StartPwmState;
93 oC_TIMER_InputTrigger_t InputTrigger;
97 extern oC_ErrorCode_t oC_TIMER_TurnOn (
void );
98 extern oC_ErrorCode_t oC_TIMER_TurnOff (
void );
99 extern bool oC_TIMER_IsTurnedOn (
void );
100 extern oC_ErrorCode_t oC_TIMER_Configure (
const oC_TIMER_Config_t * Config , oC_TIMER_Context_t * outContext );
101 extern oC_ErrorCode_t oC_TIMER_Unconfigure (
const oC_TIMER_Config_t * Config , oC_TIMER_Context_t * outContext );
102 extern oC_ErrorCode_t oC_TIMER_ReadValue ( oC_TIMER_Context_t Context , uint64_t * outValue );
103 extern oC_ErrorCode_t oC_TIMER_SetValue ( oC_TIMER_Context_t Context , uint64_t Value );
104 extern oC_ErrorCode_t oC_TIMER_ReadMatchValue ( oC_TIMER_Context_t Context , uint64_t * outValue );
105 extern oC_ErrorCode_t oC_TIMER_SetMatchValue ( oC_TIMER_Context_t Context , uint64_t Value );
106 extern oC_ErrorCode_t oC_TIMER_ReadMaxValue ( oC_TIMER_Context_t Context , uint64_t * outValue );
107 extern oC_ErrorCode_t oC_TIMER_SetMaxValue ( oC_TIMER_Context_t Context , uint64_t Value );
108 extern oC_ErrorCode_t oC_TIMER_Start ( oC_TIMER_Context_t Context );
109 extern oC_ErrorCode_t oC_TIMER_Stop ( oC_TIMER_Context_t Context );
The file with LLD interface for the TIMER driver.
double oC_Frequency_t
type to store frequency
The library with time definitions.
The file with interface for driver creating.