This is the final version of Mini Gateway for Automation and Security desgined for Renesas GR Peach Design Contest

Dependencies:   GR-PEACH_video GraphicsFramework HTTPServer R_BSP mbed-rpc mbed-rtos Socket lwip-eth lwip-sys lwip FATFileSystem

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nRF24L01.h Source File

nRF24L01.h

00001 /*
00002     Copyright (c) 2007 Stefan Engelke <mbox@stefanengelke.de>
00003     Portions Copyright (C) 2011 Greg Copeland
00004 
00005     Permission is hereby granted, free of charge, to any person
00006     obtaining a copy of this software and associated documentation
00007     files (the "Software"), to deal in the Software without
00008     restriction, including without limitation the rights to use, copy,
00009     modify, merge, publish, distribute, sublicense, and/or sell copies
00010     of the Software, and to permit persons to whom the Software is
00011     furnished to do so, subject to the following conditions:
00012 
00013     The above copyright notice and this permission notice shall be
00014     included in all copies or substantial portions of the Software.
00015 
00016     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00017     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00019     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
00020     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
00021     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00022     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023     DEALINGS IN THE SOFTWARE.
00024 */
00025 
00026 /*
00027  * Mbed support added by Akash Vibhute <akash.roboticist@gmail.com>
00028  * Porting completed on Nov/05/2015
00029  *
00030  * Updated 1: Synced with TMRh20's RF24 library on Nov/04/2015 from https://github.com/TMRh20
00031  * Updated 2: Synced with TMRh20's RF24 library on Apr/18/2015 from https://github.com/TMRh20
00032  *
00033  */
00034 
00035 /* Memory Map */
00036 #define NRF_CONFIG      0x00
00037 #define EN_AA       0x01
00038 #define EN_RXADDR   0x02
00039 #define SETUP_AW    0x03
00040 #define SETUP_RETR  0x04
00041 #define RF_CH       0x05
00042 #define RF_SETUP    0x06
00043 #define NRF_STATUS  0x07
00044 #define OBSERVE_TX  0x08
00045 #define CD          0x09
00046 #define RX_ADDR_P0  0x0A
00047 #define RX_ADDR_P1  0x0B
00048 #define RX_ADDR_P2  0x0C
00049 #define RX_ADDR_P3  0x0D
00050 #define RX_ADDR_P4  0x0E
00051 #define RX_ADDR_P5  0x0F
00052 #define TX_ADDR     0x10
00053 #define RX_PW_P0    0x11
00054 #define RX_PW_P1    0x12
00055 #define RX_PW_P2    0x13
00056 #define RX_PW_P3    0x14
00057 #define RX_PW_P4    0x15
00058 #define RX_PW_P5    0x16
00059 #define FIFO_STATUS 0x17
00060 #define DYNPD       0x1C
00061 #define FEATURE     0x1D
00062 
00063 /* Bit Mnemonics */
00064 #define MASK_RX_DR  6
00065 #define MASK_TX_DS  5
00066 #define MASK_MAX_RT 4
00067 #define EN_CRC      3
00068 #define CRCO        2
00069 #define PWR_UP      1
00070 #define PRIM_RX     0
00071 #define ENAA_P5     5
00072 #define ENAA_P4     4
00073 #define ENAA_P3     3
00074 #define ENAA_P2     2
00075 #define ENAA_P1     1
00076 #define ENAA_P0     0
00077 #define ERX_P5      5
00078 #define ERX_P4      4
00079 #define ERX_P3      3
00080 #define ERX_P2      2
00081 #define ERX_P1      1
00082 #define ERX_P0      0
00083 #define AW          0
00084 #define ARD         4
00085 #define ARC         0
00086 #define PLL_LOCK    4
00087 #define RF_DR       3
00088 #define RF_PWR      6
00089 #define RX_DR       6
00090 #define TX_DS       5
00091 #define MAX_RT      4
00092 #define RX_P_NO     1
00093 #define TX_FULL     0
00094 #define PLOS_CNT    4
00095 #define ARC_CNT     0
00096 #define TX_REUSE    6
00097 #define FIFO_FULL   5
00098 #define TX_EMPTY    4
00099 #define RX_FULL     1
00100 #define RX_EMPTY    0
00101 #define DPL_P5      5
00102 #define DPL_P4      4
00103 #define DPL_P3      3
00104 #define DPL_P2      2
00105 #define DPL_P1      1
00106 #define DPL_P0      0
00107 #define EN_DPL      2
00108 #define EN_ACK_PAY  1
00109 #define EN_DYN_ACK  0
00110 
00111 /* Instruction Mnemonics */
00112 #define R_REGISTER    0x00
00113 #define W_REGISTER    0x20
00114 #define REGISTER_MASK 0x1F
00115 #define ACTIVATE      0x50
00116 #define R_RX_PL_WID   0x60
00117 #define R_RX_PAYLOAD  0x61
00118 #define W_TX_PAYLOAD  0xA0
00119 #define W_ACK_PAYLOAD 0xA8
00120 #define FLUSH_TX      0xE1
00121 #define FLUSH_RX      0xE2
00122 #define REUSE_TX_PL   0xE3
00123 #define NOP           0xFF
00124 
00125 /* Non-P omissions */
00126 #define LNA_HCURR   0
00127 
00128 /* P model memory Map */
00129 #define RPD         0x09
00130 #define W_TX_PAYLOAD_NO_ACK  0xB0
00131 
00132 /* P model bit Mnemonics */
00133 #define RF_DR_LOW   5
00134 #define RF_DR_HIGH  3
00135 #define RF_PWR_LOW  1
00136 #define RF_PWR_HIGH 2
00137 
00138