aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/Audio/cw.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Audio/cw.h')
-rw-r--r--src/common/Audio/cw.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/common/Audio/cw.h b/src/common/Audio/cw.h
index 39be9c5..153f219 100644
--- a/src/common/Audio/cw.h
+++ b/src/common/Audio/cw.h
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
- * Copyright (c) 2015 Matthias P. Braendli
+ * Copyright (c) 2019 Matthias P. Braendli
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -22,32 +22,38 @@
* SOFTWARE.
*/
-#ifndef __CW_H_
-#define __CW_H_
+#pragma once
#include <stdint.h>
#include <stddef.h>
// Setup the CW generator to create audio samples at the given
// samplerate.
-void cw_psk31_init(unsigned int samplerate);
-
-// Append new CW or PSK31 text to transmit
-// CW/PSK31 audio centre frequency in Hz
-// if dit_duration == 0, message is sent in PSK31
+void cw_psk_init(unsigned int samplerate);
+
+// Append new CW or PSK text to transmit
+// CW/PSK audio centre frequency in Hz
+//
+// Supported characters for CW:
+// All ASCII between '+' and '\', which includes
+// numerals and capital letters.
+//
+// Supported characters for PSK: 7-bit clean ASCII
+//
+// if dit_duration == -1, message is sent in PSK31
+// if dit_duration == -2, message is sent in PSK63
+// if dit_duration == -3, message is sent in PSK125
// otherwise it is sent in CW, with dit_duration in ms
// returns 0 on failure, 1 on success
-int cw_psk31_push_message(const char* text, int frequency, int dit_duration);
+int cw_psk_push_message(const char* text, int frequency, int dit_duration);
-// Write the waveform into the buffer (stereo), both for cw and psk31
-size_t cw_psk31_fill_buffer(int16_t *buf, size_t bufsize);
+// Write the waveform into the buffer (stereo), both for cw and psk
+size_t cw_psk_fill_buffer(int16_t *buf, size_t bufsize);
-// Return 1 if the CW or PSK31 generator is running
-int cw_psk31_busy(void);
+// Return 1 if the CW or PSK generator is running
+int cw_psk_busy(void);
void cw_message_sent(const char*);
size_t cw_symbol(uint8_t, uint8_t *, size_t);
-#endif // __CW_H_
-