For Calypso MCUs, rename up_spiinitialize to calypso_spibus_initialize
This commit is contained in:
parent
afbd0f55c3
commit
120f7ccebf
@ -9,6 +9,8 @@
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
|
||||
#include "calypso_spi.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_power_off
|
||||
*
|
||||
@ -31,8 +33,8 @@
|
||||
#ifdef CONFIG_BOARDCTL_POWEROFF
|
||||
int board_power_off(int status)
|
||||
{
|
||||
struct spi_dev_s *spi = calypso_spibus_initialize(0);
|
||||
uint16_t tx;
|
||||
struct spi_dev_s *spi = up_spiinitialize(0);
|
||||
|
||||
SPI_SETBITS(spi, 16);
|
||||
(void)SPI_HWFEATURES(spi, 0);
|
||||
@ -46,4 +48,3 @@ int board_power_off(int status)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -283,7 +283,21 @@ int spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din)
|
||||
return 0;
|
||||
}
|
||||
|
||||
FAR struct spi_dev_s *up_spiinitialize(int port)
|
||||
/****************************************************************************
|
||||
* Name: calypso_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 *calypso_spibus_initialize(int port)
|
||||
{
|
||||
switch (port)
|
||||
{
|
||||
|
@ -1,20 +1,13 @@
|
||||
#ifndef ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H
|
||||
#define ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BASE_ADDR_SPI 0xfffe3000
|
||||
#define SPI_REG(n) (BASE_ADDR_SPI+(n))
|
||||
|
||||
enum spi_regs {
|
||||
REG_SET1 = 0x00,
|
||||
REG_SET2 = 0x02,
|
||||
REG_CTRL = 0x04,
|
||||
REG_STATUS = 0x06,
|
||||
REG_TX_LSB = 0x08,
|
||||
REG_TX_MSB = 0x0a,
|
||||
REG_RX_LSB = 0x0c,
|
||||
REG_RX_MSB = 0x0e,
|
||||
};
|
||||
|
||||
#define SPI_SET1_EN_CLK (1 << 0)
|
||||
#define SPI_SET1_WR_IRQ_DIS (1 << 4)
|
||||
#define SPI_SET1_RDWR_IRQ_DIS (1 << 5)
|
||||
@ -27,4 +20,40 @@ enum spi_regs {
|
||||
#define SPI_STATUS_RE (1 << 0) /* Read End */
|
||||
#define SPI_STATUS_WE (1 << 1) /* Write End */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
enum spi_regs
|
||||
{
|
||||
REG_SET1 = 0x00,
|
||||
REG_SET2 = 0x02,
|
||||
REG_CTRL = 0x04,
|
||||
REG_STATUS = 0x06,
|
||||
REG_TX_LSB = 0x08,
|
||||
REG_TX_MSB = 0x0a,
|
||||
REG_RX_LSB = 0x0c,
|
||||
REG_RX_MSB = 0x0e,
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: calypso_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 *calypso_spibus_initialize(int port)
|
||||
|
||||
#endif /* ___ARCH_ARM_SRC_CALYPSO_CALYPSO_SPI_H */
|
||||
|
Loading…
Reference in New Issue
Block a user