Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

void gpio_spi_active ( int  cspi_mod  ) 

Setup GPIO for a CSPI device to be active

Parameters:
cspi_mod an CSPI device

Definition at line 183 of file mx37_3stack_gpio.c.

References IOMUX_CONFIG_ALT0, IOMUX_CONFIG_ALT3, mxc_iomux_set_pad(), and mxc_request_iomux().

{
      switch (cspi_mod) {
      case 0:
            break;
      case 1:
            /* SPI2 */
            mxc_request_iomux(MX37_PIN_CSPI2_MISO, IOMUX_CONFIG_ALT0);
            mxc_iomux_set_pad(MX37_PIN_CSPI2_MISO, PAD_CTL_SRE_FAST);
            mxc_iomux_set_pad(MX37_PIN_GRP_H9, PAD_CTL_HYS_ENABLE);

            mxc_request_iomux(MX37_PIN_CSPI2_MOSI, IOMUX_CONFIG_ALT0);
            mxc_iomux_set_pad(MX37_PIN_CSPI2_MOSI, PAD_CTL_SRE_FAST);

            mxc_request_iomux(MX37_PIN_UART1_CTS, IOMUX_CONFIG_ALT3);
            mxc_iomux_set_pad(MX37_PIN_UART1_CTS, PAD_CTL_HYS_ENABLE |
                          PAD_CTL_PKE_ENABLE);

            mxc_request_iomux(MX37_PIN_CSPI2_SCLK, IOMUX_CONFIG_ALT0);
            mxc_iomux_set_pad(MX37_PIN_CSPI2_SCLK, PAD_CTL_HYS_ENABLE |
                          PAD_CTL_SRE_FAST);

            mxc_request_iomux(MX37_PIN_CSPI2_SS1, IOMUX_CONFIG_ALT0);
            mxc_iomux_set_pad(MX37_PIN_CSPI2_SS1, PAD_CTL_SRE_FAST);

            mxc_request_iomux(MX37_PIN_CSPI2_SS0, IOMUX_CONFIG_ALT0);
            mxc_iomux_set_pad(MX37_PIN_CSPI2_SS0, PAD_CTL_SRE_FAST);
            mxc_iomux_set_pad(MX37_PIN_GRP_H10, PAD_CTL_HYS_ENABLE);
            break;
      case 2:
            break;
      default:
            break;
      }
}


Generated by  Doxygen 1.6.0   Back to index