⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nrf24l01.h

📁 MSP acquires data and sends through USB to PC. Check the link for PC capture software and project d
💻 H
字号:
/*
 * File:        nrf24l01.h
 * Purpose:     Prototype of nRF24L01 handler functions
 * Author:      Peter Ivanov, Olimex Ltd.
 * Modified by:
 * Created:     2007-10-14 11:29:32
 * Last modify: 2007-10-21 11:19:04 ivanovp {Time-stamp}
 * Copyright:   (C) Peter Ivanov, 2007
 * Licence:     GPL
 */
/**
 * \file nrf24l01.h
 * \brief Prototypes and defines for nRF24L01 handler functions.
 * \author Peter Ivanov, Olimex Ltd.
 */

#ifndef __INCLUDE_NRF24L01_H
#define __INCLUDE_NRF24L01_H
#include "common.h"

void NRF_init (void);
void NRF_send (uint8_t byte);
void NRF_prepareForReceive ();
bool_t NRF_receive (uint8_t *const byte);

//CONSTANTS
#define   NRF_NOP         0xff
#define   R_REGISTER      0x00
#define   W_REGISTER      0x01
#define   R_RX_PAYLOAD    0x61
#define   W_TX_PAYLOAD    0xA0
#define   FLUSH_TX        0xE1
#define   FLUSH_RX        0xE2
#define   REUSE_TX_PL     0xE3

#define   RX_ADDR_P0      0x0A
#define   RX_ADDR_P1      0x0B
#define   TX_ADDR         0x10
#define   RX_PW_P0        0x11
#define   RX_PW_P1        0x12
#define   FIFO_STATUS     0x17

#define   MAX_RT          0x10

#define   CONFIG_REG_ADDR 0x00
#define   STATUS_ADDR     0x07

#define   FLUSH_TX        0xE1
#define   TX_FULL         0x01
#define   RX_DR           0x40
#define   TX_DS           0x20

#define   IRQ()           (!(P8IN & BIT5)) // netagive logic

#define   RX_TX_TIME      100000
#define   BUT_TIME        10000

#endif // __INCLUDE_NRF24L01_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -