Choco OS  V.0.16.9.0
Join to the chocolate world
oc_pwm.h
Go to the documentation of this file.
1 
28 #ifndef SYSTEM_CORE_INC_DRIVERS_PWM_OC_PWM_H_
29 #define SYSTEM_CORE_INC_DRIVERS_PWM_OC_PWM_H_
30 
31 #define DRIVER_HEADER
32 #define DRIVER_NAME PWM
33 
34 #include <oc_driver.h>
35 #include <oc_gpio.h>
36 #include <oc_frequency.h>
37 
43 #define _________________________________________TYPES_SECTION______________________________________________________________________________
44 
45 typedef enum
46 {
47  oC_PWM_ActiveState_Low = oC_GPIO_PinsState_AllLow,
48  oC_PWM_ActiveState_High = oC_GPIO_PinsState_AllHigh
49 } oC_PWM_ActiveState_t;
50 
51 //==========================================================================================================================================
60 //==========================================================================================================================================
61 typedef struct
62 {
63  oC_Pins_t Pin;
64  oC_PWM_ActiveState_t ActiveState;
65  uint64_t MaximumValue;
66  oC_Frequency_t TickFrequency;
67  oC_Frequency_t PermissibleDiffernece;
69 
70 //==========================================================================================================================================
79 //==========================================================================================================================================
80 typedef struct Context_t * oC_PWM_Context_t;
81 
82 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
83 
89 #define _________________________________________PROTOTYPES_SECTION_________________________________________________________________________
90 
91 extern oC_ErrorCode_t oC_PWM_Configure ( const oC_PWM_Config_t * Config , oC_PWM_Context_t * outContext );
92 extern oC_ErrorCode_t oC_PWM_Unconfigure ( const oC_PWM_Config_t * Config , oC_PWM_Context_t * outContext );
93 extern oC_ErrorCode_t oC_PWM_SetDuty ( oC_PWM_Context_t Context , float PercentDuty );
94 extern oC_ErrorCode_t oC_PWM_ReadDuty ( oC_PWM_Context_t Context , float * outPercentDuty );
95 extern oC_ErrorCode_t oC_PWM_SetValue ( oC_PWM_Context_t Context , uint64_t Value );
96 extern oC_ErrorCode_t oC_PWM_ReadValue ( oC_PWM_Context_t Context , uint64_t * outValue );
97 
98 #undef _________________________________________PROTOTYPES_SECTION_________________________________________________________________________
99 
100 
101 #endif /* SYSTEM_CORE_INC_DRIVERS_PWM_OC_PWM_H_ */
The file with frequency definitions.
double oC_Frequency_t
type to store frequency
Definition: oc_frequency.h:76
all pins are set to low state
Definition: oc_gpio.h:163
The file with interface for the GPIO driver.
struct Context_t * oC_PWM_Context_t
The PWM context structure.
Definition: oc_pwm.h:80
PWM driver configuration structure.
Definition: oc_pwm.h:61
The file with interface for driver creating.
stores ETH context
Definition: oc_eth.c:97
all pins are set to high state
Definition: oc_gpio.h:164