16 #ifndef LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H 17 #define LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H 24 #include <string_view> 37 static constexpr
auto symbol =
"#"sv;
38 static constexpr
auto name =
"tick"sv;
42 static constexpr
auto symbol =
"#"sv;
43 static constexpr
auto name =
"counts"sv;
67 template <
typename T = std::ptrdiff_t>
71 template <typename T = tick_as<>::value_t>
112 template <
typename T =
signed short int>
140 namespace electronics_literals {
144 constexpr
tick operator""_tick (
long double v)
146 constexpr
tick operator""_tick (
unsigned long long int v)
152 constexpr
tick_d operator""_tickd (
long double v)
154 constexpr
tick_d operator""_tickd (
unsigned long long int v)
160 constexpr
counts operator""_ADC (
long double v)
161 {
return counts{
static_cast<signed short int>(v) }; }
162 constexpr
counts operator""_ADC (
unsigned long long int v)
163 {
return counts{
static_cast<signed short int>(v) }; }
169 {
return counts_f{
static_cast<float>(v) }; }
170 constexpr
counts_f operator""_ADCf (
unsigned long long int v)
171 {
return counts_f{
static_cast<float>(v) }; }
180 namespace intervals {
183 template <typename T = util::quantities::tick_as<>::value_t>
232 #endif // LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H
static constexpr quantity_t castFrom(U value)
Returns a new quantity initialized with the specified value.
tick_as< double > tick_d
Tick number, represented by double.
Defines point and interval variables based on quantities.
A value measured in the specified unit.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
An interval (duration, length, distance) between two quantity points.
T value_t
Type of the stored value.
Numeric variable proxies with embedded unit of measurement.
Types of variables with a unit.
tick_as< float > tick_f
Tick number, represented by float.