| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
CHIP: LPC18xx/43xx RTC driver
LPC18xx/43xx chip specific drivers

## Detailed Description

## Functions
void | Chip_RTC_Init (LPC_RTC_T *pRTC)
| Initialize the RTC peripheral.
STATIC INLINE void | Chip_RTC_DeInit (LPC_RTC_T *pRTC)
| De-initialize the RTC peripheral.
STATIC INLINE void | Chip_RTC_ResetClockTickCounter (LPC_RTC_T *pRTC)
| Reset clock tick counter in the RTC peripheral.
STATIC INLINE void | Chip_RTC_Enable (LPC_RTC_T *pRTC, FunctionalState NewState)
| Start/Stop RTC peripheral.
STATIC INLINE void | Chip_RTC_CntIncrIntConfig (LPC_RTC_T *pRTC, uint32_t cntrMask, FunctionalState NewState)
| Enable/Disable Counter increment interrupt for a time type in the RTC peripheral.
STATIC INLINE void | Chip_RTC_AlarmIntConfig (LPC_RTC_T *pRTC, uint32_t alarmMask, FunctionalState NewState)
| Enable/Disable Alarm interrupt for a time type in the RTC peripheral.
STATIC INLINE void | Chip_RTC_SetTime (LPC_RTC_T *pRTC, IP_RTC_TIMEINDEX_T Timetype, uint32_t TimeValue)
| Set current time value for a time type in the RTC peripheral.
STATIC INLINE uint32_t | Chip_RTC_GetTime (LPC_RTC_T *pRTC, IP_RTC_TIMEINDEX_T Timetype)
| Get current time value for a type time type.
STATIC INLINE void | Chip_RTC_SetFullTime (LPC_RTC_T *pRTC, IP_RTC_TIME_T *pFullTime)
| Set full time in the RTC peripheral.
STATIC INLINE void | Chip_RTC_GetFullTime (LPC_RTC_T *pRTC, IP_RTC_TIME_T *pFullTime)
| Get full time from the RTC peripheral.
STATIC INLINE void | Chip_RTC_SetAlarmTime (LPC_RTC_T *pRTC, IP_RTC_TIMEINDEX_T Timetype, uint32_t ALValue)
| Set alarm time value for a time type.
STATIC INLINE uint32_t | Chip_RTC_GetAlarmTime (LPC_RTC_T *pRTC, IP_RTC_TIMEINDEX_T Timetype)
| Get alarm time value for a time type.
STATIC INLINE void | Chip_RTC_SetFullAlarmTime (LPC_RTC_T *pRTC, IP_RTC_TIME_T *pFullTime)
| Set full alarm time in the RTC peripheral.
STATIC INLINE void | Chip_RTC_GetFullAlarmTime (LPC_RTC_T *pRTC, IP_RTC_TIME_T *pFullTime)
| Get full alarm time in the RTC peripheral.
STATIC INLINE void | Chip_REGFILE_Write (LPC_REGFILE_T *pRegFile, uint8_t index, uint32_t Value)
| Write value to General purpose registers.
STATIC INLINE uint32_t | Chip_REGFILE_Read (LPC_REGFILE_T *pRegFile, uint8_t index)
| Read value from General purpose registers.
STATIC INLINE void | Chip_RTC_CalibCounterCmd (LPC_RTC_T *pRTC, FunctionalState NewState)
| Enable/Disable calibration counter in the RTC peripheral.
STATIC INLINE void | Chip_RTC_CalibConfig (LPC_RTC_T *pRTC, uint32_t CalibValue, uint8_t CalibDir)
| Configures Calibration in the RTC peripheral.
STATIC INLINE void | Chip_RTC_ClearIntPending (LPC_RTC_T *pRTC, uint32_t IntType)
| Clear specified Location interrupt pending in the RTC peripheral.
STATIC INLINE IntStatus | Chip_RTC_GetIntPending (LPC_RTC_T *pRTC, uint32_t IntType)
| Check whether if specified location interrupt in the RTC peripheral is set or not.

## Function Documentation

STATIC INLINE uint32_t Chip_REGFILE_Read | ( | LPC_REGFILE_T * | pRegFile,
|  | uint8_t | index
| ) |  |

Read value from General purpose registers.

Parameters

  pRegFile | : RegFile peripheral selected
  index | : General purpose register index

Returns
  Read Value

Note
  TheseGeneral 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. These registers are powered in the RTC power domain.

Definition at line 226 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_REGFILE_Write | ( | LPC_REGFILE_T * | pRegFile,
|  | uint8_t | index,
|  | uint32_t | Value
| ) |  |

Write value to General purpose registers.

Parameters

  pRegFile | : RegFile peripheral selected
  index | : General purpose register index
  Value | : Value to write

Returns
  None

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. These registers are powered in the RTC power domain.

Definition at line 211 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_AlarmIntConfig | ( | LPC_RTC_T * | pRTC,
|  | uint32_t | alarmMask,
|  | FunctionalState | NewState
| ) |  |

Enable/Disable Alarm interrupt for a time type in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  alarmMask | : Or'ed bit values for ALARM types (RTC_AMR_CIIR_IM*)
  NewState | : ENABLE or DISABLE

