MTB CAT1 Peripheral driver library
Data Unit Functions

General Description

Functions

cy_en_smartio_dutr_t Cy_SmartIO_GetDuTr (SMARTIO_PRT_Type *base, cy_en_smartio_trnum_t trNum)
 Gets the data unit input trigger source. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetDuTr (SMARTIO_PRT_Type *base, cy_en_smartio_trnum_t trNum, cy_en_smartio_dutr_t trSrc)
 Sets the data unit input trigger source. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetDuTrAll (SMARTIO_PRT_Type *base, cy_en_smartio_dutr_t trSrc)
 Sets all the data unit input trigger sources. More...
 
__STATIC_INLINE cy_en_smartio_dudata_t Cy_SmartIO_GetDuData (SMARTIO_PRT_Type *base, cy_en_smartio_datanum_t dataNum)
 Gets the data unit's input "data" source. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetDuData (SMARTIO_PRT_Type *base, cy_en_smartio_datanum_t dataNum, cy_en_smartio_dudata_t dataSrc)
 Sets the data unit's input "data" source. More...
 
__STATIC_INLINE cy_en_smartio_duopc_t Cy_SmartIO_GetDuOpc (SMARTIO_PRT_Type *base)
 Gets the data unit's opcode. More...
 
__STATIC_INLINE cy_en_smartio_dusize_t Cy_SmartIO_GetDuSize (SMARTIO_PRT_Type *base)
 Gets the data unit's opcode operand bit-width. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetDuOperation (SMARTIO_PRT_Type *base, cy_en_smartio_duopc_t opcode, cy_en_smartio_dusize_t size)
 Sets the data unit's opcode and operand bit-width. More...
 
__STATIC_INLINE uint8_t Cy_SmartIO_GetDataReg (SMARTIO_PRT_Type *base)
 Gets the data unit's DATA register value. More...
 
cy_en_smartio_status_t Cy_SmartIO_SetDataReg (SMARTIO_PRT_Type *base, uint8_t dataReg)
 Sets the data unit's DATA register value. More...
 

Function Documentation

◆ Cy_SmartIO_GetDuTr()

cy_en_smartio_dutr_t Cy_SmartIO_GetDuTr ( SMARTIO_PRT_Type *  base,
cy_en_smartio_trnum_t  trNum 
)

Gets the data unit input trigger source.

Parameters
basePointer to the Smart I/O base address
trNumInput trigger number
Returns
Data unit input trigger source
Function Usage
/* Refer to the Cy_SmartIO_SetDuTr function usage example */

◆ Cy_SmartIO_SetDuTr()

cy_en_smartio_status_t Cy_SmartIO_SetDuTr ( SMARTIO_PRT_Type *  base,
cy_en_smartio_trnum_t  trNum,
cy_en_smartio_dutr_t  trSrc 
)

Sets the data unit input trigger source.

Parameters
basePointer to the Smart I/O base address
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 DU TR1 needs to be updated to be sourced
from LUT1 output */
duTr = Cy_SmartIO_GetDuTr(SMARTIO_PRT8, CY_SMARTIO_TR1);
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}

◆ Cy_SmartIO_SetDuTrAll()

cy_en_smartio_status_t Cy_SmartIO_SetDuTrAll ( SMARTIO_PRT_Type *  base,
cy_en_smartio_dutr_t  trSrc 
)

Sets all the data unit input trigger sources.

Parameters
basePointer to the Smart I/O base address
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 DU TR0, TR1 and TR2 need to be updated to be
sourced from LUT1 output */
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);

◆ Cy_SmartIO_GetDuData()

__STATIC_INLINE cy_en_smartio_dudata_t Cy_SmartIO_GetDuData ( SMARTIO_PRT_Type *  base,
cy_en_smartio_datanum_t  dataNum 
)

Gets the data unit's input "data" source.

Parameters
basePointer to the Smart I/O base address
dataNumInput data number
Returns
Data unit input trigger source
Function Usage
/* Refer to the Cy_SmartIO_SetDuData function usage example */

◆ Cy_SmartIO_SetDuData()

cy_en_smartio_status_t Cy_SmartIO_SetDuData ( SMARTIO_PRT_Type *  base,
cy_en_smartio_datanum_t  dataNum,
cy_en_smartio_dudata_t  dataSrc 
)

Sets the data unit's input "data" source.

Parameters
basePointer to the Smart I/O base address
dataNumInput data number
dataSrcData unit input 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 DU DATA0 needs to be sourced by the values
stored in DU DATAREG */
duSrc = Cy_SmartIO_GetDuData(SMARTIO_PRT8, CY_SMARTIO_DATA0);
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}

◆ Cy_SmartIO_GetDuOpc()

__STATIC_INLINE cy_en_smartio_duopc_t Cy_SmartIO_GetDuOpc ( SMARTIO_PRT_Type *  base)

Gets the data unit's opcode.

Parameters
basePointer to the Smart I/O base address
Returns
Data unit opcode
Function Usage
/* Refer to the Cy_SmartIO_SetDuOperation function usage example */

◆ Cy_SmartIO_GetDuSize()

__STATIC_INLINE cy_en_smartio_dusize_t Cy_SmartIO_GetDuSize ( SMARTIO_PRT_Type *  base)

Gets the data unit's opcode operand bit-width.

Parameters
basePointer to the Smart I/O base address
Returns
Data unit operand bit-width
Function Usage
/* Refer to the Cy_SmartIO_SetDuOperation function usage example */

◆ Cy_SmartIO_SetDuOperation()

cy_en_smartio_status_t Cy_SmartIO_SetDuOperation ( SMARTIO_PRT_Type *  base,
cy_en_smartio_duopc_t  opcode,
cy_en_smartio_dusize_t  size 
)

Sets the data unit's opcode and operand bit-width.

Parameters
basePointer to the Smart I/O base address
opcodeData Unit opcode
sizeData unit operand bit-width
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 DU opcode needs to be updated to 8-bit wrapping
increment and decrement counter mode. */
opcode = Cy_SmartIO_GetDuOpc(SMARTIO_PRT8);
size = Cy_SmartIO_GetDuSize(SMARTIO_PRT8);
if((opcode != CY_SMARTIO_DUOPC_INCR_WRAP) && (size != CY_SMARTIO_DUSIZE_8))
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}

◆ Cy_SmartIO_GetDataReg()

__STATIC_INLINE uint8_t Cy_SmartIO_GetDataReg ( SMARTIO_PRT_Type *  base)

Gets the data unit's DATA register value.

Parameters
basePointer to the Smart I/O base address
Returns
DATA register value
Function Usage
/* Refer to the Cy_SmartIO_SetDataReg function usage example */

◆ Cy_SmartIO_SetDataReg()

cy_en_smartio_status_t Cy_SmartIO_SetDataReg ( SMARTIO_PRT_Type *  base,
uint8_t  dataReg 
)

Sets the data unit's DATA register value.

Parameters
basePointer to the Smart I/O base address
dataRegDATA register value
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 DU DATAREG needs to be updated to 0xFF */
uint8_t dataReg;
dataReg = Cy_SmartIO_GetDataReg(SMARTIO_PRT8);
if(dataReg != 0xFFu)
{
Cy_SmartIO_Disable(SMARTIO_PRT8);
Cy_SmartIO_SetDataReg(SMARTIO_PRT8, 0xFFu);
Cy_SmartIO_Enable(SMARTIO_PRT8);
}