bool rxstart; ///< True if an HDLC_FLAG char has been found in the bitstream.
} Hdlc;
+/**
+ * RX FIFO buffer full error.
+ */
+#define AFSK_RXFIFO_OVERRUN BV(0)
/**
* AFSK1200 modem context.
/** True while modem sends data */
volatile bool sending;
+ /**
+ * AFSK modem status.
+ * If 0 all is ok, otherwise errors are present.
+ */
+ volatile int status;
+
/** Hdlc context */
Hdlc hdlc;
uint16_t preamble_len;
/**
- * Preamble length.
+ * 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.
return (Afsk *)fd;
}
-/**
- * ADC ISR callback.
- * This function has to be called by the ADC ISR when a sample of the configured
- * channel is available.
- * \param af Afsk context to operate one (\see Afsk).
- * \param sample current sample from the ADC.
- */
-void afsk_adc_isr(Afsk *af, int8_t sample);
-/**
- * DAC ISR callback.
- * This function has to be called by the DAC ISR when a sample of the configured
- * channel has been converted out.
- *
- * \param af Afsk context to operate one (\see Afsk).
- *
- * \note The next DAC output sample is supplied by the Afsk driver through calling
- * the AFSK_DAC_SET() callback.
- */
-void afsk_dac_isr(Afsk *af);
-
-/**
- * Initialize an AFSK1200 modem.
- * \param af Afsk context to operate one (\see Afsk).
- * \param adc_ch ADC channel used by the demodulator.
- * \param dac_ch DAC channel used by the modulator.
- */
+void afsk_adc_isr(Afsk *af, int8_t sample);
+uint8_t afsk_dac_isr(Afsk *af);
void afsk_init(Afsk *af, int adc_ch, int dac_ch);
/**
- * \name afsk filter type
+ * \name Afsk filter types.
* $WIZ$ afsk_filter_list = "AFSK_BUTTERWORTH", "AFSK_CHEBYSHEV"
* \{
*/