Fix Error: chip/s32k1xx_lpspi.c:581:9: error: unused function 's32k1xx_lpspi_[write|read]byte'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
0f85cf7503
commit
e0f1c41695
@ -380,47 +380,6 @@ static struct pm_callback_s g_spi1_pmcb =
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_getreg8
|
||||
*
|
||||
* Description:
|
||||
* Get the contents of the SPI register at offset
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - private SPI device structure
|
||||
* offset - offset to the register of interest
|
||||
*
|
||||
* Returned Value:
|
||||
* The contents of the 8-bit register
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline
|
||||
uint8_t s32k1xx_lpspi_getreg8(struct s32k1xx_lpspidev_s *priv,
|
||||
uint8_t offset)
|
||||
{
|
||||
return getreg8(priv->spibase + offset);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_putreg8
|
||||
*
|
||||
* Description:
|
||||
* Write a 8-bit value to the SPI register at offset
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - private SPI device structure
|
||||
* offset - offset to the register of interest
|
||||
* value - the 8-bit value to be written
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void s32k1xx_lpspi_putreg8(struct s32k1xx_lpspidev_s *priv,
|
||||
uint8_t offset, uint8_t value)
|
||||
{
|
||||
putreg8(value, priv->spibase + offset);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_getreg
|
||||
*
|
||||
@ -563,66 +522,6 @@ static inline void s32k1xx_lpspi_write_dword(struct s32k1xx_lpspidev_s
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_readbyte
|
||||
*
|
||||
* Description:
|
||||
* Read one byte from SPI
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - Device-specific state data
|
||||
*
|
||||
* Returned Value:
|
||||
* Byte as read
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline
|
||||
uint8_t s32k1xx_lpspi_readbyte(struct s32k1xx_lpspidev_s *priv)
|
||||
{
|
||||
/* Wait until the receive buffer is not empty */
|
||||
|
||||
while ((s32k1xx_lpspi_getreg32(priv, S32K1XX_LPSPI_SR_OFFSET) &
|
||||
LPSPI_SR_RDF) == 0)
|
||||
{
|
||||
}
|
||||
|
||||
/* Then return the received byte */
|
||||
|
||||
return s32k1xx_lpspi_getreg8(priv, S32K1XX_LPSPI_RDR_OFFSET);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_writebyte
|
||||
*
|
||||
* Description:
|
||||
* Write one 8-bit frame to the SPI FIFO
|
||||
*
|
||||
* Input Parameters:
|
||||
* priv - Device-specific state data
|
||||
* byte - Byte to send
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline
|
||||
void s32k1xx_lpspi_writebyte(struct s32k1xx_lpspidev_s *priv,
|
||||
uint8_t byte)
|
||||
{
|
||||
/* Wait until the transmit buffer is empty */
|
||||
|
||||
while ((s32k1xx_lpspi_getreg32(priv, S32K1XX_LPSPI_SR_OFFSET) &
|
||||
LPSPI_SR_TDF) == 0)
|
||||
{
|
||||
}
|
||||
|
||||
/* Then send the byte */
|
||||
|
||||
s32k1xx_lpspi_putreg8(priv, S32K1XX_LPSPI_TDR_OFFSET, byte);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: s32k1xx_lpspi_9to16bitmode
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user