mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
arm/rp2040/common: Change SPI board functions to weak
Summary Board logic change. This PR adds weak_function attributes to the RP2040 common SPI board logic. This allows board developers to override and extend the SPI board logic. Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
This commit is contained in:
parent
89ddf9e7b9
commit
fb853be004
1 changed files with 14 additions and 8 deletions
|
|
@ -70,8 +70,9 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RP2040_SPI0
|
||||
void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
void weak_function rp2040_spi0select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
|
|
@ -79,7 +80,8 @@ void rp2040_spi0select(struct spi_dev_s *dev, uint32_t devid,
|
|||
rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
|
||||
}
|
||||
|
||||
uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t weak_function rp2040_spi0status(struct spi_dev_s *dev,
|
||||
uint32_t devid)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
|
||||
|
|
@ -90,7 +92,8 @@ uint8_t rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int weak_function rp2040_spi0cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid, bool cmd)
|
||||
{
|
||||
#ifdef CONFIG_LCD_ST7789
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
|
|
@ -111,8 +114,9 @@ int rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_RP2040_SPI1
|
||||
void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
void weak_function rp2040_spi1select(struct spi_dev_s *dev,
|
||||
uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
|
|
@ -120,7 +124,8 @@ void rp2040_spi1select(struct spi_dev_s *dev, uint32_t devid,
|
|||
rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
|
||||
}
|
||||
|
||||
uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
||||
uint8_t weak_function rp2040_spi1status(struct spi_dev_s *dev,
|
||||
uint32_t devid)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
|
||||
|
|
@ -131,7 +136,8 @@ uint8_t rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
int rp2040_spi1cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
int weak_function rp2040_spi1cmddata(struct spi_dev_s *dev,
|
||||
uint32_t devid, bool cmd)
|
||||
{
|
||||
#if defined (CONFIG_LCD_ST7789) || defined (CONFIG_LCD_ST7735) || defined (CONFIG_LCD_GC9A01)
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue