nRF24L01.rar

  • hmdfr
    了解作者
  • Objective-C
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2020-05-07 01:38
    上传日期
NRF24L01 library with all definition of registers and commands
nRF24L01.rar
  • nRF24L01.h
    4.2KB
内容介绍
/* Library: NRF24L01 software library for STM32 MCUs Written by: Mohamed Yaqoob Date written: 25/10/2018 Last modified: -/- Description: */ //***includes***// #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include"stm32f4xx.h" #define _BV(x) (1<<(x)) /* Memory Map */ #define REG_CONFIG 0x00 #define REG_EN_AA 0x01 #define REG_EN_RXADDR 0x02 #define REG_SETUP_AW 0x03 #define REG_SETUP_RETR 0x04 #define REG_RF_CH 0x05 #define REG_RF_SETUP 0x06 #define REG_STATUS 0x07 #define REG_OBSERVE_TX 0x08 #define REG_CD 0x09 #define REG_RX_ADDR_P0 0x0A #define REG_RX_ADDR_P1 0x0B #define REG_RX_ADDR_P2 0x0C #define REG_RX_ADDR_P3 0x0D #define REG_RX_ADDR_P4 0x0E #define REG_RX_ADDR_P5 0x0F #define REG_TX_ADDR 0x10 #define REG_RX_PW_P0 0x11 #define REG_RX_PW_P1 0x12 #define REG_RX_PW_P2 0x13 #define REG_RX_PW_P3 0x14 #define REG_RX_PW_P4 0x15 #define REG_RX_PW_P5 0x16 #define REG_FIFO_STATUS 0x17 #define REG_DYNPD 0x1C #define REG_FEATURE 0x1D /* Bit Mnemonics */ #define MASK_RX_DR 6 #define MASK_TX_DS 5 #define MASK_MAX_RT 4 #define BIT_EN_CRC 3 #define BIT_CRCO 2 #define BIT_PWR_UP 1 #define BIT_PRIM_RX 0 #define BIT_ENAA_P5 5 #define BIT_ENAA_P4 4 #define BIT_ENAA_P3 3 #define BIT_ENAA_P2 2 #define BIT_ENAA_P1 1 #define BIT_ENAA_P0 0 #define BIT_ERX_P5 5 #define BIT_ERX_P4 4 #define BIT_ERX_P3 3 #define BIT_ERX_P2 2 #define BIT_ERX_P1 1 #define BIT_ERX_P0 0 #define BIT_AW 0 #define BIT_ARD 4 #define BIT_ARC 0 #define BIT_PLL_LOCK 4 #define BIT_RF_DR 3 #define BIT_RF_PWR 6 #define BIT_RX_DR 6 #define BIT_TX_DS 5 #define BIT_MAX_RT 4 #define BIT_RX_P_NO 1 #define BIT_TX_FULL 0 #define BIT_PLOS_CNT 4 #define BIT_ARC_CNT 0 #define BIT_TX_REUSE 6 #define BIT_FIFO_FULL 5 #define BIT_TX_EMPTY 4 #define BIT_RX_FULL 1 #define BIT_RX_EMPTY 0 #define BIT_DPL_P5 5 #define BIT_DPL_P4 4 #define BIT_DPL_P3 3 #define BIT_DPL_P2 2 #define BIT_DPL_P1 1 #define BIT_DPL_P0 0 #define BIT_EN_DPL 2 #define BIT_EN_ACK_PAY 1 #define BIT_EN_DYN_ACK 0 /* Instruction Mnemonics */ #define CMD_R_REGISTER 0x00 #define CMD_W_REGISTER 0x20 #define CMD_REGISTER_MASK 0x1F #define CMD_ACTIVATE 0x50 #define CMD_R_RX_PL_WID 0x60 #define CMD_R_RX_PAYLOAD 0x61 #define CMD_W_TX_PAYLOAD 0xA0 #define CMD_W_ACK_PAYLOAD 0xA8 #define CMD_FLUSH_TX 0xE1 #define CMD_FLUSH_RX 0xE2 #define CMD_REUSE_TX_PL 0xE3 #define CMD_NOP 0xFF /* Non-P omissions */ #define LNA_HCURR 0 /* P model memory Map */ #define REG_RPD 0x09 /* P model bit Mnemonics */ #define RF_DR_LOW 5 #define RF_DR_HIGH 3 #define RF_PWR_LOW 1 #define RF_PWR_HIGH 2 //*** Variables declaration ***// //*** Library variables ***// static uint64_t pipe0_reading_address; static bool ack_payload_available; /**< Whether there is an ack payload waiting */ static uint8_t ack_payload_length; /**< Dynamic size of pending ack payload. */ static uint8_t payload_size; /**< Fixed size of payloads */ static bool dynamic_payloads_enabled; /**< Whether dynamic payloads are enabled. */ static bool p_variant; /* False for RF24L01 and true for RF24L01P */ static bool wide_band; /* 2Mbs data rate in use? */ //**** TypeDefs ****// //1. Power Amplifier function, NRF24_setPALevel() typedef enum { RF24_PA_m18dB = 0, RF24_PA_m12dB, RF24_PA_m6dB, RF24_PA_0dB, RF24_PA_ERROR }rf24_pa_dbm_e ; //2. NRF24_setDataRate() input typedef enum { RF24_1MBPS = 0, RF24_2MBPS, RF24_250KBPS }rf24_datarate_e; //3. NRF24_setCRCLength() input typedef enum { RF24_CRC_DISABLED = 0, RF24_CRC_8, RF24_CRC_16 }rf24_crclength_e; static const uint8_t NRF24_ADDR_REGS[7] = { REG_RX_ADDR_P0, REG_RX_ADDR_P1, REG_RX_ADDR_P2, REG_RX_ADDR_P3, REG_RX_ADDR_P4, REG_RX_ADDR_P5, REG_TX_ADDR }; static const uint8_t RF24_RX_PW_PIPE[6] = { REG_RX_PW_P0, REG_RX_PW_P1, REG_RX_PW_P2, REG_RX_PW_P3, REG_RX_PW_P4, REG_RX_PW_P5 };
评论
    相关推荐
    • NRF24L01.rar
      通过STM32单片机实现对NRF24L01的控制
    • NRF24L01配置功能函数.zip
      NRF24L01不一样的配置方式,方便简洁明了,一个函数配置出所有你想要的功能。由结构体打包函数,每个参数设置都有注释说明,傻瓜式配置。 ------------------NRF24L01函数目录——————————————— ...
    • NRF24L01模块
      包含了NRF24L01模块的使用文档,原理图,及C语言代码,系统的分析了从硬件原理图到软件的各方面技术,及编C语言程代码!
    • FTDI_nRF24L01:nRF24L01 配置工具
      FTDI_nRF24L01 nRF24L01 配置工具 这个基于 qt 的工具允许您使用广泛的 FTDI(FT232R 和 FT245R)USB 到串行转换器将 nRF24L01nRF24L01+ 连接到您的 Windows/Linux PC。 对于开发,我正在使用这样的模块,任何...
    • NRF24L01手册
      NRF24L01中文版,内容比较全面。 nRF24L01是一款工作在2.4~2.5GHz世界通用ISM频段的单片无线收发器芯片 下载后输入文档密码wireless即可打开
    • 8,NRF24L01模块资料.rar
      此次NRF24L01的无线通信模块可,用于智能小车与四旋翼飞机相关的制造
    • NRF24L01.rar
      iNTERFACING NRF24L01 WITH STM32F4
    • NRF24L01资料.rar
      该压缩包包涵了无线传输模块的NRF24L01的中文和英文的数据手册
    • nrf24L01.zip
      2.4G配置使用,发送数据,与接收数据,采用一个频段可带多个字节,参考2.4g说明书
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路