![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
How to use PWM timer function of BT module. More...
Data Structures | |
| struct | stc_bt_pwm_config |
| Structure of PWM configuration. More... | |
| struct | stc_pwm_int_sel |
| structure to select the PWM interrupt More... | |
| struct | stc_pwm_int_cb |
| structure to set the PWM interrupt callback function More... | |
| struct | stc_bt_ppg_config |
| Structure of PPG configuration. More... | |
| struct | stc_ppg_int_sel |
| structure to select the PPG interrupt More... | |
| struct | stc_ppg_int_cb |
| structure to set the PPG interrupt callback function More... | |
| struct | stc_bt_rt_config |
| Structure of Reload timer configuration. More... | |
| struct | stc_rt_int_sel |
| structure to select the Reload timer interrupt More... | |
| struct | stc_rt_int_cb |
| structure to set the Reload timer interrupt callback function More... | |
| struct | stc_bt_pwc_config |
| Structure of PWC timer configuration. More... | |
| struct | stc_pwc_int_sel |
| structure to select the PWC timer interrupt More... | |
| struct | stc_pwc_int_cb |
| structure to set the PWC timer interrupt callback function More... | |
| struct | stc_bt_intern_data |
| BT internal data. More... | |
| struct | stc_bt_instance_data |
| BT instance data. More... | |
Macros | |
| #define | BT_INSTANCE_COUNT (uint32_t)(sizeof(m_astcBtInstanceDataLut) / sizeof(m_astcBtInstanceDataLut[0])) |
| #define | stc_btn_t FM4_BT_PWM_TypeDef |
| #define | BT0 (*((volatile stc_btn_t *) FM4_BT0_PWM_BASE)) |
| #define | BT1 (*((volatile stc_btn_t *) FM4_BT1_PWM_BASE)) |
| #define | BT2 (*((volatile stc_btn_t *) FM4_BT2_PWM_BASE)) |
| #define | BT3 (*((volatile stc_btn_t *) FM4_BT3_PWM_BASE)) |
| #define | BT4 (*((volatile stc_btn_t *) FM4_BT4_PWM_BASE)) |
| #define | BT5 (*((volatile stc_btn_t *) FM4_BT5_PWM_BASE)) |
| #define | BT6 (*((volatile stc_btn_t *) FM4_BT6_PWM_BASE)) |
| #define | BT7 (*((volatile stc_btn_t *) FM4_BT7_PWM_BASE)) |
| #define | BT8 (*((volatile stc_btn_t *) FM4_BT8_PWM_BASE)) |
| #define | BT9 (*((volatile stc_btn_t *) FM4_BT9_PWM_BASE)) |
| #define | BT10 (*((volatile stc_btn_t *) FM4_BT10_PWM_BASE)) |
| #define | BT11 (*((volatile stc_btn_t *) FM4_BT11_PWM_BASE)) |
| #define | BT12 (*((volatile stc_btn_t *) FM4_BT12_PWM_BASE)) |
| #define | BT13 (*((volatile stc_btn_t *) FM4_BT13_PWM_BASE)) |
| #define | BT14 (*((volatile stc_btn_t *) FM4_BT14_PWM_BASE)) |
| #define | BT15 (*((volatile stc_btn_t *) FM4_BT15_PWM_BASE)) |
Typedefs | |
| typedef enum en_bt_instance_index | en_bt_instance_index_t |
| Enumeration to define an index for each BT instance. More... | |
| typedef enum en_bt_io_mode | en_bt_io_mode_t |
| Enumeration to define BT IO mode. More... | |
| typedef enum en_bt_timer_mode | en_bt_timer_mode_t |
| Enumeration to define timer mode of BT. More... | |
| typedef enum en_pwm_clock_pres | en_pwm_clock_pres_t |
| Enumeration to define clock prescaler of PWM timer. More... | |
| typedef enum en_pwm_restart_enable | en_pwm_restart_enable_t |
| Enumeration to define the configuration of PWM restart option. More... | |
| typedef enum en_pwm_output_mask | en_pwm_output_mask_t |
| Enumeration to define the configuration of PWM output mask. More... | |
| typedef enum en_pwm_ext_trig | en_pwm_ext_trig_t |
| Enumeration to define external trigger of PWM. More... | |
| typedef enum en_pwm_output_polarity | en_pwm_output_polarity_t |
| Enumeration to define PWM initial polarity. More... | |
| typedef enum en_pwm_mode | en_pwm_mode_t |
| Enumeration to define PWM timer mode. More... | |
| typedef struct stc_bt_pwm_config | stc_bt_pwm_config_t |
| Structure of PWM configuration. More... | |
| typedef enum en_bt_pwm_int | en_bt_pwm_int_t |
| Enumeration to define PWM interrupt type. More... | |
| typedef struct stc_pwm_int_sel | stc_pwm_int_sel_t |
| structure to select the PWM interrupt More... | |
| typedef struct stc_pwm_int_cb | stc_pwm_int_cb_t |
| structure to set the PWM interrupt callback function More... | |
| typedef enum en_ppg_clock_pres | en_ppg_clock_pres_t |
| Enumeration to define clock prescaler of PPG timer. More... | |
| typedef enum en_ppg_restart_enable | en_ppg_restart_enable_t |
| Enumeration to define the configuration of PPG restart option. More... | |
| typedef enum en_ppg_output_mask | en_ppg_output_mask_t |
| Enumeration to define the configuration of PPG output mask. More... | |
| typedef enum en_ppg_ext_trig | en_ppg_ext_trig_t |
| Enumeration to define external trigger of PPG. More... | |
| typedef enum en_ppg_output_polarity | en_ppg_output_polarity_t |
| Enumeration to define PWM initial polarity. More... | |
| typedef enum en_ppg_mode | en_ppg_mode_t |
| Enumeration to define PWM timer mode. More... | |
| typedef struct stc_bt_ppg_config | stc_bt_ppg_config_t |
| Structure of PPG configuration. More... | |
| typedef enum en_bt_ppg_int | en_bt_ppg_int_t |
| Enumeration to define PPG interrupt type. More... | |
| typedef struct stc_ppg_int_sel | stc_ppg_int_sel_t |
| structure to select the PPG interrupt More... | |
| typedef struct stc_ppg_int_cb | stc_ppg_int_cb_t |
| structure to set the PPG interrupt callback function More... | |
| typedef enum en_rt_clock_pres | en_rt_clock_pres_t |
| Enumeration to define clock prescaler of Reload timer. More... | |
| typedef enum en_rt_ext_trigger | en_rt_ext_trigger_t |
| Enumeration to define external trigger of Reload timer. More... | |
| typedef enum en_rt_output_polarity | en_rt_output_polarity_t |
| Enumeration to define Reload timer output initial polarity. More... | |
| typedef enum en_rt_mode | en_rt_mode_t |
| Enumeration to define Reload timer mode. More... | |
| typedef enum en_rt_timer_size | en_rt_timer_size_t |
| Enumeration to define Reload timer size. More... | |
| typedef struct stc_bt_rt_config | stc_bt_rt_config_t |
| Structure of Reload timer configuration. More... | |
| typedef enum en_bt_rt_int | en_bt_rt_int_t |
| Enumeration to define Reload timer interrupt type. More... | |
| typedef struct stc_rt_int_sel | stc_rt_int_sel_t |
| structure to select the Reload timer interrupt More... | |
| typedef struct stc_rt_int_cb | stc_rt_int_cb_t |
| structure to set the Reload timer interrupt callback function More... | |
| typedef enum en_pwc_clock_pres | en_pwc_clock_pres_t |
| Enumeration to define clock prescaler of PWC timer. More... | |
| typedef enum en_pwc_measure_edge | en_pwc_measure_edge_t |
| Enumeration to define measure mode of PWC timer. More... | |
| typedef enum en_pwc_mode | en_pwc_mode_t |
| Enumeration to define PWC timer mode. More... | |
| typedef enum en_pwc_timer_size | en_pwc_timer_size_t |
| Enumeration to define Reload timer size. More... | |
| typedef struct stc_bt_pwc_config | stc_bt_pwc_config_t |
| Structure of PWC timer configuration. More... | |
| typedef enum en_bt_pwc_int | en_bt_pwc_int_t |
| Enumeration to define PWC timer interrupt type. More... | |
| typedef struct stc_pwc_int_sel | stc_pwc_int_sel_t |
| structure to select the PWC timer interrupt More... | |
| typedef struct stc_pwc_int_cb | stc_pwc_int_cb_t |
| structure to set the PWC timer interrupt callback function More... | |
| typedef struct stc_bt_intern_data | stc_bt_intern_data_t |
| BT internal data. More... | |
| typedef struct stc_bt_instance_data | stc_bt_instance_data_t |
| BT instance data. More... | |
Functions | |
| static stc_bt_intern_data_t * | BtGetInternDataPtr (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Return the internal data for a certain BT instance. More... | |
| void | Bt_IrqHandler (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_bt_intern_data_t *pstcBtInternData) |
| BT interrupt service routine. More... | |
| static void | Bt_InitNvic (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Set NVIC Interrupt depending on BT instance. More... | |
| static void | Bt_DeInitNvic (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Clear NVIC Interrupt depending on BT instance. More... | |
| en_result_t | Bt_ConfigIOMode (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_io_mode_t enIoMode) |
| Configure BT IO mode. More... | |
| en_result_t | Bt_SelTimerMode (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_timer_mode_t enTimerMode) |
| Select timer function of BT. More... | |
| en_result_t | Bt_Pwm_Init (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_bt_pwm_config_t *pstcPwmConfig) |
| Initialize PWM function of BT. More... | |
| en_result_t | Bt_Pwm_EnableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Enable PWM timer counting. More... | |
| en_result_t | Bt_Pwm_DisableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Disable PWM timer counting. More... | |
| en_result_t | Bt_Pwm_EnableSwTrig (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Start PWM timer by software. More... | |
| en_result_t | Bt_Pwm_EnableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_pwm_int_sel_t *pstcIntSel, stc_pwm_int_cb_t *pstcIntCallback) |
| Enable PWM timer interrupt. More... | |
| en_result_t | Bt_Pwm_DisableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_pwm_int_sel_t *pstcIntSel) |
| Disable PWM timer interrupt. More... | |
| en_int_flag_t | Bt_Pwm_GetIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_pwm_int_t enIntType) |
| Get interrupt flag of PWM timer. More... | |
| en_result_t | Bt_Pwm_ClrIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_pwm_int_t enIntType) |
| Clear interrupt flag of PWM timer. More... | |
| en_result_t | Bt_Pwm_WriteCycleVal (volatile FM4_BT_PWM_TypeDef *pstcBt, uint16_t u16Cycle) |
| Write Cycle value of PWM timer. More... | |
| en_result_t | Bt_Pwm_WriteDutyVal (volatile FM4_BT_PWM_TypeDef *pstcBt, uint16_t u16Duty) |
| Write duty value of PWM timer. More... | |
| uint16_t | Bt_Pwm_ReadCurCnt (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Read current count value of PWM timer. More... | |
| en_result_t | Bt_Ppg_Init (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_bt_ppg_config_t *pstcPpgConfig) |
| Initialize PPG function of BT. More... | |
| en_result_t | Bt_Ppg_EnableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Enable PPG timer counting. More... | |
| en_result_t | Bt_Ppg_DisableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Disable PPG timer counting. More... | |
| en_result_t | Bt_Ppg_EnableSwTrig (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Start PPG timer by software. More... | |
| en_result_t | Bt_Ppg_EnableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_ppg_int_sel_t *pstcIntSel, stc_ppg_int_cb_t *pstcIntCallback) |
| Enable PPG timer interrupt. More... | |
| en_result_t | Bt_Ppg_DisableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_ppg_int_sel_t *pstcIntSel) |
| Disable PPG timer interrupt. More... | |
| en_int_flag_t | Bt_Ppg_GetIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_ppg_int_t enIntType) |
| Get interrupt flag of PPG timer. More... | |
| en_result_t | Bt_Ppg_ClrIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_ppg_int_t enIntType) |
| Clear interrupt flag of PPG timer. More... | |
| en_result_t | Bt_Ppg_WriteLowWidthVal (volatile FM4_BT_PWM_TypeDef *pstcBt, uint16_t u16Val) |
| Write low width count value of PPG timer. More... | |
| en_result_t | Bt_Ppg_WriteHighWidthVal (volatile FM4_BT_PWM_TypeDef *pstcBt, uint16_t u16Val) |
| Write high width count value of PPG timer. More... | |
| uint16_t | Bt_Ppg_ReadCurCnt (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Read current count value of PPG timer. More... | |
| en_result_t | Bt_Rt_Init (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_bt_rt_config_t *pstcRtConfig) |
| Initialize RT function of BT. More... | |
| en_result_t | Bt_Rt_EnableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Enable Reload timer counting. More... | |
| en_result_t | Bt_Rt_DisableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Disable Reload timer counting. More... | |
| en_result_t | Bt_Rt_EnableSwTrig (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Start Reload timer by software. More... | |
| en_result_t | Bt_Rt_EnableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_rt_int_sel_t *pstcIntSel, stc_rt_int_cb_t *pstcIntCallback) |
| Enable Reload timer interrupt. More... | |
| en_result_t | Bt_Rt_DisableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_rt_int_sel_t *pstcIntSel) |
| Disable Reload timer interrupt. More... | |
| en_int_flag_t | Bt_Rt_GetIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_rt_int_t enIntType) |
| Get interrupt flag of Reload timer. More... | |
| en_result_t | Bt_Rt_ClrIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_rt_int_t enIntType) |
| Clear interrupt flag of Reload timer. More... | |
| en_result_t | Bt_Rt_WriteCycleVal (volatile FM4_BT_PWM_TypeDef *pstcBt, uint16_t u16Val) |
| Write count cycle of Reload timer. More... | |
| uint16_t | Bt_Rt_ReadCurCnt (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Read current count value of Reload timer. More... | |
| en_result_t | Bt_Pwc_Init (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_bt_pwc_config_t *pstcPwcConfig) |
| Initialize PWC function of BT. More... | |
| en_result_t | Bt_Pwc_EnableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Enable PWC timer counting. More... | |
| en_result_t | Bt_Pwc_DisableCount (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Disable PWC timer counting. More... | |
| en_result_t | Bt_Pwc_EnableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_pwc_int_sel_t *pstcIntSel, stc_pwc_int_cb_t *pstcIntCallback) |
| Enable PWC timer interrupt. More... | |
| en_result_t | Bt_Pwc_DisableInt (volatile FM4_BT_PWM_TypeDef *pstcBt, stc_pwc_int_sel_t *pstcIntSel) |
| Disable PWC timer interrupt. More... | |
| en_int_flag_t | Bt_Pwc_GetIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_pwc_int_t enIntType) |
| Get interrupt flag of PWC timer. More... | |
| en_result_t | Bt_Pwc_ClrIntFlag (volatile FM4_BT_PWM_TypeDef *pstcBt, en_bt_pwc_int_t enIntType) |
| Clear interrupt flag of PWC timer. More... | |
| en_stat_flag_t | Bt_Pwc_GetErrorFlag (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Get error flag of PWC timer. More... | |
| uint16_t | Bt_Pwc_Get16BitMeasureData (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Get 16 bits measure data of PWC timer. More... | |
| uint32_t | Bt_Pwc_Get32BitMeasureData (volatile FM4_BT_PWM_TypeDef *pstcBt) |
| Get 32 bits measure data of PWC timer. More... | |
| void | Bt_SetSimultaneousStart (uint16_t u16Value) |
| Set the Simultaneous Start register of Base timer. More... | |
Variables | |
| stc_bt_instance_data_t | m_astcBtInstanceDataLut [] |
| Look-up table for all enabled BT instances and their internal data. More... | |
| stc_bt_instance_data_t | m_astcBtInstanceDataLut [] |
| Look-up table for all enabled BT instances and their internal data. More... | |
How to use PWM timer function of BT module.
Provided BT module functions:
Bt_ConfigIOMode() must be used to configure BT I/O mode to I/O mode 0 first.
Bt_SelTimerMode() must be used to configure BT mode to PWM function then.
Bt_Pwm_Init() is used to initialize PWM timer source clock, output polarity, operation mode and so on. Following operation mode can set:
A PWM interrupt can be enabled by the function Bt_Pwm_EnableInt(). This function can set callback function for each channel too.
With Bt_Pwm_WriteCycleVal() the PWM cycle counter is set to the value given in the parameter Bt_Pwm_WriteCycleVal::u16Cycle.
With Bt_Pwm_WriteDutyVal() the PWM duty counter is set to the value given in the parameter Bt_Pwm_WriteDutyVal::u16Duty.
Notes that PWM can be only set to 16-bit mode, so above two parameters should be 16-bit.
Bt_Pwm_EnableCount() is used to enabe PWM counter.
After above setting is done, calling Bt_Pwm_EnableSwTrig() will start PWM timer.
With Bt_Pwm_ReadCurCnt() the current PWM count can be read when PWM timer is running.
With interrupt mode, when the interrupt occurs, the interrupt flag will be cleared and run into user interrupt callback function.
With polling mode, user can use Bt_Pwm_GetIntFlag() to check if the interrupt occurs, and clear the interrupt flag by Bt_Pwm_ClrIntFlag().
When stopping the PWM timer, use Bt_Pwm_DisableCount() to disable PWM counter and Bt_Pwm_DisableInt() to disable PWM interrupt.
How to use PPG timer function of BT module
Bt_ConfigIOMode() must be used to configure BT I/O mode to I/O mode 0 first.
Bt_SelTimerMode() must be used to configure BT mode to PPG function then.
Bt_Ppg_Init() is used to initialize PPG timer source clock, output polarity, operation mode and so on. Following operation mode can set:
A PPG interrupt can be enabled by the function Bt_Ppg_EnableInt(). This function can set callback function for each channel too.
With Bt_Ppg_WriteLowWidthVal() the PPG low width is set to the value given in the parameter Bt_Ppg_WriteLowWidthVal::u16Cycle.
With Bt_Ppg_WriteHighWidthVal() the PPG high width is set to the value given in the parameter Bt_Ppg_WriteHighWidthVal::u16Cycle.
Notes that PPG can be only set to 16-bit mode, so above two parameters should be 16-bit.
Bt_Ppg_EnableCount() is used to enabe PPG counter.
After above setting is done, calling Bt_Ppg_EnableSwTrig() will start PPG timer.
With Bt_Ppg_ReadCurCnt() the current PPG count can be read when PPG timer is running.
With interrupt mode, when the interrupt occurs, the interrupt flag will be cleared and run into user interrupt callback function.
With polling mode, user can use Bt_Ppg_GetIntFlag() to check if the interrupt occurs, and clear the interrupt flag by Bt_Ppg_ClrIntFlag().
When stopping the PPG timer, use Bt_Ppg_DisableCount() to disable PPG counter and Bt_Ppg_DisableInt() to disable PPG interrupt.
**How to use Reload Timer (RT) function of BT module
Bt_ConfigIOMode() must be used to configure BT I/O mode to I/O mode 0 first.
Bt_SelTimerMode() must be used to configure BT mode to Reload Timer function then.
Bt_Rt_Init() is used to initialize RT source clock, output polarity, operation mode and so on. Following operation mode can set:
A RT interrupt can be enabled by the function Bt_Rt_EnableInt(). This function can set callback function for each channel too.
RT can be set to 16-bit mode or 32-bit mode. In 16-bit mode, Bt_Rt_WriteCycleVal() set the RT counter cycle of according channel. In the 32-bit mode, Bt_Rt_WriteCycleVal() with even channel register pointer as paremater set the low 16-bit cycle value and Bt_Rt_WriteCycleVal() with odd channel register pointer as paremater set the high 16-bit cycle value.
Bt_Rt_EnableCount() is used to enabe RT counter.
After above setting is done, calling Bt_Rt_EnableSwTrig() will start Reload Timer.
With Bt_Rt_ReadCurCnt() the current RT count can be read when Reload Timer is running.
With interrupt mode, when the interrupt occurs, the interrupt flag will be cleared and run into user interrupt callback function.
With polling mode, user can use Bt_Rt_GetIntFlag() to check if the interrupt occurs, and clear the interrupt flag by Rt_Ppg_ClrIntFlag().
When stopping the PPG timer, use Bt_Rt_DisableCount() to disable RT counter and Bt_Rt_DisableInt() to disable RT interrupt.
**How to use PWC timer function of BT module
Bt_ConfigIOMode() must be used to configure BT I/O mode to I/O mode 0 first.
Bt_SelTimerMode() must be used to configure BT mode to PWC function then.
Bt_Pwc_Init() is used to initialize PWC timer source clock, measurement mode and so on. Following measurement mode can set:
A PWC interrupt can be enabled by the function Bt_Pwc_EnableInt(). This function can set callback function for each channel too.
Bt_Pwc_EnableCount() is used to enabe PWC counter.
After above setting is done, when the valid edge (1st) is detected, the measurement starts, and the valid edge (2nd) is detected, the measurement ends, the interrupt request flag is set at the same time.
PWC timer can be set to 16-bit mode and 32-bit mode. In the 16-bit mode, with Bt_Pwc_Get16BitMeasureData() the measured value can be read after measurement completes, in the 32-bit mode, with Bt_Pwc_Get32BitMeasureData() the measured value can be read.
With interrupt mode, when the interrupt occurs, the interrupt flag will be cleared and the code runs into user interrupt callback function.
With polling mode, user can use Bt_Pwc_GetIntFlag() to check if the completion interrupt occurs, and clear the interrupt flag by Bt_Pwc_ClrIntFlag(). Bt_Pwc_GetErrorFlag() is used to get the error flag of PWC measurement.
When stopping the PWC timer, use Bt_Pwc_DisableCount() to disable PWC counter and Bt_Pwc_DisableInt() to disable PWC interrupt.
| #define BT0 (*((volatile stc_btn_t *) FM4_BT0_PWM_BASE)) |
Definition at line 282 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT1 (*((volatile stc_btn_t *) FM4_BT1_PWM_BASE)) |
Definition at line 283 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT10 (*((volatile stc_btn_t *) FM4_BT10_PWM_BASE)) |
Definition at line 292 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT11 (*((volatile stc_btn_t *) FM4_BT11_PWM_BASE)) |
Definition at line 293 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT12 (*((volatile stc_btn_t *) FM4_BT12_PWM_BASE)) |
Definition at line 294 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT13 (*((volatile stc_btn_t *) FM4_BT13_PWM_BASE)) |
Definition at line 295 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT14 (*((volatile stc_btn_t *) FM4_BT14_PWM_BASE)) |
Definition at line 296 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT15 (*((volatile stc_btn_t *) FM4_BT15_PWM_BASE)) |
Definition at line 297 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT2 (*((volatile stc_btn_t *) FM4_BT2_PWM_BASE)) |
Definition at line 284 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT3 (*((volatile stc_btn_t *) FM4_BT3_PWM_BASE)) |
Definition at line 285 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT4 (*((volatile stc_btn_t *) FM4_BT4_PWM_BASE)) |
Definition at line 286 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT5 (*((volatile stc_btn_t *) FM4_BT5_PWM_BASE)) |
Definition at line 287 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT6 (*((volatile stc_btn_t *) FM4_BT6_PWM_BASE)) |
Definition at line 288 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT7 (*((volatile stc_btn_t *) FM4_BT7_PWM_BASE)) |
Definition at line 289 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT8 (*((volatile stc_btn_t *) FM4_BT8_PWM_BASE)) |
Definition at line 290 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), and Bt_InitNvic().
| #define BT9 (*((volatile stc_btn_t *) FM4_BT9_PWM_BASE)) |
Definition at line 291 of file bt.h.
Referenced by Bt_ConfigIOMode(), Bt_DeInitNvic(), Bt_InitNvic(), and Bt_Pwc_Get32BitMeasureData().
| #define BT_INSTANCE_COUNT (uint32_t)(sizeof(m_astcBtInstanceDataLut) / sizeof(m_astcBtInstanceDataLut[0])) |
Definition at line 68 of file bt.c.
Referenced by BtGetInternDataPtr().
| #define stc_btn_t FM4_BT_PWM_TypeDef |
Definition at line 280 of file bt.h.
Referenced by Bt_DeInitNvic(), and Bt_InitNvic().
| typedef enum en_bt_instance_index en_bt_instance_index_t |
Enumeration to define an index for each BT instance.
| typedef enum en_bt_io_mode en_bt_io_mode_t |
Enumeration to define BT IO mode.
| typedef enum en_bt_ppg_int en_bt_ppg_int_t |
Enumeration to define PPG interrupt type.
| typedef enum en_bt_pwc_int en_bt_pwc_int_t |
Enumeration to define PWC timer interrupt type.
| typedef enum en_bt_pwm_int en_bt_pwm_int_t |
Enumeration to define PWM interrupt type.
| typedef enum en_bt_rt_int en_bt_rt_int_t |
Enumeration to define Reload timer interrupt type.
| typedef enum en_bt_timer_mode en_bt_timer_mode_t |
Enumeration to define timer mode of BT.
| typedef enum en_ppg_clock_pres en_ppg_clock_pres_t |
Enumeration to define clock prescaler of PPG timer.
| typedef enum en_ppg_ext_trig en_ppg_ext_trig_t |
Enumeration to define external trigger of PPG.
| typedef enum en_ppg_mode en_ppg_mode_t |
Enumeration to define PWM timer mode.
| typedef enum en_ppg_output_mask en_ppg_output_mask_t |
Enumeration to define the configuration of PPG output mask.
| typedef enum en_ppg_output_polarity en_ppg_output_polarity_t |
Enumeration to define PWM initial polarity.
| typedef enum en_ppg_restart_enable en_ppg_restart_enable_t |
Enumeration to define the configuration of PPG restart option.
| typedef enum en_pwc_clock_pres en_pwc_clock_pres_t |
Enumeration to define clock prescaler of PWC timer.
| typedef enum en_pwc_measure_edge en_pwc_measure_edge_t |
Enumeration to define measure mode of PWC timer.
| typedef enum en_pwc_mode en_pwc_mode_t |
Enumeration to define PWC timer mode.
| typedef enum en_pwc_timer_size en_pwc_timer_size_t |
Enumeration to define Reload timer size.
| typedef enum en_pwm_clock_pres en_pwm_clock_pres_t |
Enumeration to define clock prescaler of PWM timer.
| typedef enum en_pwm_ext_trig en_pwm_ext_trig_t |
Enumeration to define external trigger of PWM.
| typedef enum en_pwm_mode en_pwm_mode_t |
Enumeration to define PWM timer mode.
| typedef enum en_pwm_output_mask en_pwm_output_mask_t |
Enumeration to define the configuration of PWM output mask.
| typedef enum en_pwm_output_polarity en_pwm_output_polarity_t |
Enumeration to define PWM initial polarity.
| typedef enum en_pwm_restart_enable en_pwm_restart_enable_t |
Enumeration to define the configuration of PWM restart option.
| typedef enum en_rt_clock_pres en_rt_clock_pres_t |
Enumeration to define clock prescaler of Reload timer.
| typedef enum en_rt_ext_trigger en_rt_ext_trigger_t |
Enumeration to define external trigger of Reload timer.
| typedef enum en_rt_mode en_rt_mode_t |
Enumeration to define Reload timer mode.
| typedef enum en_rt_output_polarity en_rt_output_polarity_t |
Enumeration to define Reload timer output initial polarity.
| typedef enum en_rt_timer_size en_rt_timer_size_t |
Enumeration to define Reload timer size.
| typedef struct stc_bt_instance_data stc_bt_instance_data_t |
BT instance data.
| typedef struct stc_bt_intern_data stc_bt_intern_data_t |
BT internal data.
| typedef struct stc_bt_ppg_config stc_bt_ppg_config_t |
Structure of PPG configuration.
| typedef struct stc_bt_pwc_config stc_bt_pwc_config_t |
Structure of PWC timer configuration.
| typedef struct stc_bt_pwm_config stc_bt_pwm_config_t |
Structure of PWM configuration.
| typedef struct stc_bt_rt_config stc_bt_rt_config_t |
Structure of Reload timer configuration.
| typedef struct stc_ppg_int_cb stc_ppg_int_cb_t |
structure to set the PPG interrupt callback function
| typedef struct stc_ppg_int_sel stc_ppg_int_sel_t |
structure to select the PPG interrupt
| typedef struct stc_pwc_int_cb stc_pwc_int_cb_t |
structure to set the PWC timer interrupt callback function
| typedef struct stc_pwc_int_sel stc_pwc_int_sel_t |
structure to select the PWC timer interrupt
| typedef struct stc_pwm_int_cb stc_pwm_int_cb_t |
structure to set the PWM interrupt callback function
| typedef struct stc_pwm_int_sel stc_pwm_int_sel_t |
structure to select the PWM interrupt
| typedef struct stc_rt_int_cb stc_rt_int_cb_t |
structure to set the Reload timer interrupt callback function
| typedef struct stc_rt_int_sel stc_rt_int_sel_t |
structure to select the Reload timer interrupt
| enum en_bt_instance_index |
Enumeration to define an index for each BT instance.
| enum en_bt_io_mode |
| enum en_bt_ppg_int |
| enum en_bt_pwc_int |
| enum en_bt_pwm_int |
| enum en_bt_rt_int |
| enum en_bt_timer_mode |
| enum en_ppg_clock_pres |
Enumeration to define clock prescaler of PPG timer.
| enum en_ppg_ext_trig |
| enum en_ppg_mode |
| enum en_ppg_output_mask |
| enum en_pwc_clock_pres |
Enumeration to define clock prescaler of PWC timer.
| enum en_pwc_measure_edge |
Enumeration to define measure mode of PWC timer.
| enum en_pwc_mode |
| enum en_pwc_timer_size |
| enum en_pwm_clock_pres |
Enumeration to define clock prescaler of PWM timer.
| enum en_pwm_ext_trig |
| enum en_pwm_mode |
| enum en_pwm_output_mask |
| enum en_rt_clock_pres |
Enumeration to define clock prescaler of Reload timer.
| enum en_rt_ext_trigger |
Enumeration to define external trigger of Reload timer.
| enum en_rt_mode |
| enum en_rt_timer_size |
| en_result_t Bt_ConfigIOMode | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_io_mode_t | enIoMode | ||
| ) |
Configure BT IO mode.
| [in] | pstcBt | BT instance |
| [in] | enIoMode | BT IO mode |
| Ok | BT IO mode has been set successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 522 of file bt.c.
References BT0, BT1, BT10, BT11, BT12, BT13, BT14, BT15, BT2, BT3, BT4, BT5, BT6, BT7, BT8, BT9, BtGetInternDataPtr(), BtIoMode8, ErrorInvalidParameter, and Ok.

