BeRTOS
Data Fields
Afsk Struct Reference

AFSK1200 modem context. More...

#include <afsk.h>

Data Fields

KFile fd
 Base "class".
int adc_ch
 ADC channel to be used by the demodulator.
int dac_ch
 DAC channel to be used by the modulator.
uint8_t sample_count
 Current sample of bit for output data.
uint8_t curr_out
 Current character to be modulated.
uint8_t tx_bit
 Mask of current modulated bit.
bool bit_stuff
 True if bit stuff is allowed, false otherwise.
uint8_t stuff_cnt
 Counter for bit stuffing.
uint16_t phase_acc
 DDS phase accumulator for generating modulated data.
uint16_t phase_inc
 Current phase increment for current modulated bit.
FIFOBuffer delay_fifo
 Delay line used to delay samples by (SAMPLEPERBIT / 2)
int8_t delay_buf [SAMPLEPERBIT/2+1]
 Buffer for delay FIFO.
FIFOBuffer rx_fifo
 FIFO for received data.
uint8_t rx_buf [CONFIG_AFSK_RX_BUFLEN]
 FIFO rx buffer.
FIFOBuffer tx_fifo
 FIFO for transmitted data.
uint8_t tx_buf [CONFIG_AFSK_TX_BUFLEN]
 FIFO tx buffer.
int16_t iir_x [2]
 IIR filter X cells, used to filter sampled data by the demodulator.
int16_t iir_y [2]
 IIR filter Y cells, used to filter sampled data by the demodulator.
uint8_t sampled_bits
 Bits sampled by the demodulator are here.
int8_t curr_phase
 Current phase, needed to know when the bitstream at ADC speed should be sampled.
uint8_t found_bits
 Bits found by the demodulator at the correct bitrate speed.
volatile bool sending
 True while modem sends data.
volatile int status
 AFSK modem status.
Hdlc hdlc
 Hdlc context.
uint16_t preamble_len
 Preamble length.
uint16_t trailer_len
 Trailer length.

Detailed Description

AFSK1200 modem context.

Definition at line 93 of file afsk.h.


Field Documentation

int8_t Afsk::delay_buf[SAMPLEPERBIT/2+1]

Buffer for delay FIFO.

The 1 is added because the FIFO macros need 1 byte more to handle a buffer (SAMPLEPERBIT / 2) bytes long.

Definition at line 134 of file afsk.h.

Bits found by the demodulator at the correct bitrate speed.

Definition at line 168 of file afsk.h.

Preamble length.

When the AFSK modem wants to send data, before sending the actual data, shifts out preamble_len HDLC_FLAG characters. This helps to synchronize the demodulator filters on the receiver side.

Definition at line 188 of file afsk.h.

Current sample of bit for output data.

Definition at line 105 of file afsk.h.

Bits sampled by the demodulator are here.

Since ADC samplerate is higher than the bitrate, the bits here are SAMPLEPERBIT times the bitrate.

Definition at line 159 of file afsk.h.

volatile int Afsk::status

AFSK modem status.

If 0 all is ok, otherwise errors are present.

Definition at line 177 of file afsk.h.

Trailer length.

After sending the actual data, the AFSK shifts out trailer_len HDLC_FLAG characters. This helps to synchronize the demodulator filters on the receiver side.

Definition at line 196 of file afsk.h.


The documentation for this struct was generated from the following file: