mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Rename all tiva_spi functions to tiva_ssi
This commit is contained in:
@@ -98,32 +98,32 @@ void weak_function tm4c_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ int board_app_initialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
CONFIG_NSH_MMCSDSPIPORTNO);
|
CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = tiva_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
spi = tiva_ssibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -107,38 +107,38 @@ void weak_function lm_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
/* Assert the CS pin to the card */
|
/* Assert the CS pin to the card */
|
||||||
|
|
||||||
ssi_dumpgpio("tiva_spiselect() before tiva_gpiowrite()");
|
ssi_dumpgpio("tiva_ssiselect() before tiva_gpiowrite()");
|
||||||
tiva_gpiowrite(SDCCS_GPIO, !selected);
|
tiva_gpiowrite(SDCCS_GPIO, !selected);
|
||||||
ssi_dumpgpio("tiva_spiselect() after tiva_gpiowrite()");
|
ssi_dumpgpio("tiva_ssiselect() after tiva_gpiowrite()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -113,28 +113,28 @@ void weak_function lm_spidev_initialize(void)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
/* Assert the CS pin to the card */
|
/* Assert the CS pin to the card */
|
||||||
@@ -149,10 +149,10 @@ void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select
|
|||||||
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -109,28 +109,28 @@ void weak_function lm_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
|
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
@@ -139,10 +139,10 @@ void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select
|
|||||||
tiva_gpiowrite(SDCCS_GPIO, !selected);
|
tiva_gpiowrite(SDCCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ int board_app_initialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
CONFIG_NSH_MMCSDSPIPORTNO);
|
CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = tiva_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
spi = tiva_ssibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
|
|
||||||
/* Get the SSI port (configure as a Freescale SPI port) */
|
/* Get the SSI port (configure as a Freescale SPI port) */
|
||||||
|
|
||||||
spi = tiva_spibus_initialize(0);
|
spi = tiva_ssibus_initialize(0);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
glldbg("Failed to initialize SSI port 0\n");
|
glldbg("Failed to initialize SSI port 0\n");
|
||||||
@@ -140,7 +140,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: tiva_spicmddata
|
* Name: tiva_ssicmddata
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Set or clear the SD1329 D/Cn bit to select data (true) or command
|
* Set or clear the SD1329 D/Cn bit to select data (true) or command
|
||||||
@@ -162,7 +162,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int tiva_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
int tiva_ssicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||||
{
|
{
|
||||||
if (devid == SPIDEV_DISPLAY)
|
if (devid == SPIDEV_DISPLAY)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: tiva_spidev_initialize
|
* Name: tiva_ssidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
* Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit.
|
||||||
@@ -114,28 +114,28 @@ void weak_function lm_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
|
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
@@ -151,10 +151,10 @@ void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select
|
|||||||
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ int board_app_initialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
CONFIG_NSH_MMCSDSPIPORTNO);
|
CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
spi = tiva_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
spi = tiva_ssibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
|
|
||||||
/* Get the SSI port (configure as a Freescale SPI port) */
|
/* Get the SSI port (configure as a Freescale SPI port) */
|
||||||
|
|
||||||
spi = tiva_spibus_initialize(0);
|
spi = tiva_ssibus_initialize(0);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
glldbg("Failed to initialize SSI port 0\n");
|
glldbg("Failed to initialize SSI port 0\n");
|
||||||
@@ -137,7 +137,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: tiva_spicmddata
|
* Name: tiva_ssicmddata
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Set or clear the SD1329 D/Cn bit to select data (true) or command
|
* Set or clear the SD1329 D/Cn bit to select data (true) or command
|
||||||
@@ -159,7 +159,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int tiva_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
int tiva_ssicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd)
|
||||||
{
|
{
|
||||||
if (devid == SPIDEV_DISPLAY)
|
if (devid == SPIDEV_DISPLAY)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: tiva_spidev_initialize
|
* Name: tiva_ssidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the LM3S8962 Eval Kit.
|
* Called to configure SPI chip select GPIO pins for the LM3S8962 Eval Kit.
|
||||||
@@ -114,28 +114,28 @@ void weak_function lm_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
|
|
||||||
if (devid == SPIDEV_MMCSD)
|
if (devid == SPIDEV_MMCSD)
|
||||||
{
|
{
|
||||||
@@ -151,10 +151,10 @@ void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool select
|
|||||||
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
tiva_gpiowrite(OLEDCS_GPIO, !selected);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -99,32 +99,32 @@ void weak_function lm4f_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
@@ -98,32 +98,32 @@ void weak_function tm4c_spidev_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* The external functions, tiva_spiselect and tiva_spistatus must be provided
|
* The external functions, tiva_ssiselect and tiva_ssistatus must be provided
|
||||||
* by board-specific logic. The are implementations of the select and status
|
* by board-specific logic. The are implementations of the select and status
|
||||||
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
* methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All othermethods (including tiva_spibus_initialize()) are provided by common
|
* All othermethods (including tiva_ssibus_initialize()) are provided by common
|
||||||
* logic. To use this common SPI logic on your board:
|
* logic. To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide tiva_spiselect() and tiva_spistatus() functions in your
|
* 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your
|
||||||
* board-specific logic. This function will perform chip selection and
|
* board-specific logic. This function will perform chip selection and
|
||||||
* status operations using GPIOs in the way your board is configured.
|
* status operations using GPIOs in the way your board is configured.
|
||||||
* 2. Add a call to tiva_spibus_initialize() in your low level initialization
|
* 2. Add a call to tiva_ssibus_initialize() in your low level initialization
|
||||||
* logic
|
* logic
|
||||||
* 3. The handle returned by tiva_spibus_initialize() may then be used to bind the
|
* 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the
|
||||||
* SPI driver to higher level logic (e.g., calling
|
* SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void tiva_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
void tiva_ssiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
|
||||||
{
|
{
|
||||||
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
ssidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||||
ssi_dumpgpio("tiva_spiselect() Entry");
|
ssi_dumpgpio("tiva_ssiselect() Entry");
|
||||||
ssi_dumpgpio("tiva_spiselect() Exit");
|
ssi_dumpgpio("tiva_ssiselect() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t tiva_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
uint8_t tiva_ssistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
|
||||||
{
|
{
|
||||||
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
ssidbg("Returning SPI_STATUS_PRESENT\n");
|
||||||
return SPI_STATUS_PRESENT;
|
return SPI_STATUS_PRESENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user