1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /*
- * radio.h
- *
- * Created on: Oct 11, 2019
- * Author: curiousmuch
- */
- #include <stdint.h>
- #ifndef RADIO_H_
- #define RADIO_H_
- /* Data Structures */
- typedef enum {
- NOT_CONFIGURED = 0,
- AX25,
- ARROW_MESH,
- ESP_MESH,
- } radio_config_t;
- typedef enum {
- RADIO_IDLE = 0,
- RADIO_TX,
- RADIO_RX,
- } radio_status_t;
- // internal radio data structure
- typedef struct {
- radio_config_t type;
- radio_status_t status;
- void (*rx_cb)(uint8_t *, uint32_t);
- void (*tx_cb)(void);
- } radio_param_t;
- // holds all the settings for AX25
- // style communications used typically
- // on 2M band
- typedef struct {
- uint8_t tx_delay;
- uint8_t tx_tail;
- uint32_t sample_rate;
- uint32_t symbol0_freq;
- uint32_t symbol1_freq;
- uint8_t *rx_buf;
- uint32_t rx_buf_len;
- void (*rx_cb)(uint8_t *, uint32_t);
- void (*tx_cb)(void);
- uint8_t cpu_core;
- } ax25_param_t;
- /* Public Functions */
- void radio_init(radio_config_t type, void *settings);
- void radio_set_frequency(uint32_t);
- void radio_set_power(int8_t);
- uint8_t radio_get_cs(void);
- int8_t radio_get_rssi(void);
- int8_t radio_get_sample(void);
- void radio_packet_rx(void *settings);
- void radio_packet_tx(uint8_t *data, int32_t len, void *settings);
- #endif /* COMPONENTS_RADIO_INCLUDE_RADIO_H_ */
|