18 #include "nRF905_config.h" 133 #define NRF905_MAX_PAYLOAD 32 134 #define NRF905_REGISTER_COUNT 10 135 #define NRF905_DEFAULT_RXADDR 0xE7E7E7E7 136 #define NRF905_DEFAULT_TXADDR 0xE7E7E7E7 138 #define NRF905_CALC_CHANNEL(f, b) ((((f) / (1 + (b>>1))) - 422400000UL) / 100000UL) 140 #if defined(__cplusplus) 355 #if DOXYGEN || NRF905_INTERRUPTS == 0 358 #define nRF905_SERVICE() ((void)(0)) 382 #if DOXYGEN || NRF905_INTERRUPTS != 0 384 #if !defined(DOXYGEN) 385 static inline void _nRF905_iRestore(
const uint8_t *__s)
388 __asm__
volatile (
"" :::
"memory");
406 #define NRF905_NO_INTERRUPT() \ 407 for(uint8_t nrf905_irq __attribute__((__cleanup__(_nRF905_iRestore))) = nRF905_irq_off(), \ 408 nrf905_tmp = 1; nrf905_tmp ; nrf905_tmp = 0) 411 #define NRF905_NO_INTERRUPT() ((void)(0)); 415 #if defined(__cplusplus) nRF905_addr_size_t
Address size.
Definition: nRF905.h:103
void nRF905_setAddressSize(nRF905_addr_size_t size)
Address size.
10dBm = 10mW
Definition: nRF905.h:53
uint8_t nRF905_airwayBusy(void)
See if airway is busy (carrier detect pin asserted).
void nRF905_setPayloadSize(uint8_t size)
Payload size.
868/915MHz band
Definition: nRF905.h:42
nRF905_auto_retran_t
Auto re-transmit options.
Definition: nRF905.h:68
4MHz clock
Definition: nRF905.h:80
nRF905_band_t
Frequency bands.
Definition: nRF905.h:33
Transmit mode (will auto-retransmit if ::NRF905_AUTO_RETRAN is NRF905_AUTO_RETRAN_ENABLE, otherwise will transmit a carrier wave with no data)
Definition: nRF905.h:27
uint8_t nRF905_TX(uint32_t sendTo, void *data, uint8_t len, nRF905_nextmode_t nextMode)
Begin a transmission.
Disable auto re-transmit.
Definition: nRF905.h:70
void nRF905_powerUp(void)
Enter standby mode.
2MHz clock
Definition: nRF905.h:81
void nRF905_setAutoRetransmit(nRF905_auto_retran_t val)
Set auto retransmit.
void nRF905_setLowRxPower(nRF905_low_rx_t val)
Set low power receive.
nRF905_outclk_t
Output a clock signal on pin 3 of IC.
Definition: nRF905.h:77
6dBm = 4mW
Definition: nRF905.h:52
Disable low power receive.
Definition: nRF905.h:61
void nRF905_setClockOut(nRF905_outclk_t val)
Set clock output.
void nRF905_standby(void)
Enter standby mode.
Disable CRC.
Definition: nRF905.h:93
1MHz clock
Definition: nRF905.h:82
nRF905_pwr_t
Output power (n means negative, n10 = -10).
Definition: nRF905.h:48
void nRF905_irq_on(uint8_t origVal)
When using interrupts use this to re-enable them for the nRF905.
void nRF905_getConfigRegisters(void *)
Read configuration registers into byte array of NRF905_REGISTER_COUNT elements, mainly for debugging...
433MHz band
Definition: nRF905.h:40
Standby mode.
Definition: nRF905.h:25
void nRF905_setBand(nRF905_band_t band)
Frequency band.
1 byte (not recommended, a lot of false invalid packets will be received)
Definition: nRF905.h:105
8bit CRC (Don't know what algorithm is used for this one)
Definition: nRF905.h:94
void nRF905_setListenAddress(uint32_t address)
Set address to listen to.
nRF905_low_rx_t
Save a few mA by reducing receive sensitivity.
Definition: nRF905.h:59
void nRF905_init(void)
Initialise, must be called before anything else!
void nRF905_setChannel(uint16_t channel)
Channel to listen and transmit on.
4 bytes
Definition: nRF905.h:106
void nRF905_setCRC(nRF905_crc_t val)
Set CRC.
Receive mode.
Definition: nRF905.h:26
void nRF905_RX(void)
Enter receive mode.
void nRF905_setTransmitPower(nRF905_pwr_t val)
Set output power.
nRF905_nextmode_t
Available modes after transmission complete.
Definition: nRF905.h:23
void nRF905_read(void *data, uint8_t len)
Get received payload.
Disable output clock.
Definition: nRF905.h:79
void nRF905_powerDown(void)
Sleep.
16bit CRC (CRC16-CCITT-FALSE (0xFFFF))
Definition: nRF905.h:95
uint8_t nRF905_irq_off(void)
When using interrupts use this to disable them for the nRF905.
868/915MHz band
Definition: nRF905.h:41
Enable low power receive.
Definition: nRF905.h:62
void nRF905_SERVICE(void)
If interrupts are disabled (::NRF905_INTERRUPTS in nRF905_config.h) then this function should be call...
-2dBm = 631uW
Definition: nRF905.h:51
-10dBm = 100uW
Definition: nRF905.h:50
nRF905_crc_t
CRC Checksum.
Definition: nRF905.h:91
500KHz clock (default)
Definition: nRF905.h:83
Enable auto re-transmit.
Definition: nRF905.h:71
uint8_t nRF905_receiveBusy(void)
See if the attach match is asserted.