rtc_alarm.h
Go to the documentation of this file.
1 /*
2  * SocialLedge.com - Copyright (C) 2013
3  *
4  * This file is part of free software framework for embedded processors.
5  * You can use it and/or distribute it as long as this copyright header
6  * remains unmodified. The code is free for personal use and requires
7  * permission to use in a commercial product.
8  *
9  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
10  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
12  * I SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
13  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
14  *
15  * You can reach the author of this software at :
16  * p r e e t . w i k i @ g m a i l . c o m
17  */
18 
25 #ifndef RTC_SEM_HPP_
26 #define RTC_SEM_HPP_
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <stdint.h>
32 
33 #include "FreeRTOS.h"
34 #include "semphr.h"
35 
36 
37 
41 typedef enum {
44  everyHour = 2,
45  everyDay = 3,
46 } alarm_freq_t;
47 
53 typedef struct {
54  uint8_t hour, min, sec;
55 } alarm_time_t;
56 
57 
58 
67 
87 
92 static inline void rtc_alarm_off(alarm_time_t *p) { p->hour = 25; p->min = p->sec=0; }
93 
94 
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 #endif /* RTC_SEM_HPP_ */
uint8_t min
Definition: rtc_alarm.h:54
Definition: rtc_alarm.h:45
alarm_freq_t
Definition: rtc_alarm.h:41
Definition: rtc_alarm.h:53
uint8_t sec
Definition: rtc_alarm.h:54
void rtc_alarm_create_recurring(alarm_freq_t freq, SemaphoreHandle_t *pAlarm)
Definition: rtc_alarm.c:83
Definition: rtc_alarm.h:44
Definition: rtc_alarm.h:42
alarm_time_t * rtc_alarm_create(alarm_time_t time, SemaphoreHandle_t *pAlarm)
Definition: rtc_alarm.c:97
uint8_t hour
Definition: rtc_alarm.h:54
QueueHandle_t SemaphoreHandle_t
Definition: semphr.h:79
Definition: rtc_alarm.h:43