mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-25 05:47:44 +00:00
Added basic POCSAG receiver
Added Yes/no modal screen (for future tx warnings)
This commit is contained in:
@@ -40,6 +40,7 @@ constexpr iir_biquad_config_t audio_48k_hpf_300hz_config {
|
||||
constexpr iir_biquad_config_t audio_24k_hpf_300hz_config {
|
||||
{ 0.94597686f, -1.89195371f, 0.94597686f },
|
||||
{ 1.00000000f, -1.88903308f, 0.89487434f }
|
||||
|
||||
};
|
||||
|
||||
// scipy.signal.butter(2, 300 / 8000.0, 'highpass', analog=False)
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "baseband_packet.hpp"
|
||||
#include "ert_packet.hpp"
|
||||
#include "tpms_packet.hpp"
|
||||
#include "pocsag_packet.hpp"
|
||||
#include "dsp_fir_taps.hpp"
|
||||
#include "dsp_iir.hpp"
|
||||
#include "fifo.hpp"
|
||||
@@ -73,9 +74,12 @@ public:
|
||||
OOKConfigure = 25,
|
||||
RDSConfigure = 26,
|
||||
AudioTXConfig = 27,
|
||||
POCSAGConfigure = 28,
|
||||
|
||||
FIFOSignal = 28,
|
||||
FIFOData = 29,
|
||||
POCSAGPacket = 30,
|
||||
|
||||
FIFOSignal = 31,
|
||||
FIFOData = 32,
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -270,6 +274,18 @@ public:
|
||||
baseband::Packet packet;
|
||||
};
|
||||
|
||||
class POCSAGPacketMessage : public Message {
|
||||
public:
|
||||
constexpr POCSAGPacketMessage(
|
||||
const pocsag::POCSAGPacket& packet
|
||||
) : Message { ID::POCSAGPacket },
|
||||
packet { packet }
|
||||
{
|
||||
}
|
||||
|
||||
pocsag::POCSAGPacket packet;
|
||||
};
|
||||
|
||||
class ShutdownMessage : public Message {
|
||||
public:
|
||||
constexpr ShutdownMessage(
|
||||
@@ -602,6 +618,18 @@ public:
|
||||
const uint32_t pause_symbols;
|
||||
};
|
||||
|
||||
class POCSAGConfigureMessage : public Message {
|
||||
public:
|
||||
constexpr POCSAGConfigureMessage(
|
||||
const uint32_t rate
|
||||
) : Message { ID::POCSAGConfigure },
|
||||
rate(rate)
|
||||
{
|
||||
}
|
||||
|
||||
const uint32_t rate;
|
||||
};
|
||||
|
||||
// TODO: use streaming buffer instead
|
||||
class FIFOSignalMessage : public Message {
|
||||
public:
|
||||
|
27
firmware/common/pocsag_packet.cpp
Normal file
27
firmware/common/pocsag_packet.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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 "pocsag_packet.hpp"
|
||||
|
||||
namespace pocsag {
|
||||
|
||||
} /* namespace pocsag */
|
78
firmware/common/pocsag_packet.hpp
Normal file
78
firmware/common/pocsag_packet.hpp
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (C) 2015 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.
|
||||
*/
|
||||
|
||||
#ifndef __POCSAG_PACKET_H__
|
||||
#define __POCSAG_PACKET_H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
#include "optional.hpp"
|
||||
|
||||
#include "baseband.hpp"
|
||||
|
||||
namespace pocsag {
|
||||
|
||||
enum SignalRate : uint32_t {
|
||||
FSK512 = 1,
|
||||
FSK1200 = 2,
|
||||
FSK2400 = 3,
|
||||
DEBUG = 4
|
||||
};
|
||||
|
||||
class POCSAGPacket {
|
||||
public:
|
||||
void set_timestamp(const Timestamp& value) {
|
||||
timestamp_ = value;
|
||||
}
|
||||
|
||||
Timestamp timestamp() const {
|
||||
return timestamp_;
|
||||
}
|
||||
|
||||
void set(const size_t index, const uint32_t data) {
|
||||
if (index < 16)
|
||||
codewords[index] = data;
|
||||
}
|
||||
|
||||
uint32_t operator[](const size_t index) const {
|
||||
return (index < 16) ? codewords[index] : 0;
|
||||
}
|
||||
|
||||
SignalRate signal_rate() const {
|
||||
return FSK1200;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
for (size_t c = 0; c < 16; c++)
|
||||
codewords[c] = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
//SignalRate rate = FSK1200;
|
||||
uint32_t codewords[16];
|
||||
Timestamp timestamp_ { };
|
||||
};
|
||||
|
||||
} /* namespace pocsag */
|
||||
|
||||
#endif/*__POCSAG_PACKET_H__*/
|
@@ -68,6 +68,7 @@ constexpr image_tag_t image_tag_capture { 'P', 'C', 'A', 'P' };
|
||||
constexpr image_tag_t image_tag_ert { 'P', 'E', 'R', 'T' };
|
||||
constexpr image_tag_t image_tag_nfm_audio { 'P', 'N', 'F', 'M' };
|
||||
constexpr image_tag_t image_tag_tpms { 'P', 'T', 'P', 'M' };
|
||||
constexpr image_tag_t image_tag_pocsag { 'P', 'P', 'O', 'C' };
|
||||
constexpr image_tag_t image_tag_wfm_audio { 'P', 'W', 'F', 'M' };
|
||||
constexpr image_tag_t image_tag_wideband_spectrum { 'P', 'S', 'P', 'E' };
|
||||
|
||||
|
Reference in New Issue
Block a user