|
static |
Clear NVIC Interrupt depending on BT instance.
| [in] | pstcBt | Pointer to BT instance |
Definition at line 391 of file bt.c.
References BT0, BT1, BT10, BT11, BT12, BT13, BT14, BT15, BT2, BT3, BT4, BT5, BT6, BT7, BT8, BT9, PDL_DEFAULT_INTERRUPT_LEVEL, and stc_btn_t.
Referenced by Bt_Ppg_DisableInt(), Bt_Pwc_DisableInt(), Bt_Pwm_DisableInt(), and Bt_Rt_DisableInt().

|
static |
Set NVIC Interrupt depending on BT instance.
| [in] | pstcBt | Pointer to BT instance |
Definition at line 275 of file bt.c.
References BT0, BT1, BT10, BT11, BT12, BT13, BT14, BT15, BT2, BT3, BT4, BT5, BT6, BT7, BT8, BT9, PDL_IRQ_LEVEL_BT0, PDL_IRQ_LEVEL_BT1, PDL_IRQ_LEVEL_BT10, PDL_IRQ_LEVEL_BT11, PDL_IRQ_LEVEL_BT12_13_14_15, PDL_IRQ_LEVEL_BT2, PDL_IRQ_LEVEL_BT3, PDL_IRQ_LEVEL_BT4, PDL_IRQ_LEVEL_BT5, PDL_IRQ_LEVEL_BT6, PDL_IRQ_LEVEL_BT7, PDL_IRQ_LEVEL_BT8, PDL_IRQ_LEVEL_BT9, and stc_btn_t.
Referenced by Bt_Ppg_EnableInt(), Bt_Pwc_EnableInt(), Bt_Pwm_EnableInt(), and Bt_Rt_EnableInt().

| void Bt_IrqHandler | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_bt_intern_data_t * | pstcBtInternData | ||
| ) |
BT interrupt service routine.
| [in] | pstcBt | BT instance |
| [in] | pstcBtInternData | Pointer to BT internal data |
Definition at line 214 of file bt.c.
References stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit1IntCallback, and stc_bt_intern_data::pfnBit2IntCallback.
| en_result_t Bt_Ppg_ClrIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_ppg_int_t | enIntType | ||
| ) |
Clear interrupt flag of PPG timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PPG timer interrupt type |
| ErrorInvalidParameter | pstcBt == NULL enIntType > PwmUnderflowInt |
| Ok | Clear interrupt flag successfully |
Definition at line 1279 of file bt.c.
References ErrorInvalidParameter, Ok, PpgTrigInt, and PpgUnderflowInt.
| en_result_t Bt_Ppg_DisableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Disable PPG timer counting.
| [in] | pstcBt | BT instance |
| Ok | Disable PPG timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1095 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Ppg_DisableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_ppg_int_sel_t * | pstcIntSel | ||
| ) |
Disable PPG timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | PPG timer interrupt type |
| Ok | Disable PPG timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1198 of file bt.c.
References stc_ppg_int_sel::bPpgTrigInt, stc_ppg_int_sel::bPpgUnderflowInt, Bt_DeInitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, and stc_bt_intern_data::pfnBit2IntCallback.

| en_result_t Bt_Ppg_EnableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Enable PPG timer counting.
| [in] | pstcBt | BT instance |
| Ok | Enable PPG timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1074 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Ppg_EnableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_ppg_int_sel_t * | pstcIntSel, | ||
| stc_ppg_int_cb_t * | pstcIntCallback | ||
| ) |
Enable PPG timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | PPG timer interrupt type |
| [in] | pstcIntCallback | Pointer to interrupt callback function structure |
| Ok | Enable PPG timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL pstcIntCallback == NULL Other invalid configuration |
Definition at line 1149 of file bt.c.
References stc_ppg_int_sel::bPpgTrigInt, stc_ppg_int_sel::bPpgUnderflowInt, Bt_InitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit2IntCallback, stc_ppg_int_cb::pfnPpgTrigIntCallback, and stc_ppg_int_cb::pfnPpgUnderflowIntCallback.

| en_result_t Bt_Ppg_EnableSwTrig | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Start PPG timer by software.
| [in] | pstcBt | BT instance |
| Ok | Start PPG timer successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1116 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_int_flag_t Bt_Ppg_GetIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_ppg_int_t | enIntType | ||
| ) |
Get interrupt flag of PPG timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PPG timer interrupt type |
| PdlSet | Interrupt flag is set |
| PdlClr | Interrupt flag is clear |
Definition at line 1249 of file bt.c.
References PdlClr, PdlSet, PpgTrigInt, and PpgUnderflowInt.
| en_result_t Bt_Ppg_Init | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_bt_ppg_config_t * | pstcPpgConfig | ||
| ) |
Initialize PPG function of BT.
| [in] | pstcBt | BT instance |
| [in] | pstcPpgConfig | Pointer to PPG configuration |
| Ok | PPG function has been configured successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1009 of file bt.c.
References BtGetInternDataPtr(), stc_bt_ppg_config::enExtTrig, stc_bt_ppg_config::enMode, stc_bt_ppg_config::enOutputMask, stc_bt_ppg_config::enOutputPolarity, stc_bt_ppg_config::enPres, stc_bt_ppg_config::enRestartEn, ErrorInvalidParameter, Ok, PpgExtTrigBoth, PpgOneshot, PpgOutputMask, PpgPolarityHigh, PpgPres1Div2048, PpgPres1Div512, and PpgRestartEnable.

