Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top