MSP430 DriverLib for MSP430FR2xx_4xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
rtc

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...
 

Detailed Description

Function Documentation

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.

Parameters
baseAddressis the base address of the RTC module.
interruptFlagMaskis a bit mask of the interrupt flags to clear Valid values are:
  • RTC_OVERFLOW_INTERRUPT_FLAG - asserts when counter overflows

Modified bits are RTCIF of RTCCTL register.

Returns
None
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.

Parameters
baseAddressis the base address of the RTC module.
interruptMaskis a bit mask of the interrupts to disable. Valid values are:
  • RTC_OVERFLOW_INTERRUPT - counter overflow interrupt

Modified bits are RTCIE of RTCCTL register.

Returns
None
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.

Parameters
baseAddressis the base address of the RTC module.
interruptMaskis a bit mask of the interrupts to enable. Valid values are:
  • RTC_OVERFLOW_INTERRUPT - counter overflow interrupt

Modified bits are RTCIE of RTCCTL register.

Returns
None
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.

Parameters
baseAddressis the base address of the RTC module.
interruptFlagMaskis a bit mask of the interrupt flags to return the status of. Valid values are:
  • RTC_OVERFLOW_INTERRUPT_FLAG - asserts when counter overflows
Returns
A bit mask of the selected interrupt flag's status.
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.

Parameters
baseAddressis the base address of the RTC module.
modulois the modulo value to set to RTC.
Modified bits of RTCMOD register.
clockPredivideris the clock pre-divider select for RTC. Valid values are:
  • RTC_CLOCKPREDIVIDER_1 [Default]
  • RTC_CLOCKPREDIVIDER_10
  • RTC_CLOCKPREDIVIDER_100
  • RTC_CLOCKPREDIVIDER_1000
  • RTC_CLOCKPREDIVIDER_16
  • RTC_CLOCKPREDIVIDER_64
  • RTC_CLOCKPREDIVIDER_256
  • RTC_CLOCKPREDIVIDER_1024
    Modified bits are RTCPS of RTCCTL register.
Returns
None
void RTC_setModulo ( uint16_t  baseAddress,
uint16_t  modulo 
)

Sets the modulo value.

This function does software reset for RTC.

Parameters
baseAddressis the base address of the RTC module.
modulois the modulo value to set to RTC.
Modified bits of RTCMOD register.
Returns
None
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.

Parameters
baseAddressis the base address of the RTC module.
clockSourceis the clock source select for RTC. Valid values are:
  • RTC_CLOCKSOURCE_DISABLED [Default]
  • RTC_CLOCKSOURCE_SMCLK
  • RTC_CLOCKSOURCE_XT1CLK
  • RTC_CLOCKSOURCE_VLOCLK
    Modified bits are RTCSS of RTCCTL register.

Modified bits are RTCSR of RTCCTL register.

Returns
None
void RTC_stop ( uint16_t  baseAddress)

Stops RTC running.

This function does software reset for RTC.

Parameters
baseAddressis the base address of the RTC module.
Returns
None

Copyright 2015, Texas Instruments Incorporated