How to use "LPSPI_DRV_MasterTransferBlocking" to read the slave data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to use "LPSPI_DRV_MasterTransferBlocking" to read the slave data

ソリューションへジャンプ
1,247件の閲覧回数
Hrohn
Contributor II
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?
0 件の賞賛
返信
1 解決策
1,233件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, it seems to be correct

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,234件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, it seems to be correct

BR, Petr

0 件の賞賛
返信