BeRTOS
Data Structures | Defines | Functions
afsk.h File Reference

AFSK1200 modem. More...

#include "cfg/cfg_afsk.h"
#include "hw/hw_afsk.h"
#include <cfg/compiler.h>
#include <io/kfile.h>
#include <struct/fifobuf.h>

Go to the source code of this file.

Data Structures

struct  Hdlc
 HDLC (High-Level Data Link Control) context. More...
struct  Afsk
 AFSK1200 modem context. More...

Defines

#define SAMPLERATE   9600
 ADC sample rate.
#define BITRATE   1200
 Bitrate of the received/transmitted data.
#define AFSK_RXFIFO_OVERRUN   BV(0)
 RX FIFO buffer full error.
Afsk filter types.
#define AFSK_BUTTERWORTH   0
#define AFSK_CHEBYSHEV   1

Functions

void afsk_adc_isr (Afsk *af, int8_t sample)
 ADC ISR callback.
uint8_t afsk_dac_isr (Afsk *af)
 DAC ISR callback.
void afsk_init (Afsk *af, int adc_ch, int dac_ch)
 Initialize an AFSK1200 modem.

Detailed Description

AFSK1200 modem.

Author:
Francesco Sacchi <batt@develer.com>

Definition in file afsk.h.


Define Documentation

#define BITRATE   1200

Bitrate of the received/transmitted data.

The demodulator filters and decoderes are designed to work at this frequency. If you need to change this remember to update afsk_adc_isr().

Definition at line 69 of file afsk.h.

#define SAMPLERATE   9600

ADC sample rate.

The demodulator filters are designed to work at this frequency. If you need to change this remember to update afsk_adc_isr().

Definition at line 62 of file afsk.h.


Function Documentation

void afsk_adc_isr ( Afsk af,
int8_t  curr_sample 
)

ADC ISR callback.

This function has to be called by the ADC ISR when a sample of the configured channel is available.

Parameters:
afAfsk context to operate on.
curr_samplecurrent sample from the ADC.

Definition at line 210 of file afsk.c.

uint8_t afsk_dac_isr ( Afsk af)

DAC ISR callback.

This function has to be called by the DAC ISR when a sample of the configured channel has been converted out.

Parameters:
afAfsk context to operate on.
Returns:
The next DAC output sample.

Definition at line 342 of file afsk.c.

void afsk_init ( Afsk af,
int  adc_ch,
int  dac_ch 
)

Initialize an AFSK1200 modem.

Parameters:
afAfsk context to operate on.
adc_chADC channel used by the demodulator.
dac_chDAC channel used by the modulator.

Definition at line 537 of file afsk.c.