The section describes the programming interface of the TPM HAL driver.
|
enum | tpm_clock_mode_t {
kTpmClockSourceNoneClk = 0,
kTpmClockSourceModuleClk,
kTpmClockSourceExternalClk,
kTpmClockSourceReservedClk
} |
| TPM clock source selection for TPM_SC[CMOD]. More...
|
|
enum | tpm_counting_mode_t {
kTpmCountingUp = 0,
kTpmCountingUpDown
} |
| TPM counting mode, up or down.
|
|
enum | tpm_clock_ps_t {
kTpmDividedBy1 = 0,
kTpmDividedBy2,
kTpmDividedBy4,
kTpmDividedBy8,
kTpmDividedBy16,
kTpmDividedBy32,
kTpmDividedBy64,
kTpmDividedBy128
} |
| TPM prescaler factor selection for clock source.
|
|
enum | tpm_trigger_source_t {
kTpmTrigSel0 = 0,
kTpmTrigSel1,
kTpmTrigSel2,
kTpmTrigSel3,
kTpmTrigSel4,
kTpmTrigSel5,
kTpmTrigSel6,
kTpmTrigSel7,
kTpmTrigSel8,
kTpmTrigSel9,
kTpmTrigSel10,
kTpmTrigSel11,
kTpmTrigSel12,
kTpmTrigSel13,
kTpmTrigSel14,
kTpmTrigSel15
} |
| TPM trigger sources, please refer to the chip reference manual for available options. More...
|
|
enum | tpm_pwm_mode_t {
kTpmEdgeAlignedPWM = 0,
kTpmCenterAlignedPWM
} |
| TPM operation mode. More...
|
|
enum | tpm_pwm_edge_mode_t {
kTpmHighTrue = 0,
kTpmLowTrue
} |
| TPM PWM output pulse mode, high-true or low-true on match up. More...
|
|
enum | tpm_input_capture_mode_t {
kTpmRisingEdge = 1,
kTpmFallingEdge,
kTpmRiseOrFallEdge
} |
| TPM input capture modes.
|
|
enum | tpm_output_compare_mode_t {
kTpmOutputNone = 0,
kTpmToggleOutput,
kTpmClearOutput,
kTpmSetOutput,
kTpmHighPulseOutput,
kTpmLowPulseOutput
} |
| TPM output compare modes.
|
|
enum | tpm_status_t {
kStatusTpmSuccess = 0x00U,
kStatusTpmFail = 0x01U
} |
| Error codes for TPM driver. More...
|
|
|
void | TPM_HAL_Reset (TPM_Type *tpmBase, uint32_t instance) |
| reset tpm registers More...
|
|
void | TPM_HAL_EnablePwmMode (TPM_Type *tpmBase, tpm_pwm_param_t *config, uint8_t channel) |
| Enables the TPM PWM output mode. More...
|
|
void | TPM_HAL_DisableChn (TPM_Type *tpmBase, uint8_t channel) |
| Disables the TPM channel. More...
|
|
void | TPM_HAL_SetClockMode (TPM_Type *tpmBase, tpm_clock_mode_t mode) |
| Set TPM clock mode. More...
|
|
static tpm_clock_mode_t | TPM_HAL_GetClockMode (TPM_Type *tpmBase) |
| get TPM clock mode. More...
|
|
static void | TPM_HAL_SetClockDiv (TPM_Type *tpmBase, tpm_clock_ps_t ps) |
| set TPM clock divider. More...
|
|
static tpm_clock_ps_t | TPM_HAL_GetClockDiv (TPM_Type *tpmBase) |
| get TPM clock divider. More...
|
|
static void | TPM_HAL_EnableTimerOverflowInt (TPM_Type *tpmBase) |
| Enable the TPM peripheral timer overflow interrupt. More...
|
|
static void | TPM_HAL_DisableTimerOverflowInt (TPM_Type *tpmBase) |
| Disable the TPM peripheral timer overflow interrupt. More...
|
|
static bool | TPM_HAL_IsOverflowIntEnabled (TPM_Type *tpmBase) |
| Read the bit that controls TPM timer overflow interrupt enablement. More...
|
|
static bool | TPM_HAL_GetTimerOverflowStatus (TPM_Type *tpmBase) |
| return TPM peripheral timer overflow interrupt flag. More...
|
|
static void | TPM_HAL_ClearTimerOverflowFlag (TPM_Type *tpmBase) |
| Clear the TPM timer overflow interrupt flag. More...
|
|
static void | TPM_HAL_SetCpwms (TPM_Type *tpmBase, uint8_t mode) |
| set TPM center-aligned PWM select. More...
|
|
static bool | TPM_HAL_GetCpwms (TPM_Type *tpmBase) |
| get TPM center-aligned PWM selection value. More...
|
|
static void | TPM_HAL_ClearCounter (TPM_Type *tpmBase) |
| clear TPM peripheral current counter value. More...
|
|
static uint16_t | TPM_HAL_GetCounterVal (TPM_Type *tpmBase) |
| return TPM peripheral current counter value. More...
|
|
static void | TPM_HAL_SetMod (TPM_Type *tpmBase, uint16_t val) |
| set TPM peripheral timer modulo value. More...
|
|
static uint16_t | TPM_HAL_GetMod (TPM_Type *tpmBase) |
| return TPM peripheral counter modulo value. More...
|
|
static void | TPM_HAL_SetChnMsnbaElsnbaVal (TPM_Type *tpmBase, uint8_t channel, uint8_t value) |
| Set TPM peripheral timer channel mode and edge level,. More...
|
|
static uint8_t | TPM_HAL_GetChnMsnbaVal (TPM_Type *tpmBase, uint8_t channel) |
| get TPM peripheral timer channel mode. More...
|
|
static uint8_t | TPM_HAL_GetChnElsnbaVal (TPM_Type *tpmBase, uint8_t channel) |
| get TPM peripheral timer channel edge level. More...
|
|
static void | TPM_HAL_EnableChnInt (TPM_Type *tpmBase, uint8_t channel) |
| enable TPM peripheral timer channel(n) interrupt. More...
|
|
static void | TPM_HAL_DisableChnInt (TPM_Type *tpmBase, uint8_t channel) |
| disable TPM peripheral timer channel(n) interrupt. More...
|
|
static bool | TPM_HAL_IsChnIntEnabled (TPM_Type *tpmBase, uint8_t channel) |
| get TPM peripheral timer channel(n) interrupt enabled or not. More...
|
|
static bool | TPM_HAL_GetChnStatus (TPM_Type *tpmBase, uint8_t channel) |
| return if any event for TPM peripheral timer channel has occourred , More...
|
|
static void | TPM_HAL_ClearChnInt (TPM_Type *tpmBase, uint8_t channel) |
| return if any event for TPM peripheral timer channel has occourred , More...
|
|
static void | TPM_HAL_SetChnCountVal (TPM_Type *tpmBase, uint8_t channel, uint16_t val) |
| set TPM peripheral timer channel counter value, More...
|
|
static uint16_t | TPM_HAL_GetChnCountVal (TPM_Type *tpmBase, uint8_t channel) |
| get TPM peripheral timer channel counter value. More...
|
|
static uint32_t | TPM_HAL_GetStatusRegVal (TPM_Type *tpmBase) |
| get TPM peripheral timer channel event status. More...
|
|
static void | TPM_HAL_ClearStatusReg (TPM_Type *tpmBase, uint16_t tpm_status) |
| clear TPM peripheral timer clear status register value, More...
|
|
static void | TPM_HAL_SetTriggerSrc (TPM_Type *tpmBase, tpm_trigger_source_t trigger_num) |
| set TPM peripheral timer trigger. More...
|
|
static void | TPM_HAL_SetTriggerMode (TPM_Type *tpmBase, bool enable) |
| set TPM peripheral timer running on trigger or not . More...
|
|
static void | TPM_HAL_SetReloadOnTriggerMode (TPM_Type *tpmBase, bool enable) |
| enable TPM timer counter reload on selected trigger or not. More...
|
|
static void | TPM_HAL_SetStopOnOverflowMode (TPM_Type *tpmBase, bool enable) |
| enable TPM timer counter sotp on selected trigger or not. More...
|
|
static void | TPM_HAL_EnableGlobalTimeBase (TPM_Type *tpmBase, bool enable) |
| enable TPM timer global time base. More...
|
|
static void | TPM_HAL_SetDbgMode (TPM_Type *tpmBase, bool enable) |
| set BDM mode. More...
|
|
static void | TPM_HAL_SetWaitMode (TPM_Type *tpmBase, bool enable) |
| set WAIT mode behavior. More...
|
|