ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_communication_radio.h
Go to the documentation of this file.
1 #ifndef RUUVI_INTERFACE_COMMUNICATION_RADIO_H
2 #define RUUVI_INTERFACE_COMMUNICATION_RADIO_H
3 
5 #include "ruuvi_driver_error.h"
6 #include <stdbool.h>
7 #include <stdint.h>
8 #if RI_RADIO_ENABLED
9 #define RUUVI_NRF5_SDK15_RADIO_ENABLED RUUVI_NRF5_SDK15_ENABLED
10 #endif
11 
30 typedef enum
31 {
35 
39 typedef enum
40 {
46 
50 typedef struct
51 {
52  uint8_t channel_37 : 1;
53  uint8_t channel_38 : 1;
54  uint8_t channel_39 : 1;
56 
64 
72 
81 
96 
107 
118 rd_status_t ri_radio_address_get (uint64_t * const address);
119 
134 rd_status_t ri_radio_address_set (uint64_t const address);
135 
143 
150 
165 
167 #endif
uint32_t rd_status_t
bitfield for representing errors
void ri_radio_activity_callback_set(const ri_radio_activity_interrupt_fp_t handler)
Setup radio activity interrupt.
rd_status_t ri_radio_get_modulation(ri_radio_modulation_t *const p_modulation)
Get the modulation used by application.
bool ri_radio_is_init()
Check if radio is initialized.
ri_radio_activity_evt_t
radio activity event type.
rd_status_t ri_radio_init(const ri_radio_modulation_t modulation)
Enable radio stack for an user. This function also starts radio activity callbacks internally.
rd_status_t ri_radio_uninit()
Release radio stack.
rd_status_t ri_radio_address_get(uint64_t *const address)
bool ri_radio_supports(ri_radio_modulation_t modulation)
Check if radio supports given modulation.
void(* ri_radio_activity_interrupt_fp_t)(const ri_radio_activity_evt_t evt)
Type of radio activity interrupt. This is common to all radio modules, i,e, the callback gets called ...
ri_radio_modulation_t
type of radio modulation to be used.
rd_status_t ri_radio_address_set(uint64_t const address)
uint8_t ri_radio_num_channels_get(const ri_radio_channels_t channels)
Check how many radio channels are enabled.
@ RI_RADIO_AFTER
Event is after radio activity, i.e. radio was turned off.
@ RI_RADIO_BEFORE
Event is before radio goes active, i.e. radio turns on soon.
@ RI_RADIO_BLE_1MBPS
"Normal" BLE 4 modulation
@ RI_RADIO_BLE_2MBPS
"Fast BLE". Advertising uses 1MBPS primary advertisement followed by 2 MBit/s extended advertisement.
@ RI_RADIO_BLE_125KBPS
Also known as BLE Long Range S=8.
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
Bitfield to describe related sensor data.
uint8_t channel_37
BLE channel 37, 2402 MHz.
uint8_t channel_39
BLE channel 39, 2480 MHz.
uint8_t channel_38
BLE channel 38, 2426 MHz.