/Libraries/RF24/RF24.h

https://github.com/bobtfish/equail · C Header · 829 lines · 77 code · 79 blank · 673 comment · 3 complexity · 324126691d9c1b0c73bdee51a96e3a20 MD5 · raw file

  1. /*
  2. Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. version 2 as published by the Free Software Foundation.
  6. */
  7. /**
  8. * @file RF24.h
  9. *
  10. * Class declaration for RF24 and helper enums
  11. */
  12. #ifndef __RF24_H__
  13. #define __RF24_H__
  14. #include <RF24_config.h>
  15. /**
  16. * Power Amplifier level.
  17. *
  18. * For use with setPALevel()
  19. */
  20. typedef enum { RF24_PA_MIN = 0,RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX, RF24_PA_ERROR } rf24_pa_dbm_e ;
  21. /**
  22. * Data rate. How fast data moves through the air.
  23. *
  24. * For use with setDataRate()
  25. */
  26. typedef enum { RF24_1MBPS = 0, RF24_2MBPS, RF24_250KBPS } rf24_datarate_e;
  27. /**
  28. * CRC Length. How big (if any) of a CRC is included.
  29. *
  30. * For use with setCRCLength()
  31. */
  32. typedef enum { RF24_CRC_DISABLED = 0, RF24_CRC_8, RF24_CRC_16 } rf24_crclength_e;
  33. /**
  34. * Driver for nRF24L01(+) 2.4GHz Wireless Transceiver
  35. */
  36. class RF24
  37. {
  38. private:
  39. uint8_t ce_pin; /**< "Chip Enable" pin, activates the RX or TX role */
  40. uint8_t csn_pin; /**< SPI Chip select */
  41. bool wide_band; /* 2Mbs data rate in use? */
  42. bool p_variant; /* False for RF24L01 and true for RF24L01P */
  43. uint8_t payload_size; /**< Fixed size of payloads */
  44. uint8_t address_size; /**< Size of hardware addresses */
  45. bool ack_payload_available; /**< Whether there is an ack payload waiting */
  46. bool dynamic_payloads_enabled; /**< Whether dynamic payloads are enabled. */
  47. uint8_t ack_payload_length; /**< Dynamic size of pending ack payload. */
  48. uint64_t pipe0_reading_address; /**< Last address set on pipe 0 for reading. */
  49. protected:
  50. /**
  51. * @name Low-level internal interface.
  52. *
  53. * Protected methods that address the chip directly. Regular users cannot
  54. * ever call these. They are documented for completeness and for developers who
  55. * may want to extend this class.
  56. */
  57. /**@{*/
  58. /**
  59. * Set chip select pin
  60. *
  61. * Running SPI bus at PI_CLOCK_DIV2 so we don't waste time transferring data
  62. * and best of all, we make use of the radio's FIFO buffers. A lower speed
  63. * means we're less likely to effectively leverage our FIFOs and pay a higher
  64. * AVR runtime cost as toll.
  65. *
  66. * @param mode HIGH to take this unit off the SPI bus, LOW to put it on
  67. */
  68. void csn(int mode);
  69. /**
  70. * Set chip enable
  71. *
  72. * @param level HIGH to actively begin transmission or LOW to put in standby. Please see data sheet
  73. * for a much more detailed description of this pin.
  74. */
  75. void ce(int level);
  76. /**
  77. * Read a chunk of data in from a register
  78. *
  79. * @param reg Which register. Use constants from nRF24L01.h
  80. * @param buf Where to put the data
  81. * @param len How many bytes of data to transfer
  82. * @return Current value of status register
  83. */
  84. uint8_t read_register(uint8_t reg, uint8_t* buf, uint8_t len);
  85. /**
  86. * Read single byte from a register
  87. *
  88. * @param reg Which register. Use constants from nRF24L01.h
  89. * @return Current value of register @p reg
  90. */
  91. uint8_t read_register(uint8_t reg);
  92. /**
  93. * Write a chunk of data to a register
  94. *
  95. * @param reg Which register. Use constants from nRF24L01.h
  96. * @param buf Where to get the data
  97. * @param len How many bytes of data to transfer
  98. * @return Current value of status register
  99. */
  100. uint8_t write_register(uint8_t reg, const uint8_t* buf, uint8_t len);
  101. /**
  102. * Write a single byte to a register
  103. *
  104. * @param reg Which register. Use constants from nRF24L01.h
  105. * @param value The new value to write
  106. * @return Current value of status register
  107. */
  108. uint8_t write_register(uint8_t reg, uint8_t value);
  109. /**
  110. * Write the transmit payload
  111. *
  112. * The size of data written is the fixed payload size, see getPayloadSize()
  113. *
  114. * @param buf Where to get the data
  115. * @param len Number of bytes to be sent
  116. * @return Current value of status register
  117. */
  118. uint8_t write_payload(const void* buf, uint8_t len);
  119. /**
  120. * Read the receive payload
  121. *
  122. * The size of data read is the fixed payload size, see getPayloadSize()
  123. *
  124. * @param buf Where to put the data
  125. * @param len Maximum number of bytes to read
  126. * @return Current value of status register
  127. */
  128. uint8_t read_payload(void* buf, uint8_t len);
  129. /**
  130. * Empty the receive buffer
  131. *
  132. * @return Current value of status register
  133. */
  134. uint8_t flush_rx(void);
  135. /**
  136. * Empty the transmit buffer
  137. *
  138. * @return Current value of status register
  139. */
  140. uint8_t flush_tx(void);
  141. /**
  142. * Retrieve the current status of the chip
  143. *
  144. * @return Current value of status register
  145. */
  146. uint8_t get_status(void);
  147. /**
  148. * Decode and print the given status to stdout
  149. *
  150. * @param status Status value to print
  151. *
  152. * @warning Does nothing if stdout is not defined. See fdevopen in stdio.h
  153. */
  154. void print_status(uint8_t status);
  155. /**
  156. * Decode and print the given 'observe_tx' value to stdout
  157. *
  158. * @param value The observe_tx value to print
  159. *
  160. * @warning Does nothing if stdout is not defined. See fdevopen in stdio.h
  161. */
  162. void print_observe_tx(uint8_t value);
  163. /**
  164. * Print the name and value of an 8-bit register to stdout
  165. *
  166. * Optionally it can print some quantity of successive
  167. * registers on the same line. This is useful for printing a group
  168. * of related registers on one line.
  169. *
  170. * @param name Name of the register
  171. * @param reg Which register. Use constants from nRF24L01.h
  172. * @param qty How many successive registers to print
  173. */
  174. void print_byte_register(const char* name, uint8_t reg, uint8_t qty = 1);
  175. /**
  176. * Print the name and value of a 40-bit address register to stdout
  177. *
  178. * Optionally it can print some quantity of successive
  179. * registers on the same line. This is useful for printing a group
  180. * of related registers on one line.
  181. *
  182. * @param name Name of the register
  183. * @param reg Which register. Use constants from nRF24L01.h
  184. * @param qty How many successive registers to print
  185. */
  186. void print_address_register(const char* name, uint8_t reg, uint8_t qty = 1);
  187. /**
  188. * Turn on or off the special features of the chip
  189. *
  190. * The chip has certain 'features' which are only available when the 'features'
  191. * are enabled. See the datasheet for details.
  192. */
  193. void toggle_features(void);
  194. /**@}*/
  195. public:
  196. /**
  197. * @name Primary public interface
  198. *
  199. * These are the main methods you need to operate the chip
  200. */
  201. /**@{*/
  202. /**
  203. * Constructor
  204. *
  205. * Creates a new instance of this driver. Before using, you create an instance
  206. * and send in the unique pins that this chip is connected to.
  207. *
  208. * @param _cepin The pin attached to Chip Enable on the RF module
  209. * @param _cspin The pin attached to Chip Select
  210. */
  211. RF24(uint8_t _cepin, uint8_t _cspin);
  212. /**
  213. * Begin operation of the chip
  214. *
  215. * Call this in setup(), before calling any other methods.
  216. */
  217. void begin(void);
  218. /**
  219. * Start listening on the pipes opened for reading.
  220. *
  221. * Be sure to call openReadingPipe() first. Do not call write() while
  222. * in this mode, without first calling stopListening(). Call
  223. * isAvailable() to check for incoming traffic, and read() to get it.
  224. */
  225. void startListening(void);
  226. /**
  227. * Stop listening for incoming messages
  228. *
  229. * Do this before calling write().
  230. */
  231. void stopListening(void);
  232. /**
  233. * Write to the open writing pipe
  234. *
  235. * Be sure to call openWritingPipe() first to set the destination
  236. * of where to write to.
  237. *
  238. * This blocks until the message is successfully acknowledged by
  239. * the receiver or the timeout/retransmit maxima are reached. In
  240. * the current configuration, the max delay here is 60ms.
  241. *
  242. * The maximum size of data written is the fixed payload size, see
  243. * getPayloadSize(). However, you can write less, and the remainder
  244. * will just be filled with zeroes.
  245. *
  246. * @param buf Pointer to the data to be sent
  247. * @param len Number of bytes to be sent
  248. * @return True if the payload was delivered successfully false if not
  249. */
  250. bool write( const void* buf, uint8_t len );
  251. /**
  252. * Test whether there are bytes available to be read
  253. *
  254. * @return True if there is a payload available, false if none is
  255. */
  256. bool available(void);
  257. /**
  258. * Read the payload
  259. *
  260. * Return the last payload received
  261. *
  262. * The size of data read is the fixed payload size, see getPayloadSize()
  263. *
  264. * @note I specifically chose 'void*' as a data type to make it easier
  265. * for beginners to use. No casting needed.
  266. *
  267. * @param buf Pointer to a buffer where the data should be written
  268. * @param len Maximum number of bytes to read into the buffer
  269. * @return True if the payload was delivered successfully false if not
  270. */
  271. bool read( void* buf, uint8_t len );
  272. /**
  273. * Open a pipe for writing
  274. *
  275. * Only one pipe can be open at once, but you can change the pipe
  276. * you'll listen to. Do not call this while actively listening.
  277. * Remember to stopListening() first.
  278. *
  279. * Addresses are 40-bit hex values, e.g.:
  280. *
  281. * @code
  282. * openWritingPipe(0xF0F0F0F0F0);
  283. * @endcode
  284. *
  285. * @param address The 40-bit address of the pipe to open. This can be
  286. * any value whatsoever, as long as you are the only one writing to it
  287. * and only one other radio is listening to it. Coordinate these pipe
  288. * addresses amongst nodes on the network.
  289. */
  290. void openWritingPipe(uint64_t address);
  291. /**
  292. * Open a pipe for reading
  293. *
  294. * Up to 6 pipes can be open for reading at once. Open all the
  295. * reading pipes, and then call startListening().
  296. *
  297. * @see openWritingPipe
  298. *
  299. * @warning Pipes 1-5 should share the first 32 bits.
  300. * Only the least significant byte should be unique, e.g.
  301. * @code
  302. * openReadingPipe(1,0xF0F0F0F0AA);
  303. * openReadingPipe(2,0xF0F0F0F066);
  304. * @endcode
  305. *
  306. * @warning Pipe 0 is also used by the writing pipe. So if you open
  307. * pipe 0 for reading, and then startListening(), it will overwrite the
  308. * writing pipe. Ergo, do an openWritingPipe() again before write().
  309. *
  310. * @todo Enforce the restriction that pipes 1-5 must share the top 32 bits
  311. *
  312. * @param number Which pipe# to open, 0-5.
  313. * @param address The 40-bit address of the pipe to open.
  314. */
  315. void openReadingPipe(uint8_t number, uint64_t address);
  316. /**@}*/
  317. /**
  318. * @name Optional Configurators
  319. *
  320. * Methods you can use to get or set the configuration of the chip.
  321. * None are required. Calling begin() sets up a reasonable set of
  322. * defaults.
  323. */
  324. /**@{*/
  325. /**
  326. * Set the number and delay of retries upon failed submit
  327. *
  328. * @param delay How long to wait between each retry, in multiples of 250us,
  329. * max is 15. 0 means 250us, 15 means 4000us.
  330. * @param count How many retries before giving up, max 15
  331. */
  332. void setRetries(uint8_t delay, uint8_t count);
  333. /**
  334. * Set RF communication channel
  335. *
  336. * @param channel Which RF channel to communicate on, 0-127
  337. */
  338. void setChannel(uint8_t channel);
  339. /**
  340. * Set Static Payload Size
  341. *
  342. * This implementation uses a pre-stablished fixed payload size for all
  343. * transmissions. If this method is never called, the driver will always
  344. * transmit the maximum payload size (32 bytes), no matter how much
  345. * was sent to write().
  346. *
  347. * @todo Implement variable-sized payloads feature
  348. *
  349. * @param size The number of bytes in the payload
  350. */
  351. void setPayloadSize(uint8_t size);
  352. /**
  353. * Set Hardware Address Size
  354. *
  355. * Set to either 3, 4 or 5 bytes. Default is 5.
  356. *
  357. * @param size The number of bytes in the payload
  358. */
  359. void setAddressSize(uint8_t size);
  360. /**
  361. * Get Static Payload Size
  362. *
  363. * @see setPayloadSize()
  364. *
  365. * @return The number of bytes in the payload
  366. */
  367. uint8_t getPayloadSize(void);
  368. /**
  369. * Get Dynamic Payload Size
  370. *
  371. * For dynamic payloads, this pulls the size of the payload off
  372. * the chip
  373. *
  374. * @return Payload length of last-received dynamic payload
  375. */
  376. uint8_t getDynamicPayloadSize(void);
  377. /**
  378. * Enable custom payloads on the acknowledge packets
  379. *
  380. * Ack payloads are a handy way to return data back to senders without
  381. * manually changing the radio modes on both units.
  382. *
  383. * @see examples/pingpair_pl/pingpair_pl.pde
  384. */
  385. void enableAckPayload(void);
  386. /**
  387. * Enable dynamically-sized payloads
  388. *
  389. * This way you don't always have to send large packets just to send them
  390. * once in a while. This enables dynamic payloads on ALL pipes.
  391. *
  392. * @see examples/pingpair_pl/pingpair_dyn.pde
  393. */
  394. void enableDynamicPayloads(void);
  395. /**
  396. * Determine whether the hardware is an nRF24L01+ or not.
  397. *
  398. * @return true if the hardware is nRF24L01+ (or compatible) and false
  399. * if its not.
  400. */
  401. bool isPVariant(void) ;
  402. /**
  403. * Enable or disable auto-acknowlede packets
  404. *
  405. * This is enabled by default, so it's only needed if you want to turn
  406. * it off for some reason.
  407. *
  408. * @param enable Whether to enable (true) or disable (false) auto-acks
  409. */
  410. void setAutoAck(bool enable);
  411. /**
  412. * Enable or disable auto-acknowlede packets on a per pipeline basis.
  413. *
  414. * AA is enabled by default, so it's only needed if you want to turn
  415. * it off/on for some reason on a per pipeline basis.
  416. *
  417. * @param pipe Which pipeline to modify
  418. * @param enable Whether to enable (true) or disable (false) auto-acks
  419. */
  420. void setAutoAck( uint8_t pipe, bool enable ) ;
  421. /**
  422. * Set Power Amplifier (PA) level to one of four levels.
  423. * Relative mnemonics have been used to allow for future PA level
  424. * changes. According to 6.5 of the nRF24L01+ specification sheet,
  425. * they translate to: RF24_PA_MIN=-18dBm, RF24_PA_LOW=-12dBm,
  426. * RF24_PA_MED=-6dBM, and RF24_PA_HIGH=0dBm.
  427. *
  428. * @param level Desired PA level.
  429. */
  430. void setPALevel( rf24_pa_dbm_e level ) ;
  431. /**
  432. * Fetches the current PA level.
  433. *
  434. * @return Returns a value from the rf24_pa_dbm_e enum describing
  435. * the current PA setting. Please remember, all values represented
  436. * by the enum mnemonics are negative dBm. See setPALevel for
  437. * return value descriptions.
  438. */
  439. rf24_pa_dbm_e getPALevel( void ) ;
  440. /**
  441. * Set the transmission data rate
  442. *
  443. * @warning setting RF24_250KBPS will fail for non-plus units
  444. *
  445. * @param speed RF24_250KBPS for 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS for 2Mbps
  446. * @return true if the change was successful
  447. */
  448. bool setDataRate(rf24_datarate_e speed);
  449. /**
  450. * Fetches the transmission data rate
  451. *
  452. * @return Returns the hardware's currently configured datarate. The value
  453. * is one of 250kbs, RF24_1MBPS for 1Mbps, or RF24_2MBPS, as defined in the
  454. * rf24_datarate_e enum.
  455. */
  456. rf24_datarate_e getDataRate( void ) ;
  457. /**
  458. * Set the CRC length
  459. *
  460. * @param length RF24_CRC_8 for 8-bit or RF24_CRC_16 for 16-bit
  461. */
  462. void setCRCLength(rf24_crclength_e length);
  463. /**
  464. * Get the CRC length
  465. *
  466. * @return RF24_DISABLED if disabled or RF24_CRC_8 for 8-bit or RF24_CRC_16 for 16-bit
  467. */
  468. rf24_crclength_e getCRCLength(void);
  469. /**
  470. * Disable CRC validation
  471. *
  472. */
  473. void disableCRC( void ) ;
  474. /**@}*/
  475. /**
  476. * @name Advanced Operation
  477. *
  478. * Methods you can use to drive the chip in more advanced ways
  479. */
  480. /**@{*/
  481. /**
  482. * Print a giant block of debugging information to stdout
  483. *
  484. * @warning Does nothing if stdout is not defined. See fdevopen in stdio.h
  485. */
  486. void printDetails(void);
  487. /**
  488. * Enter low-power mode
  489. *
  490. * To return to normal power mode, either write() some data or
  491. * startListening, or powerUp().
  492. */
  493. void powerDown(void);
  494. /**
  495. * Leave low-power mode - making radio more responsive
  496. *
  497. * To return to low power mode, call powerDown().
  498. */
  499. void powerUp(void) ;
  500. /**
  501. * Test whether there are bytes available to be read
  502. *
  503. * Use this version to discover on which pipe the message
  504. * arrived.
  505. *
  506. * @param[out] pipe_num Which pipe has the payload available
  507. * @return True if there is a payload available, false if none is
  508. */
  509. bool available(uint8_t* pipe_num);
  510. /**
  511. * Non-blocking write to the open writing pipe
  512. *
  513. * Just like write(), but it returns immediately. To find out what happened
  514. * to the send, catch the IRQ and then call whatHappened().
  515. *
  516. * @see write()
  517. * @see whatHappened()
  518. *
  519. * @param buf Pointer to the data to be sent
  520. * @param len Number of bytes to be sent
  521. * @return True if the payload was delivered successfully false if not
  522. */
  523. void startWrite( const void* buf, uint8_t len );
  524. /**
  525. * Write an ack payload for the specified pipe
  526. *
  527. * The next time a message is received on @p pipe, the data in @p buf will
  528. * be sent back in the acknowledgement.
  529. *
  530. * @warning According to the data sheet, only three of these can be pending
  531. * at any time. I have not tested this.
  532. *
  533. * @param pipe Which pipe# (typically 1-5) will get this response.
  534. * @param buf Pointer to data that is sent
  535. * @param len Length of the data to send, up to 32 bytes max. Not affected
  536. * by the static payload set by setPayloadSize().
  537. */
  538. void writeAckPayload(uint8_t pipe, const void* buf, uint8_t len);
  539. /**
  540. * Determine if an ack payload was received in the most recent call to
  541. * write().
  542. *
  543. * Call read() to retrieve the ack payload.
  544. *
  545. * @warning Calling this function clears the internal flag which indicates
  546. * a payload is available. If it returns true, you must read the packet
  547. * out as the very next interaction with the radio, or the results are
  548. * undefined.
  549. *
  550. * @return True if an ack payload is available.
  551. */
  552. bool isAckPayloadAvailable(void);
  553. /**
  554. * Call this when you get an interrupt to find out why
  555. *
  556. * Tells you what caused the interrupt, and clears the state of
  557. * interrupts.
  558. *
  559. * @param[out] tx_ok The send was successful (TX_DS)
  560. * @param[out] tx_fail The send failed, too many retries (MAX_RT)
  561. * @param[out] rx_ready There is a message waiting to be read (RX_DS)
  562. */
  563. void whatHappened(bool& tx_ok,bool& tx_fail,bool& rx_ready);
  564. /**
  565. * Test whether there was a carrier on the line for the
  566. * previous listening period.
  567. *
  568. * Useful to check for interference on the current channel.
  569. *
  570. * @return true if was carrier, false if not
  571. */
  572. bool testCarrier(void);
  573. /**
  574. * Test whether a signal (carrier or otherwise) greater than
  575. * or equal to -64dBm is present on the channel. Valid only
  576. * on nRF24L01P (+) hardware. On nRF24L01, use testCarrier().
  577. *
  578. * Useful to check for interference on the current channel and
  579. * channel hopping strategies.
  580. *
  581. * @return true if signal => -64dBm, false if not
  582. */
  583. bool testRPD(void) ;
  584. /**
  585. * Test whether this is a real radio, or a mock shim for
  586. * debugging. Setting either pin to 0xff is the way to
  587. * indicate that this is not a real radio.
  588. *
  589. * @return true if this is a legitimate radio
  590. */
  591. bool isValid() { return ce_pin != 0xff && csn_pin != 0xff; }
  592. /**@}*/
  593. };
  594. /**
  595. * @example GettingStarted.pde
  596. *
  597. * This is an example which corresponds to my "Getting Started" blog post:
  598. * <a style="text-align:center" href="http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/">Getting Started with nRF24L01+ on Arduino</a>.
  599. *
  600. * It is an example of how to use the RF24 class. Write this sketch to two
  601. * different nodes. Put one of the nodes into 'transmit' mode by connecting
  602. * with the serial monitor and sending a 'T'. The ping node sends the current
  603. * time to the pong node, which responds by sending the value back. The ping
  604. * node can then see how long the whole cycle took.
  605. */
  606. /**
  607. * @example nordic_fob.pde
  608. *
  609. * This is an example of how to use the RF24 class to receive signals from the
  610. * Sparkfun Nordic FOB. See http://www.sparkfun.com/products/8602 .
  611. * Thanks to Kirk Mower for providing test hardware.
  612. */
  613. /**
  614. * @example led_remote.pde
  615. *
  616. * This is an example of how to use the RF24 class to control a remote
  617. * bank of LED's using buttons on a remote control.
  618. *
  619. * Every time the buttons change on the remote, the entire state of
  620. * buttons is send to the led board, which displays the state.
  621. */
  622. /**
  623. * @example pingpair.pde
  624. *
  625. * This is an example of how to use the RF24 class. Write this sketch to two
  626. * different nodes, connect the role_pin to ground on one. The ping node sends
  627. * the current time to the pong node, which responds by sending the value back.
  628. * The ping node can then see how long the whole cycle took.
  629. */
  630. /**
  631. * @example pingpair_maple.pde
  632. *
  633. * This is an example of how to use the RF24 class on the Maple. For a more
  634. * detailed explanation, see my blog post:
  635. * <a href="http://maniacbug.wordpress.com/2011/12/14/nrf24l01-running-on-maple-3/">nRF24L01+ Running on Maple</a>
  636. *
  637. * It will communicate well to an Arduino-based unit as well, so it's not for only Maple-to-Maple communication.
  638. *
  639. * Write this sketch to two different nodes,
  640. * connect the role_pin to ground on one. The ping node sends the current time to the pong node,
  641. * which responds by sending the value back. The ping node can then see how long the whole cycle
  642. * took.
  643. */
  644. /**
  645. * @example starping.pde
  646. *
  647. * This sketch is a more complex example of using the RF24 library for Arduino.
  648. * Deploy this on up to six nodes. Set one as the 'pong receiver' by tying the
  649. * role_pin low, and the others will be 'ping transmit' units. The ping units
  650. * unit will send out the value of millis() once a second. The pong unit will
  651. * respond back with a copy of the value. Each ping unit can get that response
  652. * back, and determine how long the whole cycle took.
  653. *
  654. * This example requires a bit more complexity to determine which unit is which.
  655. * The pong receiver is identified by having its role_pin tied to ground.
  656. * The ping senders are further differentiated by a byte in eeprom.
  657. */
  658. /**
  659. * @example pingpair_pl.pde
  660. *
  661. * This is an example of how to do two-way communication without changing
  662. * transmit/receive modes. Here, a payload is set to the transmitter within
  663. * the Ack packet of each transmission. Note that the payload is set BEFORE
  664. * the sender's message arrives.
  665. */
  666. /**
  667. * @example pingpair_irq.pde
  668. *
  669. * This is an example of how to user interrupts to interact with the radio.
  670. * It builds on the pingpair_pl example, and uses ack payloads.
  671. */
  672. /**
  673. * @example pingpair_sleepy.pde
  674. *
  675. * This is an example of how to use the RF24 class to create a battery-
  676. * efficient system. It is just like the pingpair.pde example, but the
  677. * ping node powers down the radio and sleeps the MCU after every
  678. * ping/pong cycle.
  679. */
  680. /**
  681. * @example scanner.pde
  682. *
  683. * Example to detect interference on the various channels available.
  684. * This is a good diagnostic tool to check whether you're picking a
  685. * good channel for your application.
  686. *
  687. * Inspired by cpixip.
  688. * See http://arduino.cc/forum/index.php/topic,54795.0.html
  689. */
  690. /**
  691. * @mainpage Driver for nRF24L01(+) 2.4GHz Wireless Transceiver
  692. *
  693. * @section Goals Design Goals
  694. *
  695. * This library is designed to be...
  696. * @li Maximally compliant with the intended operation of the chip
  697. * @li Easy for beginners to use
  698. * @li Consumed with a public interface that's similiar to other Arduino standard libraries
  699. *
  700. * @section News News
  701. *
  702. * NOW COMPATIBLE WITH ARDUINO 1.0 - The 'master' branch and all examples work with both Arduino 1.0 and earlier versions.
  703. * Please <a href="https://github.com/maniacbug/RF24/issues/new">open an issue</a> if you find any problems using it with any version of Arduino.
  704. *
  705. * NOW COMPATIBLE WITH MAPLE - RF24 has been tested with the
  706. * <a href="http://leaflabs.com/store/#Maple-Native">Maple Native</a>,
  707. * and should work with any Maple board. See the pingpair_maple example.
  708. * Note that only the pingpair_maple example has been tested on Maple, although
  709. * the others can certainly be adapted.
  710. *
  711. * @section Useful Useful References
  712. *
  713. * Please refer to:
  714. *
  715. * @li <a href="http://maniacbug.github.com/RF24/">Documentation Main Page</a>
  716. * @li <a href="http://maniacbug.github.com/RF24/classRF24.html">RF24 Class Documentation</a>
  717. * @li <a href="https://github.com/maniacbug/RF24/">Source Code</a>
  718. * @li <a href="https://github.com/maniacbug/RF24/archives/master">Downloads Page</a>
  719. * @li <a href="http://www.nordicsemi.com/files/Product/data_sheet/nRF24L01_Product_Specification_v2_0.pdf">Chip Datasheet</a>
  720. *
  721. * This chip uses the SPI bus, plus two chip control pins. Remember that pin 10 must still remain an output, or
  722. * the SPI hardware will go into 'slave' mode.
  723. *
  724. * @section More More Information
  725. *
  726. * @subpage FAQ
  727. *
  728. * @section Projects Projects
  729. *
  730. * Stuff I have built with RF24
  731. *
  732. * <img src="http://farm7.staticflickr.com/6044/6307669179_a8d19298a6_m.jpg" width="240" height="160" alt="RF24 Getting Started - Finished Product">
  733. *
  734. * <a style="text-align:center" href="http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/">Getting Started with nRF24L01+ on Arduino</a>
  735. *
  736. * <img src="http://farm8.staticflickr.com/7159/6645514331_38eb2bdeaa_m.jpg" width="240" height="160" alt="Nordic FOB and nRF24L01+">
  737. *
  738. * <a style="text-align:center" href="http://maniacbug.wordpress.com/2012/01/08/nordic-fob/">Using the Sparkfun Nordic FOB</a>
  739. *
  740. * <img src="http://farm7.staticflickr.com/6097/6224308836_b9b3b421a3_m.jpg" width="240" height="160" alt="RF Duinode V3 (2V4)">
  741. *
  742. * <a href="http://maniacbug.wordpress.com/2011/10/19/sensor-node/">Low-Power Wireless Sensor Node</a>
  743. *
  744. * <img src="http://farm8.staticflickr.com/7012/6489477865_b56edb629b_m.jpg" width="240" height="161" alt="nRF24L01+ connected to Leaf Labs Maple Native">
  745. *
  746. * <a href="http://maniacbug.wordpress.com/2011/12/14/nrf24l01-running-on-maple-3/">nRF24L01+ Running on Maple</a>
  747. */
  748. #endif // __RF24_H__
  749. // vim:ai:cin:sts=2 sw=2 ft=cpp