| 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
Data Structures | Macros | Enumerations | Functions
IP: MRT register block and driver
IP drivers: Common drivers used on multiple NXP devices

## Detailed Description

## Data Structures
struct | IP_MRT_001_T
| MRT register block structure. More...

## Macros
#define | IP_MRT_001_INTVAL_IVALUE (0xFFFFFF)
| MRT register bit fields & masks.
#define | IP_MRT_001_INTVAL_LOAD (1 << 31)
#define | IP_MRT_001_CTRL_MODE_REPEAT (0x00)
#define | IP_MRT_001_CTRL_MODE_ONESHOT (0x01)
#define | IP_MRT_001_CTRL_INTEN_MASK (0x01)
#define | IP_MRT_001_CTRL_MODE_POS (0x01)
#define | IP_MRT_001_CTRL_MODE_MASK (0x06)
#define | IP_MRT_001_CTRL_MODE_SHIFT(x) (x << 1)
#define | IP_MRT_001_STAT_INTFLAG (0x01)
#define | IP_MRT_001_STAT_RUNNING (0x02)

## Enumerations
enum | IP_MRT_001_MODE_T { MRT_MODE_REPEAT = 0, MRT_MODE_ONESHOT = 1 }
| MRT Interrupt Modes enum. More...

## Functions
STATIC INLINE void | IP_MRT_Init (void)
| Initializes the MRT.
STATIC INLINE void | IP_MRT_DeInit (void)
| De-initializes the MRT Channel.
STATIC INLINE uint32_t | IP_MRT_GetInterval (IP_MRT_001_T *pMRT)
| Returns the timer time interval value.
STATIC INLINE void | IP_MRT_SetInterval (IP_MRT_001_T *pMRT, uint32_t interval)
| Sets the timer time interval value.
STATIC INLINE uint32_t | IP_MRT_GetTimer (IP_MRT_001_T *pMRT)
| Returns the current timer value.
STATIC INLINE bool | IP_MRT_GetEnabled (IP_MRT_001_T *pMRT)
| Returns true if the timer is enabled.
STATIC INLINE void | IP_MRT_SetEnabled (IP_MRT_001_T *pMRT)
| Enables the timer.
STATIC INLINE IP_MRT_001_MODE_T | IP_MRT_GetMode (IP_MRT_001_T *pMRT)
| Returns the timer mode (repeat or one-shot).
STATIC INLINE void | IP_MRT_SetMode (IP_MRT_001_T *pMRT, IP_MRT_001_MODE_T mode)
| Sets the timer mode to be repeat or one-shot.
STATIC INLINE bool | IP_MRT_IsRepeatMode (IP_MRT_001_T *pMRT)
| Returns true if the timer is configured in repeat mode.
STATIC INLINE bool | IP_MRT_IsOneShotMode (IP_MRT_001_T *pMRT)
| Returns true if the timer is configured in one-shot mode.
STATIC INLINE bool | IP_MRT_IntPending (IP_MRT_001_T *pMRT)
| Returns true if the timer has an interrupt pending.
STATIC INLINE void | IP_MRT_IntClear (IP_MRT_001_T *pMRT)
| Clears the pending interrupt (if any).
STATIC INLINE bool | IP_MRT_Running (IP_MRT_001_T *pMRT)
| Returns true if the timer is running.

## Macro Definition Documentation

#define IP_MRT_001_CTRL_INTEN_MASK (0x01)

Definition at line 67 of file mrt_001.h.

#define IP_MRT_001_CTRL_MODE_MASK (0x06)

Definition at line 69 of file mrt_001.h.

#define IP_MRT_001_CTRL_MODE_ONESHOT (0x01)

Definition at line 66 of file mrt_001.h.

#define IP_MRT_001_CTRL_MODE_POS (0x01)

Definition at line 68 of file mrt_001.h.

#define IP_MRT_001_CTRL_MODE_REPEAT (0x00)

Definition at line 65 of file mrt_001.h.

#define IP_MRT_001_CTRL_MODE_SHIFT | ( |  | x | ) | (x << 1)

Definition at line 70 of file mrt_001.h.

#define IP_MRT_001_INTVAL_IVALUE (0xFFFFFF)

MRT register bit fields & masks.

Definition at line 61 of file mrt_001.h.

#define IP_MRT_001_INTVAL_LOAD (1 << 31)

