Ejemplo n.º 1
0
/*******************************************************************************
* Function Name: ModbusUART_SetPins
********************************************************************************
*
* Summary:
*  Sets the pins settings accordingly to the selected operation mode.
*  Only available in the Unconfigured operation mode. The mode specific
*  initialization function calls it.
*  Pins configuration is set by PSoC Creator when a specific mode of operation
*  is selected in design time.
*
* Parameters:
*  mode:      Mode of SCB operation.
*  subMode:   Sub-mode of SCB operation. It is only required for SPI and UART
*             modes.
*  uartEnableMask: enables TX or RX direction and RTS and CTS signals.
*
* Return:
*  None
*
*******************************************************************************/
void ModbusUART_SetPins(uint32 mode, uint32 subMode, uint32 uartEnableMask)
{
    uint32 hsiomSel [ModbusUART_SCB_PINS_NUMBER];
    uint32 pinsDm   [ModbusUART_SCB_PINS_NUMBER];

#if (!ModbusUART_CY_SCBIP_V1)
    uint32 pinsInBuf = 0u;
#endif /* (!ModbusUART_CY_SCBIP_V1) */

    uint32 i;

    /* Set default HSIOM to GPIO and Drive Mode to Analog Hi-Z */
    for(i = 0u; i < ModbusUART_SCB_PINS_NUMBER; i++)
    {
        hsiomSel[i]  = ModbusUART_HSIOM_DEF_SEL;
        pinsDm[i]    = ModbusUART_PIN_DM_ALG_HIZ;
    }

    if((ModbusUART_SCB_MODE_I2C   == mode) ||
            (ModbusUART_SCB_MODE_EZI2C == mode))
    {
        hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_I2C_SEL;
        hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_I2C_SEL;

        pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
        pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
    }
#if (!ModbusUART_CY_SCBIP_V1)
    else if(ModbusUART_SCB_MODE_SPI == mode)
    {
        hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
        hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
        hsiomSel[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_HSIOM_SPI_SEL;

        if(ModbusUART_SPI_SLAVE == subMode)
        {
            /* Slave */
            pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
            pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsDm[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_PIN_DM_DIG_HIZ;

#if(ModbusUART_SS0_PIN)
            /* Only SS0 is valid choice for Slave */
            hsiomSel[ModbusUART_SS0_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            pinsDm  [ModbusUART_SS0_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
#endif /* (ModbusUART_SS1_PIN) */

#if(ModbusUART_MISO_SDA_TX_PIN)
            /* Disable input buffer */
            pinsInBuf |= ModbusUART_MISO_SDA_TX_PIN_MASK;
#endif /* (ModbusUART_MISO_SDA_TX_PIN_PIN) */
        }
        else /* (Master) */
        {
            pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
            pinsDm[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_PIN_DM_STRONG;

#if(ModbusUART_SS0_PIN)
            hsiomSel [ModbusUART_SS0_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            pinsDm   [ModbusUART_SS0_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsInBuf                                |= ModbusUART_SS0_PIN_MASK;
#endif /* (ModbusUART_SS0_PIN) */

#if(ModbusUART_SS1_PIN)
            hsiomSel [ModbusUART_SS1_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            pinsDm   [ModbusUART_SS1_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsInBuf                                |= ModbusUART_SS1_PIN_MASK;
#endif /* (ModbusUART_SS1_PIN) */

#if(ModbusUART_SS2_PIN)
            hsiomSel [ModbusUART_SS2_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            pinsDm   [ModbusUART_SS2_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsInBuf                                |= ModbusUART_SS2_PIN_MASK;
#endif /* (ModbusUART_SS2_PIN) */

#if(ModbusUART_SS3_PIN)
            hsiomSel [ModbusUART_SS3_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            pinsDm   [ModbusUART_SS3_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            pinsInBuf                                |= ModbusUART_SS3_PIN_MASK;
#endif /* (ModbusUART_SS2_PIN) */

            /* Disable input buffers */
#if(ModbusUART_MOSI_SCL_RX_PIN)
            pinsInBuf |= ModbusUART_MOSI_SCL_RX_PIN_MASK;
#endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

#if(ModbusUART_MOSI_SCL_RX_WAKE_PIN)
            pinsInBuf |= ModbusUART_MOSI_SCL_RX_WAKE_PIN_MASK;
#endif /* (ModbusUART_MOSI_SCL_RX_WAKE_PIN) */

#if(ModbusUART_SCLK_PIN)
            pinsInBuf |= ModbusUART_SCLK_PIN_MASK;
#endif /* (ModbusUART_SCLK_PIN) */
        }
    }
    else /* UART */
    {
        if(ModbusUART_UART_MODE_SMARTCARD == subMode)
        {
            /* SmartCard */
            hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
            pinsDm  [ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
        }
        else /* Standard or IrDA */
        {
            if(0u != (ModbusUART_UART_RX_PIN_ENABLE & uartEnableMask))
            {
                hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                pinsDm  [ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
            }

            if(0u != (ModbusUART_UART_TX_PIN_ENABLE & uartEnableMask))
            {
                hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                pinsDm  [ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;

#if(ModbusUART_MISO_SDA_TX_PIN)
                pinsInBuf |= ModbusUART_MISO_SDA_TX_PIN_MASK;
#endif /* (ModbusUART_MISO_SDA_TX_PIN_PIN) */
            }

#if !(ModbusUART_CY_SCBIP_V0 || ModbusUART_CY_SCBIP_V1)
            if(ModbusUART_UART_MODE_STD == subMode)
            {
                if(0u != (ModbusUART_UART_CTS_PIN_ENABLE & uartEnableMask))
                {
                    /* CTS input is multiplexed with SCLK */
                    hsiomSel[ModbusUART_SCLK_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                    pinsDm  [ModbusUART_SCLK_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
                }

                if(0u != (ModbusUART_UART_RTS_PIN_ENABLE & uartEnableMask))
                {
                    /* RTS output is multiplexed with SS0 */
                    hsiomSel[ModbusUART_SS0_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                    pinsDm  [ModbusUART_SS0_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;

#if(ModbusUART_SS0_PIN)
                    /* Disable input buffer */
                    pinsInBuf |= ModbusUART_SS0_PIN_MASK;
#endif /* (ModbusUART_SS0_PIN) */
                }
            }
#endif /* !(ModbusUART_CY_SCBIP_V0 || ModbusUART_CY_SCBIP_V1) */
        }
    }
#endif /* (!ModbusUART_CY_SCBIP_V1) */

    /* Configure pins: set HSIOM, DM and InputBufEnable */
    /* Note: the DR register settings do not effect the pin output if HSIOM is other than GPIO */

#if(ModbusUART_MOSI_SCL_RX_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_MOSI_SCL_RX_HSIOM_REG,
                             ModbusUART_MOSI_SCL_RX_HSIOM_MASK,
                             ModbusUART_MOSI_SCL_RX_HSIOM_POS,
                             hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX]);

    ModbusUART_spi_mosi_i2c_scl_uart_rx_SetDriveMode((uint8) pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX]);

#if (!ModbusUART_CY_SCBIP_V1)
    ModbusUART_SET_INP_DIS(ModbusUART_spi_mosi_i2c_scl_uart_rx_INP_DIS,
                           ModbusUART_spi_mosi_i2c_scl_uart_rx_MASK,
                           (0u != (pinsInBuf & ModbusUART_MOSI_SCL_RX_PIN_MASK)));
#endif /* (!ModbusUART_CY_SCBIP_V1) */
#endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

#if(ModbusUART_MOSI_SCL_RX_WAKE_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_REG,
                             ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_MASK,
                             ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_POS,
                             hsiomSel[ModbusUART_MOSI_SCL_RX_WAKE_PIN_INDEX]);

    ModbusUART_spi_mosi_i2c_scl_uart_rx_wake_SetDriveMode((uint8)
            pinsDm[ModbusUART_MOSI_SCL_RX_WAKE_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_mosi_i2c_scl_uart_rx_wake_INP_DIS,
                           ModbusUART_spi_mosi_i2c_scl_uart_rx_wake_MASK,
                           (0u != (pinsInBuf & ModbusUART_MOSI_SCL_RX_WAKE_PIN_MASK)));

    /* Set interrupt on falling edge */
    ModbusUART_SET_INCFG_TYPE(ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_REG,
                              ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_TYPE_MASK,
                              ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_TYPE_POS,
                              ModbusUART_INTCFG_TYPE_FALLING_EDGE);
#endif /* (ModbusUART_MOSI_SCL_RX_WAKE_PIN) */

#if(ModbusUART_MISO_SDA_TX_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_MISO_SDA_TX_HSIOM_REG,
                             ModbusUART_MISO_SDA_TX_HSIOM_MASK,
                             ModbusUART_MISO_SDA_TX_HSIOM_POS,
                             hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX]);

    ModbusUART_spi_miso_i2c_sda_uart_tx_SetDriveMode((uint8) pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX]);

#if (!ModbusUART_CY_SCBIP_V1)
    ModbusUART_SET_INP_DIS(ModbusUART_spi_miso_i2c_sda_uart_tx_INP_DIS,
                           ModbusUART_spi_miso_i2c_sda_uart_tx_MASK,
                           (0u != (pinsInBuf & ModbusUART_MISO_SDA_TX_PIN_MASK)));
#endif /* (!ModbusUART_CY_SCBIP_V1) */
#endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

#if(ModbusUART_SCLK_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_SCLK_HSIOM_REG, ModbusUART_SCLK_HSIOM_MASK,
                             ModbusUART_SCLK_HSIOM_POS, hsiomSel[ModbusUART_SCLK_PIN_INDEX]);

    ModbusUART_spi_sclk_SetDriveMode((uint8) pinsDm[ModbusUART_SCLK_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_sclk_INP_DIS,
                           ModbusUART_spi_sclk_MASK,
                           (0u != (pinsInBuf & ModbusUART_SCLK_PIN_MASK)));
#endif /* (ModbusUART_SCLK_PIN) */

#if(ModbusUART_SS0_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_SS0_HSIOM_REG, ModbusUART_SS0_HSIOM_MASK,
                             ModbusUART_SS0_HSIOM_POS, hsiomSel[ModbusUART_SS0_PIN_INDEX]);

    ModbusUART_spi_ss0_SetDriveMode((uint8) pinsDm[ModbusUART_SS0_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_ss0_INP_DIS,
                           ModbusUART_spi_ss0_MASK,
                           (0u != (pinsInBuf & ModbusUART_SS0_PIN_MASK)));
#endif /* (ModbusUART_SS1_PIN) */

#if(ModbusUART_SS1_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_SS1_HSIOM_REG, ModbusUART_SS1_HSIOM_MASK,
                             ModbusUART_SS1_HSIOM_POS, hsiomSel[ModbusUART_SS1_PIN_INDEX]);

    ModbusUART_spi_ss1_SetDriveMode((uint8) pinsDm[ModbusUART_SS1_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_ss1_INP_DIS,
                           ModbusUART_spi_ss1_MASK,
                           (0u != (pinsInBuf & ModbusUART_SS1_PIN_MASK)));
#endif /* (ModbusUART_SS1_PIN) */

#if(ModbusUART_SS2_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_SS2_HSIOM_REG, ModbusUART_SS2_HSIOM_MASK,
                             ModbusUART_SS2_HSIOM_POS, hsiomSel[ModbusUART_SS2_PIN_INDEX]);

    ModbusUART_spi_ss2_SetDriveMode((uint8) pinsDm[ModbusUART_SS2_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_ss2_INP_DIS,
                           ModbusUART_spi_ss2_MASK,
                           (0u != (pinsInBuf & ModbusUART_SS2_PIN_MASK)));
#endif /* (ModbusUART_SS2_PIN) */

#if(ModbusUART_SS3_PIN)
    ModbusUART_SET_HSIOM_SEL(ModbusUART_SS3_HSIOM_REG,  ModbusUART_SS3_HSIOM_MASK,
                             ModbusUART_SS3_HSIOM_POS, hsiomSel[ModbusUART_SS3_PIN_INDEX]);

    ModbusUART_spi_ss3_SetDriveMode((uint8) pinsDm[ModbusUART_SS3_PIN_INDEX]);

    ModbusUART_SET_INP_DIS(ModbusUART_spi_ss3_INP_DIS,
                           ModbusUART_spi_ss3_MASK,
                           (0u != (pinsInBuf & ModbusUART_SS3_PIN_MASK)));
#endif /* (ModbusUART_SS3_PIN) */
}
    /*******************************************************************************
    * Function Name: ModbusUART_SetPins
    ********************************************************************************
    *
    * Summary:
    *  Sets pins settings accordingly to selected operation mode.
    *  Only available in Unconfigured operation mode. The mode specific
    *  initialization function calls it.
    *  Pins configuration is set by PSoC Creator when specific mode of operation
    *  selected in design time.
    *
    * Parameters:
    *  mode:      Mode of SCB operation.
    *  subMode:   Submode of SCB operation. It is only required for SPI and UART
    *             modes.
    *  uartTxRx:  Direction for UART.
    *
    * Return:
    *  None
    *
    *******************************************************************************/
    void ModbusUART_SetPins(uint32 mode, uint32 subMode, uint32 uartTxRx)
    {
        uint32 hsiomSel[ModbusUART_SCB_PINS_NUMBER];
        uint32 pinsDm  [ModbusUART_SCB_PINS_NUMBER];
        uint32 i;

        /* Make all unused */
        for(i = 0u; i < ModbusUART_SCB_PINS_NUMBER; i++)
        {
            hsiomSel[i] = ModbusUART_HSIOM_DEF_SEL;
            pinsDm[i]   = ModbusUART_PIN_DM_ALG_HIZ;
        }

        /* Choice the Dm and HSIOM */
        if((ModbusUART_SCB_MODE_I2C   == mode) ||
           (ModbusUART_SCB_MODE_EZI2C == mode))
        {
            hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_I2C_SEL;
            hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_I2C_SEL;

            pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
            pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
        }
        else if(ModbusUART_SCB_MODE_SPI == mode)
        {
            hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
            hsiomSel[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_HSIOM_SPI_SEL;

            if(ModbusUART_SPI_SLAVE == subMode)
            {
                /* Slave */
                pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
                pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
                pinsDm[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_PIN_DM_DIG_HIZ;

            #if(ModbusUART_SS0_PIN)
                /* Only SS0 is valid choice for Slave */
                hsiomSel[ModbusUART_SS0_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
                pinsDm  [ModbusUART_SS0_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
            #endif /* (ModbusUART_SS1_PIN) */
            }
            else /* (Master) */
            {
                pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
                pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
                pinsDm[ModbusUART_SCLK_PIN_INDEX]        = ModbusUART_PIN_DM_STRONG;

            #if(ModbusUART_SS0_PIN)
                hsiomSel[ModbusUART_SS0_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
                pinsDm  [ModbusUART_SS0_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            #endif /* (ModbusUART_SS0_PIN) */

            #if(ModbusUART_SS1_PIN)
                hsiomSel[ModbusUART_SS1_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
                pinsDm  [ModbusUART_SS1_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            #endif /* (ModbusUART_SS1_PIN) */

            #if(ModbusUART_SS2_PIN)
                hsiomSel[ModbusUART_SS2_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
                pinsDm  [ModbusUART_SS2_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            #endif /* (ModbusUART_SS2_PIN) */

            #if(ModbusUART_SS3_PIN)
                hsiomSel[ModbusUART_SS3_PIN_INDEX] = ModbusUART_HSIOM_SPI_SEL;
                pinsDm  [ModbusUART_SS3_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
            #endif /* (ModbusUART_SS2_PIN) */
            }
        }
        else /* UART */
        {
            if(ModbusUART_UART_MODE_SMARTCARD == subMode)
            {
                /* SmartCard */
                hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                pinsDm  [ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_OD_LO;
            }
            else /* Standard or IrDA */
            {
                if(0u != (ModbusUART_UART_RX & uartTxRx))
                {
                    hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                    pinsDm  [ModbusUART_MOSI_SCL_RX_PIN_INDEX] = ModbusUART_PIN_DM_DIG_HIZ;
                }

                if(0u != (ModbusUART_UART_TX & uartTxRx))
                {
                    hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_HSIOM_UART_SEL;
                    pinsDm  [ModbusUART_MISO_SDA_TX_PIN_INDEX] = ModbusUART_PIN_DM_STRONG;
                }
            }
        }

        /* Condfigure pins: set HSIOM and DM */
        /* Condfigure pins: DR registers configuration remains unchanged for cyfitter_cfg() */

    #if(ModbusUART_MOSI_SCL_RX_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_MOSI_SCL_RX_HSIOM_REG,
                                       ModbusUART_MOSI_SCL_RX_HSIOM_MASK,
                                       ModbusUART_MOSI_SCL_RX_HSIOM_POS,
                                       hsiomSel[ModbusUART_MOSI_SCL_RX_PIN_INDEX]);
    #endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

    #if(ModbusUART_MOSI_SCL_RX_WAKE_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_REG,
                                       ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_MASK,
                                       ModbusUART_MOSI_SCL_RX_WAKE_HSIOM_POS,
                                       hsiomSel[ModbusUART_MOSI_SCL_RX_WAKE_PIN_INDEX]);
    #endif /* (ModbusUART_MOSI_SCL_RX_WAKE_PIN) */

    #if(ModbusUART_MISO_SDA_TX_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_MISO_SDA_TX_HSIOM_REG,
                                       ModbusUART_MISO_SDA_TX_HSIOM_MASK,
                                       ModbusUART_MISO_SDA_TX_HSIOM_POS,
                                       hsiomSel[ModbusUART_MISO_SDA_TX_PIN_INDEX]);
    #endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

    #if(ModbusUART_SCLK_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_SCLK_HSIOM_REG, ModbusUART_SCLK_HSIOM_MASK,
                                       ModbusUART_SCLK_HSIOM_POS, hsiomSel[ModbusUART_SCLK_PIN_INDEX]);
    #endif /* (ModbusUART_SCLK_PIN) */

    #if(ModbusUART_SS0_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_SS0_HSIOM_REG, ModbusUART_SS0_HSIOM_MASK,
                                       ModbusUART_SS0_HSIOM_POS, hsiomSel[ModbusUART_SS0_PIN_INDEX]);
    #endif /* (ModbusUART_SS1_PIN) */

    #if(ModbusUART_SS1_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_SS1_HSIOM_REG, ModbusUART_SS1_HSIOM_MASK,
                                       ModbusUART_SS1_HSIOM_POS, hsiomSel[ModbusUART_SS1_PIN_INDEX]);
    #endif /* (ModbusUART_SS1_PIN) */

    #if(ModbusUART_SS2_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_SS2_HSIOM_REG, ModbusUART_SS2_HSIOM_MASK,
                                       ModbusUART_SS2_HSIOM_POS, hsiomSel[ModbusUART_SS2_PIN_INDEX]);
    #endif /* (ModbusUART_SS2_PIN) */

    #if(ModbusUART_SS3_PIN)
        ModbusUART_SET_HSIOM_SEL(ModbusUART_SS3_HSIOM_REG,  ModbusUART_SS3_HSIOM_MASK,
                                       ModbusUART_SS3_HSIOM_POS, hsiomSel[ModbusUART_SS3_PIN_INDEX]);
    #endif /* (ModbusUART_SS3_PIN) */



    #if(ModbusUART_MOSI_SCL_RX_PIN)
        ModbusUART_spi_mosi_i2c_scl_uart_rx_SetDriveMode((uint8)
                                                               pinsDm[ModbusUART_MOSI_SCL_RX_PIN_INDEX]);
    #endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

    #if(ModbusUART_MOSI_SCL_RX_WAKE_PIN)
    ModbusUART_spi_mosi_i2c_scl_uart_rx_wake_SetDriveMode((uint8)
                                                               pinsDm[ModbusUART_MOSI_SCL_RX_WAKE_PIN_INDEX]);

    /* Set interrupt on rising edge */
    ModbusUART_SET_INCFG_TYPE(ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_REG,
                                    ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_TYPE_MASK,
                                    ModbusUART_MOSI_SCL_RX_WAKE_INTCFG_TYPE_POS,
                                    ModbusUART_INTCFG_TYPE_FALLING_EDGE);

    #endif /* (ModbusUART_MOSI_SCL_RX_WAKE_PIN) */

    #if(ModbusUART_MISO_SDA_TX_PIN)
        ModbusUART_spi_miso_i2c_sda_uart_tx_SetDriveMode((uint8)
                                                                    pinsDm[ModbusUART_MISO_SDA_TX_PIN_INDEX]);
    #endif /* (ModbusUART_MOSI_SCL_RX_PIN) */

    #if(ModbusUART_SCLK_PIN)
        ModbusUART_spi_sclk_SetDriveMode((uint8) pinsDm[ModbusUART_SCLK_PIN_INDEX]);
    #endif /* (ModbusUART_SCLK_PIN) */

    #if(ModbusUART_SS0_PIN)
        ModbusUART_spi_ss0_SetDriveMode((uint8) pinsDm[ModbusUART_SS0_PIN_INDEX]);
    #endif /* (ModbusUART_SS0_PIN) */

    #if(ModbusUART_SS1_PIN)
        ModbusUART_spi_ss1_SetDriveMode((uint8) pinsDm[ModbusUART_SS1_PIN_INDEX]);
    #endif /* (ModbusUART_SS1_PIN) */

    #if(ModbusUART_SS2_PIN)
        ModbusUART_spi_ss2_SetDriveMode((uint8) pinsDm[ModbusUART_SS2_PIN_INDEX]);
    #endif /* (ModbusUART_SS2_PIN) */

    #if(ModbusUART_SS3_PIN)
        ModbusUART_spi_ss3_SetDriveMode((uint8) pinsDm[ModbusUART_SS3_PIN_INDEX]);
    #endif /* (ModbusUART_SS3_PIN) */
    }