Skip to main content

no_std_generated_fixtures/tests/fixtures/
family_acceptance_generated.rs

1// Auto-generated by ph-curves-gen. Do not edit.
2
3use ph_curves::MonotonicCurveLut;
4
5use ph_curves::{BoundaryBehavior, MonotonicDirection, ObservationGuardBehavior, ObservationGuardMetadata, PiecewiseLinearTransfer, TransferMetadata};
6
7type MonoLut = MonotonicCurveLut<u8, u8, 256>;
8
9static LINEAR_FWD: [u8; 256] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255];
10static LINEAR_INV: [u8; 256] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255];
11/// "linear" — monotonic curve.
12pub const LINEAR: MonoLut = MonoLut::new(&LINEAR_FWD, &LINEAR_INV);
13
14#[rustfmt::skip]
15static FRONT_END_HIGH_DC_INPUTS: [u16; 2] = [100, 250];
16#[rustfmt::skip]
17static FRONT_END_HIGH_DC_OUTPUTS: [i32; 2] = [3201, 8006];
18/// Family: "front\_end".
19/// Selectors: "coupling" = "dc", "range" = "high".
20/// "front\_end\_high\_dc" sparse physical transfer function.
21///
22/// Source provenance: identity "synthetic multi-range ADC note"; locator "Table 1".
23/// Representation: "scaled polynomial (3 coefficients, scale=32000/1000000)".
24/// Generation policy: requested interpolation error <= 1; max_knots = 32; below = error; above = clamp.
25/// Domain: 100..=250 "adc\_code"; output: "millivolt" x 1000.
26/// Knots: 2 (12 bytes array payload).
27/// Exhaustive numerical error: requested <= 1, achieved 0.864000 output quanta
28/// (conservative metadata bound 1) at input 175.
29/// This is table/quantization error against the configured ideal source, not total sensor accuracy.
30/// Observation guard: code 65535 with Error behavior.
31/// Classification of this code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy, not inferred from the integer value.
32#[rustfmt::skip]
33pub const FRONT_END_HIGH_DC: PiecewiseLinearTransfer<2> =
34PiecewiseLinearTransfer::new(&FRONT_END_HIGH_DC_INPUTS, &FRONT_END_HIGH_DC_OUTPUTS, MonotonicDirection::Increasing)
35.with_boundaries(BoundaryBehavior::Error, BoundaryBehavior::Clamp)
36.with_observation_guard(65535, ObservationGuardBehavior::Error);
37/// Metadata for [`FRONT_END_HIGH_DC`].
38pub const FRONT_END_HIGH_DC_METADATA: TransferMetadata = TransferMetadata {
39    input_unit: "adc_code",
40    output_unit: "millivolt",
41    output_scale: 1000,
42    domain_min: 100,
43    domain_max: 250,
44    range_min: 3201,
45    range_max: 8006,
46    direction: MonotonicDirection::Increasing,
47    knot_count: 2,
48    strictly_monotonic: true,
49    flat_segment_count: 0,
50    requested_max_error: 1,
51    achieved_max_error: 1,
52    worst_case_input: 175,
53    achieved_max_inverse_code_error: 0,
54};
55/// Optional observation-code guard for [`FRONT_END_HIGH_DC`].
56///
57/// Classification of a code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy,
58/// not inferred from the integer value. The runtime getter and this constant agree.
59pub const FRONT_END_HIGH_DC_OBSERVATION_GUARD: Option<ObservationGuardMetadata> = Some(ObservationGuardMetadata {
60    code: 65535,
61    behavior: ObservationGuardBehavior::Error,
62});
63
64#[rustfmt::skip]
65static FRONT_END_LOW_DC_INPUTS: [u16; 2] = [100, 500];
66#[rustfmt::skip]
67static FRONT_END_LOW_DC_OUTPUTS: [i32; 2] = [200, 1000];
68/// Family: "front\_end".
69/// Selectors: "coupling" = "dc", "range" = "low".
70/// "front\_end\_low\_dc" sparse physical transfer function.
71///
72/// Source provenance: identity "synthetic multi-range ADC note"; locator "Table 1".
73/// Representation: "scaled polynomial (3 coefficients, scale=2000/1000000)".
74/// Generation policy: requested interpolation error <= 1; max_knots = 32; below = error; above = clamp.
75/// Domain: 100..=500 "adc\_code"; output: "millivolt" x 1000.
76/// Knots: 2 (12 bytes array payload).
77/// Exhaustive numerical error: requested <= 1, achieved 0.100000 output quanta
78/// (conservative metadata bound 1) at input 500.
79/// This is table/quantization error against the configured ideal source, not total sensor accuracy.
80/// Observation guard: code 65535 with Error behavior.
81/// Classification of this code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy, not inferred from the integer value.
82#[rustfmt::skip]
83pub const FRONT_END_LOW_DC: PiecewiseLinearTransfer<2> =
84PiecewiseLinearTransfer::new(&FRONT_END_LOW_DC_INPUTS, &FRONT_END_LOW_DC_OUTPUTS, MonotonicDirection::Increasing)
85.with_boundaries(BoundaryBehavior::Error, BoundaryBehavior::Clamp)
86.with_observation_guard(65535, ObservationGuardBehavior::Error);
87/// Metadata for [`FRONT_END_LOW_DC`].
88pub const FRONT_END_LOW_DC_METADATA: TransferMetadata = TransferMetadata {
89    input_unit: "adc_code",
90    output_unit: "millivolt",
91    output_scale: 1000,
92    domain_min: 100,
93    domain_max: 500,
94    range_min: 200,
95    range_max: 1000,
96    direction: MonotonicDirection::Increasing,
97    knot_count: 2,
98    strictly_monotonic: true,
99    flat_segment_count: 0,
100    requested_max_error: 1,
101    achieved_max_error: 1,
102    worst_case_input: 500,
103    achieved_max_inverse_code_error: 0,
104};
105/// Optional observation-code guard for [`FRONT_END_LOW_DC`].
106///
107/// Classification of a code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy,
108/// not inferred from the integer value. The runtime getter and this constant agree.
109pub const FRONT_END_LOW_DC_OBSERVATION_GUARD: Option<ObservationGuardMetadata> = Some(ObservationGuardMetadata {
110    code: 65535,
111    behavior: ObservationGuardBehavior::Error,
112});
113
114#[rustfmt::skip]
115static FRONT_END_MID_DC_INPUTS: [u16; 2] = [100, 400];
116#[rustfmt::skip]
117static FRONT_END_MID_DC_OUTPUTS: [i32; 2] = [800, 3201];
118/// Family: "front\_end".
119/// Selectors: "coupling" = "dc", "range" = "mid".
120/// "front\_end\_mid\_dc" sparse physical transfer function.
121///
122/// Source provenance: identity "synthetic multi-range ADC note"; locator "Table 1".
123/// Representation: "scaled polynomial (3 coefficients, scale=8000/1000000)".
124/// Generation policy: requested interpolation error <= 1; max_knots = 32; below = error; above = clamp.
125/// Domain: 100..=400 "adc\_code"; output: "millivolt" x 1000.
126/// Knots: 2 (12 bytes array payload).
127/// Exhaustive numerical error: requested <= 1, achieved 0.600000 output quanta
128/// (conservative metadata bound 1) at input 250.
129/// This is table/quantization error against the configured ideal source, not total sensor accuracy.
130/// Observation guard: code 65535 with Error behavior.
131/// Classification of this code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy, not inferred from the integer value.
132#[rustfmt::skip]
133pub const FRONT_END_MID_DC: PiecewiseLinearTransfer<2> =
134PiecewiseLinearTransfer::new(&FRONT_END_MID_DC_INPUTS, &FRONT_END_MID_DC_OUTPUTS, MonotonicDirection::Increasing)
135.with_boundaries(BoundaryBehavior::Error, BoundaryBehavior::Clamp)
136.with_observation_guard(65535, ObservationGuardBehavior::Error);
137/// Metadata for [`FRONT_END_MID_DC`].
138pub const FRONT_END_MID_DC_METADATA: TransferMetadata = TransferMetadata {
139    input_unit: "adc_code",
140    output_unit: "millivolt",
141    output_scale: 1000,
142    domain_min: 100,
143    domain_max: 400,
144    range_min: 800,
145    range_max: 3201,
146    direction: MonotonicDirection::Increasing,
147    knot_count: 2,
148    strictly_monotonic: true,
149    flat_segment_count: 0,
150    requested_max_error: 1,
151    achieved_max_error: 1,
152    worst_case_input: 250,
153    achieved_max_inverse_code_error: 0,
154};
155/// Optional observation-code guard for [`FRONT_END_MID_DC`].
156///
157/// Classification of a code as saturation is cited from identity "synthetic multi-range ADC note"; locator "§4 saturation" and applied as declared policy,
158/// not inferred from the integer value. The runtime getter and this constant agree.
159pub const FRONT_END_MID_DC_OBSERVATION_GUARD: Option<ObservationGuardMetadata> = Some(ObservationGuardMetadata {
160    code: 65535,
161    behavior: ObservationGuardBehavior::Error,
162});
163
164#[rustfmt::skip]
165static GUARDED_IDENTITY_INPUTS: [u16; 2] = [1, 10];
166#[rustfmt::skip]
167static GUARDED_IDENTITY_OUTPUTS: [i32; 2] = [1, 10];
168/// "guarded\_identity" sparse physical transfer function.
169///
170/// Source provenance: none declared.
171/// Representation: "formula y = x".
172/// Generation policy: requested interpolation error <= 1; max_knots = 8; below = error; above = clamp.
173/// Domain: 1..=10 "adc\_code"; output: "millivolt" x 1.
174/// Knots: 2 (12 bytes array payload).
175/// Exhaustive numerical error: requested <= 1, achieved 0.000000 output quanta
176/// (conservative metadata bound 0) at input 1.
177/// This is table/quantization error against the configured ideal source, not total sensor accuracy.
178/// Observation guard: code 65535 with Error behavior.
179/// Classification of this code as saturation is declared consumer/device policy, not inferred from the integer value.
180#[rustfmt::skip]
181pub const GUARDED_IDENTITY: PiecewiseLinearTransfer<2> =
182PiecewiseLinearTransfer::new(&GUARDED_IDENTITY_INPUTS, &GUARDED_IDENTITY_OUTPUTS, MonotonicDirection::Increasing)
183.with_boundaries(BoundaryBehavior::Error, BoundaryBehavior::Clamp)
184.with_observation_guard(65535, ObservationGuardBehavior::Error);
185/// Metadata for [`GUARDED_IDENTITY`].
186pub const GUARDED_IDENTITY_METADATA: TransferMetadata = TransferMetadata {
187    input_unit: "adc_code",
188    output_unit: "millivolt",
189    output_scale: 1,
190    domain_min: 1,
191    domain_max: 10,
192    range_min: 1,
193    range_max: 10,
194    direction: MonotonicDirection::Increasing,
195    knot_count: 2,
196    strictly_monotonic: true,
197    flat_segment_count: 0,
198    requested_max_error: 1,
199    achieved_max_error: 0,
200    worst_case_input: 1,
201    achieved_max_inverse_code_error: 0,
202};
203/// Optional observation-code guard for [`GUARDED_IDENTITY`].
204///
205/// Classification of a code as saturation is declared consumer/device policy,
206/// not inferred from the integer value. The runtime getter and this constant agree.
207pub const GUARDED_IDENTITY_OBSERVATION_GUARD: Option<ObservationGuardMetadata> = Some(ObservationGuardMetadata {
208    code: 65535,
209    behavior: ObservationGuardBehavior::Error,
210});