Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Wi-Fi Combo

Anonymous
Not applicable

Hello,

I'm trying to drive a SPI peripheral on SPI_1 and I cannot get SPI_1_CS to be driven properly.

The wiced_spi_device_t data structure that is supplied to wiced_spi_init() expects a wiced_gpio_t structure for it's .chip_select, but SPI_1_CS is a wiced_peripheral_pin_t, not a wiced_gpio_t. When a wiced_peripheral_pin_t is supplied, the SPI bus fails to initialize. When a wiced_gpio_t is supplied, the driver fails to drive the pin.

Is there any example code available that shows how to set up SPI_1?

0 Likes
1 Reply
ToIn_1742091
Level 5
10 solutions authored 5 solutions authored First solution authored
Level 5

I see this define in platform.h, so CS is controlled by SPI Controller, not as a GPIO.

#define WICED_SPI_FLASH_CS   (WICED_GPIO_NONE) /* No GPIO available, must use controller */

In platform.c, pin definition of SPI2 is missing, so you may need to add mosi/miso/clock/cs as below.

    [WICED_SPI_2]  =

    {

        .port                    = BCM4390X_SPI_1,

        .pin_mosi                = &platform_gpio_pins[WICED_PERIPHERAL_PIN_13],

        .pin_miso                = &platform_gpio_pins[WICED_PERIPHERAL_PIN_11],

        .pin_clock               = &platform_gpio_pins[WICED_PERIPHERAL_PIN_12],

        .pin_cs                  = &platform_gpio_pins[WICED_PERIPHERAL_PIN_14],

        .driver                  = &spi_gsio_driver,

    },