Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16 | jlesech | 1 | /**************************************************************************//** |
2 | * \brief Date and time management library |
||
3 | * \author Copyright (C) 2011 Julien Le Sech - www.idreammicro.com |
||
4 | * \version 1.0 |
||
5 | * \date 20090501 |
||
6 | * |
||
7 | * This file is part of the iDreamMicro library. |
||
8 | * |
||
9 | * This library is free software: you can redistribute it and/or modify it under |
||
10 | * the terms of the GNU Lesser General Public License as published by the Free |
||
11 | * Software Foundation, either version 3 of the License, or (at your option) any |
||
12 | * later version. |
||
13 | * |
||
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
||
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
16 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
||
17 | * details. |
||
18 | * |
||
19 | * You should have received a copy of the GNU Lesser General Public License |
||
20 | * along with this program. If not, see http://www.gnu.org/licenses/ |
||
21 | ******************************************************************************/ |
||
22 | |||
23 | /**************************************************************************//** |
||
24 | * \headerfile datetime.h |
||
25 | ******************************************************************************/ |
||
26 | |||
27 | #ifndef H__IDREAMMICRO__USEFUL__DATETIME__H |
||
28 | #define H__IDREAMMICRO__USEFUL__DATETIME__H |
||
29 | |||
30 | #ifdef _cplusplus |
||
31 | extern "C"{ |
||
32 | #endif |
||
33 | |||
34 | /****************************************************************************** |
||
35 | * Header file inclusions. |
||
36 | ******************************************************************************/ |
||
37 | |||
38 | #include <stdint.h> |
||
39 | |||
40 | /****************************************************************************** |
||
41 | * Public types definitions. |
||
42 | ******************************************************************************/ |
||
43 | |||
44 | /**************************************************************************//** |
||
45 | * \enum datetime__meridiems |
||
46 | * \brief Time meridiems. |
||
47 | * |
||
48 | * \typedef datetime__meridiem_t |
||
49 | * \brief Time meridiem. |
||
50 | ******************************************************************************/ |
||
51 | typedef enum datetime__meridiems |
||
52 | { |
||
53 | DATETIME__MERIDIEM__AM = 0, /*!< Ante meridiem. */ |
||
54 | DATETIME__MERIDIEM__PM = 1 /*!< Post meridiem. */ |
||
55 | } datetime__meridiem_t; |
||
56 | |||
57 | /**************************************************************************//** |
||
58 | * \struct datetime__time |
||
59 | * \brief Time. |
||
60 | * |
||
61 | * \typedef datetime__time_t |
||
62 | * \brief Time. |
||
63 | ******************************************************************************/ |
||
64 | typedef struct datetime__time |
||
65 | { |
||
66 | uint8_t seconds; /*!< Seconds (0-59). */ |
||
67 | uint8_t minutes; /*!< Minutes (0-59). */ |
||
68 | uint8_t hours; /*!< Hours (1-12 or 0-23). */ |
||
69 | datetime__meridiem_t meridiem; /*!< Meridiem (AM-PM). */ |
||
70 | } datetime__time_t; |
||
71 | |||
72 | /**************************************************************************//** |
||
73 | * \struct datetime__date |
||
74 | * \brief Date. |
||
75 | * |
||
76 | * \typedef datetime__date_t |
||
77 | * \brief Date. |
||
78 | ******************************************************************************/ |
||
79 | typedef struct datetime__date |
||
80 | { |
||
81 | uint8_t day; /*!< Day (1-7). */ |
||
82 | uint8_t date; /*!< Date (1-31). */ |
||
83 | uint8_t month; /*!< Month (1-12). */ |
||
84 | uint8_t year; /*!< Year (0-99). */ |
||
85 | } datetime__date_t; |
||
86 | |||
87 | #ifdef _cplusplus |
||
88 | } |
||
89 | #endif |
||
90 | |||
91 | #endif /* H__IDREAMMICRO__USEFUL__DATETIME__H */ |