mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-23 14:24:18 -04:00
Added RFM69 helper
LGE tool: new frames Text entry string length bugfix
This commit is contained in:
parent
dd35bda197
commit
b1e72c788b
18 changed files with 417 additions and 130 deletions
58
firmware/application/rfm69.hpp
Normal file
58
firmware/application/rfm69.hpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright (C) 2017 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2019 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 __RFM69_H__
|
||||
#define __RFM69_H__
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
class RFM69 {
|
||||
public:
|
||||
RFM69(const uint8_t num_preamble, const uint16_t sync_word, const bool CRC, const bool manchester)
|
||||
: num_preamble_(num_preamble), sync_word_(sync_word), CRC_(CRC), manchester_(manchester)
|
||||
{ }
|
||||
//~RFM69();
|
||||
|
||||
void set_sync_word(const uint16_t sync_word) {
|
||||
sync_word_ = sync_word;
|
||||
};
|
||||
void set_data_config(const bool CRC, const bool manchester) {
|
||||
CRC_ = CRC;
|
||||
manchester_ = manchester;
|
||||
};
|
||||
void set_num_preamble(const uint8_t num_preamble) {
|
||||
num_preamble_ = num_preamble;
|
||||
};
|
||||
|
||||
uint32_t gen_frame(std::vector<uint8_t>& payload);
|
||||
|
||||
private:
|
||||
uint8_t num_preamble_ { 5 };
|
||||
uint16_t sync_word_ { 0x2DD4 };
|
||||
bool CRC_ { true };
|
||||
bool manchester_ { false };
|
||||
};
|
||||
|
||||
#endif/*__RFM69_H__*/
|
Loading…
Add table
Add a link
Reference in a new issue