Initialization Functions

group group_smartio_functions_init

Functions

cy_en_smartio_status_t Cy_SmartIO_Init(SMARTIO_PRT_Type *base, const cy_stc_smartio_config_t *config)

Initializes the Smart I/O.

Return

Status of the initialization operation

Function Usage


    #define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8

    const cy_stc_smartio_lutcfg_t ioss_0_port_8_smartio_0_lutCfg0 = 
    {
        .tr0 = CY_SMARTIO_LUTTR_IO1,
        .tr1 = CY_SMARTIO_LUTTR_IO1,
        .tr2 = CY_SMARTIO_LUTTR_IO1,
        .opcode = CY_SMARTIO_LUTOPC_COMB,
        .lutMap = 1u,
    };
    
    const cy_stc_smartio_config_t ioss_0_port_8_smartio_0_config = 
    {
        .clkSrc = CY_SMARTIO_CLK_ASYNC,
        .bypassMask = CY_SMARTIO_CHANNEL4|CY_SMARTIO_CHANNEL5|CY_SMARTIO_CHANNEL6|CY_SMARTIO_CHANNEL7,
        .ioSyncEn = 0u|0u|0u|0u|0u|0u|0u|0u,
        .chipSyncEn = 0u|0u|0u|0u|0u|0u|0u|0u,
        .lutCfg0 = &ioss_0_port_8_smartio_0_lutCfg0,
        .lutCfg1 = NULL,
        .lutCfg2 = NULL,
        .lutCfg3 = NULL,
        .lutCfg4 = NULL,
        .lutCfg5 = NULL,
        .lutCfg6 = NULL,
        .lutCfg7 = NULL,
        .duCfg = NULL,
        .hldOvr = false,
    };

    /* Scenario: Initialize Smart I/O block 8 to invert the input signal on pin 0 
        and drive it back out to pin 1. GPIO P8.0 and P8.1 are already configured to
        be digital input and digital output respectively. */
    
    /* Configure the CM0+ bus master - privileged, secure, allow setting PC to PC=1 and PC=2 */
    if(CY_SMARTIO_SUCCESS != Cy_SmartIO_Init(SMARTIO_PRT8, &ioss_0_port_8_smartio_0_config))
    {
        /* Insert error handling */
    }
    
    /* Enable Smart I/O block 8 */
    Cy_SmartIO_Enable(SMARTIO_PRT8);

Parameters
  • base: Pointer to the Smart I/O base address

  • config: Pointer to the Smart I/O configuration structure

void Cy_SmartIO_Deinit(SMARTIO_PRT_Type *base)

Resets the Smart I/O to default values.

Function Usage


    #define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
    
    /* Scenario: Smart I/O block 8 configuration needs to be reverted to its
       default values. */
       
    Cy_SmartIO_Disable(SMARTIO_PRT8);   
    Cy_SmartIO_Deinit(SMARTIO_PRT8);

Parameters
  • base: Pointer to the Smart I/O base address

void Cy_SmartIO_Enable(SMARTIO_PRT_Type *base)

Enables the Smart I/O.

Function Usage


    /* Refer to the Cy_SmartIO_Init() function usage example */

Parameters
  • base: Pointer to the Smart I/O base address

void Cy_SmartIO_Disable(SMARTIO_PRT_Type *base)

Disables the Smart I/O.

Function Usage


    #define ioss_0_port_8_smartio_0_HW SMARTIO_PRT8
    
    /* Scenario: Smart I/O block 8 needs to be reconfigured to be driven by the
        low-frequency clock. It must first be disabled, reconfigured and enabled. */
    
    Cy_SmartIO_Disable(SMARTIO_PRT8);
    Cy_SmartIO_SetClock(SMARTIO_PRT8, CY_SMARTIO_CLK_LFCLK);
    Cy_SmartIO_Enable(SMARTIO_PRT8);

Parameters
  • base: Pointer to the Smart I/O base address