Port of the nRF24l01+ library of these dudes. Not GPLed, so yeah, you can use it. Copyright (c) 2007 Stefan Engelke <mbox@stefanengelke.de> Some parts copyright (c) 2012 Eric Brundick <spirilis [at] linux dot com>
nRF24L01.h@0:670ecbc1478a, 2013-05-28 (annotated)
- Committer:
- heroic
- Date:
- Tue May 28 03:48:04 2013 +0000
- Revision:
- 0:670ecbc1478a
Initial commit to mbedland: port of the Energia nRF24l01+ library as ported to mbed.; ; This is what happens if you use a GPLv3 license, guys: people who want to use the chip have to write their own, or port someone else's MIT licensed one.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
heroic | 0:670ecbc1478a | 1 | /* nRF24L01.h |
heroic | 0:670ecbc1478a | 2 | * Register definitions for manipulating the Nordic Semiconductor |
heroic | 0:670ecbc1478a | 3 | * nRF24L01+ RF transceiver chipsets. |
heroic | 0:670ecbc1478a | 4 | * |
heroic | 0:670ecbc1478a | 5 | |
heroic | 0:670ecbc1478a | 6 | Copyright (c) 2007 Stefan Engelke <mbox@stefanengelke.de> |
heroic | 0:670ecbc1478a | 7 | Some parts copyright (c) 2012 Eric Brundick <spirilis [at] linux dot com> |
heroic | 0:670ecbc1478a | 8 | |
heroic | 0:670ecbc1478a | 9 | Permission is hereby granted, free of charge, to any person |
heroic | 0:670ecbc1478a | 10 | obtaining a copy of this software and associated documentation |
heroic | 0:670ecbc1478a | 11 | files (the "Software"), to deal in the Software without |
heroic | 0:670ecbc1478a | 12 | restriction, including without limitation the rights to use, copy, |
heroic | 0:670ecbc1478a | 13 | modify, merge, publish, distribute, sublicense, and/or sell copies |
heroic | 0:670ecbc1478a | 14 | of the Software, and to permit persons to whom the Software is |
heroic | 0:670ecbc1478a | 15 | furnished to do so, subject to the following conditions: |
heroic | 0:670ecbc1478a | 16 | |
heroic | 0:670ecbc1478a | 17 | The above copyright notice and this permission notice shall be |
heroic | 0:670ecbc1478a | 18 | included in all copies or substantial portions of the Software. |
heroic | 0:670ecbc1478a | 19 | |
heroic | 0:670ecbc1478a | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
heroic | 0:670ecbc1478a | 21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
heroic | 0:670ecbc1478a | 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
heroic | 0:670ecbc1478a | 23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
heroic | 0:670ecbc1478a | 24 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
heroic | 0:670ecbc1478a | 25 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
heroic | 0:670ecbc1478a | 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
heroic | 0:670ecbc1478a | 27 | DEALINGS IN THE SOFTWARE. |
heroic | 0:670ecbc1478a | 28 | */ |
heroic | 0:670ecbc1478a | 29 | #ifndef _NRF24L01_H |
heroic | 0:670ecbc1478a | 30 | #define _NRF24L01_H |
heroic | 0:670ecbc1478a | 31 | |
heroic | 0:670ecbc1478a | 32 | /* Register Map */ |
heroic | 0:670ecbc1478a | 33 | #define RF24_CONFIG 0x00 |
heroic | 0:670ecbc1478a | 34 | #define RF24_EN_AA 0x01 |
heroic | 0:670ecbc1478a | 35 | #define RF24_EN_RXADDR 0x02 |
heroic | 0:670ecbc1478a | 36 | #define RF24_SETUP_AW 0x03 |
heroic | 0:670ecbc1478a | 37 | #define RF24_SETUP_RETR 0x04 |
heroic | 0:670ecbc1478a | 38 | #define RF24_RF_CH 0x05 |
heroic | 0:670ecbc1478a | 39 | #define RF24_RF_SETUP 0x06 |
heroic | 0:670ecbc1478a | 40 | #define RF24_STATUS 0x07 |
heroic | 0:670ecbc1478a | 41 | #define RF24_OBSERVE_TX 0x08 |
heroic | 0:670ecbc1478a | 42 | #define RF24_CD 0x09 |
heroic | 0:670ecbc1478a | 43 | #define RF24_RPD 0x09 |
heroic | 0:670ecbc1478a | 44 | #define RF24_RX_ADDR_P0 0x0A |
heroic | 0:670ecbc1478a | 45 | #define RF24_RX_ADDR_P1 0x0B |
heroic | 0:670ecbc1478a | 46 | #define RF24_RX_ADDR_P2 0x0C |
heroic | 0:670ecbc1478a | 47 | #define RF24_RX_ADDR_P3 0x0D |
heroic | 0:670ecbc1478a | 48 | #define RF24_RX_ADDR_P4 0x0E |
heroic | 0:670ecbc1478a | 49 | #define RF24_RX_ADDR_P5 0x0F |
heroic | 0:670ecbc1478a | 50 | #define RF24_TX_ADDR 0x10 |
heroic | 0:670ecbc1478a | 51 | #define RF24_RX_PW_P0 0x11 |
heroic | 0:670ecbc1478a | 52 | #define RF24_RX_PW_P1 0x12 |
heroic | 0:670ecbc1478a | 53 | #define RF24_RX_PW_P2 0x13 |
heroic | 0:670ecbc1478a | 54 | #define RF24_RX_PW_P3 0x14 |
heroic | 0:670ecbc1478a | 55 | #define RF24_RX_PW_P4 0x15 |
heroic | 0:670ecbc1478a | 56 | #define RF24_RX_PW_P5 0x16 |
heroic | 0:670ecbc1478a | 57 | #define RF24_FIFO_STATUS 0x17 |
heroic | 0:670ecbc1478a | 58 | #define RF24_DYNPD 0x1C |
heroic | 0:670ecbc1478a | 59 | #define RF24_FEATURE 0x1D |
heroic | 0:670ecbc1478a | 60 | |
heroic | 0:670ecbc1478a | 61 | /* Register Bits */ |
heroic | 0:670ecbc1478a | 62 | #define RF24_MASK_RX_DR BIT6 |
heroic | 0:670ecbc1478a | 63 | #define RF24_MASK_TX_DS BIT5 |
heroic | 0:670ecbc1478a | 64 | #define RF24_MASK_MAX_RT BIT4 |
heroic | 0:670ecbc1478a | 65 | #define RF24_EN_CRC BIT3 |
heroic | 0:670ecbc1478a | 66 | #define RF24_CRCO BIT2 |
heroic | 0:670ecbc1478a | 67 | #define RF24_PWR_UP BIT1 |
heroic | 0:670ecbc1478a | 68 | #define RF24_PRIM_RX BIT0 |
heroic | 0:670ecbc1478a | 69 | #define RF24_ENAA_P5 BIT5 |
heroic | 0:670ecbc1478a | 70 | #define RF24_ENAA_P4 BIT4 |
heroic | 0:670ecbc1478a | 71 | #define RF24_ENAA_P3 BIT3 |
heroic | 0:670ecbc1478a | 72 | #define RF24_ENAA_P2 BIT2 |
heroic | 0:670ecbc1478a | 73 | #define RF24_ENAA_P1 BIT1 |
heroic | 0:670ecbc1478a | 74 | #define RF24_ENAA_P0 BIT0 |
heroic | 0:670ecbc1478a | 75 | #define RF24_ERX_P5 BIT5 |
heroic | 0:670ecbc1478a | 76 | #define RF24_ERX_P4 BIT4 |
heroic | 0:670ecbc1478a | 77 | #define RF24_ERX_P3 BIT3 |
heroic | 0:670ecbc1478a | 78 | #define RF24_ERX_P2 BIT2 |
heroic | 0:670ecbc1478a | 79 | #define RF24_ERX_P1 BIT1 |
heroic | 0:670ecbc1478a | 80 | #define RF24_ERX_P0 BIT0 |
heroic | 0:670ecbc1478a | 81 | #define RF24_AW BIT0 |
heroic | 0:670ecbc1478a | 82 | #define RF24_ARD BIT4 |
heroic | 0:670ecbc1478a | 83 | #define RF24_ARC BIT0 |
heroic | 0:670ecbc1478a | 84 | #define RF24_PLL_LOCK BIT4 |
heroic | 0:670ecbc1478a | 85 | #define RF24_CONT_WAVE BIT7 |
heroic | 0:670ecbc1478a | 86 | #define RF24_RF_DR BIT3 |
heroic | 0:670ecbc1478a | 87 | #define RF24_RF_DR_LOW BIT5 |
heroic | 0:670ecbc1478a | 88 | #define RF24_RF_DR_HIGH BIT3 |
heroic | 0:670ecbc1478a | 89 | #define RF24_RF_PWR BIT1 |
heroic | 0:670ecbc1478a | 90 | #define RF24_LNA_HCURR BIT0 |
heroic | 0:670ecbc1478a | 91 | #define RF24_RX_DR BIT6 |
heroic | 0:670ecbc1478a | 92 | #define RF24_TX_DS BIT5 |
heroic | 0:670ecbc1478a | 93 | #define RF24_MAX_RT BIT4 |
heroic | 0:670ecbc1478a | 94 | #define RF24_RX_P_NO BIT1 |
heroic | 0:670ecbc1478a | 95 | #define RF24_TX_FULL BIT0 |
heroic | 0:670ecbc1478a | 96 | #define RF24_PLOS_CNT BIT4 |
heroic | 0:670ecbc1478a | 97 | #define RF24_ARC_CNT BIT0 |
heroic | 0:670ecbc1478a | 98 | #define RF24_TX_REUSE BIT6 |
heroic | 0:670ecbc1478a | 99 | #define RF24_FIFO_FULL BIT5 |
heroic | 0:670ecbc1478a | 100 | #define RF24_TX_EMPTY BIT4 |
heroic | 0:670ecbc1478a | 101 | #define RF24_RX_FULL BIT1 |
heroic | 0:670ecbc1478a | 102 | #define RF24_RX_EMPTY BIT0 |
heroic | 0:670ecbc1478a | 103 | #define RF24_EN_DPL BIT2 |
heroic | 0:670ecbc1478a | 104 | #define RF24_EN_ACK_PAY BIT1 |
heroic | 0:670ecbc1478a | 105 | #define RF24_EN_DYN_ACK BIT0 |
heroic | 0:670ecbc1478a | 106 | |
heroic | 0:670ecbc1478a | 107 | /* Instructions */ |
heroic | 0:670ecbc1478a | 108 | #define RF24_R_REGISTER 0x00 |
heroic | 0:670ecbc1478a | 109 | #define RF24_W_REGISTER 0x20 |
heroic | 0:670ecbc1478a | 110 | #define RF24_REGISTER_MASK 0x1F |
heroic | 0:670ecbc1478a | 111 | #define RF24_R_RX_PAYLOAD 0x61 |
heroic | 0:670ecbc1478a | 112 | #define RF24_W_TX_PAYLOAD 0xA0 |
heroic | 0:670ecbc1478a | 113 | #define RF24_FLUSH_TX 0xE1 |
heroic | 0:670ecbc1478a | 114 | #define RF24_FLUSH_RX 0xE2 |
heroic | 0:670ecbc1478a | 115 | #define RF24_REUSE_TX_PL 0xE3 |
heroic | 0:670ecbc1478a | 116 | #define RF24_R_RX_PL_WID 0x60 |
heroic | 0:670ecbc1478a | 117 | #define RF24_W_ACK_PAYLOAD 0xA8 |
heroic | 0:670ecbc1478a | 118 | #define RF24_W_TX_PAYLOAD_NOACK 0xB0 |
heroic | 0:670ecbc1478a | 119 | #define RF24_NOP 0xFF |
heroic | 0:670ecbc1478a | 120 | |
heroic | 0:670ecbc1478a | 121 | #endif |