微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 51单片机 SPI nRF24L01 无线简单程序 1

51单片机 SPI nRF24L01 无线简单程序 1

时间:11-19 来源:互联网 点击:

0x09 // Carrier Detect register address58 #define RX_ADDR_P0 0x0A // RX address pipe0 register address59 #define RX_ADDR_P1 0x0B // RX address pipe1 register address60 #define RX_ADDR_P2 0x0C // RX address pipe2 register address61 #define RX_ADDR_P3 0x0D // RX address pipe3 register address62 #define RX_ADDR_P4 0x0E // RX address pipe4 register address63 #define RX_ADDR_P5 0x0F // RX address pipe5 register address64 #define TX_ADDR 0x10 // TX address register address65 #define RX_PW_P0 0x11 // RX payload width, pipe0 register address66 #define RX_PW_P1 0x12 // RX payload width, pipe1 register address67 #define RX_PW_P2 0x13 // RX payload width, pipe2 register address68 #define RX_PW_P3 0x14 // RX payload width, pipe3 register address69 #define RX_PW_P4 0x15 // RX payload width, pipe4 register address70 #define RX_PW_P5 0x16 // RX payload width, pipe5 register address71 #define FIFO_STATUS 0x17 // FIFO Status Register register address72 73 //***************************************************************//74 // FUNCTIONs PROTOTYPES //75 /****************************************************************76 void SPI_Init(BYTE Mode); // Init HW or SW SPI77 BYTE SPI_RW(BYTE byte); // Single SPI read/write78 BYTE SPI_Read(BYTE reg); // Read one byte from nRF24L0179 BYTE SPI_RW_Reg(BYTE reg, BYTE byte); // Write one byte to register reg80 BYTE SPI_Write_Buf(BYTE reg, BYTE *pBuf, BYTE bytes); // Writes multiply bytes to one register81 BYTE SPI_Read_Buf(BYTE reg, BYTE *pBuf, BYTE bytes); // Read multiply bytes from one register82 //*****************************************************************/

api.h

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top