![]() |
Kinetis SDK v.1.2 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the PDB HAL driver.
Data Structures | |
struct | pdb_timer_config_t |
Defines the type of structure for basic timer in PDB. More... | |
Functions | |
void | PDB_HAL_Init (PDB_Type *base) |
Resets the PDB registers to a known state. More... | |
pdb_status_t | PDB_HAL_ConfigTimer (PDB_Type *base, const pdb_timer_config_t *configPtr) |
Configure the PDB timer. More... | |
static void | PDB_HAL_SetSoftTriggerCmd (PDB_Type *base) |
Triggers the DAC by software if enabled. More... | |
static void | PDB_HAL_Enable (PDB_Type *base) |
Switches on to enable the PDB module. More... | |
static void | PDB_HAL_Disable (PDB_Type *base) |
Switches to disable the PDB module. More... | |
static bool | PDB_HAL_GetTimerIntFlag (PDB_Type *base) |
Gets the PDB delay interrupt flag. More... | |
static void | PDB_HAL_ClearTimerIntFlag (PDB_Type *base) |
Clears the PDB delay interrupt flag. More... | |
static void | PDB_HAL_SetLoadValuesCmd (PDB_Type *base) |
Loads the delay registers value for the PDB module. More... | |
static void | PDB_HAL_SetTimerModulusValue (PDB_Type *base, uint32_t value) |
Sets the modulus value for the PDB module. More... | |
static uint32_t | PDB_HAL_GetTimerValue (PDB_Type *base) |
Gets the PDB counter value of PDB timer. More... | |
static void | PDB_HAL_SetValueForTimerInterrupt (PDB_Type *base, uint32_t value) |
Sets the interrupt delay milestone of the PDB counter. More... | |
void | PDB_HAL_SetAdcPreTriggerBackToBackEnable (PDB_Type *base, uint32_t chn, uint32_t preChnMask, bool enable) |
Switches to enable the pre-trigger back-to-back mode. More... | |
void | PDB_HAL_SetAdcPreTriggerOutputEnable (PDB_Type *base, uint32_t chn, uint32_t preChnMask, bool enable) |
Switches to enable the pre-trigger output. More... | |
void | PDB_HAL_SetAdcPreTriggerEnable (PDB_Type *base, uint32_t chn, uint32_t preChnMask, bool enable) |
Switches to enable the pre-trigger. More... | |
static uint32_t | PDB_HAL_GetAdcPreTriggerFlags (PDB_Type *base, uint32_t chn, uint32_t preChnMask) |
Gets the flag which indicates whether the PDB counter has reached the pre-trigger delay value. More... | |
void | PDB_HAL_ClearAdcPreTriggerFlags (PDB_Type *base, uint32_t chn, uint32_t preChnMask) |
Clears the flag which indicates that the PDB counter has reached the pre-trigger delay value. More... | |
static uint32_t | PDB_HAL_GetAdcPreTriggerSeqErrFlags (PDB_Type *base, uint32_t chn, uint32_t preChnMask) |
Gets the flag which indicates whether a sequence error is detected. More... | |
void | PDB_HAL_ClearAdcPreTriggerSeqErrFlags (PDB_Type *base, uint32_t chn, uint32_t preChnMask) |
Clears the flag which indicates that a sequence error has been detected. More... | |
void | PDB_HAL_SetAdcPreTriggerDelayValue (PDB_Type *base, uint32_t chn, uint32_t preChn, uint32_t value) |
Sets the pre-trigger delay value. More... | |
static void | PDB_HAL_SetDacExtTriggerInputEnable (PDB_Type *base, uint32_t dacChn, bool enable) |
Switches to enable the DAC external trigger input. More... | |
static void | PDB_HAL_SetDacIntervalTriggerEnable (PDB_Type *base, uint32_t dacChn, bool enable) |
Switches to enable the DAC external trigger input. More... | |
static void | PDB_HAL_SetDacIntervalValue (PDB_Type *base, uint32_t dacChn, uint32_t value) |
Sets the interval value for the DAC trigger. More... | |
void | PDB_HAL_SetCmpPulseOutEnable (PDB_Type *base, uint32_t pulseChnMask, bool enable) |
Switches to enable the pulse-out trigger. More... | |
static void | PDB_HAL_SetCmpPulseOutDelayForHigh (PDB_Type *base, uint32_t pulseChn, uint32_t value) |
Sets the counter delay value for the pulse-out goes high. More... | |
static void | PDB_HAL_SetCmpPulseOutDelayForLow (PDB_Type *base, uint32_t pulseChn, uint32_t value) |
Sets the counter delay value for the pulse-out goes low. More... | |
struct pdb_timer_config_t |
Data Fields | |
pdb_load_value_mode_t | loadValueMode |
Select the load mode. | |
bool | seqErrIntEnable |
Enable PDB Sequence Error Interrupt. | |
pdb_clk_prescaler_div_t | clkPreDiv |
Select the prescaler divider. | |
pdb_clk_prescaler_mult_factor_t | clkPreMultFactor |
Select multiplication factor for prescaler. | |
pdb_trigger_src_t | triggerInput |
Select the trigger input source. | |
bool | continuousModeEnable |
Enable the continuous mode. | |
bool | dmaEnable |
Enable the dma for timer. | |
bool | intEnable |
Enable the interrupt for timer. | |
enum pdb_status_t |
Some timing related registers, such as the MOD, IDLY, CHnDLYm, INTx and POyDLY, buffer the setting values. Only the load operation is triggered. The setting value is loaded from a buffer and takes effect. There are four loading modes to fit different applications.
enum pdb_trigger_src_t |
Selects the trigger input source for the PDB. The trigger input source can be internal or external (EXTRG pin), or the software trigger.
Selects the multiplication factor of the prescaler divider for the PDB counter clock.
void PDB_HAL_Init | ( | PDB_Type * | base | ) |
This function resets the PDB registers to a known state. This state is defined in a reference manual and is power on reset value.
base | Register base address for the module. |
pdb_status_t PDB_HAL_ConfigTimer | ( | PDB_Type * | base, |
const pdb_timer_config_t * | configPtr | ||
) |
This function configure the PDB's basic timer.
base | Register base address for the module. |
configPtr | Pointer to configuration structure, see to "pdb_timer_config_t". |
|
inlinestatic |
If enabled, this function triggers the DAC by using software.
base | Register base address for the module. |
|
inlinestatic |
This function switches on to enable the PDB module.
base | Register base address for the module. |
|
inlinestatic |
This function switches to disable the PDB module.
base | Register base address for the module. |
|
inlinestatic |
This function gets the PDB delay interrupt flag.
base | Register base address for the module. |
|
inlinestatic |
This function clears PDB delay interrupt flag.
base | Register base address for the module. |
|
inlinestatic |
This function sets the LDOK bit and loads the delay registers value. Writing one to this bit updates the internal registers MOD, IDLY, CHnDLYm, DACINTx, and POyDLY with the values written to their buffers. The MOD, IDLY, CHnDLYm, DACINTx, and POyDLY take effect according to the load mode settings.
After one is written to the LDOK bit, the values in the buffers of above mentioned registers are not effective and cannot be written until the values in the buffers are loaded into their internal registers. The LDOK can be written only when the the PDB is enabled or as alone with it. It is automatically cleared either when the values in the buffers are loaded into the internal registers or when the PDB is disabled.
base | Register base address for the module. |
|
inlinestatic |
This function sets the modulus value for the PDB module. When the counter reaches the setting value, it is automatically reset to zero. When in continuous mode, the counter begins to increase again.
base | Register base address for the module. |
value | The setting value of upper limit for PDB counter. |
|
inlinestatic |
This function gets the PDB counter value of PDB timer.
base | Register base address for the module. |
|
inlinestatic |
This function sets the interrupt delay milestone of the PDB counter. If enabled, a PDB interrupt is generated when the counter is equal to the setting value.
base | Register base address for the module. |
value | The setting value for interrupt delay milestone of PDB counter. |
void PDB_HAL_SetAdcPreTriggerBackToBackEnable | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChnMask, | ||
bool | enable | ||
) |
This function switches to enable the pre-trigger back-to-back mode.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
enable | Switcher to assert the feature. |
void PDB_HAL_SetAdcPreTriggerOutputEnable | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChnMask, | ||
bool | enable | ||
) |
This function switches to enable pre-trigger output.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
enable | Switcher to assert the feature. |
void PDB_HAL_SetAdcPreTriggerEnable | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChnMask, | ||
bool | enable | ||
) |
This function switches to enable the pre-trigger.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
enable | Switcher to assert the feature. |
|
inlinestatic |
This function gets the flag which indicates the PDB counter has reached the pre-trigger delay value.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
void PDB_HAL_ClearAdcPreTriggerFlags | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChnMask | ||
) |
This function clears the flag which indicates that the PDB counter has reached the pre-trigger delay value.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
|
inlinestatic |
This function gets the flag which indicates whether a sequence error is detected.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
void PDB_HAL_ClearAdcPreTriggerSeqErrFlags | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChnMask | ||
) |
This function clears the flag which indicates that the sequence error has been detected.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChnMask | ADC channel group index mask for trigger. |
void PDB_HAL_SetAdcPreTriggerDelayValue | ( | PDB_Type * | base, |
uint32_t | chn, | ||
uint32_t | preChn, | ||
uint32_t | value | ||
) |
This function sets the pre-trigger delay value.
base | Register base address for the module. |
chn | ADC instance index for trigger. |
preChn | ADC channel group index for trigger. |
value | Setting value for pre-trigger's delay value. |
|
inlinestatic |
This function switches to enable the DAC external trigger input.
base | Register base address for the module. |
dacChn | DAC instance index for trigger. |
value | Setting value for pre-trigger's delay value. |
enable | Switcher to assert the feature. |
|
inlinestatic |
This function switches to enable the DAC external trigger input.
base | Register base address for the module. |
dacChn | DAC instance index for trigger. |
enable | Switcher to assert the feature. |
|
inlinestatic |
This function sets the interval value for the DAC trigger.
base | Register base address for the module. |
dacChn | DAC instance index for trigger. |
value | Setting value for DAC trigger interval. |
void PDB_HAL_SetCmpPulseOutEnable | ( | PDB_Type * | base, |
uint32_t | pulseChnMask, | ||
bool | enable | ||
) |
This function switches to enable the pulse-out trigger.
base | Register base address for the module. |
pulseChnMask | Pulse-out channle index mask for trigger. |
enable | Switcher to assert the feature. |
|
inlinestatic |
This function sets the counter delay value for the pulse-out goes high.
base | Register base address for the module. |
pulseChn | Pulse-out channel index for trigger. |
value | Setting value for PDB delay . |
|
inlinestatic |
This function sets the counter delay value for the pulse-out goes low.
base | Register base address for the module. |
pulseChn | Pulse-out channel index for trigger. |
value | Setting value for PDB delay . |