17#ifndef ESP_SDR_IEEE154_PHY_H_
18#define ESP_SDR_IEEE154_PHY_H_
34#define IEEE154_PHY_PSDU_MAX 127
37#define IEEE154_PHY_MOD_SAMPLES(len) ((6 + (size_t)(len)) * 128 + 4)
44#define IEEE154_PHY_FRAME_SAMPLES(len) ((6U + (uint32_t)(len)) * 128U)
74#define IEEE154_PHY_DUP_SAMPLES 4
85 uint32_t end_pos,
void *user);
93 uint32_t win, nchip, anchor;
95 uint8_t run, st, nib_have, nib_lo, len, pos;
99 uint16_t err_sum, nsym;
145 int32_t dc_i, dc_q, pi1, pq1, pi2, pq2;
147 uint32_t frame_start;
uint32_t ieee154_phy_rx_frame_start_i(const struct ieee154_phy_rx *rx)
void ieee154_phy_rx_block(const int16_t *iq, size_t n)
void ieee154_phy_init(void)
void ieee154_phy_rx_counts_clear_i(struct ieee154_phy_rx *rx)
uint32_t ieee154_phy_rx_position(void)
uint32_t ieee154_phy_rx_position_i(const struct ieee154_phy_rx *rx)
void ieee154_phy_set_all_cb_i(struct ieee154_phy_rx *rx, ieee154_phy_all_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)
uint32_t ieee154_phy_chips(int sym)
void ieee154_phy_rx_counts(struct ieee154_phy_counts *c)
void ieee154_phy_rx_init(struct ieee154_phy_rx *rx)
uint8_t ieee154_phy_rx_preamble_run_i(const struct ieee154_phy_rx *rx)
void(* ieee154_phy_frame_cb_t)(const uint8_t *psdu, uint8_t len, int lqi, void *user)
Definition ieee154_phy.h:51
void(* ieee154_phy_all_cb_t)(const uint8_t *psdu, uint8_t len, int lqi, bool fcs_ok, void *user)
Definition ieee154_phy.h:67
void ieee154_phy_rx_block_i(struct ieee154_phy_rx *rx, const int16_t *iq, size_t n)
void ieee154_phy_rx_counts_i(const struct ieee154_phy_rx *rx, struct ieee154_phy_counts *c)
void ieee154_phy_set_rx_cb_i(struct ieee154_phy_rx *rx, ieee154_phy_frame_cb_t cb, void *user)
bool(* ieee154_phy_hdr_cb_t)(const uint8_t *psdu, uint8_t have, uint8_t len, uint32_t end_pos, void *user)
Definition ieee154_phy.h:84
void ieee154_phy_rx_counts_clear(void)
void ieee154_phy_rx_reset(void)
size_t ieee154_phy_append_fcs(uint8_t *buf, size_t n)
#define IEEE154_PHY_PSDU_MAX
Definition ieee154_phy.h:34
void ieee154_phy_set_hdr_cb(ieee154_phy_hdr_cb_t cb, void *user)
uint32_t ieee154_phy_rx_frame_start(void)
void ieee154_phy_set_rx_cb(ieee154_phy_frame_cb_t cb, void *user)
void ieee154_phy_rx_reset_i(struct ieee154_phy_rx *rx)
size_t ieee154_phy_modulate(const uint8_t *psdu, uint8_t len, int16_t amp, int16_t *out, size_t max_samples)
Definition ieee154_phy.h:110
uint32_t drop_frame
Definition ieee154_phy.h:120
uint32_t psdu
Definition ieee154_phy.h:116
uint32_t short_phr
Definition ieee154_phy.h:122
uint32_t preamble
Definition ieee154_phy.h:112
uint32_t drop_shr
Definition ieee154_phy.h:118
uint32_t sfd
Definition ieee154_phy.h:114
uint32_t fcs_bad
Definition ieee154_phy.h:124
Definition ieee154_phy.h:132
Definition ieee154_phy.h:91