diff --git a/arch/arm/src/tiva/tiva_ssi.c b/arch/arm/src/tiva/tiva_ssi.c index bd8c8bea6a8..e991eee42ee 100644 --- a/arch/arm/src/tiva/tiva_ssi.c +++ b/arch/arm/src/tiva/tiva_ssi.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/tiva/tiva_ssi.c * - * Copyright (C) 2009-2010, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -1481,7 +1481,7 @@ static void ssi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, ****************************************************************************/ /**************************************************************************** - * Name: up_spiinitialize + * Name: tiva_spibus_initialize * * Description: * Initialize common parts the selected SPI port. Initialization of @@ -1502,7 +1502,7 @@ static void ssi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, * ****************************************************************************/ -FAR struct spi_dev_s *up_spiinitialize(int port) +FAR struct spi_dev_s *tiva_spibus_initialize(int port) { struct tiva_ssidev_s *priv; irqstate_t flags; diff --git a/arch/arm/src/tiva/tiva_ssi.h b/arch/arm/src/tiva/tiva_ssi.h index cac0f6cdc5d..a17c6422b0a 100644 --- a/arch/arm/src/tiva/tiva_ssi.h +++ b/arch/arm/src/tiva/tiva_ssi.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/tiva/tiva_ssi.h * - * Copyright (C) 2009-2010, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,23 +45,11 @@ #include #include -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Public Types - ************************************************************************************/ - -/************************************************************************************ - * Inline Functions - ************************************************************************************/ - #ifndef __ASSEMBLY__ -/************************************************************************************ - * Public Data - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ #if defined(__cplusplus) extern "C" @@ -69,15 +57,35 @@ extern "C" #endif /**************************************************************************** - * Public Function Prototypes + * Name: tiva_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 SSI interfaces) + * + * Returned Value: + * Valid SPI device structure reference on succcess; a NULL on failure + * ****************************************************************************/ +FAR struct spi_dev_s *tiva_spibus_initialize(int port); + /**************************************************************************** * The external functions, tiva_spiselect, tiva_spistatus, and * tiva_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 provided by common + * All other methods (including tiva_spibus_initialize()) are provided by common * logic. To use this common SPI logic on your board: * * 1. Provide logic in tiva_boardinitialize() to configure SPI chip select @@ -89,9 +97,9 @@ extern "C" * the tiva_spicmddata() function in your board-specific logic. This * functions will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 4. Add a call to up_spiinitialize() in your low level application + * 4. Add a call to tiva_spibus_initialize() in your low level application * initialization logic - * 5. The handle returned by up_spiinitialize() may then be used to bind the + * 5. The handle returned by tiva_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).