2016-08-02 06:44:31 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
|
|
|
|
* Copyright (C) 2016 Furrtek
|
|
|
|
*
|
|
|
|
* This file is part of PortaPack.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ui.hpp"
|
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
#ifndef __MODEMS_H__
|
|
|
|
#define __MODEMS_H__
|
2016-08-02 06:44:31 -04:00
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
namespace modems {
|
2016-08-02 06:44:31 -04:00
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
#define MODEM_DEF_COUNT 7
|
2017-09-24 15:05:42 -04:00
|
|
|
#define AFSK_TX_SAMPLERATE 1536000U
|
2016-08-02 06:44:31 -04:00
|
|
|
|
2017-09-02 03:28:29 -04:00
|
|
|
enum ModemModulation {
|
2017-04-21 01:22:31 -04:00
|
|
|
AFSK = 0,
|
|
|
|
FSK,
|
|
|
|
PSK,
|
2017-09-02 03:28:29 -04:00
|
|
|
AM // SSB
|
2017-04-21 01:22:31 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct modem_def_t {
|
2018-05-15 18:35:30 -04:00
|
|
|
char name[16];
|
2017-09-02 03:28:29 -04:00
|
|
|
ModemModulation modulation;
|
2017-04-21 01:22:31 -04:00
|
|
|
uint16_t mark_freq;
|
|
|
|
uint16_t space_freq;
|
|
|
|
uint16_t baudrate;
|
2016-08-02 06:44:31 -04:00
|
|
|
};
|
|
|
|
|
2018-05-15 18:35:30 -04:00
|
|
|
constexpr modem_def_t modem_defs[MODEM_DEF_COUNT] = {
|
2017-04-21 01:22:31 -04:00
|
|
|
{ "Bell202", AFSK, 1200, 2200, 1200 },
|
|
|
|
{ "Bell103", AFSK, 1270, 1070, 300 },
|
|
|
|
{ "V21", AFSK, 980, 1180, 300 },
|
|
|
|
{ "V23 M1", AFSK, 1300, 1700, 600 },
|
|
|
|
{ "V23 M2", AFSK, 1300, 2100, 1200 },
|
2017-09-02 03:28:29 -04:00
|
|
|
{ "RTTY US", AM, 2295, 2125, 45 },
|
|
|
|
{ "RTTY EU", AM, 2125, 1955, 45 }
|
2016-08-02 06:44:31 -04:00
|
|
|
};
|
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
void generate_data(const std::string& in_message, uint16_t * out_data);
|
2017-09-02 03:28:29 -04:00
|
|
|
uint32_t deframe_word(uint32_t raw_word);
|
2016-08-02 06:44:31 -04:00
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
} /* namespace modems */
|
2016-08-02 06:44:31 -04:00
|
|
|
|
2017-04-21 01:22:31 -04:00
|
|
|
#endif/*__MODEMS_H__*/
|