2014-04-03 16:21:37 -04:00
|
|
|
|
2014-04-03 16:29:26 -04:00
|
|
|
#ifndef FSK_MODEM_HW
|
|
|
|
#define FSK_MODEM_HW
|
2014-04-03 16:21:37 -04:00
|
|
|
|
|
|
|
#include "cfg/cfg_arch.h"
|
|
|
|
|
|
|
|
#include <avr/io.h>
|
|
|
|
|
|
|
|
struct Afsk;
|
|
|
|
void hw_afsk_adcInit(int ch, struct Afsk *_ctx);
|
|
|
|
void hw_afsk_dacInit(int ch, struct Afsk *_ctx);
|
|
|
|
|
2014-04-03 16:54:34 -04:00
|
|
|
// ADC initialization
|
2014-04-03 16:21:37 -04:00
|
|
|
#define AFSK_ADC_INIT(ch, ctx) hw_afsk_adcInit(ch, ctx)
|
|
|
|
|
2014-04-03 16:54:34 -04:00
|
|
|
// LED on/off (pin 13)
|
2014-04-03 16:21:37 -04:00
|
|
|
#define AFSK_STROBE_INIT() do { DDRB |= BV(5); } while (0)
|
|
|
|
#define AFSK_STROBE_ON() do { PORTB |= BV(5); } while (0)
|
|
|
|
#define AFSK_STROBE_OFF() do { PORTB &= ~BV(5); } while (0)
|
|
|
|
|
2014-04-03 16:29:26 -04:00
|
|
|
// Initialization, start and stop for DAC
|
2014-04-03 16:21:37 -04:00
|
|
|
#define AFSK_DAC_INIT(ch, ctx) do { (void)ch, (void)ctx; DDRD |= 0xF0; DDRB |= BV(3); } while (0)
|
|
|
|
#define AFSK_DAC_IRQ_START(ch) do { (void)ch; extern bool hw_afsk_dac_isr; PORTB |= BV(3); hw_afsk_dac_isr = true; } while (0)
|
|
|
|
#define AFSK_DAC_IRQ_STOP(ch) do { (void)ch; extern bool hw_afsk_dac_isr; PORTB &= ~BV(3); hw_afsk_dac_isr = false; } while (0)
|
|
|
|
|
2014-04-03 16:29:26 -04:00
|
|
|
#endif
|