Hello,
I am using MSP432P401R with CCS6.1.1. I am reading the RTC time by using MAP_RTC_C_getCalendarTime (); API. Now i want to save that time into some variable.How can i do that??
Thanks
Nafeesa
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I am using MSP432P401R with CCS6.1.1. I am reading the RTC time by using MAP_RTC_C_getCalendarTime (); API. Now i want to save that time into some variable.How can i do that??
Thanks
Nafeesa
Hi Nafeesa,
This function returns the current Calendar time in the form of a Calendar structure RTC_C_Calendar, therefore:
volatile RTC_C_Calendar newTime; newTime = MAP_RTC_C_getCalendarTime();
You may also want to take a look at our driverlib RTC_C example.
Best regards,
David
This is the definition of RTC_C_Calendar from rtc_c.h:
typedef struct _RTC_C_Calendar
{
uint_fast8_t seconds;
uint_fast8_t minutes;
uint_fast8_t hours;
uint_fast8_t dayOfWeek;
uint_fast8_t dayOfmonth;
uint_fast8_t month;
uint_fast16_t year;
} RTC_C_Calendar;
So if you follow David's instructions you can save the whole struct which contains all the values you want. Alternatively just read the minutes, hours, dayOfmonth, month and year from struct returned by RTC_C_getCalendarTime() and store them in their own variables.
**Attention** This is a public forum