12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef APRS_ENCODER_H_
- #define APRS_ENCODER_H_
- #include <stdint.h>
- typedef enum {
- NOCONFIG = 0,
- STOP,
- READY,
- ERROR,
- } ax25_enc_status_t;
- typedef struct {
- uint8_t tx_delay;
- uint8_t tx_tail;
- } ax25_enc_param_t;
- typedef enum {
- PREAMBLE = 0,
- FRAME,
- TAIL,
- DONE
- } ax25_enc_state_t;
- typedef struct {
- uint8_t *frame;
- uint32_t frame_len;
- uint32_t index;
- uint8_t bit_index;
- uint8_t one_count;
- uint8_t cur_bit;
- uint8_t prev_bit;
- uint8_t nrzi_bit;
- uint32_t byte;
- uint8_t flag_count;
- ax25_enc_status_t status;
- ax25_enc_state_t state;
- } ax25_enc_var_t;
- void ax25_encoder_init(uint8_t tx_delay, uint8_t tx_tail);
- ax25_enc_status_t ax25_encoder_encode(uint8_t *frame, int32_t frame_len);
- uint8_t ax25_encoder_get_bit(void);
- ax25_enc_status_t ax25_encoder_get_status(void);
- #endif
|