Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "wiced.h"
- void application_start(void)
- {
- /* Initialise the device and WICED framework */
- wiced_init( );
- wiced_spi_device_t spi = {
- .port = WICED_SPI_1,
- .chip_select = WICED_SPI_FLASH_CS,
- .speed = 750000,
- .mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_LOW | SPI_NO_DMA | SPI_MSB_FIRST),
- .bits = 8
- };
- wiced_spi_init(&spi);
- uint8_t out[33];
- uint8_t in[33];
- memset(in, 0, 33);
- memset(out, 0, 33);
- while(1) {
- wiced_spi_message_segment_t segments[1];
- //out[0] = i;
- segments[0].tx_buffer = out;
- segments[0].length = 32;
- segments[0].rx_buffer = in;
- wiced_spi_transfer(&spi, segments, 1);
- out[0] = in[0];
- WPRINT_APP_INFO( ("[SPI] in: %s\r\n", (char *)in) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement