MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
PDB API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define PDB_SetLDMode(mode)
 Sets the load mode for internal registers. More...
 
#define PDB_ErrIsrEnable()
 Enables the sequence error interrupt generation. More...
 
#define PDB_ErrIsrDisable()
 Enables sequence error interrupt generation. More...
 
#define PDB_SWTrg()
 Generates SW trigger if SW trigger is selected and PDB is enabled. More...
 
#define PDB_DmaEnable()
 Enables DMA request generation. More...
 
#define PDB_DmaDisable()
 Disables DMA request generation. More...
 
#define PDB_Enable()
 Enables the PDB module. More...
 
#define PDB_Disable()
 Disables the PDB module. More...
 
#define PDB_IsrEnable()
 Enables interrupt generation. More...
 
#define PDB_IsrDisable()
 Disables interrupt generation. More...
 
#define PDB_OneshotModeEnable()
 Enables one shot mode of PDB. More...
 
#define PDB_ContModeEnable()
 Enables continuous mode of PDB. More...
 
#define PDB_SetLDOK()
 Enables the loading buffered register by theirs buffered value according to LDMOD selection. More...
 
#define PDB_SetModulo(modulo)
 Sets the modulo register. More...
 
#define PDB_SetIdelay(val)
 Sets the delay register. More...
 
#define PDB_PoutEnable()
 Enables the pulse output. More...
 
#define PDB_PoutDisable()
 Disables specified the pulse output. More...
 
#define PDB_PtrgB2BModeEnable(trg)
 Enables back-to-back mode for specified PDB channel pre-trigger. More...
 
#define PDB_PtrgB2BModeDisable(trg)
 Disables back-to-back mode for specified PDB channel pre-trigger. More...
 
#define PDB_PtrgBypassModeEnable(trg)
 Enables bypass mode for specified PDB channel pre-trigger. More...
 
#define PDB_PtrgBypassModeDisable(trg)
 Disables bypass mode for specified PDB channel pre-trigger. More...
 
#define PDB_PtrgEnable(trg)
 Enables specified channel pre-trigger. More...
 
#define PDB_PtrgDisable(trg)
 Disables specified channel pre-trigger. More...
 
#define PDB_PtrgSetDelay(trg, val)
 Sets trigger delay value. More...
 
#define PDB_PoutSetDelay(dly, val)
 Sets specified pulseout delay value. More...
 
#define PDB_PtrgInit(trg, cfg, val)
 PDB pre-trigger initialization. More...
 
#define PDB_PoutInit(cfg, val1, val2)
 PDB pulse out module initialization. More...
 
#define PDB_Init(pdb, ip, callback)
 PDB module initialization. More...
 

Macro Definition Documentation

#define PDB_SetLDMode (   mode)

This macro sets the load mode for internal registers after PDB_SetLDOK macro is called.

Parameters
modeSelect one of the PDB Load Modes.
Note
Implemented as an inline macro.
See also
PDB_SetLDOK
#define PDB_ErrIsrEnable ( )

This macro enables the sequence error interrupt. The sequence error occurs when a new pre-trigger asserts when there is a active lock in the PDB channel.

Note
Implemented as an inline macro.
See also
PDB_ErrIsrDisable
#define PDB_ErrIsrDisable ( )

This macro disables the sequence error interrupt. The sequence error occurs when a new pre-trigger asserts when there is a active lock in the PDB channel.

Note
Implemented as an inline macro.
See also
PDB_ErrIsrEnable
#define PDB_SWTrg ( )

This macro generates software trigger if the PDBTRG_SW is selected as the PDB trigger source.

Note
Implemented as an inline macro.
See also
PDB_PtrgInit
#define PDB_DmaEnable ( )

This macro enables the DMA request generation when the PDB counter reaches the value set by PDB_SetIdelay.

Note
Implemented as an inline macro.
See also
PDB_SetIdelay, PDB_DmaDisable
#define PDB_DmaDisable ( )

This macro disables the DMA request generation when the PDB counter reaches the value set by PDB_SetIdelay.

Note
Implemented as an inline macro.
See also
PDB_DmaEnable
#define PDB_Enable ( )

This macro enables the PDB module.

Note
Implemented as an inline macro.
See also
PDB_Disable
#define PDB_Disable ( )

This macro disables the PDB module. When the PDB is disabled the counter is off.

Note
Implemented as an inline macro.
See also
PDB_Enable
#define PDB_IsrEnable ( )

This macro enables an interrupt generation when the PDB counter reaches the value set by PDB_SetIdelay.

Note
Implemented as an inline macro.
See also
PDB_SetIdelay, PDB_IsrDisable
#define PDB_IsrDisable ( )

This macro disables an interrupt generation when the PDB counter reaches the value set by PDB_SetIdelay.

Note
Implemented as an inline macro.
See also
PDB_IsrEnable
#define PDB_OneshotModeEnable ( )

This macro enables the one shot mode of the PDB. When the PDB counter reaches value set by PDB_SetModulo the Modulo register is cleared to zero and is waiting to a new trigger.

Note
Implemented as an inline macro.
See also
PDB_ContModeEnable
#define PDB_ContModeEnable ( )

This macro enables the continuous mode of the PDB. When the PDB counter reaches value set by PDB_SetModulo the counter begins a new counting.

Note
Implemented as an inline macro.
See also
PDB_OneshotModeEnable
#define PDB_SetLDOK ( )

This macro updates internal registers of MOD, IDLY, CHnDLYm, POyDLY with the values written to their buffers.

Note
Implemented as an inline macro.
#define PDB_SetModulo (   modulo)

This macro specifies the period of the counter.

Parameters
modulo16-bit modulo value.
Note
Implemented as an inline macro.
See also
PDB_OneshotModeEnable, PDB_ContModeEnable
#define PDB_SetIdelay (   val)

This macro specifies the delay value to schedule the PDB interrupt or the DMA request.

Parameters
val16-bit delay trigger value.
Note
Implemented as an inline macro.
See also
PDB_DmaEnable, PDB_IsrEnable
#define PDB_PoutEnable ( )

This macro enables the pulse output.

Note
Implemented as an inline macro.
See also
PDB_PoutDisable, PDB_PoutSetDelay
#define PDB_PoutDisable ( )

This macro disables the pulse output.

Note
Implemented as an inline macro.
See also
PDB_PoutEnable, PDB_PoutSetDelay
#define PDB_PtrgB2BModeEnable (   trg)

This macro enables the back-to-back mode for specified PDB channel pre-trigger. If this mode is enabled the ADC conversion complete or XBAR_OUT35 (for pre-trigger 0), XBAR_OUT36 (for pre-trigger 1), XBAR_OUT37 (for pre-trigger 2), XBAR_OUT38 (for pre-trigger 3) is used as an acknowledgement for the next trigger. Which source is used can be selected with the SIM_SelAdcTrg function.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
SIM_SelAdcTrg, PDB_PtrgB2BModeDisable
#define PDB_PtrgB2BModeDisable (   trg)

This macro disables the back-to-back mode for specified PDB channel pre-trigger.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
SIM_SelAdcTrg, PDB_PtrgB2BModeEnable
#define PDB_PtrgBypassModeEnable (   trg)

This macro enables the bypass mode for a specified PDB channel pre-trigger. When the bypass mode is selected the pre-trigger asserts one peripheral clock cycle after a rising edge is detected on the selected trigger input source or software trigger is selected and PDB_SWTrg is called.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
PDB_PtrgBypassModeDisable
#define PDB_PtrgBypassModeDisable (   trg)

This macro disables the bypass mode for a specified PDB channel pre-trigger. When the bypass mode is disabled the pre-trigger asserts when the counter reaches the channel delay register plus one peripheral clock cycle after a rising edge is detected on the selected trigger input source or software trigger is selected and PDB_SWTrg is called.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
PDB_PtrgBypassModeEnable
#define PDB_PtrgEnable (   trg)

This macro enables specified pre-trigger.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
PDB_PtrgDisable, PDB_PtrgInit
#define PDB_PtrgDisable (   trg)

This macro disables specified pre-trigger.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
Note
Implemented as an inline macro.
See also
PDB_PtrgEnable, PDB_PtrgSetDelay, PDB_PtrgInit
#define PDB_PtrgSetDelay (   trg,
  val 
)

This macro sets trigger delay value. The pre-trigger asserts when the counter is equal to this value.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
val16-bit delay value.
Note
Implemented as an inline macro.
See also
PDB_PtrgEnable, PDB_PtrgDisable, PDB_PtrgInit
#define PDB_PoutSetDelay (   dly,
  val 
)

This macro sets specified pulseout delay value. Pulse-out goes high when the PDB counter is equal to the DLY1 value and goes low when is equal to the DLY2 value.

Parameters
dlyDLY1,DLY2.
val16-bit delay value.
Note
Implemented as an inline macro.
See also
PDB_PoutEnable, PDB_PoutInit
#define PDB_PtrgInit (   trg,
  cfg,
  val 
)

This macro initializes specified pre-trigger. It also initializes pre-trigger delay value.

Parameters
trgTRG0,TRG1,TRG2,TRG3.
cfgSelect one of the PDB Channel and Pretrigger Configuration Structures.
val16-bit delay value.
Note
Implemented as a function call.
Warning
PDB_PtrgInit function should be called before PDB module initialization in order to allow the delay registers to be updated from their buffers correctly.
See also
PDB_PtrgEnable, PDB_PtrgSetDelay
#define PDB_PoutInit (   cfg,
  val1,
  val2 
)

This macro initializes pulse output. It also initializes value1 (pulse out goes high) and value2(pulse out goes low).

Parameters
cfgSelect one of the PDB Pulse Output Configuration Structures.
val116-bit delay value (pulse out goes high).
val216-bit delay value (pulse out goes low again).
Note
Implemented as a function call.
Warning
PDB_PoutInit function should be called before PDB module initialization in order to allow the delay registers to be updated from their buffers correctly.
See also
PDB_PoutEnable, PDB_PoutSetDelay
#define PDB_Init (   pdb,
  ip,
  callback 
)

This macro initializes PDB module. It also installs callback function for interrupt vector associated with PDB module: vector 21(PDB0).

Parameters
pdbSelect one of the PDB Module Configuration Structures.
ipSelect one of the ARM Cortex-M0+ Interrupt Priority Levels.
callbackPointer to the PDB Callback Function.
Note
Implemented as a function call.