Add the prototype for up_spi_slave_initialize() to the SPI slave interface header file

This commit is contained in:
Gregory Nutt 2015-08-09 17:42:47 -06:00
parent 17fab9dbd5
commit 21d4f00e65
3 changed files with 26 additions and 8 deletions

2
arch

@ -1 +1 @@
Subproject commit 98596b23794fafd7a25d7da1f3a5748ee53b47cd
Subproject commit 1efba67cba08b28a2a4a1a4649daf2df93b2d596

View File

@ -263,12 +263,13 @@
* slave device and the SPI slave controller hardware. This interface
* is implemented by the SPI slave device controller lower-half driver
* and is provided to the the SPI slave device driver when that driver
* is initialized. That SPI slave device initialization function might
* look something like:
* is initialized. That SPI slave device initialization function has
* the prototype:
*
* int xyz_dev_initialize(FAR struct spi_sctrlr_s *sctrlr);
* FAR struct spi_sctrlr_s *up_spi_slave_initialize(int port);
*
* where xyz is replaced with the SPI device name.
* Given an SPI port number, this function returns an instance of the
* SPI slave controller interface.
*
* 2) struct spi_sdev_s: Defines the second interface between the SPI
* slave device and the SPI slave controller hardware. This interface
@ -282,7 +283,7 @@
* 1) Board-specific logic calls board- or chip-specific logic to create an
* instance of the SPI slave controller interface, struct spi_sctrlr_s.
*
* 2) Board-specific logic then calls xyz_dev_initialize() to initialize
* 2) Board-specific logic then calls up_dev_initialize() to initialize
* the SPI slave device. The board-specific logic passes the instance
* of struct spi_sctrlr_s to support the initialization.
*
@ -449,6 +450,23 @@ extern "C"
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_spi_slave_initialize
*
* Description:
* Initialize the selected SPI port in slave mode.
*
* Input Parameter:
* port - Chip select number identifying the "logical" SPI port. Includes
* encoded port and chip select information.
*
* Returned Value:
* Valid SPI device structure reference on success; a NULL on failure
*
****************************************************************************/
FAR struct spi_sctrlr_s *up_spi_slave_initialize(int port);
#undef EXTERN
#if defined(__cplusplus)
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/spi/spi.h
*
* Copyright(C) 2008-2013 Gregory Nutt. All rights reserved.
* Copyright(C) 2008-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -437,7 +437,7 @@ extern "C"
* Name: up_spiinitialize
*
* Description:
* Initialize the selected SPI port.
* Initialize the selected SPI port in master mode.
*
* This is a generic prototype for the SPI initialize logic. Specific
* architectures may support different SPI initialization functions if,