diff --git a/arch/mips/src/pic32mx/pic32mx-spi.c b/arch/mips/src/pic32mx/pic32mx-spi.c index bbfa730c101..8829cecb2df 100644 --- a/arch/mips/src/pic32mx/pic32mx-spi.c +++ b/arch/mips/src/pic32mx/pic32mx-spi.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mx/pic32mx-spi.c * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -844,7 +844,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw ****************************************************************************/ /**************************************************************************** - * Name: up_spiinitialize + * Name: pic32mx_spibus_initialize * * Description: * Initialize the selected SPI port @@ -857,7 +857,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t nw * ****************************************************************************/ -FAR struct spi_dev_s *up_spiinitialize(int port) +FAR struct spi_dev_s *pic32mx_spibus_initialize(int port) { FAR struct pic32mx_dev_s *priv; irqstate_t flags; diff --git a/arch/mips/src/pic32mx/pic32mx.h b/arch/mips/src/pic32mx/pic32mx.h index f03cc31288d..718a9674f9d 100644 --- a/arch/mips/src/pic32mx/pic32mx.h +++ b/arch/mips/src/pic32mx/pic32mx.h @@ -384,6 +384,22 @@ void pic32mx_dumpgpio(uint32_t pinset, const char *msg); # define pic32mx_dumpgpio(p,m) #endif +/**************************************************************************** + * Name: pic32mx_spibus_initialize + * + * Description: + * Initialize the selected SPI port + * + * Input Parameter: + * Port number (for hardware that has mutiple SPI interfaces) + * + * Returned Value: + * Valid SPI device structure reference on succcess; a NULL on failure + * + ****************************************************************************/ + +FAR struct spi_dev_s *pic32mx_spibus_initialize(int port); + /************************************************************************************ * Name: pic32mx_spiNselect, pic32mx_spiNstatus, and pic32mx_spiNcmddata * @@ -391,7 +407,7 @@ void pic32mx_dumpgpio(uint32_t pinset, const char *msg); * These external functions must be provided by board-specific logic. They 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 PIC32MX logic. To use + * including pic32mx_spibus_initialize()) are provided by common PIC32MX logic. To use * this common SPI logic on your board: * * 1. Provide logic in pic32mx_boardinitialize() to configure SPI/SSP chip select @@ -403,9 +419,9 @@ void pic32mx_dumpgpio(uint32_t pinset, const char *msg); * pic32mx_spiNcmddata() functions in your board-specific logic. These * functions 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 application + * 3. Add a call to pic32mx_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by pic32mx_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). diff --git a/arch/mips/src/pic32mz/pic32mz-spi.c b/arch/mips/src/pic32mz/pic32mz-spi.c index 232cf92d8ff..2e874f07997 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.c +++ b/arch/mips/src/pic32mz/pic32mz-spi.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mz/pic32mz-spi.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -1201,7 +1201,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, ****************************************************************************/ /**************************************************************************** - * Name: up_spiinitialize + * Name: pic32mz_spibus_initialize * * Description: * Initialize the selected SPI port @@ -1214,7 +1214,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, * ****************************************************************************/ -FAR struct spi_dev_s *up_spiinitialize(int port) +FAR struct spi_dev_s *pic32mz_spibus_initialize(int port) { FAR struct pic32mz_dev_s *priv; uintptr_t regaddr; diff --git a/arch/mips/src/pic32mz/pic32mz-spi.h b/arch/mips/src/pic32mz/pic32mz-spi.h index e376ebe4d35..f6182d8eef3 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.h +++ b/arch/mips/src/pic32mz/pic32mz-spi.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/mips/src/pic32mz/pic32mz-spi.h * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -70,6 +70,22 @@ extern "C" * Public Function Prototypes ************************************************************************************/ +/**************************************************************************** + * Name: pic32mz_spibus_initialize + * + * Description: + * Initialize the selected SPI port + * + * Input Parameter: + * Port number (for hardware that has mutiple SPI interfaces) + * + * Returned Value: + * Valid SPI device structure reference on succcess; a NULL on failure + * + ****************************************************************************/ + +FAR struct spi_dev_s *pic32mz_spibus_initialize(int port); + /************************************************************************************ * Name: pic32mz_spiNselect, pic32mz_spiNstatus, and pic32mz_spiNcmddata * @@ -77,7 +93,7 @@ extern "C" * These external functions must be provided by board-specific logic. They 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 PIC32MZ logic. To use + * including pic32mz_spibus_initialize()) are provided by common PIC32MZ logic. To use * this common SPI logic on your board: * * 1. Provide logic in pic32mz_boardinitialize() to configure SPI/SSP chip select @@ -89,9 +105,9 @@ extern "C" * pic32mz_spiNcmddata() functions in your board-specific logic. These * functions 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 application + * 3. Add a call to pic32mz_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by pic32mz_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).