#include <msp430x44x.h>
#include "nrf24l01.h"
#include "lcd.h"
Include dependency graph for nrf24l01.c:

Go to the source code of this file.
Defines | |
| #define | CSN_TIME 2 |
| #define | CE_HIGH_TIME 10000 |
Functions | |
| void | Delay (unsigned long a) |
| Software delay. | |
| void | CSN_HIGH (void) |
| Internally used function to switch /CS line to high. | |
| void | CSN_LOW (void) |
| Internally used function to switch /CS line to low. | |
| void | CE_HIGH (void) |
| Internal function to enable chip nRF24L01 (switch chip enable line to high). | |
| void | CE_LOW (void) |
| Internally used function to disable chip nRF24L01 (switch chip enable line to low). | |
| unsigned char | SPI_SendByte (unsigned char data) |
| Internally used function to transmit and receive a byte via SPI channel. | |
| unsigned char | SPI_Send_command_with_ADDR (unsigned char cmd, unsigned char addr, unsigned char data_byte) |
| Internally used function to send command to the chip NRF24L01 via SPI. | |
| unsigned char | SPI_Send_command_without_ADDR (unsigned char cmd, unsigned char data_byte) |
| Internally used function to send command to the chip NRF24L01 via SPI. | |
| void | NRF_init (void) |
| Initialize SPI interface and chip nRF24L01. | |
| void | NRF_send (uint8_t byte) |
| Send one byte to the air via chip nRF24L01. | |
| void | NRF_prepareForReceive () |
| After sending a byte you may set the device to RX mode. | |
| bool_t | NRF_receive (uint8_t *const byte) |
| Receive one byte from the air via chip nRF24L01. | |
Variables | |
| unsigned char | RX_ADDRESS_P0 [5] = {5,6,7,8,9} |
| Receive the packets with following address. | |
| unsigned char | RX_ADDRESS_P1 [5] = {0,1,2,3,4} |
| Receive the packets with following address. | |
| unsigned char | TX_ADDRESS [5] = {5,6,7,8,9} |
| Transmit packets with following address. | |
| unsigned char | ADDRESS [5] |
| unsigned char | status |
This is for MOD-NRF24Lx (MOD-NRF24LR or MOD-NRF24LS) extension board. You should connect P3.0 to CSN, P3.1 to MOSI, P3.2 to MISO, P3.3 to CLK and P1.6 to CE using the EXT connector of MSP430-449STK2.
Definition in file nrf24l01.c.
| #define CE_HIGH_TIME 10000 |
Definition at line 24 of file nrf24l01.c.
| #define CSN_TIME 2 |
Definition at line 23 of file nrf24l01.c.
| void CE_HIGH | ( | void | ) |
Internal function to enable chip nRF24L01 (switch chip enable line to high).
Definition at line 66 of file nrf24l01.c.
| void CE_LOW | ( | void | ) | [inline] |
Internally used function to disable chip nRF24L01 (switch chip enable line to low).
Definition at line 75 of file nrf24l01.c.
| void CSN_HIGH | ( | void | ) | [inline] |
| void CSN_LOW | ( | void | ) |
| void Delay | ( | unsigned long | a | ) |
| void NRF_init | ( | void | ) |
| void NRF_prepareForReceive | ( | ) |
| bool_t NRF_receive | ( | uint8_t *const | byte | ) |
Receive one byte from the air via chip nRF24L01.
Addresses are hardcoded:
| byte | The data byte to receive. |
Definition at line 340 of file nrf24l01.c.
| void NRF_send | ( | uint8_t | byte | ) |
Send one byte to the air via chip nRF24L01.
Addresses are hardcoded:
| byte | The data byte to send. |
Definition at line 264 of file nrf24l01.c.
| unsigned char SPI_Send_command_with_ADDR | ( | unsigned char | cmd, | |
| unsigned char | addr, | |||
| unsigned char | data_byte | |||
| ) |
Internally used function to send command to the chip NRF24L01 via SPI.
| cmd | Command to send. Example: R_REGISTER | |
| addr | Address to send. Example: RX_ADDR_P0 | |
| data_byte | Data byte to send. This data byte will not be sent in some cases! Check source code! |
Definition at line 102 of file nrf24l01.c.
| unsigned char SPI_Send_command_without_ADDR | ( | unsigned char | cmd, | |
| unsigned char | data_byte | |||
| ) |
Internally used function to send command to the chip NRF24L01 via SPI.
| cmd | Command to send. Example: R_REGISTER | |
| data_byte | Data byte to send. This data byte will not be sent in some cases! Check source code! |
Definition at line 185 of file nrf24l01.c.
| unsigned char SPI_SendByte | ( | unsigned char | data | ) |
Internally used function to transmit and receive a byte via SPI channel.
| data | One byte to send. |
Definition at line 86 of file nrf24l01.c.
| unsigned char ADDRESS[5] |
Definition at line 32 of file nrf24l01.c.
| unsigned char RX_ADDRESS_P0[5] = {5,6,7,8,9} |
| unsigned char RX_ADDRESS_P1[5] = {0,1,2,3,4} |
| unsigned char status |
Definition at line 34 of file nrf24l01.c.
| unsigned char TX_ADDRESS[5] = {5,6,7,8,9} |
1.5.1