esp-sdr-zephyr
Raw I/Q receive and transmit on the ESP32-S3/C6 Wi-Fi radio, for Zephyr
Loading...
Searching...
No Matches
ieee154_phy.h File Reference

Software IEEE 802.15.4 2.4 GHz O-QPSK PHY, portable C. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ieee154_phy_trk
struct  ieee154_phy_counts
struct  ieee154_phy_rx

Macros

#define IEEE154_PHY_PSDU_MAX   127
#define IEEE154_PHY_MOD_SAMPLES(len)
#define IEEE154_PHY_FRAME_SAMPLES(len)
#define IEEE154_PHY_DUP_SAMPLES   4

Typedefs

typedef void(* ieee154_phy_frame_cb_t) (const uint8_t *psdu, uint8_t len, int lqi, void *user)
typedef void(* ieee154_phy_all_cb_t) (const uint8_t *psdu, uint8_t len, int lqi, bool fcs_ok, void *user)
typedef bool(* ieee154_phy_hdr_cb_t) (const uint8_t *psdu, uint8_t have, uint8_t len, uint32_t end_pos, void *user)

Functions

void ieee154_phy_init (void)
void ieee154_phy_rx_init (struct ieee154_phy_rx *rx)
void ieee154_phy_set_rx_cb_i (struct ieee154_phy_rx *rx, ieee154_phy_frame_cb_t cb, void *user)
void ieee154_phy_set_hdr_cb_i (struct ieee154_phy_rx *rx, ieee154_phy_hdr_cb_t cb, void *user)
void ieee154_phy_set_all_cb_i (struct ieee154_phy_rx *rx, ieee154_phy_all_cb_t cb, void *user)
void ieee154_phy_rx_block_i (struct ieee154_phy_rx *rx, const int16_t *iq, size_t n)
void ieee154_phy_rx_reset_i (struct ieee154_phy_rx *rx)
uint8_t ieee154_phy_rx_preamble_run_i (const struct ieee154_phy_rx *rx)
void ieee154_phy_rx_counts_i (const struct ieee154_phy_rx *rx, struct ieee154_phy_counts *c)
void ieee154_phy_rx_counts_clear_i (struct ieee154_phy_rx *rx)
uint32_t ieee154_phy_rx_position_i (const struct ieee154_phy_rx *rx)
uint32_t ieee154_phy_rx_frame_start_i (const struct ieee154_phy_rx *rx)
void ieee154_phy_set_rx_cb (ieee154_phy_frame_cb_t cb, void *user)
void ieee154_phy_set_hdr_cb (ieee154_phy_hdr_cb_t cb, void *user)
void ieee154_phy_rx_block (const int16_t *iq, size_t n)
void ieee154_phy_rx_reset (void)
uint32_t ieee154_phy_rx_position (void)
uint32_t ieee154_phy_rx_frame_start (void)
void ieee154_phy_rx_counts (struct ieee154_phy_counts *c)
void ieee154_phy_rx_counts_clear (void)
uint32_t ieee154_phy_chips (int sym)
size_t ieee154_phy_modulate (const uint8_t *psdu, uint8_t len, int16_t amp, int16_t *out, size_t max_samples)
size_t ieee154_phy_append_fcs (uint8_t *buf, size_t n)

Detailed Description

Software IEEE 802.15.4 2.4 GHz O-QPSK PHY, portable C.

All sample buffers are interleaved int16 I/Q at 4 MS/s (2 samples per chip). The receiver's state is a struct ieee154_phy_rx: the instance functions (suffix _i where a function of the same name exists for the one static instance behind the original API) take it first, and any number of receivers run side by side. The chip tables are global: ieee154_phy_init() once, before any receiver.