Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
keever50 committed Feb 22, 2025
1 parent 778331f commit 420cfb9
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions boards/arm/rp2040/common/src/rp2040_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,18 @@
****************************************************************************/

#ifdef CONFIG_RP2040_SPI0
void weak_function 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");

rp2040_gpio_put(CONFIG_RP2040_SPI0_CS_GPIO, !selected);
}

uint8_t weak_function 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;

Expand All @@ -90,7 +92,8 @@ uint8_t weak_function rp2040_spi0status(struct spi_dev_s *dev, uint32_t devid)
}

#ifdef CONFIG_SPI_CMDDATA
int weak_function 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))
Expand All @@ -111,16 +114,18 @@ int weak_function rp2040_spi0cmddata(struct spi_dev_s *dev, uint32_t devid, bool
#endif

#ifdef CONFIG_RP2040_SPI1
void weak_function 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");

rp2040_gpio_put(CONFIG_RP2040_SPI1_CS_GPIO, !selected);
}

uint8_t weak_function 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;

Expand All @@ -131,7 +136,8 @@ uint8_t weak_function rp2040_spi1status(struct spi_dev_s *dev, uint32_t devid)
}

#ifdef CONFIG_SPI_CMDDATA
int weak_function 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))
Expand Down

0 comments on commit 420cfb9

Please sign in to comment.