![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
This document consists of sections titled with Driver Overview, Data Structures, Enumerations, Functions, etc., each with an overview list and detailed documentation. It is recommended to read the Driver Overview first for it includes a comprehensive description of the peripheral, driver and driver changes. Other sections give detailed information for APIs, enums, macros, etc., for your further reference.
Modules | |
PIT Peripheral and Driver Overview | |
Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method. | |
The Driver Change Log | |
The current PIT driver version is 2.3.0. | |
Data Structures | |
struct | pit_config_t |
List of SYNC_OUT output mode. More... | |
Enumerations | |
enum | pit_prescaler_value_t { kPIT_PrescalerDivBy1 = 0x0U, kPIT_PrescalerDivBy2 = 0x1U, kPIT_PrescalerDivBy4 = 0x2U, kPIT_PrescalerDivBy8 = 0x3U, kPIT_PrescalerDivBy16 = 0x4U, kPIT_PrescalerDivBy32 = 0x5U, kPIT_PrescalerDivBy64 = 0x6U, kPIT_PrescalerDivBy128 = 0x7U, kPIT_PrescalerDivBy256 = 0x8U, kPIT_PrescalerDivBy512 = 0x9U, kPIT_PrescalerDivBy1024 = 0xAU, kPIT_PrescalerDivBy2048 = 0xBU, kPIT_PrescalerDivBy4096 = 0xCU, kPIT_PrescalerDivBy8192 = 0xDU, kPIT_PrescalerDivBy16384 = 0xEU, kPIT_PrescalerDivBy32768 = 0xFU } |
PIT clock prescaler values. More... | |
enum | _pit_status_flags { kPIT_Timer_RollOverFlag = PIT_CTRL_PRF_MASK } |
List of PIT status flags. More... | |
Driver version | |
#define | FSL_PIT_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
PIT driver version. More... | |
Initialization and deinitialization Interfaces | |
void | PIT_Init (PIT_Type *base, const pit_config_t *psConfig) |
Ungates the PIT clock, configures the PIT features. More... | |
void | PIT_Deinit (PIT_Type *base) |
Gates the PIT clock and disables the PIT module. More... | |
void | PIT_GetDefaultConfig (pit_config_t *psConfig) |
Fill in the PIT config structure with the default settings. More... | |
PIT operation Interfaces | |
static void | PIT_EnableSlaveMode (PIT_Type *base, bool bEnable) |
Enable/Disable PIT slave mode. More... | |
static void | PIT_SetTimerPrescaler (PIT_Type *base, pit_prescaler_value_t ePrescaler) |
Sets the PIT clock prescaler. More... | |
static void | PIT_SetTimerPeriod (PIT_Type *base, uint16_t u16PeriodCount) |
Sets the timer period in units of count. More... | |
static uint16_t | PIT_GetCurrentTimerCount (PIT_Type *base) |
Reads the current timer counting value. More... | |
static void | PIT_StartTimer (PIT_Type *base) |
Starts the timer counting. More... | |
static void | PIT_StopTimer (PIT_Type *base) |
Stops the timer counting. More... | |
Interrupt control Interfaces | |
static void | PIT_EnableInterrupt (PIT_Type *base) |
Enables the PIT interrupts. More... | |
static void | PIT_DisableInterrupt (PIT_Type *base) |
Disables the selected PIT interrupts. More... | |
PIT Status Flag Interfaces. | |
static uint16_t | PIT_GetStatusFlags (PIT_Type *base) |
Gets the PIT status flags. More... | |
static void | PIT_ClearStatusFlags (PIT_Type *base) |
Clears the PIT status flags. More... | |
struct pit_config_t |
PIT FILT configuration structure
This structure holds the configuration settings for the PIT FILT register. To initialize this structure to reasonable defaults, call the PIT_GetDefaultConfig() function and pass a pointer to your config structure instance.
The configuration structure can be made constant so it resides in flash.
PIT CTRL2 configuration structure
This structure holds the configuration settings for the PIT CTRL2 register. To initialize this structure to reasonable defaults, call the PIT_GetDefaultConfig() function and pass a pointer to your config structure instance.
The configuration structure can be made constant so it resides in flash.
PIT configuration structure
This structure holds the configuration settings for the PIT peripheral. To initialize this structure to reasonable defaults, call the PIT_GetDefaultConfig() function and pass a pointer to your config structure instance.
The configuration structure can be made constant so it resides in flash.
Data Fields | |
pit_prescaler_value_t | ePrescaler: 5 |
Clock prescaler value. | |
bool | bEnableInterrupt: 1 |
Enable PIT Roll-Over Interrupt. | |
bool | bEnableSlaveMode: 1 |
Enable the PIT module in slave mode, in which mode the timer will be triggered by master PIT enable. More... | |
bool | bEnableTimer: 1 |
PIT timer enable flag, which is false by default. | |
pit_count_clock_source_t | eClockSource |
Specify the PIT count clock source. | |
uint16_t | u16PeriodCount |
Timer period in clock cycles, Use macro definition MSEC_TO_COUNT to convert value in ms to count of ticks, the COP clock rate is source clock divide prescaler. More... | |
bool pit_config_t::bEnableSlaveMode |
uint16_t pit_config_t::u16PeriodCount |
#define FSL_PIT_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
enum _pit_status_flags |
void PIT_Init | ( | PIT_Type * | base, |
const pit_config_t * | psConfig | ||
) |
The configurations are:
base | PIT peripheral base address |
psConfig | Pointer to the user's PIT config structure |
void PIT_Deinit | ( | PIT_Type * | base | ) |
base | PIT peripheral base address |
void PIT_GetDefaultConfig | ( | pit_config_t * | psConfig | ) |
This function initializes the PIT configuration structure to default values.
psConfig | Pointer to user's PIT config structure. |
|
inlinestatic |
base | PIT peripheral base address |
bEnable | enable/disable slave mode |
|
inlinestatic |
base | PIT peripheral base address |
ePrescaler | Timer prescaler value |
|
inlinestatic |
Timers begin counting from 0 until it reaches the value set by this function, then it generates an interrupt and counter resumes counting from 0 again.
base | PIT peripheral base address |
u16PeriodCount | Timer period in units of ticks, use macro definition MSEC_TO_COUNT to convert value in ms to count of ticks, the PIT clock rate is source clock divide prescaler. |
|
inlinestatic |
This function returns the real-time timer counting value, in a range from 0 to a timer period.
base | PIT peripheral base address |
|
inlinestatic |
After calling this function, timers load period value, count down to 0 and then load the respective start value again. Each time a timer reaches 0, it generates a trigger pulse and sets the timeout interrupt flag.
base | PIT peripheral base address |
|
inlinestatic |
This function stops timer counting, and the counter remains at or returns to a 0 value.
base | PIT peripheral base address |
|
inlinestatic |
base | PIT peripheral base address |
|
inlinestatic |
base | PIT peripheral base address |
|
inlinestatic |
base | PIT peripheral base address |
|
inlinestatic |
base | PIT peripheral base address |