Extension Bus Advanced Guide | XDK110
Code 24. SPI write appInitSystem() function call
void appInitSystem(void
{
if
(CmdProcessorHandle == NULL)
{
printf("Command processor handle is null
assert(false);
}
BCDS_UNUSED(param2);
vTaskDelay(5000);
// Other Initialization code from the code snipppets 16-20 here
// Ensuring that CS is at its high state initially
SpiSetCSHigh();
uint8_t
regAddr = 0x01;
uint8_t
regWriteVal = 0x09;
uint8_t
dataSize = UINT8_C(1);
SpiWriteRegister(regAddr, ®WriteVal, dataSize);
}
SpiWriteRegister()
Here the function
the length of the value into it.
An alternative approach to send data to the slave device would be achieved by lowering the chip select line to a low
voltage level and then call
voltage level on the chip select line to high would be required.
* CmdProcessorHandle,
is simply called, by passing a register address, a value written to the register and
MCU_SPI_Send()
to transmit then desired data to the slave device. Afterwards, only raising the
uint32_t
param2)
\n\r");
21 24
|