![]() |
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 | |
PDB Peripheral and Driver Overview | |
Content including 1) peripheral features, work logic and work method; 2) driver design logic and use method; 3) typical use case. | |
The Driver Change Log | |
The current Pdb driver version is 2.0.0. | |
Data Structures | |
struct | pdb_trigger_output_logic_config_t |
configuring PDB trigger output logic. More... | |
struct | pdb_config_t |
PDB module config structure. More... | |
Driver version | |
#define | FSL_PDB_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
PDB driver version. More... | |
Initialization and deinitialization Interfaces | |
void | PDB_Init (PDB_Type *base, const pdb_config_t *psConfig) |
Initializes the PDB module. More... | |
void | PDB_Deinit (PDB_Type *base) |
De-initializes the PDB module. More... | |
void | PDB_GetDefaultConfig (pdb_config_t *psConfig) |
Initializes the PDB user configuration structure. More... | |
void | PDB_SetTriggerOutputLogicConfig (PDB_Type *base, pdb_logic_t eLogic, const pdb_trigger_output_logic_config_t *psConfig) |
Set the PDB trigger output logic. More... | |
Basic Counter | |
static void | PDB_EnableModule (PDB_Type *base, bool bEnablePDBMode) |
Enable the PDB module. More... | |
static void | PDB_EnableContinuousMode (PDB_Type *base, bool bEnableContinuousMode) |
Enables the PDB continuous mode. More... | |
static void | PDB_DoSoftwareTrigger (PDB_Type *base) |
Triggers the PDB counter by software. More... | |
static void | PDB_SetLoadOk (PDB_Type *base) |
Loads the counter values. More... | |
static bool | PDB_GetPdbLdOk (PDB_Type *base) |
Get the PDB LDOK bit status. More... | |
static void | PDB_EnableTriggerOutput (PDB_Type *base, pdb_trigger_output_t eTrigger, bool bEnable) |
Enable the PDB trigger output. More... | |
static void | PDB_BypassTrigger (PDB_Type *base, pdb_trigger_output_t eTrigger, bool bValue) |
Bypass the PDB trigger output. More... | |
static void | PDB_EnableTriggerConbineMode (PDB_Type *base, pdb_logic_t eLogic, bool bMode) |
Enable Trigger output A & B combined mode. More... | |
static void | PDB_SetTriggerInitValue (PDB_Type *base, pdb_trigger_output_t eTrigger, pdb_init_value_t eInitValue) |
Initial trigger Value. More... | |
static void | PDB_EnableFault (PDB_Type *base, pdb_logic_t eLogic, bool bEnable) |
Enable PDB fault feature. More... | |
static void | PDB_FaultLength (PDB_Type *base, pdb_logic_t eLogic, pdb_fault_length_t ePdbFaultLength) |
Set the PDB fault length feature. More... | |
static void | PDB_SetFaultPolarity (PDB_Type *base, pdb_logic_t eLogic, pdb_fault_polarity_t ePolarity) |
Set fault input polarity. More... | |
static void | PDB_EnableInterrupts (PDB_Type *base, uint16_t u16Mask) |
The PDB interrupt is enabled according to the provided mask. More... | |
static void | PDB_DisableInterrupts (PDB_Type *base, uint16_t u16Mask) |
The PDB interrupt is disabled according to the provided mask. More... | |
static void | PDB_ClearStatusFlags (PDB_Type *base, uint16_t u16Mask) |
Clears the PDB status flags. More... | |
static uint16_t | PDB_GetStatusFlags (PDB_Type *base) |
Gets the status flags of the PDB module. More... | |
static void | PDB_SetTriggerDelay (PDB_Type *base, pdb_trigger_output_t eTrigger, uint16_t u16DelayValue) |
Sets the PDB trigger delay. More... | |
static void | PDB_SetModulusValue (PDB_Type *base, uint16_t u16PeriodCount) |
Specifies the counter period. More... | |
static uint16_t | PDB_GetCounterValue (PDB_Type *base) |
Gets the PDB counter's current value. More... | |
struct pdb_trigger_output_logic_config_t |
PDB has two output logic and each output logic has two output trigger signals: trigger1 and trigger2.
Data Fields | |
bool | bFaultEnable: 1U |
Set PDB fault input bit, true: PDB fault is enable; false: PDB fault is disable. More... | |
pdb_fault_polarity_t | eFaultPolarity: 1U |
Selected the PDB fault polarity 0 or 1. More... | |
pdb_fault_length_t | eFaultLength: 1U |
Selected the PDB fault length, 0: 2 IP bus clock cycles; 1: 4 IP bus clock cycles. More... | |
pdb_init_value_t | eTriggerInitValue: 1U |
Set fault bit forces the output from trigger logic : fault bit is enabled or trigger logic output is set and the counter is reloaded. More... | |
bool | bEnbleTriggerCombineOutput: 1U |
Trigger output select. More... | |
bool | bEnableTrigger1: 1U |
Set trigger1 in each trigger output logic of PDB. More... | |
bool | bEnableTrigger2: 1U |
Set trigger2 in each trigger output logic of PDB. More... | |
bool | bBypassTrigger1: 1U |
Set bypass trigger1 in each trigger output logic of PDB. More... | |
bool | bBypassTrigger2: 1U |
Set bypass trigger2 in each trigger output logic of PDB. More... | |
uint16_t | uDelay1 |
Set the delay of trigger1 in each trigger output logic of the PDB. More... | |
uint16_t | uDelay2 |
Set the delay of trigger2 in each trigger output logic of the PDB. More... | |
bool pdb_trigger_output_logic_config_t::bFaultEnable |
pdb_fault_polarity_t pdb_trigger_output_logic_config_t::eFaultPolarity |
pdb_fault_length_t pdb_trigger_output_logic_config_t::eFaultLength |
pdb_init_value_t pdb_trigger_output_logic_config_t::eTriggerInitValue |
bool pdb_trigger_output_logic_config_t::bEnbleTriggerCombineOutput |
true: Trigger1 and trigger2 Combine Output; false: Trigger1 and trigger2 function is only delay.
bool pdb_trigger_output_logic_config_t::bEnableTrigger1 |
true: PDB trigger1 is enable; false: PDB trigger1 is disable.
bool pdb_trigger_output_logic_config_t::bEnableTrigger2 |
true: PDB trigger2 is enable; false: PDB trigger2 is disable.
bool pdb_trigger_output_logic_config_t::bBypassTrigger1 |
true: PDB bypass trigger is enable; false: PDB bypass trigger is disable.
bool pdb_trigger_output_logic_config_t::bBypassTrigger2 |
true: PDB bypass trigger is enable; false: PDB bypass trigger is disable.
uint16_t pdb_trigger_output_logic_config_t::uDelay1 |
uint16_t pdb_trigger_output_logic_config_t::uDelay2 |
struct pdb_config_t |
Data Fields | |
bool | bEnableContinuousMode: 1U |
true: Module is in one-shot mode; false: Module is in continuous mode. More... | |
pdb_load_value_mode_t | eLoadValueMode: 1U |
Configures PDB load value mode.0: load immediately; 1: load after the PDB counter rolls over or receives a trigger signal. More... | |
pdb_prescaler_divider_t | ePrescalerDivider: 3U |
Configures PDB counter clock source prescaler. More... | |
pdb_input_trigger_t | eInputTrigger: 3U |
Configures PDB trigger input source. More... | |
pdb_trigger_output_logic_config_t | sPdbTriggerABOutputConfig |
Configure PDB trigger output logic A . More... | |
pdb_trigger_output_logic_config_t | sPdbTriggerCDOutputConfig |
Configure PDB trigger output logic C. More... | |
uint16_t | u16PeriodCount |
The period of the counter in terms of peripheral bus cycles. More... | |
bool | bEnablePDB |
true: PDB module id enable; false: PDB module id disable. More... | |
uint16_t | u16EnableInterruptMask |
PDB interrupt enable mask, logic OR of _pdb_interrupt_enable. More... | |
bool pdb_config_t::bEnableContinuousMode |
pdb_load_value_mode_t pdb_config_t::eLoadValueMode |
pdb_prescaler_divider_t pdb_config_t::ePrescalerDivider |
pdb_input_trigger_t pdb_config_t::eInputTrigger |
pdb_trigger_output_logic_config_t pdb_config_t::sPdbTriggerABOutputConfig |
pdb_trigger_output_logic_config_t pdb_config_t::sPdbTriggerCDOutputConfig |
uint16_t pdb_config_t::u16PeriodCount |
bool pdb_config_t::bEnablePDB |
uint16_t pdb_config_t::u16EnableInterruptMask |
#define FSL_PDB_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
The prescaler used for counting is selected by dividing the peripheral clock by the divisor.
Choose to load the DELAY and MOD registers into a set of buffers to take effect immediately or take effect after the counter is reversed and a trigger signal is received.
enum pdb_input_trigger_t |
Selects the trigger input source for the PDB. The trigger input source can be internal or the software trigger. When select kPDB_TriggerSoftware and the module is enabled, writing a one to MCTRL[SWTRIG] will trigger and software trigger. See chip configuration details for the actual PDB input trigger connections.
enum pdb_fault_length_t |
This bit is used to determine the minimum width requirement of the input fault for it to be recognized as a valid fault condition.
Enumerator | |
---|---|
kPDB_2IPBusClockCycles |
Fault input must be active at least 2 IPBus clock cycles. |
kPDB_4IPBusClockCycles |
Fault input must be active at least 4 IPBus clock cycles. |
enum pdb_fault_polarity_t |
enum pdb_trigger_output_t |
enum pdb_logic_t |
enum pdb_init_value_t |
enum _pdb_status_flags |
void PDB_Init | ( | PDB_Type * | base, |
const pdb_config_t * | psConfig | ||
) |
This function initializes the PDB module. The operations included are as follows.
base | PDB peripheral base address. |
psConfig | Pointer to the configuration structure. See pdb_config_t. |
void PDB_Deinit | ( | PDB_Type * | base | ) |
base | PDB peripheral base address. |
void PDB_GetDefaultConfig | ( | pdb_config_t * | psConfig | ) |
This function initializes the user configuration structure to a default value. The default values are as follows.
psConfig | Pointer to configuration structure. See pdb_config_t. |
void PDB_SetTriggerOutputLogicConfig | ( | PDB_Type * | base, |
pdb_logic_t | eLogic, | ||
const pdb_trigger_output_logic_config_t * | psConfig | ||
) |
base | PDB peripheral base address. |
eLogic | index for PDB trigger output logic instance. See pdb_logic_t. |
psConfig | Pointer to the configuration structure. See pdb_trigger_output_logic_config_t. |
|
inlinestatic |
base | PDB peripheral base address. |
bEnablePDBMode | Enable the module or not. |
|
inlinestatic |
base | PDB peripheral base address. |
bEnableContinuousMode | Enable the module or not. |
|
inlinestatic |
base | PDB peripheral base address. |
|
inlinestatic |
This function loads the counter values from the internal buffer.
base | PDB peripheral base address. |
|
inlinestatic |
base | PDB peripheral base address. |
|
inlinestatic |
When disabled, trigger output will be forced to 0.
base | PDB peripheral base address. |
eTrigger | index for trigger instance. See pdb_trigger_output_t. |
bEnable | bEnable the triggers or not. |
|
inlinestatic |
When bypass enabled, Trigger output is a single pulse created by the selected trigger source.
base | PDB peripheral base address. |
eTrigger | index for trigger instance. See pdb_trigger_output_t. |
bValue | The PDB bypassA mode enable or not. |
|
inlinestatic |
When enabled, Trigger A and Trigger B outputs are a function of combined DELAYA and DELAYB. Trigger A is an extended pulse and Trigger B is a dual pulse. When disabled, Trigger A is a function of DELAYA only. Trigger B is a function of DELAYB only.
base | PDB peripheral base address. |
eLogic | index for PDB trigger output logic instance. See pdb_logic_t. |
bMode | The trigger A output mode select. |
|
inlinestatic |
base | PDB peripheral base address. |
eTrigger | index for trigger instance. See pdb_trigger_output_t. |
eInitValue | set trigger init value. See pdb_init_value_t. |
|
inlinestatic |
base | PDB peripheral base address. |
eLogic | index for PDB trigger output logic instance. See pdb_logic_t. |
bEnable | Enable the interrupts or not. |
|
inlinestatic |
This bit is used to determine the minimum width requirement of the input fault for it to be recognized as a valid fault condition.
base | PDB peripheral base address. |
eLogic | index for PDB trigger output logic instance. See pdb_logic_t. |
ePdbFaultLength | Set the PDB fault length. See pdb_fault_length_t. |
|
inlinestatic |
base | PDB peripheral base address. |
eLogic | index for PDB trigger output logic instance. See pdb_logic_t. |
ePolarity | Set the PDB fault polarity. See pdb_fault_polarity_t. |
|
inlinestatic |
base | PDB peripheral base address. |
u16Mask | The PDB interrupts to enable. Logical OR of _pdb_interrupt_enable. |
|
inlinestatic |
base | PDB peripheral base address. |
u16Mask | The PDB interrupts to disable. Logical OR of _pdb_interrupt_enable. |
|
inlinestatic |
base | PDB peripheral base address. |
u16Mask | The status flags to clear. This is the logical OR of _pdb_status_flags. |
|
inlinestatic |
base | PDB peripheral base address. |
|
inlinestatic |
Write logic 1 to the MCTRL[LDMOD] bit, any value written to the DELAY register will be ignored until the value in these registers is loaded into the buffer; and this bit is 0, we need to manually set it to 1.
base | PDB peripheral base address. |
eTrigger | index for trigger instance. See pdb_trigger_output_t. |
u16DelayValue | Setting value for PDB counter delay event. 16-bit is available. |
|
inlinestatic |
Write logic 1 to the MCTRL[LDMOD] bit, any value written to the MOD register will be ignored until the value in these registers is loaded into the buffer; and this bit is 0, we need to manually set it to 1.
base | PDB peripheral base address. |
u16PeriodCount | Setting value for the modulus. 16-bit is available. |
|
inlinestatic |
base | PDB peripheral base address. |