@@ -423,16 +423,16 @@ void RTC_DeInit(void)
423
423
* @param minutes: 0-59
424
424
* @param seconds: 0-59
425
425
* @param subSeconds: 0-999
426
- * @param format : select AM or PM format in case RTC is set in 12 hours mode. Else ingored.
426
+ * @param period : select AM or PM period in case RTC is set in 12 hours mode. Else ingored.
427
427
* @retval None
428
428
*/
429
- void RTC_SetTime (uint8_t hours , uint8_t minutes , uint8_t seconds , uint32_t subSeconds , hourAM_PM_t format )
429
+ void RTC_SetTime (uint8_t hours , uint8_t minutes , uint8_t seconds , uint32_t subSeconds , hourAM_PM_t period )
430
430
{
431
431
RTC_TimeTypeDef RTC_TimeStruct ;
432
432
433
433
// Ignore time AM PM configuration if in 24 hours format
434
434
if (initFormat == HOUR_FORMAT_24 ) {
435
- format = AM ;
435
+ period = AM ;
436
436
}
437
437
438
438
if ((((initFormat == HOUR_FORMAT_24 ) && IS_RTC_HOUR24 (hours )) || IS_RTC_HOUR12 (hours ))
@@ -441,7 +441,7 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
441
441
RTC_TimeStruct .Minutes = minutes ;
442
442
RTC_TimeStruct .Seconds = seconds ;
443
443
#if !defined(STM32F1xx )
444
- if (format == PM ) {
444
+ if (period == PM ) {
445
445
RTC_TimeStruct .TimeFormat = RTC_HOURFORMAT12_PM ;
446
446
} else {
447
447
RTC_TimeStruct .TimeFormat = RTC_HOURFORMAT12_AM ;
@@ -456,7 +456,7 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
456
456
RTC_TimeStruct .StoreOperation = RTC_DAYLIGHTSAVING_NONE ;
457
457
#else
458
458
UNUSED (subSeconds );
459
- UNUSED (format );
459
+ UNUSED (period );
460
460
#endif // !defined(STM32F1xx)
461
461
462
462
HAL_RTC_SetTime (& RtcHandle , & RTC_TimeStruct , RTC_FORMAT_BIN );
@@ -469,23 +469,23 @@ void RTC_SetTime(uint8_t hours, uint8_t minutes, uint8_t seconds, uint32_t subSe
469
469
* @param minutes: 0-59
470
470
* @param seconds: 0-59
471
471
* @param subSeconds: 0-999
472
- * @param format : returns AM or PM format in case RTC is set in 12 hours mode.
472
+ * @param period : returns AM or PM period in case RTC is set in 12 hours mode.
473
473
* @retval None
474
474
*/
475
- void RTC_GetTime (uint8_t * hours , uint8_t * minutes , uint8_t * seconds , uint32_t * subSeconds , hourAM_PM_t * format )
475
+ void RTC_GetTime (uint8_t * hours , uint8_t * minutes , uint8_t * seconds , uint32_t * subSeconds , hourAM_PM_t * period )
476
476
{
477
477
RTC_TimeTypeDef RTC_TimeStruct ;
478
478
479
- if ((hours != NULL ) && (minutes != NULL ) && (seconds != NULL ) && (subSeconds != NULL ) && (format != NULL )) {
479
+ if ((hours != NULL ) && (minutes != NULL ) && (seconds != NULL ) && (subSeconds != NULL ) && (period != NULL )) {
480
480
HAL_RTC_GetTime (& RtcHandle , & RTC_TimeStruct , RTC_FORMAT_BIN );
481
481
* hours = RTC_TimeStruct .Hours ;
482
482
* minutes = RTC_TimeStruct .Minutes ;
483
483
* seconds = RTC_TimeStruct .Seconds ;
484
484
#if !defined(STM32F1xx )
485
485
if (RTC_TimeStruct .TimeFormat == RTC_HOURFORMAT12_PM ) {
486
- * format = PM ;
486
+ * period = PM ;
487
487
} else {
488
- * format = AM ;
488
+ * period = AM ;
489
489
}
490
490
#if !defined(STM32F2xx ) && !defined(STM32L1xx ) || defined(STM32L1_ULPH )
491
491
* subSeconds = RTC_TimeStruct .SubSeconds ;
@@ -498,19 +498,19 @@ void RTC_GetTime(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint32_t *s
498
498
* @brief Set RTC calendar
499
499
* @param year: 0-99
500
500
* @param month: 1-12
501
- * @param date : 1-31
502
- * @param day : 1-7
501
+ * @param day : 1-31
502
+ * @param wday : 1-7
503
503
* @retval None
504
504
*/
505
- void RTC_SetDate (uint8_t year , uint8_t month , uint8_t date , uint8_t day )
505
+ void RTC_SetDate (uint8_t year , uint8_t month , uint8_t day , uint8_t wday )
506
506
{
507
507
RTC_DateTypeDef RTC_DateStruct ;
508
508
509
- if (IS_RTC_YEAR (year ) && IS_RTC_MONTH (month ) && IS_RTC_DATE (date ) && IS_RTC_WEEKDAY (day )) {
509
+ if (IS_RTC_YEAR (year ) && IS_RTC_MONTH (month ) && IS_RTC_DATE (day ) && IS_RTC_WEEKDAY (wday )) {
510
510
RTC_DateStruct .Year = year ;
511
511
RTC_DateStruct .Month = month ;
512
- RTC_DateStruct .Date = date ;
513
- RTC_DateStruct .WeekDay = day ;
512
+ RTC_DateStruct .Date = day ;
513
+ RTC_DateStruct .WeekDay = wday ;
514
514
HAL_RTC_SetDate (& RtcHandle , & RTC_DateStruct , RTC_FORMAT_BIN );
515
515
}
516
516
}
@@ -519,44 +519,44 @@ void RTC_SetDate(uint8_t year, uint8_t month, uint8_t date, uint8_t day)
519
519
* @brief Get RTC calendar
520
520
* @param year: 0-99
521
521
* @param month: 1-12
522
- * @param date : 1-31
523
- * @param day : 1-7
522
+ * @param day : 1-31
523
+ * @param wday : 1-7
524
524
* @retval None
525
525
*/
526
- void RTC_GetDate (uint8_t * year , uint8_t * month , uint8_t * date , uint8_t * day )
526
+ void RTC_GetDate (uint8_t * year , uint8_t * month , uint8_t * day , uint8_t * wday )
527
527
{
528
528
RTC_DateTypeDef RTC_DateStruct ;
529
529
530
- if ((year != NULL ) && (month != NULL ) && (date != NULL ) && (day != NULL )) {
530
+ if ((year != NULL ) && (month != NULL ) && (day != NULL ) && (wday != NULL )) {
531
531
HAL_RTC_GetDate (& RtcHandle , & RTC_DateStruct , RTC_FORMAT_BIN );
532
532
* year = RTC_DateStruct .Year ;
533
533
* month = RTC_DateStruct .Month ;
534
- * date = RTC_DateStruct .Date ;
535
- * day = RTC_DateStruct .WeekDay ;
534
+ * day = RTC_DateStruct .Date ;
535
+ * wday = RTC_DateStruct .WeekDay ;
536
536
}
537
537
}
538
538
539
539
/**
540
540
* @brief Set RTC alarm and activate it with IT mode
541
- * @param date : 1-31 (day of the month)
541
+ * @param day : 1-31 (day of the month)
542
542
* @param hours: 0-12 or 0-23 depends on the hours mode.
543
543
* @param minutes: 0-59
544
544
* @param seconds: 0-59
545
545
* @param subSeconds: 0-999
546
- * @param hours format : AM or PM if in 12 hours mode else ignored.
546
+ * @param period : AM or PM if in 12 hours mode else ignored.
547
547
* @retval None
548
548
*/
549
- void RTC_StartAlarm (uint8_t date , uint8_t hours , uint8_t minutes , uint8_t seconds , uint32_t subSeconds , hourAM_PM_t format )
549
+ void RTC_StartAlarm (uint8_t day , uint8_t hours , uint8_t minutes , uint8_t seconds , uint32_t subSeconds , hourAM_PM_t period )
550
550
{
551
551
RTC_AlarmTypeDef RTC_AlarmStructure ;
552
552
553
553
// Ignore time AM PM configuration if in 24 hours format
554
554
if (initFormat == HOUR_FORMAT_24 ) {
555
- format = AM ;
555
+ period = AM ;
556
556
}
557
557
558
558
if ((((initFormat == HOUR_FORMAT_24 ) && IS_RTC_HOUR24 (hours )) || IS_RTC_HOUR12 (hours ))
559
- && IS_RTC_DATE (date ) && IS_RTC_MINUTES (minutes ) && IS_RTC_SECONDS (seconds )) {
559
+ && IS_RTC_DATE (day ) && IS_RTC_MINUTES (minutes ) && IS_RTC_SECONDS (seconds )) {
560
560
/* Set RTC_AlarmStructure with calculated values*/
561
561
RTC_AlarmStructure .Alarm = RTC_ALARM_A ; //Use alarm A by default because it is common to all STM32 HAL.
562
562
RTC_AlarmStructure .AlarmTime .Seconds = seconds ;
@@ -569,20 +569,20 @@ void RTC_StartAlarm(uint8_t date, uint8_t hours, uint8_t minutes, uint8_t second
569
569
#else
570
570
UNUSED (subSeconds );
571
571
#endif
572
- if (format == PM ) {
572
+ if (period == PM ) {
573
573
RTC_AlarmStructure .AlarmTime .TimeFormat = RTC_HOURFORMAT12_PM ;
574
574
} else {
575
575
RTC_AlarmStructure .AlarmTime .TimeFormat = RTC_HOURFORMAT12_AM ;
576
576
}
577
577
RTC_AlarmStructure .AlarmTime .DayLightSaving = RTC_DAYLIGHTSAVING_NONE ;
578
578
RTC_AlarmStructure .AlarmTime .StoreOperation = RTC_STOREOPERATION_RESET ;
579
- RTC_AlarmStructure .AlarmDateWeekDay = date ;
579
+ RTC_AlarmStructure .AlarmDateWeekDay = day ;
580
580
RTC_AlarmStructure .AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE ;
581
581
RTC_AlarmStructure .AlarmMask = RTC_ALARMMASK_NONE ;
582
582
#else
583
583
UNUSED (subSeconds );
584
- UNUSED (format );
585
- UNUSED (date );
584
+ UNUSED (period );
585
+ UNUSED (day );
586
586
#endif // !defined(STM32F1xx)
587
587
588
588
/* Set RTC_Alarm */
@@ -606,30 +606,30 @@ void RTC_StopAlarm(void)
606
606
607
607
/**
608
608
* @brief Get RTC alarm
609
- * @param date : 1-31 (day of the month)
609
+ * @param day : 1-31 (day of the month)
610
610
* @param hours: 0-12 or 0-23 depends on the hours mode.
611
611
* @param minutes: 0-59
612
612
* @param seconds: 0-59
613
613
* @param subSeconds: 0-999
614
- * @param hours format : AM or PM
614
+ * @param period : AM or PM
615
615
* @retval None
616
616
*/
617
- void RTC_GetAlarm (uint8_t * date , uint8_t * hours , uint8_t * minutes , uint8_t * seconds , uint32_t * subSeconds , hourAM_PM_t * format )
617
+ void RTC_GetAlarm (uint8_t * day , uint8_t * hours , uint8_t * minutes , uint8_t * seconds , uint32_t * subSeconds , hourAM_PM_t * period )
618
618
{
619
619
RTC_AlarmTypeDef RTC_AlarmStructure ;
620
620
621
- if ((date != NULL ) && (hours != NULL ) && (minutes != NULL ) && (seconds != NULL ) && (subSeconds != NULL ) && (format != NULL )) {
621
+ if ((day != NULL ) && (hours != NULL ) && (minutes != NULL ) && (seconds != NULL ) && (subSeconds != NULL ) && (period != NULL )) {
622
622
HAL_RTC_GetAlarm (& RtcHandle , & RTC_AlarmStructure , RTC_ALARM_A , RTC_FORMAT_BIN );
623
623
624
624
* seconds = RTC_AlarmStructure .AlarmTime .Seconds ;
625
625
* minutes = RTC_AlarmStructure .AlarmTime .Minutes ;
626
626
* hours = RTC_AlarmStructure .AlarmTime .Hours ;
627
627
#if !defined(STM32F1xx )
628
- * date = RTC_AlarmStructure .AlarmDateWeekDay ;
628
+ * day = RTC_AlarmStructure .AlarmDateWeekDay ;
629
629
if (RTC_AlarmStructure .AlarmTime .TimeFormat == RTC_HOURFORMAT12_PM ) {
630
- * format = PM ;
630
+ * period = PM ;
631
631
} else {
632
- * format = AM ;
632
+ * period = AM ;
633
633
}
634
634
#if !defined(STM32F2xx ) && !defined(STM32L1xx ) || defined(STM32L1_ULPH )
635
635
* subSeconds = RTC_AlarmStructure .AlarmTime .SubSeconds ;
0 commit comments