diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-03-16 23:06:54 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-03-16 23:06:54 +0800 |
| commit | 264a3d1b988178b71ae3c78bad9f1ab371ab8f9d (patch) | |
| tree | 03a712f9d7bcf5149d54ba71d921d5343513d5ca /nrfm.c | |
| parent | b3f6f812b93bfddcaec8faa26172d15bd3607dd8 (diff) | |
| download | avr-nrf24l01-driver-264a3d1b988178b71ae3c78bad9f1ab371ab8f9d.tar.gz | |
Code format.
Diffstat (limited to 'nrfm.c')
| -rw-r--r-- | nrfm.c | 31 |
1 files changed, 14 insertions, 17 deletions
@@ -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:"); |
