kendryte / kendryte-standalone-sdk

Standalone SDK for kendryte K210
https://kendryte.com
Apache License 2.0
440 stars 161 forks source link

When the endian parameter of spi_init() is 1, there is no data on MOSI #121

Open ZiyangYE opened 3 years ago

ZiyangYE commented 3 years ago

BUG REPORT

When the endian parameter of spi_init() is 1, there is no data on MOSI

Expected behavior

There should be data on MOSI

Actual behavior

No data on MOSI

Test code

fpioa_set_function(30,FUNC_SPI0_SS0);
fpioa_set_function(31,FUNC_SPI0_SCLK);
fpioa_set_function(32,FUNC_SPI0_D0);
fpioa_set_function(33,FUNC_SPI0_D1);

spi_init(SPI_DEVICE_0,SPI_WORK_MODE_0,SPI_FF_STANDARD,8,1);

spi_set_clk_rate(SPI_DEVICE_0,1000000);

uint8_t cmd[3];
uint8_t dat[2];

cmd[0]=0x01;
cmd[1]=0x02;
cmd[2]=0x03;

dat[0]=0x00;
dat[1]=0xFF;

spi_send_data_standard(SPI_DEVICE_0,SPI_CHIP_SELECT_0,cmd,3,dat,2);

Document version

Develop 06a2ea7

Hardware

KD233

System

standalone