| uint16_t Bt_Ppg_ReadCurCnt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| en_result_t Bt_Ppg_WriteHighWidthVal | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| uint16_t | u16Val | ||
| ) |
Write high width count value of PPG timer.
| [in] | pstcBt | BT instance |
| [in] | u16Val | High width count value |
| Ok | Write high width count value successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1333 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Ppg_WriteLowWidthVal | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| uint16_t | u16Val | ||
| ) |
Write low width count value of PPG timer.
| [in] | pstcBt | BT instance |
| [in] | u16Val | Low width count value |
| Ok | Write low width count value successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1311 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwc_ClrIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_pwc_int_t | enIntType | ||
| ) |
Clear interrupt flag of PWC timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PWC timer interrupt type |
| ErrorInvalidParameter | pstcBt == NULL enIntType > PwcMeasureOverflowInt |
| Ok | Clear interrupt flag successfully |
Definition at line 1960 of file bt.c.
References ErrorInvalidParameter, Ok, PwcMeasureCompleteInt, and PwcMeasureOverflowInt.
| en_result_t Bt_Pwc_DisableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Disable PWC timer counting.
| [in] | pstcBt | BT instance |
| Ok | Disable PWC timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1797 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwc_DisableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_pwc_int_sel_t * | pstcIntSel | ||
| ) |
Disable PWC timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | PWC timer interrupt type structure pointer |
| Ok | Disable PWC timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1879 of file bt.c.
References stc_pwc_int_sel::bPwcMeasCmpInt, stc_pwc_int_sel::bPwcMeasOverflowInt, Bt_DeInitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, and stc_bt_intern_data::pfnBit2IntCallback.

