[ARM] How to set values of new time ?

Status
Not open for further replies.

chaplin.u

Newbie level 1
Joined
May 5, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
I am using Cypress PSoC4 RTC. The data structure is like this:

Code:
* Alarm Time: 15:44:05 */
#define ALARM_HOUR                  (0x15u)
#define ALARM_MIN                   (0x44u)
#define ALARM_SEC                   (0x05u)
#define ALARM_TIME_HR_MIN_SEC       ((uint32)(ALARM_HOUR << HOUR_OFFSET) | \
                                    (uint32)(ALARM_MIN << MIN_OFFSET)    | \
                                     ALARM_SEC)

 // set time 
alarmTimeDate.time = ALARM_TIME_HR_MIN_SEC;

How to set values of new time. For example 12:34:56 ?
alarmTimeDate.time = ?
 

Code:
alarmTimeDate.time = ((uint32)(0x12u<< HOUR_OFFSET) | (uint32)(0x34u<< MIN_OFFSET) | 0x56u
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…