diff --git a/arch b/arch index 98596b2379..1efba67cba 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 98596b23794fafd7a25d7da1f3a5748ee53b47cd +Subproject commit 1efba67cba08b28a2a4a1a4649daf2df93b2d596 diff --git a/include/nuttx/spi/slave.h b/include/nuttx/spi/slave.h index 35d7cb63a3..f57493fa53 100644 --- a/include/nuttx/spi/slave.h +++ b/include/nuttx/spi/slave.h @@ -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) } diff --git a/include/nuttx/spi/spi.h b/include/nuttx/spi/spi.h index 43aa8e277c..2a6e25ed03 100644 --- a/include/nuttx/spi/spi.h +++ b/include/nuttx/spi/spi.h @@ -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 * * 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,