Definition at line 62 of file mrt_001.h.

#define IP_MRT_001_STAT_INTFLAG (0x01)

Definition at line 73 of file mrt_001.h.

#define IP_MRT_001_STAT_RUNNING (0x02)

Definition at line 74 of file mrt_001.h.

## Enumeration Type Documentation

enum IP_MRT_001_MODE_T

MRT Interrupt Modes enum.

Enumerator:

  MRT_MODE_REPEAT | MRT Repeat interrupt mode
  MRT_MODE_ONESHOT | MRT One-shot interrupt mode

Definition at line 79 of file mrt_001.h.

## Function Documentation

STATIC INLINE void IP_MRT_DeInit | ( | void |  | ) |

De-initializes the MRT Channel.

Returns
  Nothing

Definition at line 95 of file mrt_001.h.

STATIC INLINE bool IP_MRT_GetEnabled | ( | IP_MRT_001_T * | pMRT | ) |

Returns true if the timer is enabled.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  True if enabled, False if not enabled

Definition at line 137 of file mrt_001.h.

STATIC INLINE uint32_t IP_MRT_GetInterval | ( | IP_MRT_001_T * | pMRT | ) |

Returns the timer time interval value.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  The time interval value

Definition at line 103 of file mrt_001.h.

STATIC INLINE IP_MRT_001_MODE_T IP_MRT_GetMode | ( | IP_MRT_001_T * | pMRT | ) |

Returns the timer mode (repeat or one-shot).

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  The mode (repeat or one-shot).

Definition at line 157 of file mrt_001.h.

STATIC INLINE uint32_t IP_MRT_GetTimer | ( | IP_MRT_001_T * | pMRT | ) |

Returns the current timer value.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  The current timer value

Definition at line 127 of file mrt_001.h.

STATIC INLINE void IP_MRT_Init | ( | void |  | ) |

Initializes the MRT.

Returns
  Nothing

Definition at line 88 of file mrt_001.h.

STATIC INLINE void IP_MRT_IntClear | ( | IP_MRT_001_T * | pMRT | ) |

Clears the pending interrupt (if any).

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  Nothing

Definition at line 208 of file mrt_001.h.

STATIC INLINE bool IP_MRT_IntPending | ( | IP_MRT_001_T * | pMRT | ) |

Returns true if the timer has an interrupt pending.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  True if interrupt is pending, False if no interrupt is pending.

Definition at line 198 of file mrt_001.h.

STATIC INLINE bool IP_MRT_IsOneShotMode | ( | IP_MRT_001_T * | pMRT | ) |

Returns true if the timer is configured in one-shot mode.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  True if in one-shot mode, False if in repeat mode.

Definition at line 188 of file mrt_001.h.

STATIC INLINE bool IP_MRT_IsRepeatMode | ( | IP_MRT_001_T * | pMRT | ) |

Returns true if the timer is configured in repeat mode.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  True if in repeat mode, False if in one-shot mode

Definition at line 178 of file mrt_001.h.

STATIC INLINE bool IP_MRT_Running | ( | IP_MRT_001_T * | pMRT | ) |

Returns true if the timer is running.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  True if running, False if stopped.

Definition at line 218 of file mrt_001.h.

STATIC INLINE void IP_MRT_SetEnabled | ( | IP_MRT_001_T * | pMRT | ) |

Enables the timer.

Parameters

  pMRT | : Pointer to selected MRT Channel

Returns
  Nothing

Definition at line 147 of file mrt_001.h.

STATIC INLINE void IP_MRT_SetInterval | ( | IP_MRT_001_T * | pMRT,
|  | uint32_t | interval
| ) |  |

Sets the timer time interval value.

Parameters

  pMRT | : Pointer to selected MRT Channel
  interval | : Time interval value (24-bits)

Returns
  Nothing

Note
  Setting bit 31 in time interval register causes the time interval to load immediately, otherwise the load will occur on the next timer cycle

Definition at line 117 of file mrt_001.h.

STATIC INLINE void IP_MRT_SetMode | ( | IP_MRT_001_T * | pMRT,
|  | IP_MRT_001_MODE_T | mode
| ) |  |

Sets the timer mode to be repeat or one-shot.

Parameters

  pMRT | : Pointer to selected MRT Channel
  mode | : 0 = repeat, 1 = one-shot

Returns
  Nothing

Definition at line 168 of file mrt_001.h.