MTB CAT1 Peripheral driver library
Multi-Channel specific functions

General Description

Functions

__STATIC_INLINE void Cy_TCPWM_MOTIF_Set_MCP_Value (TCPWM_MOTIF_GRP_MOTIF_Type *base, uint32_t mcp_value)
 Sets Multi channel pattern value. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Value_When_Fault_Hall (TCPWM_MOTIF_GRP_MOTIF_Type *base, uint32_t mcp_value)
 Sets MCP value when there is a fault HALL event. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Bypass_Delay (TCPWM_MOTIF_GRP_MOTIF_Type *base, bool bypass_delay)
 Enable/Disable multi channel pattern delay bypass. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Update multi channel pattern. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Clear_Multi_Channel_Pattern (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Clears the Multi-Channel Pattern value with the content of the MCP Fault register. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Clear_Updation_Of_Multi_Channel_Pattern (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Clears updating of multi channel pattern. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern_Immediately (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 Update multi channel pattern immediately. More...
 
__STATIC_INLINE bool Cy_TCPWM_MOTIF_Get_Multi_Channel_Pattern_Update_Status (TCPWM_MOTIF_GRP_MOTIF_Type *base)
 returns the Multi Channel Pattern update status. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_SW_Update_Enable (TCPWM_MOTIF_GRP_MOTIF_Type *base, bool sw_update_enable)
 Selects the source that enables an update of the Multi-Channel pattern. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_Multi_Channel_Output_Config (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_multi_channel_output_config_t *output_config)
 Configures the output nodes for each of the Multi Channel Pattern output event. More...
 
__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Bypass_Synchronization (TCPWM_MOTIF_GRP_MOTIF_Type *base, bool bypass_sync)
 Synchronization of the trigger with the PWM is bypassed if set. More...
 
void Cy_TCPWM_MOTIF_Update_MLUT (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_tcpwm_motif_mlut_t *mlut_config)
 Update look up table for multi channel pattern MLUT mode. More...
 
cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_MCP_Init (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_tcpwm_motif_mcp_config_t const *mcp_config)
 MOTIF module initialization in Multi Channel Pattern Mode. More...
 
cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_MCP_Quaddec_Init (TCPWM_MOTIF_GRP_MOTIF_Type *base, cy_stc_tcpwm_motif_mcp_quaddec_config_t const *mcp_quad_config)
 MOTIF module initialization in Quadrature Decoder Mode and Multi Channel Pattern mode. More...
 

Function Documentation

◆ Cy_TCPWM_MOTIF_Set_MCP_Value()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Set_MCP_Value ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
uint32_t  mcp_value 
)

Sets Multi channel pattern value.

Every time a multi channel pattern transfer is triggered, this value is transferred. This is applicable when multi channel look up table mode is disabled.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
mcp_valueMulti Channel Pattern Value

◆ Cy_TCPWM_MOTIF_MCP_Value_When_Fault_Hall()

__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Value_When_Fault_Hall ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
uint32_t  mcp_value 
)

Sets MCP value when there is a fault HALL event.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
mcp_valueMulti channel pattern value to be configured when there is a fault HALL event.
Note
It is possible also to use the Hall Fault Event to clear/load the Multi-Channel Pattern with a pre-configured value - MCPF.MCFV. This mechanism can be used whenever a wrong operation is detected and a specific safe pattern needs to be applied to the PWM timers that are controlling the output switches.

◆ Cy_TCPWM_MOTIF_MCP_Bypass_Delay()

__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Bypass_Delay ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
bool  bypass_delay 
)

Enable/Disable multi channel pattern delay bypass.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
bypass_delayBypass Delay.
Note
After the Correct Hall Event is detected, a delay can be generated between this detection and the update of the Multi-Channel pattern. The delay for the update of the Multi-Channel pattern can be controlled directly by a TCPWM counter. The trigger that indicates that the delay is finished, is mapped to input MOTIFx.MSET (input for MCP trigger) This delay can be by passed by passing true to this function

◆ Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Update multi channel pattern.

