mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
For LPC17xx MCUs, rename up_spiinitialize to lpc17_spibus_initialize
This commit is contained in:
@@ -150,7 +150,7 @@ int board_app_initialize(void)
|
|||||||
|
|
||||||
/* Get the SPI port */
|
/* Get the SPI port */
|
||||||
|
|
||||||
spi = lpc17_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
spi = lpc17_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
|
||||||
if (!spi)
|
if (!spi)
|
||||||
{
|
{
|
||||||
message("board_app_initialize: Failed to initialize SPI port %d\n",
|
message("board_app_initialize: Failed to initialize SPI port %d\n",
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Name: zkit_spiinitialize
|
* Name: zkit_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select and card detect GPIO pins for the
|
* Called to configure SPI chip select and card detect GPIO pins for the
|
||||||
@@ -102,18 +102,18 @@
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void weak_function zkit_spiinitialize(void)
|
void weak_function zkit_spidev_initialize(void)
|
||||||
{
|
{
|
||||||
/* Configure the SPI-based microSD CS and Card Detect (CD) GPIO */
|
/* Configure the SPI-based microSD CS and Card Detect (CD) GPIO */
|
||||||
|
|
||||||
spi_dumpgpio("zkit_spiinitialize() Entry)");
|
spi_dumpgpio("zkit_spidev_initialize() Entry)");
|
||||||
|
|
||||||
/* Configure card detect and chip select for the SD slot. */
|
/* Configure card detect and chip select for the SD slot. */
|
||||||
|
|
||||||
(void)lpc17_configgpio(ZKITARM_SD_CS);
|
(void)lpc17_configgpio(ZKITARM_SD_CS);
|
||||||
(void)lpc17_configgpio(ZKITARM_SD_CD);
|
(void)lpc17_configgpio(ZKITARM_SD_CD);
|
||||||
|
|
||||||
spi_dumpgpio("zkit_spiinitialize() Exit");
|
spi_dumpgpio("zkit_spidev_initialize() Exit");
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
@@ -123,7 +123,7 @@ void weak_function zkit_spiinitialize(void)
|
|||||||
* The external functions, lpc17_spiselect and lpc17_spistatus
|
* The external functions, lpc17_spiselect and lpc17_spistatus
|
||||||
* must be provided by board-specific logic. They are implementations of the select
|
* must be provided by board-specific logic. They are implementations of the select
|
||||||
* and status methods of the SPI interface defined by struct spi_ops_s (see
|
* and status methods of the SPI interface defined by struct spi_ops_s (see
|
||||||
* include/nuttx/spi/spi.h). All other methods (including up_spiinitialize())
|
* include/nuttx/spi/spi.h). All other methods (including lpc17_spibus_initialize())
|
||||||
* are provided by common LPC17xx logic. To use this common SPI logic on your
|
* are provided by common LPC17xx logic. To use this common SPI logic on your
|
||||||
* board:
|
* board:
|
||||||
*
|
*
|
||||||
@@ -132,9 +132,9 @@ void weak_function zkit_spiinitialize(void)
|
|||||||
* 2. Provide lpc17_spiselect and lpc17_spistatus functions
|
* 2. Provide lpc17_spiselect and lpc17_spistatus functions
|
||||||
* in your board-specific logic. These functions will perform chip selection
|
* in your board-specific logic. These functions will perform chip selection
|
||||||
* and status operations using GPIOs in the way your board is configured.
|
* and status operations using GPIOs in the way your board is configured.
|
||||||
* 3. Add a calls to up_spiinitialize() in your low level application
|
* 3. Add a calls to lpc17_spibus_initialize() in your low level application
|
||||||
* initialization logic
|
* initialization logic
|
||||||
* 4. The handle returned by up_spiinitialize() may then be used to bind the
|
* 4. The handle returned by lpc17_spibus_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).
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ int usbmsc_archinitialize(void)
|
|||||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||||
LPC17XX_MMCSDSPIPORTNO);
|
LPC17XX_MMCSDSPIPORTNO);
|
||||||
|
|
||||||
zkit_spiinitialize();
|
zkit_spidev_initialize();
|
||||||
spi = lpc17_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
|
spi = lpc17_spibus_initialize(LPC17XX_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",
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ void weak_function zkit_sspinitialize(void);
|
|||||||
*
|
*
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
void weak_function zkit_spiinitialize(void);
|
void weak_function zkit_spidev_initialize(void);
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H */
|
#endif /* _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user