06-23-2023
01:05 AM
863 Views
Hrohn
Contributor II
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
1 Solution
06-23-2023
04:48 AM
849 Views


NXP TechSupport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1 Reply
06-23-2023
04:48 AM
850 Views


NXP TechSupport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
yes, it seems to be correct
BR, Petr
