Functions | |
void | RTC_init (uint16_t baseAddress, uint16_t modulo, uint16_t clockPredivider) |
Initializes the RTC. More... | |
void | RTC_start (uint16_t baseAddress, uint16_t clockSource) |
Starts RTC running. More... | |
void | RTC_stop (uint16_t baseAddress) |
Stops RTC running. More... | |
void | RTC_setModulo (uint16_t baseAddress, uint16_t modulo) |
Sets the modulo value. More... | |
void | RTC_enableInterrupt (uint16_t baseAddress, uint8_t interruptMask) |
Enables selected RTC interrupt sources. More... | |
void | RTC_disableInterrupt (uint16_t baseAddress, uint8_t interruptMask) |
Disables selected RTC interrupt sources. More... | |
uint8_t | RTC_getInterruptStatus (uint16_t baseAddress, uint8_t interruptFlagMask) |
Returns the status of the selected interrupts flags. More... | |
void | RTC_clearInterrupt (uint16_t baseAddress, int8_t interruptFlagMask) |
Clears selected RTC interrupt flags. More... | |
void RTC_clearInterrupt | ( | uint16_t | baseAddress, |
int8_t | interruptFlagMask | ||
) |
Clears selected RTC interrupt flags.
This function clears the RTC interrupt flag is cleared, so that it no longer asserts.
baseAddress | is the base address of the RTC module. |
interruptFlagMask | is a bit mask of the interrupt flags to clear Valid values are:
|
Modified bits are RTCIF of RTCCTL register.
void RTC_disableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | interruptMask | ||
) |
Disables selected RTC interrupt sources.
This function disables the selected RTC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the RTC module. |
interruptMask | is a bit mask of the interrupts to disable. Valid values are:
|
Modified bits are RTCIE of RTCCTL register.
void RTC_enableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | interruptMask | ||
) |
Enables selected RTC interrupt sources.
This function enables the selected RTC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the RTC module. |
interruptMask | is a bit mask of the interrupts to enable. Valid values are:
|
Modified bits are RTCIE of RTCCTL register.
uint8_t RTC_getInterruptStatus | ( | uint16_t | baseAddress, |
uint8_t | interruptFlagMask | ||
) |
Returns the status of the selected interrupts flags.
This function returns the status of the interrupt flag for the selected channel.
baseAddress | is the base address of the RTC module. |
interruptFlagMask | is a bit mask of the interrupt flags to return the status of. Valid values are:
|
void RTC_init | ( | uint16_t | baseAddress, |
uint16_t | modulo, | ||
uint16_t | clockPredivider | ||
) |
Initializes the RTC.
This function initializes the RTC for clock source and clock pre-divider.
baseAddress | is the base address of the RTC module. |
modulo | is the modulo value to set to RTC. Modified bits of RTCMOD register. |
clockPredivider | is the clock pre-divider select for RTC. Valid values are:
|
void RTC_setModulo | ( | uint16_t | baseAddress, |
uint16_t | modulo | ||
) |
Sets the modulo value.
This function does software reset for RTC.
baseAddress | is the base address of the RTC module. |
modulo | is the modulo value to set to RTC. Modified bits of RTCMOD register. |
void RTC_start | ( | uint16_t | baseAddress, |
uint16_t | clockSource | ||
) |
Starts RTC running.
This function starts the RTC by setting the clock source field (RTCSS). When started, the RTC counter will begin counting at the rate described by the clock source and pre-divider value. When the RTC counter reaches the value in the modulo register, the RTC hardware sets the RTC's interrupt flag bit (RTCIF). Please note, that the RTC actually compares the RTC counter to the modulo shadow register. Since the RTC_start() function sets the RTCSR (RTC software reset) bit, this forces the RTC to copy the value from the Modulo register into the shadow register.
baseAddress | is the base address of the RTC module. |
clockSource | is the clock source select for RTC. Valid values are:
|
Modified bits are RTCSR of RTCCTL register.
void RTC_stop | ( | uint16_t | baseAddress | ) |
Stops RTC running.
This function does software reset for RTC.
baseAddress | is the base address of the RTC module. |