代码拉取完成,页面将自动刷新
同步操作将从 何亚红/nrf24L01_plus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* ----------------------------------------------------------------------------
* “THE COFFEEWARE LICENSE” (Revision 1):
* <ihsan@kehribar.me> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a coffee in return.
* -----------------------------------------------------------------------------
* This library is based on this library:
* https://github.com/aaronds/arduino-nrf24l01
* Which is based on this library:
* http://www.tinkerer.eu/AVRLib/nRF24L01
* -----------------------------------------------------------------------------
*/
#ifndef NRF24
#define NRF24
#include "nRF24L01.h"
#include <stdint.h>
#define LOW 0
#define HIGH 1
#define nrf24_ADDR_LEN 5
#define nrf24_CONFIG ((1<<EN_CRC)|(0<<CRCO))
#define NRF24_TRANSMISSON_OK 0
#define NRF24_MESSAGE_LOST 1
/* adjustment functions */
void nrf24_init();
void nrf24_rx_address(uint8_t* adr);
void nrf24_tx_address(uint8_t* adr);
void nrf24_config(uint8_t channel, uint8_t pay_length);
/* state check functions */
uint8_t nrf24_dataReady();
uint8_t nrf24_isSending();
uint8_t nrf24_getStatus();
uint8_t nrf24_rxFifoEmpty();
/* core TX / RX functions */
void nrf24_send(uint8_t* value);
void nrf24_getData(uint8_t* data);
/* use in dynamic length mode */
uint8_t nrf24_payloadLength();
/* post transmission analysis */
uint8_t nrf24_lastMessageStatus();
uint8_t nrf24_retransmissionCount();
/* Returns the payload length */
uint8_t nrf24_payload_length();
/* power management */
void nrf24_powerUpRx();
void nrf24_powerUpTx();
void nrf24_powerDown();
/* low level interface ... */
uint8_t spi_transfer(uint8_t tx);
void nrf24_transmitSync(uint8_t* dataout,uint8_t len);
void nrf24_transferSync(uint8_t* dataout,uint8_t* datain,uint8_t len);
void nrf24_configRegister(uint8_t reg, uint8_t value);
void nrf24_readRegister(uint8_t reg, uint8_t* value, uint8_t len);
void nrf24_writeRegister(uint8_t reg, uint8_t* value, uint8_t len);
/* -------------------------------------------------------------------------- */
/* You should implement the platform spesific functions in your code */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* In this function you should do the following things:
* - Set MISO pin input
* - Set MOSI pin output
* - Set SCK pin output
* - Set CSN pin output
* - Set CE pin output */
/* -------------------------------------------------------------------------- */
extern void nrf24_setupPins();
/* -------------------------------------------------------------------------- */
/* nrf24 CE pin control function
* - state:1 => Pin HIGH
* - state:0 => Pin LOW */
/* -------------------------------------------------------------------------- */
extern void nrf24_ce_digitalWrite(uint8_t state);
/* -------------------------------------------------------------------------- */
/* nrf24 CE pin control function
* - state:1 => Pin HIGH
* - state:0 => Pin LOW */
/* -------------------------------------------------------------------------- */
extern void nrf24_csn_digitalWrite(uint8_t state);
/* -------------------------------------------------------------------------- */
/* nrf24 SCK pin control function
* - state:1 => Pin HIGH
* - state:0 => Pin LOW */
/* -------------------------------------------------------------------------- */
extern void nrf24_sck_digitalWrite(uint8_t state);
/* -------------------------------------------------------------------------- */
/* nrf24 MOSI pin control function
* - state:1 => Pin HIGH
* - state:0 => Pin LOW */
/* -------------------------------------------------------------------------- */
extern void nrf24_mosi_digitalWrite(uint8_t state);
/* -------------------------------------------------------------------------- */
/* nrf24 MISO pin read function
/* - returns: Non-zero if the pin is high */
/* -------------------------------------------------------------------------- */
extern uint8_t nrf24_miso_digitalRead();
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。