SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
fpf270x.hpp
Go to the documentation of this file.
1/*
2 * SatNOGS-COMMS control library
3 *
4 * Copyright (C) 2021-2022, Libre Space Foundation <http://libre.space>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * SPDX-License-Identifier: GNU General Public License v3.0 or later
20 */
21
22#pragma once
23
24#include <etl/string.h>
27
28namespace satnogs::comms::lib
29{
36{
37public:
38 fpf270x_pin_not_configured_exception(string_type file_name, numeric_type line)
39 : exception(exception::severity::MAJOR, file_name, line,
40 error_msg{"fpf270x pin is not configured", "fpf270xpincfg",
42 {
43 }
44};
45
47{
48public:
49 fpf270x(const etl::istring &name, bsp::gpio &on, bsp::gpio &pgood,
51
52 const etl::istring &
53 name() const;
54
55 void
56 enable(bool set = true);
57
58 bool
59 enabled() const;
60
61 bool
62 pgood() const;
63
64 bool
65 flagb() const;
66
67private:
68 etl::string<32> m_name;
69 bsp::gpio &m_on_gpio;
70 bsp::gpio &m_pgood_gpio;
71 bsp::gpio &m_flagb_gpio;
72};
73
74} // namespace satnogs::comms::lib
GPIO device abstraction.
Definition gpio.hpp:38
A class representing error messages in the SatNOGS-COMMS system.
Definition exception.hpp:83
severity
Severity levels of exceptions.
Definition exception.hpp:71
@ MAJOR
Failure causing minor mission degradation.
Definition exception.hpp:74
exception(severity sev, const char *file, int lineno, const error_msg &err_msg)
Constructor for the exception class.
fpf270x_pin_not_configured_exception(string_type file_name, numeric_type line)
Definition fpf270x.hpp:38
fpf270x(const etl::istring &name, bsp::gpio &on, bsp::gpio &pgood, bsp::gpio &flagb)
Definition fpf270x.cpp:28
const etl::istring & name() const
Definition fpf270x.cpp:36
void enable(bool set=true)
Set the logical level of the EN pin. Note that this is nornally active low!
Definition fpf270x.cpp:48
#define EHWNOTCONF
Pin is not configured.