29#define PX_NRF905_INSTR_W_CONFIG 0x00
30#define PX_NRF905_INSTR_R_CONFIG 0x10
31#define PX_NRF905_INSTR_W_TX_PAYLOAD 0x20
32#define PX_NRF905_INSTR_R_TX_PAYLOAD 0x21
33#define PX_NRF905_INSTR_W_TX_ADDRESS 0x22
34#define PX_NRF905_INSTR_R_TX_ADDRESS 0x23
35#define PX_NRF905_INSTR_R_RX_PAYLOAD 0x24
36#define PX_NRF905_INSTR_CHANNEL_CONFIG 0x80
52 px_nrf905_spi_handle = handle;
62 spi_data[0] = PX_NRF905_INSTR_W_CONFIG | start_byte;
67 &((
const uint8_t *)cfg)[start_byte],
82 spi_data[0] = PX_NRF905_INSTR_R_CONFIG | start_byte;
87 &((uint8_t *)cfg)[start_byte],
95uint8_t px_nrf905_tx_payload_wr(
const void * data, uint8_t nr_of_bytes)
102 spi_data[0] = PX_NRF905_INSTR_W_TX_PAYLOAD;
115uint8_t px_nrf905_tx_payload_rd(
void * data, uint8_t nr_of_bytes)
119 PX_LOG_ASSERT( ((nr_of_bytes >= 1) && (nr_of_bytes <= 32)) );
122 spi_data[0] = PX_NRF905_INSTR_R_TX_PAYLOAD;
135uint8_t px_nrf905_rx_payload_rd(
void * data, uint8_t nr_of_bytes)
139 PX_LOG_ASSERT( ((nr_of_bytes >= 1) && (nr_of_bytes <= 32)) );
142 spi_data[0] = PX_NRF905_INSTR_R_RX_PAYLOAD;
155uint8_t px_nrf905_channel_cfg(uint16_t channel_no, uint8_t hfreq_pll, uint8_t pa_pwr)
162 spi_data[0] = PX_NRF905_INSTR_CHANNEL_CONFIG
166 spi_data[1] = channel_no & 0xff;
#define PX_LOG_NAME(name)
Macro to declare a log name string once for each file to reduce code size.
#define PX_LOG_ASSERT(expression)
Macro that will test an expression, and block indefinitely if false.
NRF905 Configuration register map.
#define PX_SPI_FLAG_START
Begin SPI transaction (take SPI slave's Chip Select line low)
void px_spi_xc(px_spi_handle_t *handle, const void *data_wr, void *data_rd, size_t nr_of_bytes, uint8_t flags)
Perform an SPI exchange (write and read) transaction with an SPI slave.
void px_spi_wr(px_spi_handle_t *handle, const void *data, size_t nr_of_bytes, uint8_t flags)
Perform an SPI write transaction with an SPI slave.
void px_spi_rd(px_spi_handle_t *handle, void *data, size_t nr_of_bytes, uint8_t flags)
Perform an SPI read transaction with an SPI slave.
#define PX_SPI_FLAG_STOP
Finish SPI transaction (take SPI slave's Chip Select line high)