| en_result_t Bt_Pwc_EnableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Enable PWC timer counting.
| [in] | pstcBt | BT instance |
| Ok | Enable PWC timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1776 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwc_EnableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_pwc_int_sel_t * | pstcIntSel, | ||
| stc_pwc_int_cb_t * | pstcIntCallback | ||
| ) |
Enable PWC timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | PWC timer interrupt type |
| [in] | pstcIntCallback | Pointer to interrupt callback function structure |
| Ok | Enable PWC timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL pstcIntCallback == NULL Other invalid configuration |
Definition at line 1830 of file bt.c.
References stc_pwc_int_sel::bPwcMeasCmpInt, stc_pwc_int_sel::bPwcMeasOverflowInt, Bt_InitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit2IntCallback, stc_pwc_int_cb::pfnPwcMeasCmpCallback, and stc_pwc_int_cb::pfnPwcMeasOverflowCallback.

| uint16_t Bt_Pwc_Get16BitMeasureData | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| uint32_t Bt_Pwc_Get32BitMeasureData | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| en_stat_flag_t Bt_Pwc_GetErrorFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| en_int_flag_t Bt_Pwc_GetIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_pwc_int_t | enIntType | ||
| ) |
Get interrupt flag of PWC timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PWC timer interrupt type |
| PdlSet | Interrupt flag is set |
| PdlClr | Interrupt flag is clear |
Definition at line 1930 of file bt.c.
References PdlClr, PdlSet, PwcMeasureCompleteInt, and PwcMeasureOverflowInt.
| en_result_t Bt_Pwc_Init | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_bt_pwc_config_t * | pstcPwcConfig | ||
| ) |
Initialize PWC function of BT.
| [in] | pstcBt | BT instance |
| [in] | pstcPwcConfig | Pointer to PWC configuration |
| Ok | PWC function has been configured successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1717 of file bt.c.
References BtGetInternDataPtr(), stc_bt_pwc_config::enMeasureEdge, stc_bt_pwc_config::enMode, stc_bt_pwc_config::enPres, stc_bt_pwc_config::enSize, ErrorInvalidParameter, Ok, PwcMeasureFallingToRising, PwcOneshot, PwcPres1Div2048, PwcPres1Div512, and PwcSize32Bit.

| en_result_t Bt_Pwm_ClrIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_pwm_int_t | enIntType | ||
| ) |
Clear interrupt flag of PWM timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PWM timer interrupt type |
| ErrorInvalidParameter | pstcBt == NULL enIntType > PwmUnderflowInt |
| Ok | Clear interrupt flag successfully |
Definition at line 916 of file bt.c.
References ErrorInvalidParameter, Ok, PwmDutyMatchInt, PwmTrigInt, and PwmUnderflowInt.
| en_result_t Bt_Pwm_DisableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Disable PWM timer counting.
| [in] | pstcBt | BT instance |
| Ok | Disable PWM timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 716 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwm_DisableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_pwm_int_sel_t * | pstcIntSel | ||
| ) |
Disable PWM timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | Pointer to interrupt callback function |
| Ok | Disable PWM timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 825 of file bt.c.
References stc_pwm_int_sel::bPwmDutyMatchInt, stc_pwm_int_sel::bPwmTrigInt, stc_pwm_int_sel::bPwmUnderflowInt, Bt_DeInitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit1IntCallback, and stc_bt_intern_data::pfnBit2IntCallback.

| en_result_t Bt_Pwm_EnableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Enable PWM timer counting.
| [in] | pstcBt | BT instance |
| Ok | Enable PWM timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 695 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwm_EnableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_pwm_int_sel_t * | pstcIntSel, | ||
| stc_pwm_int_cb_t * | pstcIntCallback | ||
| ) |
Enable PWM timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | PWM timer interrupt type |
| [in] | pstcIntCallback | Pointer to interrupt callback function structure |
| Ok | Enable PWM timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL pstcIntCallback == NULL Other invalid configuration |
Definition at line 770 of file bt.c.
References stc_pwm_int_sel::bPwmDutyMatchInt, stc_pwm_int_sel::bPwmTrigInt, stc_pwm_int_sel::bPwmUnderflowInt, Bt_InitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit1IntCallback, stc_bt_intern_data::pfnBit2IntCallback, stc_pwm_int_cb::pfnPwmDutyMatchIntCallback, stc_pwm_int_cb::pfnPwmTrigIntCallback, and stc_pwm_int_cb::pfnPwmUnderflowIntCallback.

| en_result_t Bt_Pwm_EnableSwTrig | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Start PWM timer by software.
| [in] | pstcBt | BT instance |
| Ok | Start PWM timer successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 737 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_int_flag_t Bt_Pwm_GetIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_pwm_int_t | enIntType | ||
| ) |
Get interrupt flag of PWM timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | PWM timer interrupt type |
| PdlSet | Interrupt flag is set |
| PdlClr | Interrupt flag is clear |
Definition at line 883 of file bt.c.
References PdlClr, PdlSet, PwmDutyMatchInt, PwmTrigInt, and PwmUnderflowInt.
| en_result_t Bt_Pwm_Init | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_bt_pwm_config_t * | pstcPwmConfig | ||
| ) |
Initialize PWM function of BT.
| [in] | pstcBt | BT instance |
| [in] | pstcPwmConfig | Pointer to PWM configuration |
| Ok | PWM function has been configured successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 630 of file bt.c.
References BtGetInternDataPtr(), stc_bt_pwm_config::enExtTrig, stc_bt_pwm_config::enMode, stc_bt_pwm_config::enOutputMask, stc_bt_pwm_config::enOutputPolarity, stc_bt_pwm_config::enPres, stc_bt_pwm_config::enRestartEn, ErrorInvalidParameter, Ok, PwmExtTrigBoth, PwmOneshot, PwmOutputMask, PwmPolarityHigh, PwmPres1Div2048, PwmPres1Div512, and PwmRestartEnable.

