no-OS
rtc.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef RTC_H_
41 #define RTC_H_
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include <stdint.h>
48 
49 /******************************************************************************/
50 /*************************** Types Declarations *******************************/
51 /******************************************************************************/
52 
57 struct rtc_desc {
59  uint8_t id;
61  uint32_t freq;
63  uint32_t load;
65  void *extra;
66 };
67 
74  uint8_t id;
76  uint32_t freq;
78  uint32_t load;
80  void *extra;
81 };
82 
83 /******************************************************************************/
84 /************************ Functions Declarations ******************************/
85 /******************************************************************************/
86 
88 int32_t rtc_init(struct rtc_desc **device, struct rtc_init_param *init_param);
89 
91 int32_t rtc_remove(struct rtc_desc *dev);
92 
94 int32_t rtc_start(struct rtc_desc *dev);
95 
97 int32_t rtc_stop(struct rtc_desc *dev);
98 
100 int32_t rtc_get_cnt(struct rtc_desc *dev, uint32_t *tmr_cnt);
101 
103 int32_t rtc_set_cnt(struct rtc_desc *dev, uint32_t tmr_cnt);
104 
105 #endif /* RTC_H_ */
rtc_init_param::load
uint32_t load
Definition: rtc.h:78
rtc_desc
Structure holding RTC descriptor.
Definition: rtc.h:57
rtc_desc::freq
uint32_t freq
Definition: rtc.h:61
rtc_init
int32_t rtc_init(struct rtc_desc **device, struct rtc_init_param *init_param)
Initialize the RTC peripheral.
Definition: rtc.c:60
device
Definition: ad9361_util.h:75
rtc_desc::extra
void * extra
Definition: rtc.h:65
rtc_init_param::id
uint8_t id
Definition: rtc.h:74
rtc_desc::load
uint32_t load
Definition: rtc.h:63
rtc_remove
int32_t rtc_remove(struct rtc_desc *dev)
Free the resources allocated by rtc_init().
Definition: rtc.c:121
rtc_init_param::extra
void * extra
Definition: rtc.h:80
rtc_set_cnt
int32_t rtc_set_cnt(struct rtc_desc *dev, uint32_t tmr_cnt)
Set the current count for the real time clock.
Definition: rtc.c:188
rtc_desc::id
uint8_t id
Definition: rtc.h:59
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
rtc_get_cnt
int32_t rtc_get_cnt(struct rtc_desc *dev, uint32_t *tmr_cnt)
Get the current count for the real time clock.
Definition: rtc.c:175
rtc_init_param
Structure holding RTC initialization parameters.
Definition: rtc.h:72
rtc_init_param::freq
uint32_t freq
Definition: rtc.h:76
rtc_start
int32_t rtc_start(struct rtc_desc *dev)
Start the real time clock.
Definition: rtc.c:142
rtc_stop
int32_t rtc_stop(struct rtc_desc *dev)
Stop the real time clock.
Definition: rtc.c:158