//spi CS initPIN_Config CSPinTable[] = {CC1310_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN,/* SPI master out - slave in */CC1310_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN,/* SPI master in - slave out */CC1310_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN,CC1310_LAUNCHXL_SPI0_CS1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,PIN_TERMINATE};CSPinHandle = PIN_open(&CSPinState, CSPinTable);PIN_setOutputValue(CSPinHandle, CC1310_LAUNCHXL_SPI0_CS1, 1);SPI_init();SPI_Params_init(&spiParams);spiParams.dataSize = 8;spiParams.frameFormat = SPI_POL0_PHA0;//spiParams.bitRate = 2812500;spi = SPI_open(Board_SPI0, &spiParams);
然后返回的spi总是等于NULL,请问它返回空,可能是那些方面的原因呢
Viki Shi:
查下是不是SPI引脚被用到其他功能模块了
Felix ZF:
user4820439
//spiCSinitPIN_Config CSPinTable[] = {CC1310_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN,/* SPI master out - slave in */CC1310_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN,/* SPI master in - slave out */CC1310_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN,CC1310_LAUNCHXL_SPI0_CS1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH| PIN_PUSHPULL | PIN_DRVSTR_MAX,PIN_TERMINATE};CSPinHandle = PIN_open(&CSPinState, CSPinTable);PIN_setOutputValue(CSPinHandle, CC1310_LAUNCHXL_SPI0_CS1, 1);SPI_init();SPI_Params_init(&spiParams);spiParams.dataSize = 8;spiParams.frameFormat = SPI_POL0_PHA0;//spiParams.bitRate = 2812500;spi = SPI_open(Board_SPI0, &spiParams);然后返回的spi总是等于NULL,请问它返回空,可能是那些方面的原因呢