| uint16_t Bt_Pwm_ReadCurCnt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| en_result_t Bt_Pwm_WriteCycleVal | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| uint16_t | u16Cycle | ||
| ) |
Write Cycle value of PWM timer.
| [in] | pstcBt | BT instance |
| [in] | u16Cycle | Cycle value |
| Ok | Write Cycle value successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 951 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Pwm_WriteDutyVal | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| uint16_t | u16Duty | ||
| ) |
Write duty value of PWM timer.
| [in] | pstcBt | BT instance |
| [in] | u16Duty | Cycle value |
| Ok | Write duty value successfully |
| ErrorInvalidParameter | pstcBt == NUL |
Definition at line 973 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Rt_ClrIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_rt_int_t | enIntType | ||
| ) |
Clear interrupt flag of Reload timer.
| [in] | pstcBt | BT instance |
| [in] | enIntType | Reload timer interrupt type |
| ErrorInvalidParameter | pstcBt == NULL enIntType > RtUnderflowInt |
| Ok | Clear interrupt flag successfully |
Definition at line 1649 of file bt.c.
References ErrorInvalidParameter, Ok, RtTrigInt, and RtUnderflowInt.
| en_result_t Bt_Rt_DisableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Disable Reload timer counting.
| [in] | pstcBt | BT instance |
| Ok | Disable RT timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1468 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Rt_DisableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_rt_int_sel_t * | pstcIntSel | ||
| ) |
Disable Reload timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | Pointer to interrupt callback function structure |
| Ok | Disable Reload timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1571 of file bt.c.
References stc_rt_int_sel::bRtTrigInt, stc_rt_int_sel::bRtUnderflowInt, Bt_DeInitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, and stc_bt_intern_data::pfnBit2IntCallback.

| en_result_t Bt_Rt_EnableCount | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Enable Reload timer counting.
| [in] | pstcBt | BT instance |
| Ok | Enable RT timer counting successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1447 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_Rt_EnableInt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_rt_int_sel_t * | pstcIntSel, | ||
| stc_rt_int_cb_t * | pstcIntCallback | ||
| ) |
Enable Reload timer interrupt.
| [in] | pstcBt | BT instance |
| [in] | pstcIntSel | Reload timer interrupt type |
| [in] | pstcIntCallback | Pointer to interrupt callback function structure |
| Ok | Enable Reload timer interrupt successfully |
| ErrorInvalidParameter | pstcBt == NULL pstcIntCallback == NULL Other invalid configuration |
Definition at line 1522 of file bt.c.
References stc_rt_int_sel::bRtTrigInt, stc_rt_int_sel::bRtUnderflowInt, Bt_InitNvic(), BtGetInternDataPtr(), ErrorInvalidParameter, Ok, stc_bt_intern_data::pfnBit0IntCallback, stc_bt_intern_data::pfnBit2IntCallback, stc_rt_int_cb::pfnRtTrigIntCallback, and stc_rt_int_cb::pfnRtUnderflowIntCallback.

| en_result_t Bt_Rt_EnableSwTrig | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
Start Reload timer by software.
| [in] | pstcBt | BT instance |
| Ok | Start Reload timer successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1489 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_int_flag_t Bt_Rt_GetIntFlag | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_rt_int_t | enIntType | ||
| ) |
| en_result_t Bt_Rt_Init | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| stc_bt_rt_config_t * | pstcRtConfig | ||
| ) |
Initialize RT function of BT.
| [in] | pstcBt | BT instance |
| [in] | pstcRtConfig | Pointer to RT configuration |
| Ok | RT function has been configured successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 1369 of file bt.c.
References BtGetInternDataPtr(), stc_bt_rt_config::enExtTrig, stc_bt_rt_config::enMode, stc_bt_rt_config::enOutputPolarity, stc_bt_rt_config::enPres, stc_bt_rt_config::enSize, ErrorInvalidParameter, Ok, RtExtTiggerBothEdge, RtExtTiggerHighLevel, RtExtTiggerLowLevel, RtOneshot, RtPolarityHigh, RtPres1Div2048, RtPres1Div512, and RtSize32Bit.

| uint16_t Bt_Rt_ReadCurCnt | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt | ) |
| en_result_t Bt_Rt_WriteCycleVal | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| uint16_t | u16Val | ||
| ) |
Write count cycle of Reload timer.
| [in] | pstcBt | BT instance |
| [in] | u16Val | Cycle value |
| Ok | Write count cycle successfully |
| ErrorInvalidParameter | pstcBt == NULL |
Definition at line 1681 of file bt.c.
References ErrorInvalidParameter, and Ok.
| en_result_t Bt_SelTimerMode | ( | volatile FM4_BT_PWM_TypeDef * | pstcBt, |
| en_bt_timer_mode_t | enTimerMode | ||
| ) |
Select timer function of BT.
| [in] | pstcBt | BT instance |
| [in] | enTimerMode | Timer mode |
| Ok | BT timer mode has been selected successfully |
| ErrorInvalidParameter | pstcBt == NULL Other invalid configuration |
Definition at line 595 of file bt.c.
References BtGetInternDataPtr(), BtPwcMode, ErrorInvalidParameter, and Ok.

| void Bt_SetSimultaneousStart | ( | uint16_t | u16Value | ) |
|
static |
Return the internal data for a certain BT instance.
| [in] | pstcBt | Pointer to BT instance |
Definition at line 183 of file bt.c.
References BT_INSTANCE_COUNT, and stc_bt_instance_data::stcInternData.
Referenced by Bt_ConfigIOMode(), Bt_Ppg_DisableInt(), Bt_Ppg_EnableInt(), Bt_Ppg_Init(), Bt_Pwc_DisableInt(), Bt_Pwc_EnableInt(), Bt_Pwc_Init(), Bt_Pwm_DisableInt(), Bt_Pwm_EnableInt(), Bt_Pwm_Init(), Bt_Rt_DisableInt(), Bt_Rt_EnableInt(), Bt_Rt_Init(), and Bt_SelTimerMode().

| stc_bt_instance_data_t m_astcBtInstanceDataLut[] |
| stc_bt_instance_data_t m_astcBtInstanceDataLut[] |