diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-19 12:50:00 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-19 12:57:42 +0200 |
commit | 2837555e09a0bfb53e5289f7af31972b57cff4c0 (patch) | |
tree | 42c231d33f7919c4715e532e86ff0df0c7805b7f /firmware | |
parent | a5c5da4525273d0a15c05b989517d7fd1beb0727 (diff) |
imx233: add rtc functions related to msec
Change-Id: I3ed7469150920f3d7ac6c4218c2165fec547a422
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/imx233/rtc-imx233.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/rtc-imx233.h b/firmware/target/arm/imx233/rtc-imx233.h index 054ace40b8..baf30df7c5 100644 --- a/firmware/target/arm/imx233/rtc-imx233.h +++ b/firmware/target/arm/imx233/rtc-imx233.h @@ -101,6 +101,20 @@ static inline uint32_t imx233_rtc_read_persistent(int idx) return HW_RTC_PERSISTENTx(idx); } +static inline void imx233_rtc_clear_msec_irq(void) +{ + __REG_CLR(HW_RTC_CTRL) = HW_RTC_CTRL__ONEMSEC_IRQ; +} + +static inline void imx233_rtc_enable_msec_irq(bool enable) +{ + imx233_rtc_clear_msec_irq(); + if(enable) + __REG_SET(HW_RTC_CTRL) = HW_RTC_CTRL__ONEMSEC_IRQ_EN; + else + __REG_CLR(HW_RTC_CTRL) = HW_RTC_CTRL__ONEMSEC_IRQ_EN; +} + void imx233_rtc_write_seconds(uint32_t seconds); void imx233_rtc_write_persistent(int idx, uint32_t val); |