The update is not done immediately due to the fact that the trigger that synchronizes the update with the PWM is still needed

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
Note
Calling this function enables the Multi-Channel pattern update. The update is not done immediately due to the fact that the trigger that synchronizes the update with the PWM is still needed. The input MOTIFx.MSYNC is used for synchronization.

◆ Cy_TCPWM_MOTIF_Clear_Multi_Channel_Pattern()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Clear_Multi_Channel_Pattern ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Clears the Multi-Channel Pattern value with the content of the MCP Fault register.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.

◆ Cy_TCPWM_MOTIF_Clear_Updation_Of_Multi_Channel_Pattern()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Clear_Updation_Of_Multi_Channel_Pattern ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Clears updating of multi channel pattern.

Sets that Multi channel pattern is not ready to be updated.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.

◆ Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern_Immediately()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern_Immediately ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

Update multi channel pattern immediately.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
Note
Calling this function enables the Multi-Channel pattern update immediately. The update is done immediately with out waiting for the trigger that synchronizes the update with the PWM.

◆ Cy_TCPWM_MOTIF_Get_Multi_Channel_Pattern_Update_Status()

__STATIC_INLINE bool Cy_TCPWM_MOTIF_Get_Multi_Channel_Pattern_Update_Status ( TCPWM_MOTIF_GRP_MOTIF_Type *  base)

returns the Multi Channel Pattern update status.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
Returns
indicates if the Multi-Channel pattern is ready to be updated or not. 1: MCP is ready and 0: MCP is not ready.

◆ Cy_TCPWM_MOTIF_MCP_SW_Update_Enable()

__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_SW_Update_Enable ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
bool  sw_update_enable 
)

Selects the source that enables an update of the Multi-Channel pattern.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
sw_update_enableWhen set to true, the Multi-Channel pattern can only be updated after the SW has called the function Cy_TCPWM_MOTIF_Update_Multi_Channel_Pattern.

◆ Cy_TCPWM_MOTIF_Multi_Channel_Output_Config()

__STATIC_INLINE void Cy_TCPWM_MOTIF_Multi_Channel_Output_Config ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_multi_channel_output_config_t output_config 
)

Configures the output nodes for each of the Multi Channel Pattern output event.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
output_configOutput configuration. cy_stc_multi_channel_output_config_t

◆ Cy_TCPWM_MOTIF_MCP_Bypass_Synchronization()

__STATIC_INLINE void Cy_TCPWM_MOTIF_MCP_Bypass_Synchronization ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
bool  bypass_sync 
)

Synchronization of the trigger with the PWM is bypassed if set.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
bypass_syncSynchronization bypass configuration.

◆ Cy_TCPWM_MOTIF_Update_MLUT()

void Cy_TCPWM_MOTIF_Update_MLUT ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_tcpwm_motif_mlut_t mlut_config 
)

Update look up table for multi channel pattern MLUT mode.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
mlut_configMulti Channel Pattern Look UP Table values. cy_stc_tcpwm_motif_mlut_t
Note
Update look up table for multi channel pattern MLUT 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_MCP_Init()

cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_MCP_Init ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_tcpwm_motif_mcp_config_t const *  mcp_config 
)

MOTIF module initialization in Multi Channel Pattern Mode.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
mcp_configMulti Channel Pattern configuration cy_stc_tcpwm_motif_mcp_config_t
Returns
Returns the status of the operation.

◆ Cy_TCPWM_MOTIF_MCP_Quaddec_Init()

cy_en_tcpwm_status_t Cy_TCPWM_MOTIF_MCP_Quaddec_Init ( TCPWM_MOTIF_GRP_MOTIF_Type *  base,
cy_stc_tcpwm_motif_mcp_quaddec_config_t const *  mcp_quad_config 
)

MOTIF module initialization in Quadrature Decoder Mode and Multi Channel Pattern mode.

Parameters
baseThe pointer to the TCPWM_MOTIF instance address.
mcp_quad_configMCP and Quad configuration cy_stc_tcpwm_motif_mcp_quaddec_config_t
Returns
Returns the status of the operation.