mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
For PIC32MX/Z MCUs, rename up_spiinitialize to pic32mx/z_spibus_initialize
This commit is contained in:
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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;
|
||||
|
||||
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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).
|
||||
|
||||
Reference in New Issue
Block a user