Skyward boardcore
Loading...
Searching...
No Matches
SX1278Frontends.h
Go to the documentation of this file.
1/* Copyright (c) 2023 Skyward Experimental Rocketry
2 * Author: Davide Mor
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25#include <miosix.h>
26
27#include "SX1278Common.h"
28
29namespace Boardcore
30{
31
33{
34public:
35 EbyteFrontend(miosix::GpioPin tx_enable, miosix::GpioPin rx_enable)
36 : tx_enable(tx_enable), rx_enable(rx_enable)
37 {
38 }
39
40 bool isOnPaBoost() override { return true; }
41 int maxInPower() override { return 15; }
42
43 void enableRx() override { rx_enable.high(); }
44 void disableRx() override { rx_enable.low(); }
45 void enableTx() override { tx_enable.high(); }
46 void disableTx() override { tx_enable.low(); }
47
48private:
49 miosix::GpioPin tx_enable;
50 miosix::GpioPin rx_enable;
51};
52
54{
55public:
57
58 bool isOnPaBoost() override { return true; }
59 int maxInPower() override { return 17; }
60
61 void enableRx() override {}
62 void disableRx() override {}
63 void enableTx() override {}
64 void disableTx() override {}
65};
66
68{
69public:
71
72 bool isOnPaBoost() override { return false; }
73 int maxInPower() override { return 15; }
74
75 void enableRx() override {}
76 void disableRx() override {}
77 void enableTx() override {}
78 void disableTx() override {}
79};
80
81} // namespace Boardcore
bool isOnPaBoost() override
Is this frontend connected to PA_BOOST or RFO_LF/_HF?
EbyteFrontend(miosix::GpioPin tx_enable, miosix::GpioPin rx_enable)
int maxInPower() override
What is the maximum power supported by this frontend?
int maxInPower() override
What is the maximum power supported by this frontend?
void disableTx() override
bool isOnPaBoost() override
Is this frontend connected to PA_BOOST or RFO_LF/_HF?
void disableRx() override
Shared interface between all SX1278 frontends.
bool isOnPaBoost() override
Is this frontend connected to PA_BOOST or RFO_LF/_HF?
int maxInPower() override
What is the maximum power supported by this frontend?
This file includes all the types the logdecoder script will decode.