Returns
  None

Definition at line 105 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_CalibConfig | ( | LPC_RTC_T * | pRTC,
|  | uint32_t | CalibValue,
|  | uint8_t | CalibDir
| ) |  |

Configures Calibration in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  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

Returns
  None

Definition at line 253 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_CalibCounterCmd | ( | LPC_RTC_T * | pRTC,
|  | FunctionalState | NewState
| ) |  |

Enable/Disable calibration counter in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  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

Returns
  None

Definition at line 239 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_ClearIntPending | ( | LPC_RTC_T * | pRTC,
|  | uint32_t | IntType
| ) |  |

Clear specified Location interrupt pending in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  IntType | : Interrupt location type, should be: RTC_INT_COUNTER_INCREASE :Clear Counter Increment Interrupt pending. RTC_INT_ALARM :Clear alarm interrupt pending

Returns
  None

Definition at line 266 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_CntIncrIntConfig | ( | LPC_RTC_T * | pRTC,
|  | uint32_t | cntrMask,
|  | FunctionalState | NewState
| ) |  |

Enable/Disable Counter increment interrupt for a time type in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  cntrMask | : Or'ed bit values for time types (RTC_AMR_CIIR_IM*)
  NewState | : ENABLE or DISABLE

Returns
  None

Definition at line 92 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_DeInit | ( | LPC_RTC_T * | pRTC | ) |

De-initialize the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected

Returns
  None

Definition at line 56 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_Enable | ( | LPC_RTC_T * | pRTC,
|  | FunctionalState | NewState
| ) |  |

Start/Stop RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  NewState | : New State of this function, should be: ENABLE :The time counters are enabled DISABLE :The time counters are disabled

Returns
  None

Definition at line 79 of file rtc_18xx_43xx.h.

STATIC INLINE uint32_t Chip_RTC_GetAlarmTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIMEINDEX_T | Timetype
| ) |  |

Get alarm time value for a time type.

Parameters

  pRTC | : RTC peripheral selected
  Timetype | : Time index field to get

Returns
  Value of Alarm time according to specified time type

Definition at line 173 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_GetFullAlarmTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIME_T * | pFullTime
| ) |  |

Get full alarm time in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  pFullTime | : Pointer to full time record to fill

Returns
  None

Definition at line 195 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_GetFullTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIME_T * | pFullTime
| ) |  |

Get full time from the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  pFullTime | : Pointer to full time record to fill

Returns
  None

Definition at line 150 of file rtc_18xx_43xx.h.

STATIC INLINE IntStatus Chip_RTC_GetIntPending | ( | LPC_RTC_T * | pRTC,
|  | uint32_t | IntType
| ) |  |

Check whether if specified location interrupt in the RTC peripheral is set or not.

Parameters

  pRTC | : RTC peripheral selected
  IntType | : Interrupt location type, should be: RTC_INT_COUNTER_INCREASE: Counter Increment Interrupt block generated an interrupt. RTC_INT_ALARM: Alarm generated an interrupt.

Returns
  New state of specified Location interrupt in RTC peripheral, SET OR RESET

Definition at line 279 of file rtc_18xx_43xx.h.

STATIC INLINE uint32_t Chip_RTC_GetTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIMEINDEX_T | Timetype
| ) |  |

Get current time value for a type time type.

Parameters

  pRTC | : RTC peripheral selected
  Timetype | : Time field index type to get

Returns
  Value of time field according to specified time type

Definition at line 128 of file rtc_18xx_43xx.h.

void Chip_RTC_Init | ( | LPC_RTC_T * | pRTC | ) |

Initialize the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected

Returns
  None

Definition at line 51 of file rtc_17xx_40xx.c.

STATIC INLINE void Chip_RTC_ResetClockTickCounter | ( | LPC_RTC_T * | pRTC | ) |

Reset clock tick counter in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected

Returns
  None

Definition at line 66 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_SetAlarmTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIMEINDEX_T | Timetype,
|  | uint32_t | ALValue
| ) |  |

Set alarm time value for a time type.

Parameters

  pRTC | : RTC peripheral selected
  Timetype | : Time index field to set
  ALValue | : Alarm time value to set

Returns
  None

Definition at line 162 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_SetFullAlarmTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIME_T * | pFullTime
| ) |  |

Set full alarm time in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  pFullTime | : Pointer to full time record to set alarm

Returns
  None

Definition at line 184 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_SetFullTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIME_T * | pFullTime
| ) |  |

Set full time in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  pFullTime | : Pointer to full time data

Returns
  None

Definition at line 139 of file rtc_18xx_43xx.h.

STATIC INLINE void Chip_RTC_SetTime | ( | LPC_RTC_T * | pRTC,
|  | IP_RTC_TIMEINDEX_T | Timetype,
|  | uint32_t | TimeValue
| ) |  |

Set current time value for a time type in the RTC peripheral.

Parameters

  pRTC | : RTC peripheral selected
  Timetype | : time field index type to set
  TimeValue | : Value to palce in time field

Returns
  None

Definition at line 117 of file rtc_18xx_43xx.h.