MTB CAT1 Peripheral driver library

General Description

Functions

cy_en_smartio_luttr_t Cy_SmartIO_GetLutTr (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum, cy_en_smartio_trnum_t trNum)
 Gets the specified LUT input trigger source. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetLutTr (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum, cy_en_smartio_trnum_t trNum, cy_en_smartio_luttr_t trSrc)
 Sets the specified LUT input trigger source. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetLutTrAll (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum, cy_en_smartio_luttr_t trSrc)
 Sets all LUT input triggers to the same source. More...
 
__STATIC_INLINE cy_en_smartio_lutopc_t Cy_SmartIO_GetLutOpcode (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum)
 Gets the opcode of the specified LUT. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetLutOpcode (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum, cy_en_smartio_lutopc_t opcode)
 Sets the opcode of the specified LUT. More...
 
__STATIC_INLINE uint8_t Cy_SmartIO_GetLutMap (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum)
 Gets the 3:1 truth table of the specified LUT. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetLutMap (SMARTIO_PRT_Type *base, cy_en_smartio_lutnum_t lutNum, uint8_t lutMap)
 Sets the 3 bit input to 1 bit output mapping of the specified LUT. More...
 

Function Documentation

◆ Cy_SmartIO_GetLutTr()

cy_en_smartio_luttr_t Cy_SmartIO_GetLutTr ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum,
cy_en_smartio_trnum_t  trNum 
)

Gets the specified LUT input trigger source.

Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
trNumInput trigger number
Returns
LUT input trigger source
Function Usage
/* Refer to the Cy_SmartIO_SetLutTr() function usage example */

◆ Cy_SmartIO_SetLutTr()

cy_en_smartio_status_t Cy_SmartIO_SetLutTr ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum,
cy_en_smartio_trnum_t  trNum,
cy_en_smartio_luttr_t  trSrc 
)

Sets the specified LUT input trigger source.

Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
trNumInput trigger number
trSrcInput trigger source
Returns
Status of the operation
Note
The Smart I/O block must be disabled before calling this function.
Function Usage
#define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
/* Scenario: Smart I/O block 8 LUT1 TR0 needs to change to be sourced
from I/O 1 */
if(lut1Tr0 != CY_SMARTIO_LUTTR_IO1)
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}

◆ Cy_SmartIO_SetLutTrAll()

cy_en_smartio_status_t Cy_SmartIO_SetLutTrAll ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum,
cy_en_smartio_luttr_t  trSrc 
)

Sets all LUT input triggers to the same source.

Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
trSrcInput trigger source
Returns
Status of the operation
Note
The Smart I/O block must be disabled before calling this function.
Function Usage
#define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
/* Scenario: Smart I/O block 8 LUT1 TR0, TR1 and TR2 need to change to be
sourced from LUT output 2 */
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);

◆ Cy_SmartIO_GetLutOpcode()

__STATIC_INLINE cy_en_smartio_lutopc_t Cy_SmartIO_GetLutOpcode ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum 
)

Gets the opcode of the specified LUT.

Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
Returns
LUT opcode
Function Usage
/* Refer to the Cy_SmartIO_SetLutOpcode function usage example */

◆ Cy_SmartIO_SetLutOpcode()

cy_en_smartio_status_t Cy_SmartIO_SetLutOpcode ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum,
cy_en_smartio_lutopc_t  opcode 
)

Sets the opcode of the specified LUT.

Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
opcodeLUT opcode
Returns
Status of the operation
Note
The Smart I/O block must be disabled before calling this function.
Function Usage
#define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
/* Scenario: Smart I/O block 8 LUT1 op-code needs to be updated to combinatorial mode */
opcode = Cy_SmartIO_GetLutOpcode(SMARTIO_PRT8, CY_SMARTIO_LUT1);
if(opcode != CY_SMARTIO_LUTOPC_COMB)
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}

◆ Cy_SmartIO_GetLutMap()

__STATIC_INLINE uint8_t Cy_SmartIO_GetLutMap ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum 
)

Gets the 3:1 truth table of the specified LUT.

tr2tr1tr0lutNum
0 0 0 bit 0
0 0 1 bit 1
0 1 0 bit 2
0 1 1 bit 3
1 0 0 bit 4
1 0 1 bit 5
1 1 0 bit 6
1 1 1 bit 7
Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
Returns
Bitfield [7:0] mapping of the 3:1 LUT
Function Usage
/* Refer to the Cy_SmartIO_SetLutMap function usage example */

◆ Cy_SmartIO_SetLutMap()

cy_en_smartio_status_t Cy_SmartIO_SetLutMap ( SMARTIO_PRT_Type *  base,
cy_en_smartio_lutnum_t  lutNum,
uint8_t  lutMap 
)

Sets the 3 bit input to 1 bit output mapping of the specified LUT.

tr2tr1tr0lutMap
0 0 0 bit 0
0 0 1 bit 1
0 1 0 bit 2
0 1 1 bit 3
1 0 0 bit 4
1 0 1 bit 5
1 1 0 bit 6
1 1 1 bit 7
Parameters
basePointer to the Smart I/O base address
lutNumLUT index number
lutMapBitfield [7:0] mapping of the 3:1 LUT
Returns
Status of the operation
Note
The Smart I/O block must be disabled before calling this function.
Function Usage
#define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
/* Scenario: Smart I/O block 8 LUT1 mapping needs to be updated to produce a
1 when all TR0, TR1 and TR2 inputs are 0. */
uint8_t lutMap;
lutMap = Cy_SmartIO_GetLutMap(SMARTIO_PRT8, CY_SMARTIO_LUT1);
if(lutMap != 0x01u)
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_SetLutMap(SMARTIO_PRT8, CY_SMARTIO_LUT1, 0x01u);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}