summaryrefslogtreecommitdiffstats
path: root/nrfm.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-03-16 23:06:54 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-03-16 23:06:54 +0800
commit264a3d1b988178b71ae3c78bad9f1ab371ab8f9d (patch)
tree03a712f9d7bcf5149d54ba71d921d5343513d5ca /nrfm.c
parentb3f6f812b93bfddcaec8faa26172d15bd3607dd8 (diff)
downloadavr-nrf24l01-driver-264a3d1b988178b71ae3c78bad9f1ab371ab8f9d.tar.gz
Code format.
Diffstat (limited to 'nrfm.c')
-rw-r--r--nrfm.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/nrfm.c b/nrfm.c
index 2ffcf62..cd791ef 100644
--- a/nrfm.c
+++ b/nrfm.c
@@ -6,24 +6,25 @@
#include "nrfm.h"
#include "uart.h"
-#define SPI_SS PB2
-#define SPI_SCK PB5
-#define SPI_MISO PB4
-#define SPI_MOSI PB3
-#define SPI_DDR DDRB
-#define SPI_PORT PORTB
-
-#define NRF_IRQ PD7
-#define NRF_CE PB1
-#define NRF_CE_DDR DDRB
-#define NRF_CE_PORT PORTB
+#define SPI_SS PB2
+#define SPI_SCK PB5
+#define SPI_MISO PB4
+#define SPI_MOSI PB3
+#define SPI_DDR DDRB
+#define SPI_PORT PORTB
+
+#define NRF_IRQ PD7
+#define NRF_CE PB1
+#define NRF_CE_DDR DDRB
+#define NRF_CE_PORT PORTB
#define NRF_NOP 0xFF
#define NRF_R_REGISTER 0x1F
#define NRF_W_REGISTER 0x20
#define ADDRLEN 3
-#define LEN(a) (sizeof(a) / sizeof(a[0]))
+
+#define LEN(a) (sizeof(a) / sizeof(a[0]))
const char *bittab[16] = {
[ 0] = "0000", [ 1] = "0001", [ 2] = "0010", [ 3] = "0011",
@@ -94,11 +95,7 @@ void radio_print_config(void)
{
char s[22];
uint8_t i, rv, addr[ADDRLEN];
-
- uint8_t regs[] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
- 0x06, 0x07, 0x11
- };
+ uint8_t regs[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x11 };
uart_write_line("NRF24L01 config:");