Changed to use stdint types.
This commit is contained in:
@@ -40,7 +40,7 @@ LGPL License Terms @ref lgpl_license
|
||||
|
||||
void rtc_awake_from_off(osc_t clock_source)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Enable power and backup interface clocks. */
|
||||
RCC_APB1ENR |= (RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN);
|
||||
@@ -106,7 +106,7 @@ void rtc_awake_from_off(osc_t clock_source)
|
||||
|
||||
void rtc_enter_config_mode(void)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Wait until the RTOFF bit is 1 (no RTC register writes ongoing). */
|
||||
while ((reg32 = (RTC_CRL & RTC_CRL_RTOFF)) == 0);
|
||||
@@ -117,7 +117,7 @@ void rtc_enter_config_mode(void)
|
||||
|
||||
void rtc_exit_config_mode(void)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Exit configuration mode. */
|
||||
RTC_CRL &= ~RTC_CRL_CNF;
|
||||
@@ -126,7 +126,7 @@ void rtc_exit_config_mode(void)
|
||||
while ((reg32 = (RTC_CRL & RTC_CRL_RTOFF)) == 0);
|
||||
}
|
||||
|
||||
void rtc_set_alarm_time(u32 alarm_time)
|
||||
void rtc_set_alarm_time(uint32_t alarm_time)
|
||||
{
|
||||
rtc_enter_config_mode();
|
||||
RTC_ALRL = (alarm_time & 0x0000ffff);
|
||||
@@ -148,7 +148,7 @@ void rtc_disable_alarm(void)
|
||||
rtc_exit_config_mode();
|
||||
}
|
||||
|
||||
void rtc_set_prescale_val(u32 prescale_val)
|
||||
void rtc_set_prescale_val(uint32_t prescale_val)
|
||||
{
|
||||
rtc_enter_config_mode();
|
||||
RTC_PRLL = prescale_val & 0x0000ffff; /* PRL[15:0] */
|
||||
@@ -156,22 +156,22 @@ void rtc_set_prescale_val(u32 prescale_val)
|
||||
rtc_exit_config_mode();
|
||||
}
|
||||
|
||||
u32 rtc_get_counter_val(void)
|
||||
uint32_t rtc_get_counter_val(void)
|
||||
{
|
||||
return (RTC_CNTH << 16) | RTC_CNTL;
|
||||
}
|
||||
|
||||
u32 rtc_get_prescale_div_val(void)
|
||||
uint32_t rtc_get_prescale_div_val(void)
|
||||
{
|
||||
return (RTC_DIVH << 16) | RTC_DIVL;
|
||||
}
|
||||
|
||||
u32 rtc_get_alarm_val(void)
|
||||
uint32_t rtc_get_alarm_val(void)
|
||||
{
|
||||
return (RTC_ALRH << 16) | RTC_ALRL;
|
||||
}
|
||||
|
||||
void rtc_set_counter_val(u32 counter_val)
|
||||
void rtc_set_counter_val(uint32_t counter_val)
|
||||
{
|
||||
rtc_enter_config_mode();
|
||||
RTC_CNTH = (counter_val & 0xffff0000) >> 16; /* CNT[31:16] */
|
||||
@@ -237,9 +237,9 @@ void rtc_clear_flag(rtcflag_t flag_val)
|
||||
}
|
||||
}
|
||||
|
||||
u32 rtc_check_flag(rtcflag_t flag_val)
|
||||
uint32_t rtc_check_flag(rtcflag_t flag_val)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Read correct flag. */
|
||||
switch (flag_val) {
|
||||
@@ -262,7 +262,7 @@ u32 rtc_check_flag(rtcflag_t flag_val)
|
||||
|
||||
void rtc_awake_from_standby(void)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Enable power and backup interface clocks. */
|
||||
RCC_APB1ENR |= (RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN);
|
||||
@@ -279,9 +279,9 @@ void rtc_awake_from_standby(void)
|
||||
while ((reg32 = (RTC_CRL & RTC_CRL_RTOFF)) == 0);
|
||||
}
|
||||
|
||||
void rtc_auto_awake(osc_t clock_source, u32 prescale_val)
|
||||
void rtc_auto_awake(osc_t clock_source, uint32_t prescale_val)
|
||||
{
|
||||
u32 reg32;
|
||||
uint32_t reg32;
|
||||
|
||||
/* Enable power and backup interface clocks. */
|
||||
RCC_APB1ENR |= (RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN);
|
||||
|
||||
Reference in New Issue
Block a user