示例#1
0
文件: up_ssp.c 项目: 1015472/PX4NuttX
void weak_function nucleus2g_sspinitialize(void)
{
  /* Configure the SPI-based microSD CS GPIO */

  ssp_dumpgpio("nucleus2g_sspinitialize() Entry)");

  /* SSP0 connects only to the MMC/SD slot on the Nucleus 1G board.
   * P0[15]/TXD1/SCK0/SCK              MMC_CLK
   * P0[16]/RXD1/SSEL0/SSEL            MMC_CD
   * P0[17]/CTS1/MISO0/MISO            MMC_DATA0
   * P0[18]/DCD1/MOSI0/MOSI            MMC_MISO
   *
   * In SPI mode the MMC/SD DATA3/CD functions as the SPI chip select.
   */

#ifdef CONFIG_LPC17_SSP0
  lpc17_configgpio(NUCLEUS2G_MMCSD_CS);
#endif
  
  /* SSP1 goes off the Nucleus 2G board to the Babel CAN board along with 3 chip
   * select pins.  However, it is currently not used on that board.
   */

#ifdef CONFIG_LPC17_SSP1
# warning "SSP1 chip selects not known"
#endif
  ssp_dumpgpio("nucleus2g_sspinitialize() Exit");
}
示例#2
0
void weak_function lpcxpresso_sspdev_initialize(void)
{
  /* Configure the SPI-based microSD CS GPIO */

  ssp_dumpgpio("lpcxpresso_sspdev_initialize() Entry)");

  /* Configure card detect and chip select for the SD slot.  NOTE:  Jumper J55 must
   * be set correctly for the SD slot chip select.
   */

#ifdef CONFIG_LPC17_SSP1
  (void)lpc17_configgpio(LPCXPRESSO_SD_CS);
  (void)lpc17_configgpio(LPCXPRESSO_SD_CD);

  /* Configure chip select for the OLED. For the SPI interface, insert jumpers in
   * J42, J43, J45 pin1-2 and J46 pin 1-2.
   */

#ifdef CONFIG_NX_LCDDRIVER
  (void)lpc17_configgpio(LPCXPRESSO_OLED_CS);
#endif
#endif

  ssp_dumpgpio("lpcxpresso_sspdev_initialize() Exit");
}
示例#3
0
void  lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
  sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
  ssp_dumpgpio("lpc17_spi1select() Entry");

#warning "Assert CS here (false)"

  ssp_dumpgpio("lpc17_spi1select() Exit");
}
示例#4
0
文件: up_ssp.c 项目: 1015472/PX4NuttX
void  lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
  sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
  ssp_dumpgpio("lpc17_ssp0select() Entry");

  if (devid == SPIDEV_MMCSD)
    {
      /* Assert the CS pin to the card */

      lpc17_gpiowrite(NUCLEUS2G_MMCSD_CS, !selected);
    }
  ssp_dumpgpio("lpc17_ssp0select() Exit");
}
示例#5
0
void  lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
  sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
  ssp_dumpgpio("lpc17_spi0select() Entry");

#ifdef CONFIG_NX_LCDDRIVER
  if (devid == SPIDEV_DISPLAY)
    {
      /* Assert the CS pin to the OLED display */

      (void)lpc17_gpiowrite(ZKITARM_OLED_CS, !selected);
    }
#endif

  ssp_dumpgpio("lpc17_spi0select() Exit");
}
示例#6
0
void weak_function zkit_sspinitialize(void)
{
  /* Configure the SPI-based LCD CS GPIO */

  ssp_dumpgpio("zkit_sspinitialize() Entry)");

  /* Configure chip select for the LCD. */

#ifdef CONFIG_LPC17_SSP0
#ifdef CONFIG_NX_LCDDRIVER
  (void)lpc17_configgpio(ZKITARM_OLED_CS);
#endif
#endif /* CONFIG_LPC17_SSP0 */

  ssp_dumpgpio("zkit_sspinitialize() Exit");
}
示例#7
0
void  lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{
  sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
  ssp_dumpgpio("lpc17_ssp1select() Entry");

  if (devid == SPIDEV_MMCSD)
    {
      /* Assert/de-assert the CS pin to the card */

      (void)lpc17_gpiowrite(LPCXPRESSO_SD_CS, !selected);
    }
#ifdef CONFIG_NX_LCDDRIVER
  else if (devid == SPIDEV_DISPLAY)
    {
      /* Assert the CS pin to the OLED display */

      (void)lpc17_gpiowrite(LPCXPRESSO_OLED_CS, !selected);
    }
#endif
  ssp_dumpgpio("lpc17_ssp1select() Exit");
}