MTB CAT1 Peripheral driver library
HALL Sensor specific functions

General Description

Functions

__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_HLUT (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_tcpwm_motif_hlut_t *hlut_config)
 Update look up table contents for Hall Sensor in LUT mode. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Configure_Debounce_Bypass (TCPWM_MOTIF_GRP_MOTIF_Type *base, bool bypass_sd)
 Enable/Disable HALL Sensor debounce stage bypass. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Hall_Pattern (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Update Hall pattern immediately. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Previous_Pattern_Compare (TCPWM_MOTIF_GRP_MOTIF_Type *base, bool pp_compare)
 Enable/Disable HALL Previous Pattern compare. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Set_HALL_Pattern (TCPWM_MOTIF_GRP_MOTIF_Type *base, uint8_t current_pattern, uint8_t expected_pattern, uint8_t previous_pattern)
 Sets the Hall patterns: Current, Expected and Previous patterns. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Hall_Input_Sample_Trigger (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 The application software can issue/request a sample of the Hall Inputs. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Output_Config (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_hall_output_config_t *output_config)
 Configures the output pins for each of the hall event. More...
 
__STATIC_INLINE uint32_t Cy_TCPWM_MOTIF_HALL_Get_Output_Modulation_Value (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Returns the output modulation value. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Sample_Trigger_EdgeSel (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_en_trigger_edge_selection_t edge_select)
 Select the active edge to trigger a sample of the Hall inputs. More...
 
cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_Hall_Sensor_Init (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_tcpwm_motif_hall_sensor_config_t const *config)
 MOTIF module initialization in Hall sensor Mode. More...
 

Function Documentation

◆ Cy_TCPWM_MOTIF_Update_HLUT()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_HLUT ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_tcpwm_motif_hlut_t hlut_config 
)

Update look up table contents for Hall Sensor in LUT mode.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
hlut_configHALL Look Up Table Configuration cy_stc_tcpwm_motif_hlut_t
Note
Update look up table contents for Hall Sensor in LUT mode. User writes HLUT and MLUT when MOTIF is stopped. Writing into both LUT while MOTIF is started might lead to incorrect behavior. The LUT is loaded with forward or reverse pattern depending on motor desired direction. The pattern is stored in LUT independently from motor position. The hardware is responsible to find out the current motor position and to load the right hall and modulation pattern. HLUT and MLUT share the same hardware pointer for data extraction, therefore user needs to take care of keeping them aligned with respect to LUT address. A wrong programming might lead to incorrect behavior.

◆ Cy_TCPWM_MOTIF_Configure_Debounce_Bypass()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Configure_Debounce_Bypass ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
bool  bypass_sd 
)

Enable/Disable HALL Sensor debounce stage bypass.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
bypass_sdPassing true will disable HALL Sensor sample delay. hall inputs are immediately sample after the low pass filter with out delay.

◆ Cy_TCPWM_MOTIF_Update_Hall_Pattern()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Hall_Pattern ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Update Hall pattern immediately.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
Note
The update of the fields HALP.HCP, HALP.HEP and HALP.HPP can come from software by calling this function.

◆ Cy_TCPWM_MOTIF_HALL_Previous_Pattern_Compare()

__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Previous_Pattern_Compare ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
bool  pp_compare 
)

Enable/Disable HALL Previous Pattern compare.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
pp_comparePrevious Pattern Compare enable or disable
Note
Passing true will enables the compare logic between the sampled hall input values and the previous hall pattern. HALP.HPP will hold the previous pattern. This will be used together with the comparison of the current and expected pattern to generate a wrong hall event.

◆ Cy_TCPWM_MOTIF_Set_HALL_Pattern()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Set_HALL_Pattern ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
uint8_t  current_pattern,
uint8_t  expected_pattern,
uint8_t  previous_pattern 
)

Sets the Hall patterns: Current, Expected and Previous patterns.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
current_patternCurrent Pattern
expected_patternExpected Pattern
previous_patternPrevious Pattern
Note
When the sampling trigger is sensed, the Hall inputs are stored and compared against the Current Pattern, HALP.HCP, the Expected Hall Pattern, HALP.HEP and the Previous Pattern HALP.HPP (the Previous Pattern comparison can be disabled)

◆ Cy_TCPWM_MOTIF_Hall_Input_Sample_Trigger()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Hall_Input_Sample_Trigger ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

The application software can issue/request a sample of the Hall Inputs.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.

◆ Cy_TCPWM_MOTIF_HALL_Output_Config()

__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Output_Config ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_hall_output_config_t output_config 
)

Configures the output pins for each of the hall event.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
output_configHALL Output Configuration cy_stc_hall_output_config_t
Note
User to make sure that no two event s are routed to same node.

◆ Cy_TCPWM_MOTIF_HALL_Get_Output_Modulation_Value()

__STATIC_INLINE uint32_t Cy_TCPWM_MOTIF_HALL_Get_Output_Modulation_Value ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Returns the output modulation value.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.

◆ Cy_TCPWM_MOTIF_HALL_Sample_Trigger_EdgeSel()

__STATIC_INLINE void Cy_TCPWM_MOTIF_HALL_Sample_Trigger_EdgeSel ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_en_trigger_edge_selection_t  edge_select 
)

Select the active edge to trigger a sample of the Hall inputs.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
edge_selectEdge to trigger a sample of the Hall inputs cy_en_trigger_edge_selection_t.
Note
Edge selector for the sampling trigger This field selects which edge is used of the selected MOTIFx.HSD signal to trigger a sample of the Hall inputs.

◆ Cy_TCPWM_MOTIF_Hall_Sensor_Init()

cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_Hall_Sensor_Init ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_tcpwm_motif_hall_sensor_config_t const *  config 
)

MOTIF module initialization in Hall sensor Mode.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
configHall sensor configuration cy_stc_tcpwm_motif_hall_sensor_config_t
Returns
Returns the status of the operation.