For eZ80 MCUs, rename up_spiinitialize to ez80_spibus_initialize

This commit is contained in:
Gregory Nutt 2016-01-27 08:39:02 -06:00
parent a9dec09444
commit f002980b50
2 changed files with 33 additions and 7 deletions

View File

@ -419,7 +419,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t bu
****************************************************************************/
/****************************************************************************
* Name: up_spiinitialize
* Name: ez80_spibus_initialize
*
* Description:
* Initialize common parts the selected SPI port. Initialization of
@ -440,7 +440,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t bu
*
****************************************************************************/
FAR struct spi_dev_s *up_spiinitialize(int port)
FAR struct spi_dev_s *ez80_spibus_initialize(int port)
{
uint8_t regval;

View File

@ -100,10 +100,35 @@ extern "C"
* Public Functions
************************************************************************************/
/* The external functions, ez80_spiselect, ez80_spistatus, ans ez80_spicmddata must
/****************************************************************************
* Name: ez80_spibus_initialize
*
* Description:
* Initialize common parts the selected SPI port. Initialization of
* chip select GPIOs must have been performed by board specific logic
* prior to calling this function. Specifically: GPIOs should have
* been configured for output, and all chip selects disabled.
*
* One GPIO, SS (PB2 on the eZ8F091) is reserved as a chip select. However,
* If multiple devices on on the bus, then multiple chip selects will be
* required. Theregore, all GPIO chip management is deferred to board-
* specific logic.
*
* Input Parameter:
* Port number (for hardware that has mutiple SPI interfaces)
*
* Returned Value:
* Valid SPI device structre reference on succcess; a NULL on failure
*
****************************************************************************/
FAR struct spi_dev_s *ez80_spibus_initialize(int port);
/************************************************************************************
* The external functions, ez80_spiselect, ez80_spistatus, ans ez80_spicmddata must
* be provided by board-specific logic. These are implementations of the select,
* status, and cmddata methods of the SPI interface defined by struct spi_ops_s (see
* include/nuttx/spi/spi.h). All other methods (including up_spiinitialize()) are
* include/nuttx/spi/spi.h). All other methods (including ez80_spibus_initialize()) are
* provided by common logic. To use this common SPI logic on your board:
*
* 1. Provide ez80_spiselect() and ez80_spistatus() functions in your board-specific
@ -113,11 +138,12 @@ extern "C"
* ez80_spiscmddata() function in your board-specific logic. This function will
* perform cmd/data selection operations using GPIOs in the way your board is
* configured.
* 3. Add a call to up_spiinitialize() in your low level initialization logic
* 4. The handle returned by up_spiinitialize() may then be used to bind the
* 3. Add a call to ez80_spibus_initialize() in your low level initialization logic
* 4. The handle returned by ez80_spibus_initialize() may then be used to bind the
* SPI driver to higher level logic (e.g., calling mmcsd_spislotinitialize(),
* for example, will bind the SPI driver to the SPI MMC/SD driver).
*/
*
************************************************************************************/
void ez80_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
uint8_t ez80_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);