24. lpc17xx_rtc Module¶
RTC client library functions. See LPC17xx CMSIS-Compliant Standard Peripheral Firmware Driver Library documentation.
- robovero.lpc17xx_rtc.RTC_AlarmIntConfig(RTCx, AlarmTimeType, NewState)¶
Enable/Disable Alarm interrupt for each time type in RTC peripheral.
Args:
RTCx: RTC peripheral selected, should be LPC_RTC
- AlarmTimeType: Alarm Time Interrupt type, an matching of this type value
below with current time in RTC will generates an interrupt, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
NewState: New State of this function, should be:
- ENABLE: Alarm interrupt for this time type are enabled
- DISABLE: Alarm interrupt for this time type are disabled
- robovero.lpc17xx_rtc.RTC_CalibConfig(RTCx, CalibValue, CalibDir)¶
Configures Calibration in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- CalibValue: Calibration value, should be in range from 0 to 131,072
- CalibDir: Calibration Direction, should be:
- RTC_CALIB_DIR_FORWARD: Forward calibration
- RTC_CALIB_DIR_BACKWARD: Backward calibration
- robovero.lpc17xx_rtc.RTC_CalibCounterCmd(RTCx, NewState)¶
Enable/Disable calibration counter in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- NewState: New State of this function, should be:
- ENABLE: The calibration counter is enabled and counting
- DISABLE: The calibration counter is disabled and reset to zero
- robovero.lpc17xx_rtc.RTC_ClearIntPending(RTCx, IntType)¶
Clear specified Location interrupt pending in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- IntType: Interrupt location type, should be:
- RTC_INT_COUNTER_INCREASE: Clear Counter Increment Interrupt pending.
- RTC_INT_ALARM: Clear alarm interrupt pending
- robovero.lpc17xx_rtc.RTC_Cmd(RTCx, NewState)¶
Start/Stop RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- NewState: New State of this function, should be:
- ENABLE: The time counters are enabled
- DISABLE: The time counters are disabled
- robovero.lpc17xx_rtc.RTC_CntIncrIntConfig(RTCx, CntIncrIntType, NewState)¶
Enable/Disable Counter increment interrupt for each time type in RTC peripheral.
Args:
RTCx: RTC peripheral selected, should be LPC_RTC
- CntIncrIntType: Counter Increment Interrupt type, an increment of the type
value below will generates an interrupt, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
NewState: New state of this function, should be:
- ENABLE: Counter Increment interrupt for this time type are enabled
- DISABLE: Counter Increment interrupt for this time type are disabled
- robovero.lpc17xx_rtc.RTC_DeInit(RTCx)¶
De-initializes the RTC peripheral registers to their default reset values.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- robovero.lpc17xx_rtc.RTC_GetAlarmTime(RTCx, Timetype)¶
Get alarm time value for each time type.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Timetype: Time Type, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
Return: Value of Alarm time according to specified time type
- robovero.lpc17xx_rtc.RTC_GetFullAlarmTime(RTCx, pFullTime)¶
Get full of alarm time in RTC peripheral.
Args:
RTCx: RTC peripheral selected, should be LPC_RTC
- pFullTime: Pointer to a RTC_TIME_Type structure that will be stored alarm
time in full.
- robovero.lpc17xx_rtc.RTC_GetFullTime(RTCx, pFullTime)¶
Get full of time in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- pFullTime: Pointer to a RTC_TIME_Type structure that will be stored time in full.
- robovero.lpc17xx_rtc.RTC_GetIntPending(RTCx, IntType)¶
Check whether if specified Location interrupt in RTC peripheral is set or not.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- IntType: Interrupt location type, should be:
- RTC_INT_COUNTER_INCREASE: Counter Increment Interrupt block generated an interrupt.
- RTC_INT_ALARM: Alarm generated an interrupt.
- robovero.lpc17xx_rtc.RTC_GetTime(RTCx, Timetype)¶
Get current time value for each type time type.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Timetype: Time Type, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
Return: Value of time according to specified time type
- class robovero.lpc17xx_rtc.RTC_INT_OPT¶
RTC interrupt source.
- RTC_INT_COUNTER_INCREASE: Counter Increment Interrupt
- RTC_INT_ALARM = RTC_IRL_RTCALF: The alarm interrupt
- RTC_INT_ALARM = 2¶
- RTC_INT_COUNTER_INCREASE = 1¶
- robovero.lpc17xx_rtc.RTC_Init(RTCx)¶
Initializes the RTC peripheral..
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- robovero.lpc17xx_rtc.RTC_ReadGPREG(RTCx, Channel)¶
Read value from General purpose registers.
These General purpose registers can be used to store important information when the main power supply is off. The value in these registers is not affected by chip reset.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Channel: General purpose registers Channel number,should be in range from 0 to 4.
Return: Read Value
- robovero.lpc17xx_rtc.RTC_ResetClockTickCounter(RTCx)¶
Reset clock tick counter in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- robovero.lpc17xx_rtc.RTC_SetAlarmTime(RTCx, Timetype, ALValue)¶
Set alarm time value for each time type.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Timetype: Time Type, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
- ALValue: Alarm time value to set
- robovero.lpc17xx_rtc.RTC_SetFullAlarmTime(RTCx, pFullTime)¶
Set full of alarm time in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- pFullTime: Pointer to a RTC_TIME_Type structure that contains alarm time value in full.
- robovero.lpc17xx_rtc.RTC_SetFullTime(RTCx, pFullTime)¶
Set full of time in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- pFullTime: Pointer to a RTC_TIME_Type structure that contains time value in full.
- robovero.lpc17xx_rtc.RTC_SetTime(RTCx, Timetype, TimeValue)¶
Set current time value for each time type in RTC peripheral.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Timetype: Time Type, should be:
- RTC_TIMETYPE_SECOND
- RTC_TIMETYPE_MINUTE
- RTC_TIMETYPE_HOUR
- RTC_TIMETYPE_DAYOFWEEK
- RTC_TIMETYPE_DAYOFMONTH
- RTC_TIMETYPE_DAYOFYEAR
- RTC_TIMETYPE_MONTH
- RTC_TIMETYPE_YEAR
- TimeValue: Time value to set
- class robovero.lpc17xx_rtc.RTC_TIMETYPE_Num¶
RTC time type option.
- RTC_TIMETYPE_SECOND: Second
- RTC_TIMETYPE_MINUTE: Month
- RTC_TIMETYPE_HOUR: Hour
- RTC_TIMETYPE_DAYOFWEEK: Day of week
- RTC_TIMETYPE_DAYOFMONTH: Day of month
- RTC_TIMETYPE_DAYOFYEAR: Day of year
- RTC_TIMETYPE_MONTH: Month
- RTC_TIMETYPE_YEAR: Year
- RTC_TIMETYPE_DAYOFMONTH = 4¶
- RTC_TIMETYPE_DAYOFWEEK = 3¶
- RTC_TIMETYPE_DAYOFYEAR = 5¶
- RTC_TIMETYPE_HOUR = 2¶
- RTC_TIMETYPE_MINUTE = 1¶
- RTC_TIMETYPE_MONTH = 6¶
- RTC_TIMETYPE_SECOND = 0¶
- RTC_TIMETYPE_YEAR = 7¶
- class robovero.lpc17xx_rtc.RTC_TIME_Type(**kwargs)¶
Bases: robovero.internals.cstruct
Time structure definitions for simple manipulation.
- SEC: Seconds Register
- MIN: Minutes Register
- HOUR: Hours Register
- DOM: Day of Month Register
- DOW: Day of Week Register
- DOY: Day of Year Register
- MONTH: Months Register
- YEAR: Years Register
- ptr: LPC1769 memory address where structure is stored. Use this in place of the C reference operator (&).
- robovero.lpc17xx_rtc.RTC_WriteGPREG(RTCx, Channel, Value)¶
Write value to General purpose registers.
Note: These General purpose registers can be used to store important information when the main power supply is off. The value in these registers is not affected by chip reset.
Args:
- RTCx: RTC peripheral selected, should be LPC_RTC
- Channel: General purpose registers Channel number, should be in range from 0 to 4.
- Value: Value to write