uint8_t reg_access_read(uint8_t addr )
{
uint8_t rdata = 0;
uint8_t wdata = 0;
SpiChipSelect();
wdata = (addr & 0x7f);
LPSPI_DRV_MasterTransferBlocking(INST_LPSPI_1,(uint8_t*)&wdata,(uint8_t*)&rdata,1,OSIF_WAIT_FOREVER);
SpiChipRelease();
return rdata;
}
The above is the SPI I wrote as a function for the host to read data from the slave. Is this correct?