![]() |
MAX32665 SDK Documentation
0.2
Software Development Kit Overview and API Documentation
|
This is the high level API for the pulse train engine. More...
Modules | |
PT_Registers | |
Registers, Bit Masks and Bit Positions for the PT Peripheral Module. | |
Data Structures | |
struct | pt_pt_cfg_t |
Structure type for pulse train mode configuration. More... | |
Enumerations | |
enum | sys_pt_en_t { ENABLE_PT0 = MXC_F_PTG_ENABLE_PT0, ENABLE_PT1 = MXC_F_PTG_ENABLE_PT1, ENABLE_PT2 = MXC_F_PTG_ENABLE_PT2, ENABLE_PT3 = MXC_F_PTG_ENABLE_PT3, ENABLE_PT4 = MXC_F_PTG_ENABLE_PT4, ENABLE_PT5 = MXC_F_PTG_ENABLE_PT5, ENABLE_PT6 = MXC_F_PTG_ENABLE_PT6, ENABLE_PT7 = MXC_F_PTG_ENABLE_PT7, ENABLE_PT8 = MXC_F_PTG_ENABLE_PT8, ENABLE_PT9 = MXC_F_PTG_ENABLE_PT9, ENABLE_PT10 = MXC_F_PTG_ENABLE_PT10, ENABLE_PT11 = MXC_F_PTG_ENABLE_PT11, ENABLE_PT12 = MXC_F_PTG_ENABLE_PT12, ENABLE_PT13 = MXC_F_PTG_ENABLE_PT13, ENABLE_PT14 = MXC_F_PTG_ENABLE_PT14, ENABLE_PT15 = MXC_F_PTG_ENABLE_PT15 } |
Pulse Train ENable enumeration. More... | |
enum | sys_pt_resync_t { RESYNC_PT0 = MXC_F_PTG_RESYNC_PT0, RESYNC_PT1 = MXC_F_PTG_RESYNC_PT1, RESYNC_PT2 = MXC_F_PTG_RESYNC_PT2, RESYNC_PT3 = MXC_F_PTG_RESYNC_PT3, RESYNC_PT4 = MXC_F_PTG_RESYNC_PT4, RESYNC_PT5 = MXC_F_PTG_RESYNC_PT5, RESYNC_PT6 = MXC_F_PTG_RESYNC_PT6, RESYNC_PT7 = MXC_F_PTG_RESYNC_PT7, RESYNC_PT8 = MXC_F_PTG_RESYNC_PT8, RESYNC_PT9 = MXC_F_PTG_RESYNC_PT9, RESYNC_PT10 = MXC_F_PTG_RESYNC_PT10, RESYNC_PT11 = MXC_F_PTG_RESYNC_PT11, RESYNC_PT12 = MXC_F_PTG_RESYNC_PT12, RESYNC_PT13 = MXC_F_PTG_RESYNC_PT13, RESYNC_PT14 = MXC_F_PTG_RESYNC_PT14, RESYNC_PT15 = MXC_F_PTG_RESYNC_PT15 } |
Pulse Train Resync enumeration. More... | |
Functions | |
void | PT_Init (mxc_ptg_regs_t *ptg, const sys_cfg_ptg_t *sys_cfg) |
This function initializes the pulse trains to a known stopped state and sets the global PT clock scale. More... | |
int | PT_PTConfig (mxc_pt_regs_t *pt, pt_pt_cfg_t *cfg, const sys_cfg_pt_t *sysCfg) |
Configures the pulse train in the specified mode. More... | |
int | PT_SqrWaveConfig (mxc_pt_regs_t *pt, uint32_t freq, const sys_cfg_pt_t *sysCfg) |
Configures the pulse train in the square wave mode. More... | |
void | PT_Start (mxc_pt_regs_t *pt) |
Starts the pulse train specified. More... | |
void | PT_StartMulti (mxc_ptg_regs_t *ptg, uint32_t pts) |
Start multiple pulse train modules together. More... | |
void | PT_Stop (mxc_pt_regs_t *pt) |
Stops a pulse train. More... | |
void | PT_StopMulti (mxc_ptg_regs_t *ptg, uint32_t pts) |
Stop multiple pulse trains together. More... | |
uint32_t | PT_IsActive (mxc_pt_regs_t *pt) |
Determines if the pulse train is running. More... | |
uint32_t | PT_IsActiveMulti (mxc_ptg_regs_t *ptg, uint32_t pts) |
Determines if the pulse trains selected are running. More... | |
void | PT_SetPattern (mxc_pt_regs_t *pt, uint32_t pattern) |
Sets the pattern of the pulse train. More... | |
float | PT_GetBPS (mxc_pt_regs_t *pt) |
Sets the pattern of the pulse train. More... | |
void | PT_EnableINT (mxc_pt_regs_t *pt) |
Enable pulse train interrupt. More... | |
void | PT_EnableINTMulti (mxc_ptg_regs_t *ptg, uint32_t pts) |
Enable interrupts for the pulse trains selected. More... | |
void | PT_DisableINT (mxc_pt_regs_t *pt) |
Disable pulse train interrupt. More... | |
void | PT_DisableINTMulti (mxc_ptg_regs_t *ptg, uint32_t pts) |
Disable interrupts for the pulse trains selected. More... | |
uint32_t | PT_GetFlags (mxc_ptg_regs_t *ptg) |
Gets the pulse trains' interrupt flags. More... | |
void | PT_ClearFlags (mxc_ptg_regs_t *ptg, uint32_t mask) |
Clears the pulse trains' interrupt flag. More... | |
void | PT_SetRestart (mxc_pt_regs_t *ptToRestart, mxc_pt_regs_t *ptStop, uint8_t restartIndex) |
Setup and enables a pulse train to restart after another pulse train has exited its loop. More... | |
void | PT_RestartDisable (mxc_pt_regs_t *ptToRestart, uint8_t restartIndex) |
Disable the restart for the specified pulse train. More... | |
void | PT_Resync (mxc_ptg_regs_t *ptg, uint32_t resyncPts) |
Resynchronize individual pulse trains together. More... | |
enum sys_pt_en_t |
enum sys_pt_resync_t |
void PT_Init | ( | mxc_ptg_regs_t * | ptg, |
const sys_cfg_ptg_t * | sys_cfg | ||
) |
ptg | Pulse train global registers based on bus |
sys_cfg | System configuration object |
int PT_PTConfig | ( | mxc_pt_regs_t * | pt, |
pt_pt_cfg_t * | cfg, | ||
const sys_cfg_pt_t * | sysCfg | ||
) |
The parameters in the config structure must be set before calling this function. This function should be used for configuring pulse train mode only.
pt | Pulse train to operate on. |
cfg | Pointer to pulse train configuration. |
sysCfg | Pointer to pulse train system GPIO configuration. |
int PT_SqrWaveConfig | ( | mxc_pt_regs_t * | pt, |
uint32_t | freq, | ||
const sys_cfg_pt_t * | sysCfg | ||
) |
This function should be used for configuring square wave mode only.
pt | pulse train to operate on |
freq | square wave output frequency in Hz |
sysCfg | pointer to pulse train system GPIO configuration |
void PT_Start | ( | mxc_pt_regs_t * | pt | ) |
pt | Pulse train to operate on. |
void PT_StartMulti | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | pts | ||
) |
ptg | Pulse train global registers based on bus |
pts | Set the bits of pulse trains to start Bit0->pt0, Bit1->pt1... etc. |
void PT_Stop | ( | mxc_pt_regs_t * | pt | ) |
pt | Pulse train to operate on. |
void PT_StopMulti | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | pts | ||
) |
ptg | Pulse train global registers based on bus |
pts | Set the bits of pulse trains to stop Bit0->pt0, Bit1->pt1... etc. |
uint32_t PT_IsActive | ( | mxc_pt_regs_t * | pt | ) |
pt | Pulse train to operate on. |
uint32_t PT_IsActiveMulti | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | pts | ||
) |
ptg | Pulse train global registers based on bus |
pts | Set the bits of pulse trains to check Bit0->pt0, Bit1->pt1... etc. |
void PT_SetPattern | ( | mxc_pt_regs_t * | pt, |
uint32_t | pattern | ||
) |
pt | Pointer to pulse train to operate on |
pattern | Output pattern. |
float PT_GetBPS | ( | mxc_pt_regs_t * | pt | ) |
pt | Pointer to pulse train to operate on |
void PT_EnableINT | ( | mxc_pt_regs_t * | pt | ) |
pt | Pointer to pulse train to operate on. |
void PT_EnableINTMulti | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | pts | ||
) |
ptg | Pulse train global registers based on bus |
pts | Bit mask of which pulse trains to enable. Set the bit position of each pulse train to enable it. Bit0->pt0, Bit1->pt1... etc, 1 will enable the interrupt, 0 to leave a PT channel in its current state. |
void PT_DisableINT | ( | mxc_pt_regs_t * | pt | ) |
pt | pulse train to operate on. |
void PT_DisableINTMulti | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | pts | ||
) |
ptg | Pulse train global registers based on bus |
pts | Bit mask of what pulse trains to disable. Set the bit position of each pulse train to disable it. Bit0->pt0, Bit1->pt1... etc, 1 will disable the interrupt, 0 to leave a PT channel in its current state. |
uint32_t PT_GetFlags | ( | mxc_ptg_regs_t * | ptg | ) |
ptg | Pulse train global registers based on bus |
PT_INTFL
Register for details. void PT_ClearFlags | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | mask | ||
) |
ptg | Pulse train global registers based on bus |
mask | bits to clear, see PT_INTFL Register for details. |
void PT_SetRestart | ( | mxc_pt_regs_t * | ptToRestart, |
mxc_pt_regs_t * | ptStop, | ||
uint8_t | restartIndex | ||
) |
Each pulse train can have up to two restart triggers.
ptToRestart | pulse train to restart after ptStop ends. |
ptStop | pulse train that stops and triggers ptToRestart to begin. |
restartIndex | selects which restart trigger to set (0 or 1). |
void PT_RestartDisable | ( | mxc_pt_regs_t * | ptToRestart, |
uint8_t | restartIndex | ||
) |
ptToRestart | pulse train to disable the restart |
restartIndex | selects which restart trigger to disable (0 or 1) |
void PT_Resync | ( | mxc_ptg_regs_t * | ptg, |
uint32_t | resyncPts | ||
) |
Resync will stop those resync_pts; others will be still running
ptg | Pulse train global registers based on bus |
resyncPts | pulse train modules that need to be re-synced by bit number. Bit0->pt0, Bit1->pt1... etc. |