unsigned char hal_nrf_rw(unsigned char value) {
SPIRDAT = value;
while (!(SPIRSTAT & 0x02))
; // wait for byte transfer finished
;
return SPIRDAT; // return SPI read value
}
unsigned char hal_nrf_read_reg(unsigned char reg) {
unsigned char temp;
CSN_LOW();
hal_nrf_rw(reg);
temp = hal_nrf_rw(0);
CSN_HIGH();
return temp;
}
上面的代码有个地方看不懂(黑色字体),hal_nrf_read_reg猜测应该是读寄存器的函数,但是它是怎么读得呢,黑色字体的两行是什么意思呢? |