16 #ifndef LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H 17 #define LARDATAALG_UTILITIES_QUANTITIES_ELECTRONICS_H 26 #include <string_view> 36 static constexpr
auto symbol =
"#"sv;
37 static constexpr
auto name =
"tick"sv;
41 static constexpr
auto symbol =
"#"sv;
42 static constexpr
auto name =
"counts"sv;
65 template <
typename T = std::ptrdiff_t>
69 template <typename T = tick_as<>::value_t>
108 template <
typename T =
signed short int>
135 namespace electronics_literals {
139 constexpr
tick operator""_tick(
long double v)
143 constexpr
tick operator""_tick(
unsigned long long int v)
151 constexpr
tick_d operator""_tickd(
long double v)
155 constexpr
tick_d operator""_tickd(
unsigned long long int v)
163 constexpr
counts operator""_ADC(
long double v)
165 return counts{
static_cast<signed short int>(v)};
167 constexpr
counts operator""_ADC(
unsigned long long int v)
169 return counts{
static_cast<signed short int>(v)};
177 return counts_f{
static_cast<float>(v)};
179 constexpr
counts_f operator""_ADCf(
unsigned long long int v)
181 return counts_f{
static_cast<float>(v)};
189 namespace intervals {
192 template <typename T = util::quantities::tick_as<>::value_t>
213 template <typename T = util::quantities::tick_as<>::value_t,
typename Cat =
NoCategory>
235 #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.
Numeric variable proxies with embedded unit of measurement.
Types of variables with a unit.
tick_as< float > tick_f
Tick number, represented by float.