projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a tooltip on the 'Validate' button
[bertos.git]
/
bertos
/
net
/
afsk.h
diff --git
a/bertos/net/afsk.h
b/bertos/net/afsk.h
index 902c5b9470944a6fbd136ab248ba7acfc7e608e9..4db5fe42ab1ee7cd23c91c767729f060a24516db 100644
(file)
--- a/
bertos/net/afsk.h
+++ b/
bertos/net/afsk.h
@@
-52,8
+52,19
@@
#include <struct/fifobuf.h>
#include <struct/fifobuf.h>
-// Demodulator constants
+
+/**
+ * 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().
+ */
#define SAMPLERATE 9600
#define SAMPLERATE 9600
+
+/**
+ * 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().
+ */
#define BITRATE 1200
#define SAMPLEPERBIT (SAMPLERATE / BITRATE)
#define BITRATE 1200
#define SAMPLEPERBIT (SAMPLERATE / BITRATE)
@@
-70,6
+81,10
@@
typedef struct Hdlc
bool rxstart; ///< True if an HDLC_FLAG char has been found in the bitstream.
} Hdlc;
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.
/**
* AFSK1200 modem context.
@@
-154,6
+169,12
@@
typedef struct Afsk
/** True while modem sends data */
volatile bool sending;
/** 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;
/** Hdlc context */
Hdlc hdlc;
@@
-182,13
+203,14
@@
INLINE Afsk *AFSK_CAST(KFile *fd)
return (Afsk *)fd;
}
return (Afsk *)fd;
}
-void afsk_adc_isr(Afsk *af, int8_t curr_sample);
-void afsk_dac_isr(Afsk *af);
+
+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);
/**
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"
* \{
*/
* $WIZ$ afsk_filter_list = "AFSK_BUTTERWORTH", "AFSK_CHEBYSHEV"
* \{
*/