SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
Toggle main menu visibility
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>
25
#include <
satnogs-comms-lib/bsp/gpio.hpp
>
26
#include <
satnogs-comms-lib/exception.hpp
>
27
28
namespace
satnogs::comms::lib
29
{
35
class
fpf270x_pin_not_configured_exception
:
public
exception
36
{
37
public
:
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"
,
41
EHWNOTCONF
})
42
{
43
}
44
};
45
46
class
fpf270x
47
{
48
public
:
49
fpf270x
(
const
etl::istring &
name
,
bsp::gpio
&on,
bsp::gpio
&
pgood
,
50
bsp::gpio
&
flagb
);
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
67
private
:
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
satnogs::comms::lib::bsp::gpio
GPIO device abstraction.
Definition
gpio.hpp:38
satnogs::comms::lib::exception::error_msg
A class representing error messages in the SatNOGS-COMMS system.
Definition
exception.hpp:83
satnogs::comms::lib::exception::severity
severity
Severity levels of exceptions.
Definition
exception.hpp:71
satnogs::comms::lib::exception::severity::MAJOR
@ MAJOR
Failure causing minor mission degradation.
Definition
exception.hpp:74
satnogs::comms::lib::exception::exception
exception(severity sev, const char *file, int lineno, const error_msg &err_msg)
Constructor for the exception class.
Definition
exception.hpp:102
satnogs::comms::lib::fpf270x_pin_not_configured_exception::fpf270x_pin_not_configured_exception
fpf270x_pin_not_configured_exception(string_type file_name, numeric_type line)
Definition
fpf270x.hpp:38
satnogs::comms::lib::fpf270x::fpf270x
fpf270x(const etl::istring &name, bsp::gpio &on, bsp::gpio &pgood, bsp::gpio &flagb)
Definition
fpf270x.cpp:28
satnogs::comms::lib::fpf270x::name
const etl::istring & name() const
Definition
fpf270x.cpp:36
satnogs::comms::lib::fpf270x::enable
void enable(bool set=true)
Set the logical level of the EN pin. Note that this is nornally active low!
Definition
fpf270x.cpp:48
satnogs::comms::lib::fpf270x::flagb
bool flagb() const
Definition
fpf270x.cpp:66
satnogs::comms::lib::fpf270x::pgood
bool pgood() const
Definition
fpf270x.cpp:60
satnogs::comms::lib::fpf270x::enabled
bool enabled() const
Definition
fpf270x.cpp:54
EHWNOTCONF
#define EHWNOTCONF
Pin is not configured.
Definition
errno_extended.hpp:44
exception.hpp
gpio.hpp
satnogs::comms::lib
Definition
ad8318.hpp:30
libsatnogs-comms
include
satnogs-comms-lib
fpf270x.hpp
Generated by
1.17.0