diff --git a/.gitattributes b/.gitattributes index 483e5c1a91..9daee03b9b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,7 @@ +*.cpp text *.gradle text eol=lf +*.h text +*.inc text *.java text eol=lf *.json text eol=lf *.md text eol=lf diff --git a/datalogtool/src/main/native/cpp/main.cpp b/datalogtool/src/main/native/cpp/main.cpp index 5f1261b00f..3d1a1965f2 100644 --- a/datalogtool/src/main/native/cpp/main.cpp +++ b/datalogtool/src/main/native/cpp/main.cpp @@ -1,25 +1,25 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include - -void Application(std::string_view saveDir); - -#ifdef _WIN32 -int __stdcall WinMain(void* hInstance, void* hPrevInstance, char* pCmdLine, - int nCmdShow) { - int argc = __argc; - char** argv = __argv; -#else -int main(int argc, char** argv) { -#endif - std::string_view saveDir; - if (argc == 2) { - saveDir = argv[1]; - } - - Application(saveDir); - - return 0; -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include + +void Application(std::string_view saveDir); + +#ifdef _WIN32 +int __stdcall WinMain(void* hInstance, void* hPrevInstance, char* pCmdLine, + int nCmdShow) { + int argc = __argc; + char** argv = __argv; +#else +int main(int argc, char** argv) { +#endif + std::string_view saveDir; + if (argc == 2) { + saveDir = argv[1]; + } + + Application(saveDir); + + return 0; +} diff --git a/hal/src/main/native/athena/rev/PHFrames.cpp b/hal/src/main/native/athena/rev/PHFrames.cpp index d098c004fc..0d108c25e6 100644 --- a/hal/src/main/native/athena/rev/PHFrames.cpp +++ b/hal/src/main/native/athena/rev/PHFrames.cpp @@ -1,2071 +1,2071 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2018-2019 Erik Moqvist - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - * This file was generated by cantools version - */ - -#include - -#include "PHFrames.h" - -static inline uint8_t pack_left_shift_u8( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value << shift) & mask); -} - -static inline uint8_t pack_left_shift_u16( - uint16_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value << shift) & mask); -} - -static inline uint8_t pack_left_shift_u32( - uint32_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value << shift) & mask); -} - -static inline uint8_t pack_right_shift_u16( - uint16_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value >> shift) & mask); -} - -static inline uint8_t pack_right_shift_u32( - uint32_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value >> shift) & mask); -} - -static inline uint16_t unpack_left_shift_u16( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint16_t)((uint16_t)(value & mask) << shift); -} - -static inline uint32_t unpack_left_shift_u32( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint32_t)((uint32_t)(value & mask) << shift); -} - -static inline uint8_t unpack_right_shift_u8( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint8_t)((uint8_t)(value & mask) >> shift); -} - -static inline uint16_t unpack_right_shift_u16( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint16_t)((uint16_t)(value & mask) >> shift); -} - -static inline uint32_t unpack_right_shift_u32( - uint8_t value, - uint8_t shift, - uint8_t mask) -{ - return (uint32_t)((uint32_t)(value & mask) >> shift); -} - -int PH_compressor_config_pack( - uint8_t *dst_p, - const struct PH_compressor_config_t *src_p, - size_t size) -{ - if (size < 5u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 5); - - dst_p[0] |= pack_left_shift_u16(src_p->minimum_tank_pressure, 0u, 0xffu); - dst_p[1] |= pack_right_shift_u16(src_p->minimum_tank_pressure, 8u, 0xffu); - dst_p[2] |= pack_left_shift_u16(src_p->maximum_tank_pressure, 0u, 0xffu); - dst_p[3] |= pack_right_shift_u16(src_p->maximum_tank_pressure, 8u, 0xffu); - dst_p[4] |= pack_left_shift_u8(src_p->force_disable, 0u, 0x01u); - dst_p[4] |= pack_left_shift_u8(src_p->use_digital, 1u, 0x02u); - - return (5); -} - -int PH_compressor_config_unpack( - struct PH_compressor_config_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 5u) { - return (-EINVAL); - } - - dst_p->minimum_tank_pressure = unpack_right_shift_u16(src_p[0], 0u, 0xffu); - dst_p->minimum_tank_pressure |= unpack_left_shift_u16(src_p[1], 8u, 0xffu); - dst_p->maximum_tank_pressure = unpack_right_shift_u16(src_p[2], 0u, 0xffu); - dst_p->maximum_tank_pressure |= unpack_left_shift_u16(src_p[3], 8u, 0xffu); - dst_p->force_disable = unpack_right_shift_u8(src_p[4], 0u, 0x01u); - dst_p->use_digital = unpack_right_shift_u8(src_p[4], 1u, 0x02u); - - return (0); -} - -uint16_t PH_compressor_config_minimum_tank_pressure_encode(double value) -{ - return (uint16_t)(value / 0.001); -} - -double PH_compressor_config_minimum_tank_pressure_decode(uint16_t value) -{ - return ((double)value * 0.001); -} - -bool PH_compressor_config_minimum_tank_pressure_is_in_range(uint16_t value) -{ - return (value <= 5000u); -} - -uint16_t PH_compressor_config_maximum_tank_pressure_encode(double value) -{ - return (uint16_t)(value / 0.001); -} - -double PH_compressor_config_maximum_tank_pressure_decode(uint16_t value) -{ - return ((double)value * 0.001); -} - -bool PH_compressor_config_maximum_tank_pressure_is_in_range(uint16_t value) -{ - return (value <= 5000u); -} - -uint8_t PH_compressor_config_force_disable_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_compressor_config_force_disable_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_compressor_config_force_disable_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_compressor_config_use_digital_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_compressor_config_use_digital_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_compressor_config_use_digital_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -int PH_set_all_pack( - uint8_t *dst_p, - const struct PH_set_all_t *src_p, - size_t size) -{ - if (size < 4u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 4); - - dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x03u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 2u, 0x0cu); - dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 4u, 0x30u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 6u, 0xc0u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_4, 0u, 0x03u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_5, 2u, 0x0cu); - dst_p[1] |= pack_left_shift_u8(src_p->channel_6, 4u, 0x30u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_7, 6u, 0xc0u); - dst_p[2] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x03u); - dst_p[2] |= pack_left_shift_u8(src_p->channel_9, 2u, 0x0cu); - dst_p[2] |= pack_left_shift_u8(src_p->channel_10, 4u, 0x30u); - dst_p[2] |= pack_left_shift_u8(src_p->channel_11, 6u, 0xc0u); - dst_p[3] |= pack_left_shift_u8(src_p->channel_12, 0u, 0x03u); - dst_p[3] |= pack_left_shift_u8(src_p->channel_13, 2u, 0x0cu); - dst_p[3] |= pack_left_shift_u8(src_p->channel_14, 4u, 0x30u); - dst_p[3] |= pack_left_shift_u8(src_p->channel_15, 6u, 0xc0u); - - return (4); -} - -int PH_set_all_unpack( - struct PH_set_all_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 4u) { - return (-EINVAL); - } - - dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x03u); - dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 2u, 0x0cu); - dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 4u, 0x30u); - dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 6u, 0xc0u); - dst_p->channel_4 = unpack_right_shift_u8(src_p[1], 0u, 0x03u); - dst_p->channel_5 = unpack_right_shift_u8(src_p[1], 2u, 0x0cu); - dst_p->channel_6 = unpack_right_shift_u8(src_p[1], 4u, 0x30u); - dst_p->channel_7 = unpack_right_shift_u8(src_p[1], 6u, 0xc0u); - dst_p->channel_8 = unpack_right_shift_u8(src_p[2], 0u, 0x03u); - dst_p->channel_9 = unpack_right_shift_u8(src_p[2], 2u, 0x0cu); - dst_p->channel_10 = unpack_right_shift_u8(src_p[2], 4u, 0x30u); - dst_p->channel_11 = unpack_right_shift_u8(src_p[2], 6u, 0xc0u); - dst_p->channel_12 = unpack_right_shift_u8(src_p[3], 0u, 0x03u); - dst_p->channel_13 = unpack_right_shift_u8(src_p[3], 2u, 0x0cu); - dst_p->channel_14 = unpack_right_shift_u8(src_p[3], 4u, 0x30u); - dst_p->channel_15 = unpack_right_shift_u8(src_p[3], 6u, 0xc0u); - - return (0); -} - -uint8_t PH_set_all_channel_0_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_0_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_0_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_1_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_1_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_1_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_2_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_2_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_2_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_3_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_3_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_3_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_4_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_4_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_4_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_5_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_5_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_5_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_6_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_6_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_6_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_7_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_7_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_7_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_8_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_8_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_8_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_9_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_9_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_9_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_10_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_10_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_10_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_11_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_11_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_11_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_12_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_12_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_12_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_13_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_13_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_13_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_14_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_14_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_14_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -uint8_t PH_set_all_channel_15_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_set_all_channel_15_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_set_all_channel_15_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -int PH_pulse_once_pack( - uint8_t *dst_p, - const struct PH_pulse_once_t *src_p, - size_t size) -{ - if (size < 4u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 4); - - dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x01u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 1u, 0x02u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 2u, 0x04u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 3u, 0x08u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_4, 4u, 0x10u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_5, 5u, 0x20u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_6, 6u, 0x40u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_7, 7u, 0x80u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x01u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_9, 1u, 0x02u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_10, 2u, 0x04u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_11, 3u, 0x08u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_12, 4u, 0x10u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_13, 5u, 0x20u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_14, 6u, 0x40u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_15, 7u, 0x80u); - dst_p[2] |= pack_left_shift_u16(src_p->pulse_length_ms, 0u, 0xffu); - dst_p[3] |= pack_right_shift_u16(src_p->pulse_length_ms, 8u, 0xffu); - - return (4); -} - -int PH_pulse_once_unpack( - struct PH_pulse_once_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 4u) { - return (-EINVAL); - } - - dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x01u); - dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 1u, 0x02u); - dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 2u, 0x04u); - dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 3u, 0x08u); - dst_p->channel_4 = unpack_right_shift_u8(src_p[0], 4u, 0x10u); - dst_p->channel_5 = unpack_right_shift_u8(src_p[0], 5u, 0x20u); - dst_p->channel_6 = unpack_right_shift_u8(src_p[0], 6u, 0x40u); - dst_p->channel_7 = unpack_right_shift_u8(src_p[0], 7u, 0x80u); - dst_p->channel_8 = unpack_right_shift_u8(src_p[1], 0u, 0x01u); - dst_p->channel_9 = unpack_right_shift_u8(src_p[1], 1u, 0x02u); - dst_p->channel_10 = unpack_right_shift_u8(src_p[1], 2u, 0x04u); - dst_p->channel_11 = unpack_right_shift_u8(src_p[1], 3u, 0x08u); - dst_p->channel_12 = unpack_right_shift_u8(src_p[1], 4u, 0x10u); - dst_p->channel_13 = unpack_right_shift_u8(src_p[1], 5u, 0x20u); - dst_p->channel_14 = unpack_right_shift_u8(src_p[1], 6u, 0x40u); - dst_p->channel_15 = unpack_right_shift_u8(src_p[1], 7u, 0x80u); - dst_p->pulse_length_ms = unpack_right_shift_u16(src_p[2], 0u, 0xffu); - dst_p->pulse_length_ms |= unpack_left_shift_u16(src_p[3], 8u, 0xffu); - - return (0); -} - -uint8_t PH_pulse_once_channel_0_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_0_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_0_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_1_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_1_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_1_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_2_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_2_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_2_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_3_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_3_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_3_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_4_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_4_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_4_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_5_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_5_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_5_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_6_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_6_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_6_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_7_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_7_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_7_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_8_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_8_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_8_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_9_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_9_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_9_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_10_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_10_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_10_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_11_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_11_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_11_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_12_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_12_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_12_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_13_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_13_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_13_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_14_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_14_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_14_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_pulse_once_channel_15_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_pulse_once_channel_15_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_channel_15_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint16_t PH_pulse_once_pulse_length_ms_encode(double value) -{ - return (uint16_t)(value); -} - -double PH_pulse_once_pulse_length_ms_decode(uint16_t value) -{ - return ((double)value); -} - -bool PH_pulse_once_pulse_length_ms_is_in_range(uint16_t value) -{ - (void)value; - - return (true); -} - -int PH_status_0_pack( - uint8_t *dst_p, - const struct PH_status_0_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 8); - - dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x01u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 1u, 0x02u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 2u, 0x04u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 3u, 0x08u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_4, 4u, 0x10u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_5, 5u, 0x20u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_6, 6u, 0x40u); - dst_p[0] |= pack_left_shift_u8(src_p->channel_7, 7u, 0x80u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x01u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_9, 1u, 0x02u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_10, 2u, 0x04u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_11, 3u, 0x08u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_12, 4u, 0x10u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_13, 5u, 0x20u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_14, 6u, 0x40u); - dst_p[1] |= pack_left_shift_u8(src_p->channel_15, 7u, 0x80u); - dst_p[2] |= pack_left_shift_u8(src_p->analog_0, 0u, 0xffu); - dst_p[3] |= pack_left_shift_u8(src_p->analog_1, 0u, 0xffu); - dst_p[4] |= pack_left_shift_u8(src_p->digital_sensor, 0u, 0x01u); - dst_p[4] |= pack_left_shift_u8(src_p->brownout_fault, 1u, 0x02u); - dst_p[4] |= pack_left_shift_u8(src_p->compressor_oc_fault, 2u, 0x04u); - dst_p[4] |= pack_left_shift_u8(src_p->compressor_open_fault, 3u, 0x08u); - dst_p[4] |= pack_left_shift_u8(src_p->solenoid_oc_fault, 4u, 0x10u); - dst_p[4] |= pack_left_shift_u8(src_p->can_warning_fault, 5u, 0x20u); - dst_p[4] |= pack_left_shift_u8(src_p->hardware_fault, 6u, 0x40u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_0_fault, 0u, 0x01u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_1_fault, 1u, 0x02u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_2_fault, 2u, 0x04u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_3_fault, 3u, 0x08u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_4_fault, 4u, 0x10u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_5_fault, 5u, 0x20u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_6_fault, 6u, 0x40u); - dst_p[5] |= pack_left_shift_u8(src_p->channel_7_fault, 7u, 0x80u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_8_fault, 0u, 0x01u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_9_fault, 1u, 0x02u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_10_fault, 2u, 0x04u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_11_fault, 3u, 0x08u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_12_fault, 4u, 0x10u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_13_fault, 5u, 0x20u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_14_fault, 6u, 0x40u); - dst_p[6] |= pack_left_shift_u8(src_p->channel_15_fault, 7u, 0x80u); - dst_p[7] |= pack_left_shift_u8(src_p->compressor_on, 0u, 0x01u); - dst_p[7] |= pack_left_shift_u8(src_p->system_enabled, 1u, 0x02u); - dst_p[7] |= pack_left_shift_u8(src_p->robo_rio_present, 2u, 0x04u); - dst_p[7] |= pack_left_shift_u8(src_p->compressor_config, 3u, 0x18u); - - return (8); -} - -int PH_status_0_unpack( - struct PH_status_0_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x01u); - dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 1u, 0x02u); - dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 2u, 0x04u); - dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 3u, 0x08u); - dst_p->channel_4 = unpack_right_shift_u8(src_p[0], 4u, 0x10u); - dst_p->channel_5 = unpack_right_shift_u8(src_p[0], 5u, 0x20u); - dst_p->channel_6 = unpack_right_shift_u8(src_p[0], 6u, 0x40u); - dst_p->channel_7 = unpack_right_shift_u8(src_p[0], 7u, 0x80u); - dst_p->channel_8 = unpack_right_shift_u8(src_p[1], 0u, 0x01u); - dst_p->channel_9 = unpack_right_shift_u8(src_p[1], 1u, 0x02u); - dst_p->channel_10 = unpack_right_shift_u8(src_p[1], 2u, 0x04u); - dst_p->channel_11 = unpack_right_shift_u8(src_p[1], 3u, 0x08u); - dst_p->channel_12 = unpack_right_shift_u8(src_p[1], 4u, 0x10u); - dst_p->channel_13 = unpack_right_shift_u8(src_p[1], 5u, 0x20u); - dst_p->channel_14 = unpack_right_shift_u8(src_p[1], 6u, 0x40u); - dst_p->channel_15 = unpack_right_shift_u8(src_p[1], 7u, 0x80u); - dst_p->analog_0 = unpack_right_shift_u8(src_p[2], 0u, 0xffu); - dst_p->analog_1 = unpack_right_shift_u8(src_p[3], 0u, 0xffu); - dst_p->digital_sensor = unpack_right_shift_u8(src_p[4], 0u, 0x01u); - dst_p->brownout_fault = unpack_right_shift_u8(src_p[4], 1u, 0x02u); - dst_p->compressor_oc_fault = unpack_right_shift_u8(src_p[4], 2u, 0x04u); - dst_p->compressor_open_fault = unpack_right_shift_u8(src_p[4], 3u, 0x08u); - dst_p->solenoid_oc_fault = unpack_right_shift_u8(src_p[4], 4u, 0x10u); - dst_p->can_warning_fault = unpack_right_shift_u8(src_p[4], 5u, 0x20u); - dst_p->hardware_fault = unpack_right_shift_u8(src_p[4], 6u, 0x40u); - dst_p->channel_0_fault = unpack_right_shift_u8(src_p[5], 0u, 0x01u); - dst_p->channel_1_fault = unpack_right_shift_u8(src_p[5], 1u, 0x02u); - dst_p->channel_2_fault = unpack_right_shift_u8(src_p[5], 2u, 0x04u); - dst_p->channel_3_fault = unpack_right_shift_u8(src_p[5], 3u, 0x08u); - dst_p->channel_4_fault = unpack_right_shift_u8(src_p[5], 4u, 0x10u); - dst_p->channel_5_fault = unpack_right_shift_u8(src_p[5], 5u, 0x20u); - dst_p->channel_6_fault = unpack_right_shift_u8(src_p[5], 6u, 0x40u); - dst_p->channel_7_fault = unpack_right_shift_u8(src_p[5], 7u, 0x80u); - dst_p->channel_8_fault = unpack_right_shift_u8(src_p[6], 0u, 0x01u); - dst_p->channel_9_fault = unpack_right_shift_u8(src_p[6], 1u, 0x02u); - dst_p->channel_10_fault = unpack_right_shift_u8(src_p[6], 2u, 0x04u); - dst_p->channel_11_fault = unpack_right_shift_u8(src_p[6], 3u, 0x08u); - dst_p->channel_12_fault = unpack_right_shift_u8(src_p[6], 4u, 0x10u); - dst_p->channel_13_fault = unpack_right_shift_u8(src_p[6], 5u, 0x20u); - dst_p->channel_14_fault = unpack_right_shift_u8(src_p[6], 6u, 0x40u); - dst_p->channel_15_fault = unpack_right_shift_u8(src_p[6], 7u, 0x80u); - dst_p->compressor_on = unpack_right_shift_u8(src_p[7], 0u, 0x01u); - dst_p->system_enabled = unpack_right_shift_u8(src_p[7], 1u, 0x02u); - dst_p->robo_rio_present = unpack_right_shift_u8(src_p[7], 2u, 0x04u); - dst_p->compressor_config = unpack_right_shift_u8(src_p[7], 3u, 0x18u); - - return (0); -} - -uint8_t PH_status_0_channel_0_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_0_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_0_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_1_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_1_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_1_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_2_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_2_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_2_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_3_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_3_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_3_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_4_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_4_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_4_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_5_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_5_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_5_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_6_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_6_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_6_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_7_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_7_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_7_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_8_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_8_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_8_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_9_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_9_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_9_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_10_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_10_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_10_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_11_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_11_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_11_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_12_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_12_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_12_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_13_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_13_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_13_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_14_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_14_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_14_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_15_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_15_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_15_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_analog_0_encode(double value) -{ - return (uint8_t)(value / 0.01961); -} - -double PH_status_0_analog_0_decode(uint8_t value) -{ - return ((double)value * 0.01961); -} - -bool PH_status_0_analog_0_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_status_0_analog_1_encode(double value) -{ - return (uint8_t)(value / 0.01961); -} - -double PH_status_0_analog_1_decode(uint8_t value) -{ - return ((double)value * 0.01961); -} - -bool PH_status_0_analog_1_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_status_0_digital_sensor_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_digital_sensor_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_digital_sensor_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_brownout_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_brownout_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_brownout_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_compressor_oc_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_compressor_oc_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_compressor_oc_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_compressor_open_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_compressor_open_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_compressor_open_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_solenoid_oc_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_solenoid_oc_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_solenoid_oc_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_can_warning_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_can_warning_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_can_warning_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_hardware_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_hardware_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_hardware_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_0_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_0_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_0_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_1_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_1_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_1_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_2_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_2_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_2_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_3_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_3_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_3_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_4_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_4_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_4_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_5_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_5_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_5_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_6_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_6_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_6_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_7_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_7_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_7_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_8_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_8_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_8_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_9_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_9_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_9_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_10_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_10_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_10_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_11_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_11_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_11_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_12_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_12_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_12_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_13_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_13_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_13_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_14_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_14_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_14_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_channel_15_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_channel_15_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_channel_15_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_compressor_on_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_compressor_on_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_compressor_on_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_system_enabled_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_system_enabled_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_system_enabled_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_robo_rio_present_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_robo_rio_present_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_robo_rio_present_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_0_compressor_config_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_0_compressor_config_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_0_compressor_config_is_in_range(uint8_t value) -{ - return (value <= 3u); -} - -int PH_status_1_pack( - uint8_t *dst_p, - const struct PH_status_1_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 8); - - dst_p[0] |= pack_left_shift_u8(src_p->v_bus, 0u, 0xffu); - dst_p[1] |= pack_left_shift_u16(src_p->solenoid_voltage, 0u, 0xffu); - dst_p[2] |= pack_right_shift_u16(src_p->solenoid_voltage, 8u, 0x0fu); - dst_p[4] |= pack_left_shift_u8(src_p->compressor_current, 0u, 0xffu); - dst_p[5] |= pack_left_shift_u8(src_p->solenoid_current, 0u, 0xffu); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_brownout_fault, 0u, 0x01u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_compressor_oc_fault, 1u, 0x02u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_compressor_open_fault, 2u, 0x04u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_solenoid_oc_fault, 3u, 0x08u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_can_warning_fault, 4u, 0x10u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_can_bus_off_fault, 5u, 0x20u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_hardware_fault, 6u, 0x40u); - dst_p[6] |= pack_left_shift_u8(src_p->sticky_firmware_fault, 7u, 0x80u); - dst_p[7] |= pack_left_shift_u8(src_p->sticky_has_reset_fault, 0u, 0x01u); - dst_p[7] |= pack_left_shift_u8(src_p->supply_voltage_5_v, 1u, 0xfeu); - - return (8); -} - -int PH_status_1_unpack( - struct PH_status_1_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - dst_p->v_bus = unpack_right_shift_u8(src_p[0], 0u, 0xffu); - dst_p->solenoid_voltage = unpack_right_shift_u16(src_p[1], 0u, 0xffu); - dst_p->solenoid_voltage |= unpack_left_shift_u16(src_p[2], 8u, 0x0fu); - dst_p->compressor_current = unpack_right_shift_u8(src_p[4], 0u, 0xffu); - dst_p->solenoid_current = unpack_right_shift_u8(src_p[5], 0u, 0xffu); - dst_p->sticky_brownout_fault = unpack_right_shift_u8(src_p[6], 0u, 0x01u); - dst_p->sticky_compressor_oc_fault = unpack_right_shift_u8(src_p[6], 1u, 0x02u); - dst_p->sticky_compressor_open_fault = unpack_right_shift_u8(src_p[6], 2u, 0x04u); - dst_p->sticky_solenoid_oc_fault = unpack_right_shift_u8(src_p[6], 3u, 0x08u); - dst_p->sticky_can_warning_fault = unpack_right_shift_u8(src_p[6], 4u, 0x10u); - dst_p->sticky_can_bus_off_fault = unpack_right_shift_u8(src_p[6], 5u, 0x20u); - dst_p->sticky_hardware_fault = unpack_right_shift_u8(src_p[6], 6u, 0x40u); - dst_p->sticky_firmware_fault = unpack_right_shift_u8(src_p[6], 7u, 0x80u); - dst_p->sticky_has_reset_fault = unpack_right_shift_u8(src_p[7], 0u, 0x01u); - dst_p->supply_voltage_5_v = unpack_right_shift_u8(src_p[7], 1u, 0xfeu); - - return (0); -} - -uint8_t PH_status_1_v_bus_encode(double value) -{ - return (uint8_t)((value - 4.0) / 0.0625); -} - -double PH_status_1_v_bus_decode(uint8_t value) -{ - return (((double)value * 0.0625) + 4.0); -} - -bool PH_status_1_v_bus_is_in_range(uint8_t value) -{ - return (value <= 192u); -} - -uint16_t PH_status_1_solenoid_voltage_encode(double value) -{ - return (uint16_t)(value / 0.0078125); -} - -double PH_status_1_solenoid_voltage_decode(uint16_t value) -{ - return ((double)value * 0.0078125); -} - -bool PH_status_1_solenoid_voltage_is_in_range(uint16_t value) -{ - return (value <= 4096u); -} - -uint8_t PH_status_1_compressor_current_encode(double value) -{ - return (uint8_t)(value / 0.125); -} - -double PH_status_1_compressor_current_decode(uint8_t value) -{ - return ((double)value * 0.125); -} - -bool PH_status_1_compressor_current_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_status_1_solenoid_current_encode(double value) -{ - return (uint8_t)(value / 0.125); -} - -double PH_status_1_solenoid_current_decode(uint8_t value) -{ - return ((double)value * 0.125); -} - -bool PH_status_1_solenoid_current_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_status_1_sticky_brownout_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_brownout_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_brownout_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_compressor_oc_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_compressor_oc_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_compressor_oc_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_compressor_open_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_compressor_open_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_compressor_open_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_solenoid_oc_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_solenoid_oc_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_solenoid_oc_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_can_warning_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_can_warning_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_can_warning_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_can_bus_off_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_can_bus_off_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_can_bus_off_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_hardware_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_hardware_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_hardware_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_firmware_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_firmware_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_firmware_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_sticky_has_reset_fault_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_status_1_sticky_has_reset_fault_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_status_1_sticky_has_reset_fault_is_in_range(uint8_t value) -{ - return (value <= 1u); -} - -uint8_t PH_status_1_supply_voltage_5_v_encode(double value) -{ - return (uint8_t)((value - 4.5) / 0.0078125); -} - -double PH_status_1_supply_voltage_5_v_decode(uint8_t value) -{ - return (((double)value * 0.0078125) + 4.5); -} - -bool PH_status_1_supply_voltage_5_v_is_in_range(uint8_t value) -{ - return (value <= 128u); -} - -int PH_clear_faults_pack( - uint8_t *dst_p, - const struct PH_clear_faults_t *src_p, - size_t size) -{ - (void)dst_p; - (void)src_p; - (void)size; - - return (0); -} - -int PH_clear_faults_unpack( - struct PH_clear_faults_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - (void)dst_p; - (void)src_p; - (void)size; - - return (0); -} - -int PH_version_pack( - uint8_t *dst_p, - const struct PH_version_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - memset(&dst_p[0], 0, 8); - - dst_p[0] |= pack_left_shift_u8(src_p->firmware_fix, 0u, 0xffu); - dst_p[1] |= pack_left_shift_u8(src_p->firmware_minor, 0u, 0xffu); - dst_p[2] |= pack_left_shift_u8(src_p->firmware_year, 0u, 0xffu); - dst_p[3] |= pack_left_shift_u8(src_p->hardware_minor, 0u, 0xffu); - dst_p[4] |= pack_left_shift_u8(src_p->hardware_major, 0u, 0xffu); - dst_p[5] |= pack_left_shift_u32(src_p->unique_id, 0u, 0xffu); - dst_p[6] |= pack_right_shift_u32(src_p->unique_id, 8u, 0xffu); - dst_p[7] |= pack_right_shift_u32(src_p->unique_id, 16u, 0xffu); - - return (8); -} - -int PH_version_unpack( - struct PH_version_t *dst_p, - const uint8_t *src_p, - size_t size) -{ - if (size < 8u) { - return (-EINVAL); - } - - dst_p->firmware_fix = unpack_right_shift_u8(src_p[0], 0u, 0xffu); - dst_p->firmware_minor = unpack_right_shift_u8(src_p[1], 0u, 0xffu); - dst_p->firmware_year = unpack_right_shift_u8(src_p[2], 0u, 0xffu); - dst_p->hardware_minor = unpack_right_shift_u8(src_p[3], 0u, 0xffu); - dst_p->hardware_major = unpack_right_shift_u8(src_p[4], 0u, 0xffu); - dst_p->unique_id = unpack_right_shift_u32(src_p[5], 0u, 0xffu); - dst_p->unique_id |= unpack_left_shift_u32(src_p[6], 8u, 0xffu); - dst_p->unique_id |= unpack_left_shift_u32(src_p[7], 16u, 0xffu); - - return (0); -} - -uint8_t PH_version_firmware_fix_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_version_firmware_fix_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_version_firmware_fix_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_version_firmware_minor_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_version_firmware_minor_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_version_firmware_minor_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_version_firmware_year_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_version_firmware_year_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_version_firmware_year_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_version_hardware_minor_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_version_hardware_minor_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_version_hardware_minor_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint8_t PH_version_hardware_major_encode(double value) -{ - return (uint8_t)(value); -} - -double PH_version_hardware_major_decode(uint8_t value) -{ - return ((double)value); -} - -bool PH_version_hardware_major_is_in_range(uint8_t value) -{ - (void)value; - - return (true); -} - -uint32_t PH_version_unique_id_encode(double value) -{ - return (uint32_t)(value); -} - -double PH_version_unique_id_decode(uint32_t value) -{ - return ((double)value); -} - -bool PH_version_unique_id_is_in_range(uint32_t value) -{ - return (value <= 16777215u); -} +/** + * The MIT License (MIT) + * + * Copyright (c) 2018-2019 Erik Moqvist + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * This file was generated by cantools version + */ + +#include + +#include "PHFrames.h" + +static inline uint8_t pack_left_shift_u8( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value << shift) & mask); +} + +static inline uint8_t pack_left_shift_u16( + uint16_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value << shift) & mask); +} + +static inline uint8_t pack_left_shift_u32( + uint32_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value << shift) & mask); +} + +static inline uint8_t pack_right_shift_u16( + uint16_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value >> shift) & mask); +} + +static inline uint8_t pack_right_shift_u32( + uint32_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value >> shift) & mask); +} + +static inline uint16_t unpack_left_shift_u16( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint16_t)((uint16_t)(value & mask) << shift); +} + +static inline uint32_t unpack_left_shift_u32( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint32_t)((uint32_t)(value & mask) << shift); +} + +static inline uint8_t unpack_right_shift_u8( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint8_t)((uint8_t)(value & mask) >> shift); +} + +static inline uint16_t unpack_right_shift_u16( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint16_t)((uint16_t)(value & mask) >> shift); +} + +static inline uint32_t unpack_right_shift_u32( + uint8_t value, + uint8_t shift, + uint8_t mask) +{ + return (uint32_t)((uint32_t)(value & mask) >> shift); +} + +int PH_compressor_config_pack( + uint8_t *dst_p, + const struct PH_compressor_config_t *src_p, + size_t size) +{ + if (size < 5u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 5); + + dst_p[0] |= pack_left_shift_u16(src_p->minimum_tank_pressure, 0u, 0xffu); + dst_p[1] |= pack_right_shift_u16(src_p->minimum_tank_pressure, 8u, 0xffu); + dst_p[2] |= pack_left_shift_u16(src_p->maximum_tank_pressure, 0u, 0xffu); + dst_p[3] |= pack_right_shift_u16(src_p->maximum_tank_pressure, 8u, 0xffu); + dst_p[4] |= pack_left_shift_u8(src_p->force_disable, 0u, 0x01u); + dst_p[4] |= pack_left_shift_u8(src_p->use_digital, 1u, 0x02u); + + return (5); +} + +int PH_compressor_config_unpack( + struct PH_compressor_config_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 5u) { + return (-EINVAL); + } + + dst_p->minimum_tank_pressure = unpack_right_shift_u16(src_p[0], 0u, 0xffu); + dst_p->minimum_tank_pressure |= unpack_left_shift_u16(src_p[1], 8u, 0xffu); + dst_p->maximum_tank_pressure = unpack_right_shift_u16(src_p[2], 0u, 0xffu); + dst_p->maximum_tank_pressure |= unpack_left_shift_u16(src_p[3], 8u, 0xffu); + dst_p->force_disable = unpack_right_shift_u8(src_p[4], 0u, 0x01u); + dst_p->use_digital = unpack_right_shift_u8(src_p[4], 1u, 0x02u); + + return (0); +} + +uint16_t PH_compressor_config_minimum_tank_pressure_encode(double value) +{ + return (uint16_t)(value / 0.001); +} + +double PH_compressor_config_minimum_tank_pressure_decode(uint16_t value) +{ + return ((double)value * 0.001); +} + +bool PH_compressor_config_minimum_tank_pressure_is_in_range(uint16_t value) +{ + return (value <= 5000u); +} + +uint16_t PH_compressor_config_maximum_tank_pressure_encode(double value) +{ + return (uint16_t)(value / 0.001); +} + +double PH_compressor_config_maximum_tank_pressure_decode(uint16_t value) +{ + return ((double)value * 0.001); +} + +bool PH_compressor_config_maximum_tank_pressure_is_in_range(uint16_t value) +{ + return (value <= 5000u); +} + +uint8_t PH_compressor_config_force_disable_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_compressor_config_force_disable_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_compressor_config_force_disable_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_compressor_config_use_digital_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_compressor_config_use_digital_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_compressor_config_use_digital_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +int PH_set_all_pack( + uint8_t *dst_p, + const struct PH_set_all_t *src_p, + size_t size) +{ + if (size < 4u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 4); + + dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x03u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 2u, 0x0cu); + dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 4u, 0x30u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 6u, 0xc0u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_4, 0u, 0x03u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_5, 2u, 0x0cu); + dst_p[1] |= pack_left_shift_u8(src_p->channel_6, 4u, 0x30u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_7, 6u, 0xc0u); + dst_p[2] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x03u); + dst_p[2] |= pack_left_shift_u8(src_p->channel_9, 2u, 0x0cu); + dst_p[2] |= pack_left_shift_u8(src_p->channel_10, 4u, 0x30u); + dst_p[2] |= pack_left_shift_u8(src_p->channel_11, 6u, 0xc0u); + dst_p[3] |= pack_left_shift_u8(src_p->channel_12, 0u, 0x03u); + dst_p[3] |= pack_left_shift_u8(src_p->channel_13, 2u, 0x0cu); + dst_p[3] |= pack_left_shift_u8(src_p->channel_14, 4u, 0x30u); + dst_p[3] |= pack_left_shift_u8(src_p->channel_15, 6u, 0xc0u); + + return (4); +} + +int PH_set_all_unpack( + struct PH_set_all_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 4u) { + return (-EINVAL); + } + + dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x03u); + dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 2u, 0x0cu); + dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 4u, 0x30u); + dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 6u, 0xc0u); + dst_p->channel_4 = unpack_right_shift_u8(src_p[1], 0u, 0x03u); + dst_p->channel_5 = unpack_right_shift_u8(src_p[1], 2u, 0x0cu); + dst_p->channel_6 = unpack_right_shift_u8(src_p[1], 4u, 0x30u); + dst_p->channel_7 = unpack_right_shift_u8(src_p[1], 6u, 0xc0u); + dst_p->channel_8 = unpack_right_shift_u8(src_p[2], 0u, 0x03u); + dst_p->channel_9 = unpack_right_shift_u8(src_p[2], 2u, 0x0cu); + dst_p->channel_10 = unpack_right_shift_u8(src_p[2], 4u, 0x30u); + dst_p->channel_11 = unpack_right_shift_u8(src_p[2], 6u, 0xc0u); + dst_p->channel_12 = unpack_right_shift_u8(src_p[3], 0u, 0x03u); + dst_p->channel_13 = unpack_right_shift_u8(src_p[3], 2u, 0x0cu); + dst_p->channel_14 = unpack_right_shift_u8(src_p[3], 4u, 0x30u); + dst_p->channel_15 = unpack_right_shift_u8(src_p[3], 6u, 0xc0u); + + return (0); +} + +uint8_t PH_set_all_channel_0_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_0_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_0_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_1_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_1_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_1_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_2_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_2_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_2_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_3_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_3_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_3_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_4_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_4_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_4_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_5_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_5_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_5_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_6_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_6_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_6_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_7_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_7_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_7_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_8_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_8_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_8_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_9_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_9_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_9_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_10_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_10_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_10_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_11_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_11_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_11_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_12_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_12_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_12_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_13_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_13_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_13_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_14_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_14_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_14_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +uint8_t PH_set_all_channel_15_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_set_all_channel_15_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_set_all_channel_15_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +int PH_pulse_once_pack( + uint8_t *dst_p, + const struct PH_pulse_once_t *src_p, + size_t size) +{ + if (size < 4u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 4); + + dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x01u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 1u, 0x02u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 2u, 0x04u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 3u, 0x08u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_4, 4u, 0x10u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_5, 5u, 0x20u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_6, 6u, 0x40u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_7, 7u, 0x80u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x01u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_9, 1u, 0x02u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_10, 2u, 0x04u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_11, 3u, 0x08u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_12, 4u, 0x10u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_13, 5u, 0x20u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_14, 6u, 0x40u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_15, 7u, 0x80u); + dst_p[2] |= pack_left_shift_u16(src_p->pulse_length_ms, 0u, 0xffu); + dst_p[3] |= pack_right_shift_u16(src_p->pulse_length_ms, 8u, 0xffu); + + return (4); +} + +int PH_pulse_once_unpack( + struct PH_pulse_once_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 4u) { + return (-EINVAL); + } + + dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x01u); + dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 1u, 0x02u); + dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 2u, 0x04u); + dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 3u, 0x08u); + dst_p->channel_4 = unpack_right_shift_u8(src_p[0], 4u, 0x10u); + dst_p->channel_5 = unpack_right_shift_u8(src_p[0], 5u, 0x20u); + dst_p->channel_6 = unpack_right_shift_u8(src_p[0], 6u, 0x40u); + dst_p->channel_7 = unpack_right_shift_u8(src_p[0], 7u, 0x80u); + dst_p->channel_8 = unpack_right_shift_u8(src_p[1], 0u, 0x01u); + dst_p->channel_9 = unpack_right_shift_u8(src_p[1], 1u, 0x02u); + dst_p->channel_10 = unpack_right_shift_u8(src_p[1], 2u, 0x04u); + dst_p->channel_11 = unpack_right_shift_u8(src_p[1], 3u, 0x08u); + dst_p->channel_12 = unpack_right_shift_u8(src_p[1], 4u, 0x10u); + dst_p->channel_13 = unpack_right_shift_u8(src_p[1], 5u, 0x20u); + dst_p->channel_14 = unpack_right_shift_u8(src_p[1], 6u, 0x40u); + dst_p->channel_15 = unpack_right_shift_u8(src_p[1], 7u, 0x80u); + dst_p->pulse_length_ms = unpack_right_shift_u16(src_p[2], 0u, 0xffu); + dst_p->pulse_length_ms |= unpack_left_shift_u16(src_p[3], 8u, 0xffu); + + return (0); +} + +uint8_t PH_pulse_once_channel_0_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_0_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_0_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_1_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_1_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_1_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_2_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_2_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_2_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_3_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_3_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_3_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_4_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_4_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_4_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_5_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_5_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_5_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_6_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_6_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_6_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_7_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_7_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_7_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_8_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_8_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_8_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_9_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_9_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_9_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_10_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_10_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_10_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_11_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_11_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_11_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_12_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_12_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_12_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_13_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_13_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_13_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_14_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_14_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_14_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_pulse_once_channel_15_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_pulse_once_channel_15_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_channel_15_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint16_t PH_pulse_once_pulse_length_ms_encode(double value) +{ + return (uint16_t)(value); +} + +double PH_pulse_once_pulse_length_ms_decode(uint16_t value) +{ + return ((double)value); +} + +bool PH_pulse_once_pulse_length_ms_is_in_range(uint16_t value) +{ + (void)value; + + return (true); +} + +int PH_status_0_pack( + uint8_t *dst_p, + const struct PH_status_0_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 8); + + dst_p[0] |= pack_left_shift_u8(src_p->channel_0, 0u, 0x01u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_1, 1u, 0x02u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_2, 2u, 0x04u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_3, 3u, 0x08u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_4, 4u, 0x10u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_5, 5u, 0x20u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_6, 6u, 0x40u); + dst_p[0] |= pack_left_shift_u8(src_p->channel_7, 7u, 0x80u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_8, 0u, 0x01u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_9, 1u, 0x02u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_10, 2u, 0x04u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_11, 3u, 0x08u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_12, 4u, 0x10u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_13, 5u, 0x20u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_14, 6u, 0x40u); + dst_p[1] |= pack_left_shift_u8(src_p->channel_15, 7u, 0x80u); + dst_p[2] |= pack_left_shift_u8(src_p->analog_0, 0u, 0xffu); + dst_p[3] |= pack_left_shift_u8(src_p->analog_1, 0u, 0xffu); + dst_p[4] |= pack_left_shift_u8(src_p->digital_sensor, 0u, 0x01u); + dst_p[4] |= pack_left_shift_u8(src_p->brownout_fault, 1u, 0x02u); + dst_p[4] |= pack_left_shift_u8(src_p->compressor_oc_fault, 2u, 0x04u); + dst_p[4] |= pack_left_shift_u8(src_p->compressor_open_fault, 3u, 0x08u); + dst_p[4] |= pack_left_shift_u8(src_p->solenoid_oc_fault, 4u, 0x10u); + dst_p[4] |= pack_left_shift_u8(src_p->can_warning_fault, 5u, 0x20u); + dst_p[4] |= pack_left_shift_u8(src_p->hardware_fault, 6u, 0x40u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_0_fault, 0u, 0x01u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_1_fault, 1u, 0x02u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_2_fault, 2u, 0x04u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_3_fault, 3u, 0x08u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_4_fault, 4u, 0x10u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_5_fault, 5u, 0x20u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_6_fault, 6u, 0x40u); + dst_p[5] |= pack_left_shift_u8(src_p->channel_7_fault, 7u, 0x80u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_8_fault, 0u, 0x01u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_9_fault, 1u, 0x02u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_10_fault, 2u, 0x04u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_11_fault, 3u, 0x08u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_12_fault, 4u, 0x10u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_13_fault, 5u, 0x20u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_14_fault, 6u, 0x40u); + dst_p[6] |= pack_left_shift_u8(src_p->channel_15_fault, 7u, 0x80u); + dst_p[7] |= pack_left_shift_u8(src_p->compressor_on, 0u, 0x01u); + dst_p[7] |= pack_left_shift_u8(src_p->system_enabled, 1u, 0x02u); + dst_p[7] |= pack_left_shift_u8(src_p->robo_rio_present, 2u, 0x04u); + dst_p[7] |= pack_left_shift_u8(src_p->compressor_config, 3u, 0x18u); + + return (8); +} + +int PH_status_0_unpack( + struct PH_status_0_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + dst_p->channel_0 = unpack_right_shift_u8(src_p[0], 0u, 0x01u); + dst_p->channel_1 = unpack_right_shift_u8(src_p[0], 1u, 0x02u); + dst_p->channel_2 = unpack_right_shift_u8(src_p[0], 2u, 0x04u); + dst_p->channel_3 = unpack_right_shift_u8(src_p[0], 3u, 0x08u); + dst_p->channel_4 = unpack_right_shift_u8(src_p[0], 4u, 0x10u); + dst_p->channel_5 = unpack_right_shift_u8(src_p[0], 5u, 0x20u); + dst_p->channel_6 = unpack_right_shift_u8(src_p[0], 6u, 0x40u); + dst_p->channel_7 = unpack_right_shift_u8(src_p[0], 7u, 0x80u); + dst_p->channel_8 = unpack_right_shift_u8(src_p[1], 0u, 0x01u); + dst_p->channel_9 = unpack_right_shift_u8(src_p[1], 1u, 0x02u); + dst_p->channel_10 = unpack_right_shift_u8(src_p[1], 2u, 0x04u); + dst_p->channel_11 = unpack_right_shift_u8(src_p[1], 3u, 0x08u); + dst_p->channel_12 = unpack_right_shift_u8(src_p[1], 4u, 0x10u); + dst_p->channel_13 = unpack_right_shift_u8(src_p[1], 5u, 0x20u); + dst_p->channel_14 = unpack_right_shift_u8(src_p[1], 6u, 0x40u); + dst_p->channel_15 = unpack_right_shift_u8(src_p[1], 7u, 0x80u); + dst_p->analog_0 = unpack_right_shift_u8(src_p[2], 0u, 0xffu); + dst_p->analog_1 = unpack_right_shift_u8(src_p[3], 0u, 0xffu); + dst_p->digital_sensor = unpack_right_shift_u8(src_p[4], 0u, 0x01u); + dst_p->brownout_fault = unpack_right_shift_u8(src_p[4], 1u, 0x02u); + dst_p->compressor_oc_fault = unpack_right_shift_u8(src_p[4], 2u, 0x04u); + dst_p->compressor_open_fault = unpack_right_shift_u8(src_p[4], 3u, 0x08u); + dst_p->solenoid_oc_fault = unpack_right_shift_u8(src_p[4], 4u, 0x10u); + dst_p->can_warning_fault = unpack_right_shift_u8(src_p[4], 5u, 0x20u); + dst_p->hardware_fault = unpack_right_shift_u8(src_p[4], 6u, 0x40u); + dst_p->channel_0_fault = unpack_right_shift_u8(src_p[5], 0u, 0x01u); + dst_p->channel_1_fault = unpack_right_shift_u8(src_p[5], 1u, 0x02u); + dst_p->channel_2_fault = unpack_right_shift_u8(src_p[5], 2u, 0x04u); + dst_p->channel_3_fault = unpack_right_shift_u8(src_p[5], 3u, 0x08u); + dst_p->channel_4_fault = unpack_right_shift_u8(src_p[5], 4u, 0x10u); + dst_p->channel_5_fault = unpack_right_shift_u8(src_p[5], 5u, 0x20u); + dst_p->channel_6_fault = unpack_right_shift_u8(src_p[5], 6u, 0x40u); + dst_p->channel_7_fault = unpack_right_shift_u8(src_p[5], 7u, 0x80u); + dst_p->channel_8_fault = unpack_right_shift_u8(src_p[6], 0u, 0x01u); + dst_p->channel_9_fault = unpack_right_shift_u8(src_p[6], 1u, 0x02u); + dst_p->channel_10_fault = unpack_right_shift_u8(src_p[6], 2u, 0x04u); + dst_p->channel_11_fault = unpack_right_shift_u8(src_p[6], 3u, 0x08u); + dst_p->channel_12_fault = unpack_right_shift_u8(src_p[6], 4u, 0x10u); + dst_p->channel_13_fault = unpack_right_shift_u8(src_p[6], 5u, 0x20u); + dst_p->channel_14_fault = unpack_right_shift_u8(src_p[6], 6u, 0x40u); + dst_p->channel_15_fault = unpack_right_shift_u8(src_p[6], 7u, 0x80u); + dst_p->compressor_on = unpack_right_shift_u8(src_p[7], 0u, 0x01u); + dst_p->system_enabled = unpack_right_shift_u8(src_p[7], 1u, 0x02u); + dst_p->robo_rio_present = unpack_right_shift_u8(src_p[7], 2u, 0x04u); + dst_p->compressor_config = unpack_right_shift_u8(src_p[7], 3u, 0x18u); + + return (0); +} + +uint8_t PH_status_0_channel_0_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_0_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_0_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_1_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_1_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_1_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_2_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_2_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_2_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_3_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_3_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_3_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_4_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_4_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_4_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_5_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_5_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_5_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_6_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_6_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_6_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_7_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_7_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_7_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_8_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_8_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_8_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_9_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_9_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_9_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_10_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_10_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_10_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_11_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_11_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_11_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_12_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_12_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_12_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_13_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_13_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_13_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_14_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_14_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_14_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_15_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_15_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_15_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_analog_0_encode(double value) +{ + return (uint8_t)(value / 0.01961); +} + +double PH_status_0_analog_0_decode(uint8_t value) +{ + return ((double)value * 0.01961); +} + +bool PH_status_0_analog_0_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_status_0_analog_1_encode(double value) +{ + return (uint8_t)(value / 0.01961); +} + +double PH_status_0_analog_1_decode(uint8_t value) +{ + return ((double)value * 0.01961); +} + +bool PH_status_0_analog_1_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_status_0_digital_sensor_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_digital_sensor_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_digital_sensor_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_brownout_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_brownout_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_brownout_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_compressor_oc_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_compressor_oc_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_compressor_oc_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_compressor_open_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_compressor_open_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_compressor_open_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_solenoid_oc_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_solenoid_oc_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_solenoid_oc_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_can_warning_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_can_warning_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_can_warning_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_hardware_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_hardware_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_hardware_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_0_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_0_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_0_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_1_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_1_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_1_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_2_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_2_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_2_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_3_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_3_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_3_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_4_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_4_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_4_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_5_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_5_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_5_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_6_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_6_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_6_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_7_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_7_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_7_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_8_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_8_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_8_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_9_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_9_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_9_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_10_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_10_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_10_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_11_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_11_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_11_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_12_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_12_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_12_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_13_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_13_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_13_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_14_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_14_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_14_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_channel_15_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_channel_15_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_channel_15_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_compressor_on_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_compressor_on_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_compressor_on_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_system_enabled_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_system_enabled_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_system_enabled_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_robo_rio_present_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_robo_rio_present_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_robo_rio_present_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_0_compressor_config_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_0_compressor_config_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_0_compressor_config_is_in_range(uint8_t value) +{ + return (value <= 3u); +} + +int PH_status_1_pack( + uint8_t *dst_p, + const struct PH_status_1_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 8); + + dst_p[0] |= pack_left_shift_u8(src_p->v_bus, 0u, 0xffu); + dst_p[1] |= pack_left_shift_u16(src_p->solenoid_voltage, 0u, 0xffu); + dst_p[2] |= pack_right_shift_u16(src_p->solenoid_voltage, 8u, 0x0fu); + dst_p[4] |= pack_left_shift_u8(src_p->compressor_current, 0u, 0xffu); + dst_p[5] |= pack_left_shift_u8(src_p->solenoid_current, 0u, 0xffu); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_brownout_fault, 0u, 0x01u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_compressor_oc_fault, 1u, 0x02u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_compressor_open_fault, 2u, 0x04u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_solenoid_oc_fault, 3u, 0x08u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_can_warning_fault, 4u, 0x10u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_can_bus_off_fault, 5u, 0x20u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_hardware_fault, 6u, 0x40u); + dst_p[6] |= pack_left_shift_u8(src_p->sticky_firmware_fault, 7u, 0x80u); + dst_p[7] |= pack_left_shift_u8(src_p->sticky_has_reset_fault, 0u, 0x01u); + dst_p[7] |= pack_left_shift_u8(src_p->supply_voltage_5_v, 1u, 0xfeu); + + return (8); +} + +int PH_status_1_unpack( + struct PH_status_1_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + dst_p->v_bus = unpack_right_shift_u8(src_p[0], 0u, 0xffu); + dst_p->solenoid_voltage = unpack_right_shift_u16(src_p[1], 0u, 0xffu); + dst_p->solenoid_voltage |= unpack_left_shift_u16(src_p[2], 8u, 0x0fu); + dst_p->compressor_current = unpack_right_shift_u8(src_p[4], 0u, 0xffu); + dst_p->solenoid_current = unpack_right_shift_u8(src_p[5], 0u, 0xffu); + dst_p->sticky_brownout_fault = unpack_right_shift_u8(src_p[6], 0u, 0x01u); + dst_p->sticky_compressor_oc_fault = unpack_right_shift_u8(src_p[6], 1u, 0x02u); + dst_p->sticky_compressor_open_fault = unpack_right_shift_u8(src_p[6], 2u, 0x04u); + dst_p->sticky_solenoid_oc_fault = unpack_right_shift_u8(src_p[6], 3u, 0x08u); + dst_p->sticky_can_warning_fault = unpack_right_shift_u8(src_p[6], 4u, 0x10u); + dst_p->sticky_can_bus_off_fault = unpack_right_shift_u8(src_p[6], 5u, 0x20u); + dst_p->sticky_hardware_fault = unpack_right_shift_u8(src_p[6], 6u, 0x40u); + dst_p->sticky_firmware_fault = unpack_right_shift_u8(src_p[6], 7u, 0x80u); + dst_p->sticky_has_reset_fault = unpack_right_shift_u8(src_p[7], 0u, 0x01u); + dst_p->supply_voltage_5_v = unpack_right_shift_u8(src_p[7], 1u, 0xfeu); + + return (0); +} + +uint8_t PH_status_1_v_bus_encode(double value) +{ + return (uint8_t)((value - 4.0) / 0.0625); +} + +double PH_status_1_v_bus_decode(uint8_t value) +{ + return (((double)value * 0.0625) + 4.0); +} + +bool PH_status_1_v_bus_is_in_range(uint8_t value) +{ + return (value <= 192u); +} + +uint16_t PH_status_1_solenoid_voltage_encode(double value) +{ + return (uint16_t)(value / 0.0078125); +} + +double PH_status_1_solenoid_voltage_decode(uint16_t value) +{ + return ((double)value * 0.0078125); +} + +bool PH_status_1_solenoid_voltage_is_in_range(uint16_t value) +{ + return (value <= 4096u); +} + +uint8_t PH_status_1_compressor_current_encode(double value) +{ + return (uint8_t)(value / 0.125); +} + +double PH_status_1_compressor_current_decode(uint8_t value) +{ + return ((double)value * 0.125); +} + +bool PH_status_1_compressor_current_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_status_1_solenoid_current_encode(double value) +{ + return (uint8_t)(value / 0.125); +} + +double PH_status_1_solenoid_current_decode(uint8_t value) +{ + return ((double)value * 0.125); +} + +bool PH_status_1_solenoid_current_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_status_1_sticky_brownout_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_brownout_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_brownout_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_compressor_oc_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_compressor_oc_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_compressor_oc_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_compressor_open_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_compressor_open_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_compressor_open_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_solenoid_oc_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_solenoid_oc_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_solenoid_oc_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_can_warning_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_can_warning_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_can_warning_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_can_bus_off_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_can_bus_off_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_can_bus_off_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_hardware_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_hardware_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_hardware_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_firmware_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_firmware_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_firmware_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_sticky_has_reset_fault_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_status_1_sticky_has_reset_fault_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_status_1_sticky_has_reset_fault_is_in_range(uint8_t value) +{ + return (value <= 1u); +} + +uint8_t PH_status_1_supply_voltage_5_v_encode(double value) +{ + return (uint8_t)((value - 4.5) / 0.0078125); +} + +double PH_status_1_supply_voltage_5_v_decode(uint8_t value) +{ + return (((double)value * 0.0078125) + 4.5); +} + +bool PH_status_1_supply_voltage_5_v_is_in_range(uint8_t value) +{ + return (value <= 128u); +} + +int PH_clear_faults_pack( + uint8_t *dst_p, + const struct PH_clear_faults_t *src_p, + size_t size) +{ + (void)dst_p; + (void)src_p; + (void)size; + + return (0); +} + +int PH_clear_faults_unpack( + struct PH_clear_faults_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + (void)dst_p; + (void)src_p; + (void)size; + + return (0); +} + +int PH_version_pack( + uint8_t *dst_p, + const struct PH_version_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + memset(&dst_p[0], 0, 8); + + dst_p[0] |= pack_left_shift_u8(src_p->firmware_fix, 0u, 0xffu); + dst_p[1] |= pack_left_shift_u8(src_p->firmware_minor, 0u, 0xffu); + dst_p[2] |= pack_left_shift_u8(src_p->firmware_year, 0u, 0xffu); + dst_p[3] |= pack_left_shift_u8(src_p->hardware_minor, 0u, 0xffu); + dst_p[4] |= pack_left_shift_u8(src_p->hardware_major, 0u, 0xffu); + dst_p[5] |= pack_left_shift_u32(src_p->unique_id, 0u, 0xffu); + dst_p[6] |= pack_right_shift_u32(src_p->unique_id, 8u, 0xffu); + dst_p[7] |= pack_right_shift_u32(src_p->unique_id, 16u, 0xffu); + + return (8); +} + +int PH_version_unpack( + struct PH_version_t *dst_p, + const uint8_t *src_p, + size_t size) +{ + if (size < 8u) { + return (-EINVAL); + } + + dst_p->firmware_fix = unpack_right_shift_u8(src_p[0], 0u, 0xffu); + dst_p->firmware_minor = unpack_right_shift_u8(src_p[1], 0u, 0xffu); + dst_p->firmware_year = unpack_right_shift_u8(src_p[2], 0u, 0xffu); + dst_p->hardware_minor = unpack_right_shift_u8(src_p[3], 0u, 0xffu); + dst_p->hardware_major = unpack_right_shift_u8(src_p[4], 0u, 0xffu); + dst_p->unique_id = unpack_right_shift_u32(src_p[5], 0u, 0xffu); + dst_p->unique_id |= unpack_left_shift_u32(src_p[6], 8u, 0xffu); + dst_p->unique_id |= unpack_left_shift_u32(src_p[7], 16u, 0xffu); + + return (0); +} + +uint8_t PH_version_firmware_fix_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_version_firmware_fix_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_version_firmware_fix_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_version_firmware_minor_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_version_firmware_minor_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_version_firmware_minor_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_version_firmware_year_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_version_firmware_year_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_version_firmware_year_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_version_hardware_minor_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_version_hardware_minor_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_version_hardware_minor_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint8_t PH_version_hardware_major_encode(double value) +{ + return (uint8_t)(value); +} + +double PH_version_hardware_major_decode(uint8_t value) +{ + return ((double)value); +} + +bool PH_version_hardware_major_is_in_range(uint8_t value) +{ + (void)value; + + return (true); +} + +uint32_t PH_version_unique_id_encode(double value) +{ + return (uint32_t)(value); +} + +double PH_version_unique_id_decode(uint32_t value) +{ + return ((double)value); +} + +bool PH_version_unique_id_is_in_range(uint32_t value) +{ + return (value <= 16777215u); +} diff --git a/hal/src/main/native/athena/rev/PHFrames.h b/hal/src/main/native/athena/rev/PHFrames.h index a1849e1e6e..cc9c23ccb3 100644 --- a/hal/src/main/native/athena/rev/PHFrames.h +++ b/hal/src/main/native/athena/rev/PHFrames.h @@ -1,3816 +1,3816 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2018-2019 Erik Moqvist - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - * This file was generated by cantools version - */ - -#ifndef PH_H -#define PH_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#ifndef EINVAL -# define EINVAL 22 -#endif - -/* Frame ids. */ -#define PH_COMPRESSOR_CONFIG_FRAME_ID (0x9050840u) -#define PH_SET_ALL_FRAME_ID (0x9050c00u) -#define PH_PULSE_ONCE_FRAME_ID (0x9050c40u) -#define PH_STATUS_0_FRAME_ID (0x9051800u) -#define PH_STATUS_1_FRAME_ID (0x9051840u) -#define PH_CLEAR_FAULTS_FRAME_ID (0x9051b80u) -#define PH_VERSION_FRAME_ID (0x9052600u) - -/* Frame lengths in bytes. */ -#define PH_COMPRESSOR_CONFIG_LENGTH (5u) -#define PH_SET_ALL_LENGTH (4u) -#define PH_PULSE_ONCE_LENGTH (4u) -#define PH_STATUS_0_LENGTH (8u) -#define PH_STATUS_1_LENGTH (8u) -#define PH_CLEAR_FAULTS_LENGTH (0u) -#define PH_VERSION_LENGTH (8u) - -/* Extended or standard frame types. */ -#define PH_COMPRESSOR_CONFIG_IS_EXTENDED (1) -#define PH_SET_ALL_IS_EXTENDED (1) -#define PH_PULSE_ONCE_IS_EXTENDED (1) -#define PH_STATUS_0_IS_EXTENDED (1) -#define PH_STATUS_1_IS_EXTENDED (1) -#define PH_CLEAR_FAULTS_IS_EXTENDED (1) -#define PH_VERSION_IS_EXTENDED (1) - -/* Frame cycle times in milliseconds. */ - - -/* Signal choices. */ - - -/** - * Signals in message Compressor_Config. - * - * Configures compressor to use digital/analog sensors - * - * All signal values are as on the CAN bus. - */ -struct PH_compressor_config_t { - /** - * Range: 0..5000 (0..5 V) - * Scale: 0.001 - * Offset: 0 - */ - uint16_t minimum_tank_pressure : 16; - - /** - * Range: 0..5000 (0..5 V) - * Scale: 0.001 - * Offset: 0 - */ - uint16_t maximum_tank_pressure : 16; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t force_disable : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t use_digital : 1; -}; - -/** - * Signals in message Set_All. - * - * Set state of all channels - * - * All signal values are as on the CAN bus. - */ -struct PH_set_all_t { - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_0 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_1 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_2 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_3 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_4 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_5 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_6 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_7 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_8 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_9 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_10 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_11 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_12 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_13 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_14 : 2; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_15 : 2; -}; - -/** - * Signals in message Pulse_Once. - * - * Pulse selected channels once - * - * All signal values are as on the CAN bus. - */ -struct PH_pulse_once_t { - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_0 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_1 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_2 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_3 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_4 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_5 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_6 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_7 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_8 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_9 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_10 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_11 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_12 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_13 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_14 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_15 : 1; - - /** - * Range: 0..65535 (0..65535 -) - * Scale: 1 - * Offset: 0 - */ - uint16_t pulse_length_ms : 16; -}; - -/** - * Signals in message Status_0. - * - * Periodic status frame 0 - * - * All signal values are as on the CAN bus. - */ -struct PH_status_0_t { - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_0 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_1 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_2 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_3 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_4 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_5 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_6 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_7 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_8 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_9 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_10 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_11 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_12 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_13 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_14 : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_15 : 1; - - /** - * Range: 0..255 (0..5.00055 V) - * Scale: 0.01961 - * Offset: 0 - */ - uint8_t analog_0 : 8; - - /** - * Range: 0..255 (0..5.00055 V) - * Scale: 0.01961 - * Offset: 0 - */ - uint8_t analog_1 : 8; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t digital_sensor : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t brownout_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t compressor_oc_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t compressor_open_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t solenoid_oc_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t can_warning_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t hardware_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_0_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_1_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_2_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_3_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_4_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_5_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_6_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_7_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_8_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_9_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_10_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_11_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_12_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_13_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_14_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t channel_15_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t compressor_on : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t system_enabled : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t robo_rio_present : 1; - - /** - * Range: 0..3 (0..3 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t compressor_config : 2; -}; - -/** - * Signals in message Status_1. - * - * Periodic status frame 1 - * - * All signal values are as on the CAN bus. - */ -struct PH_status_1_t { - /** - * Range: 0..192 (4..16 V) - * Scale: 0.0625 - * Offset: 4 - */ - uint8_t v_bus : 8; - - /** - * Range: 0..4096 (0..32 V) - * Scale: 0.0078125 - * Offset: 0 - */ - uint16_t solenoid_voltage : 12; - - /** - * Range: 0..256 (0..32 A) - * Scale: 0.125 - * Offset: 0 - */ - uint8_t compressor_current : 8; - - /** - * Range: 0..256 (0..32 A) - * Scale: 0.125 - * Offset: 0 - */ - uint8_t solenoid_current : 8; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_brownout_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_compressor_oc_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_compressor_open_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_solenoid_oc_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_can_warning_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_can_bus_off_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_hardware_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_firmware_fault : 1; - - /** - * Range: 0..1 (0..1 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t sticky_has_reset_fault : 1; - - /** - * Range: 0..128 (4.5..5.5 V) - * Scale: 0.0078125 - * Offset: 4.5 - */ - uint8_t supply_voltage_5_v : 7; -}; - -/** - * Signals in message Clear_Faults. - * - * Clear sticky faults on the device - * - * All signal values are as on the CAN bus. - */ -struct PH_clear_faults_t { - /** - * Dummy signal in empty message. - */ - uint8_t dummy; -}; - -/** - * Signals in message Version. - * - * Get the version of the PH - * - * All signal values are as on the CAN bus. - */ -struct PH_version_t { - /** - * Range: 0..255 (0..255 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t firmware_fix : 8; - - /** - * Range: 0..255 (0..255 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t firmware_minor : 8; - - /** - * Range: 0..255 (0..255 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t firmware_year : 8; - - /** - * Range: 0..255 (0..255 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t hardware_minor : 8; - - /** - * Range: 0..255 (0..255 -) - * Scale: 1 - * Offset: 0 - */ - uint8_t hardware_major : 8; - - /** - * Range: 0..16777215 (0..16777215 -) - * Scale: 1 - * Offset: 0 - */ - uint32_t unique_id : 24; -}; - -/** - * Pack message Compressor_Config. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_compressor_config_pack( - uint8_t *dst_p, - const struct PH_compressor_config_t *src_p, - size_t size); - -/** - * Unpack message Compressor_Config. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_compressor_config_unpack( - struct PH_compressor_config_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint16_t PH_compressor_config_minimum_tank_pressure_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_compressor_config_minimum_tank_pressure_decode(uint16_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_compressor_config_minimum_tank_pressure_is_in_range(uint16_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint16_t PH_compressor_config_maximum_tank_pressure_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_compressor_config_maximum_tank_pressure_decode(uint16_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_compressor_config_maximum_tank_pressure_is_in_range(uint16_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_compressor_config_force_disable_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_compressor_config_force_disable_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_compressor_config_force_disable_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_compressor_config_use_digital_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_compressor_config_use_digital_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_compressor_config_use_digital_is_in_range(uint8_t value); - -/** - * Pack message Set_All. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_set_all_pack( - uint8_t *dst_p, - const struct PH_set_all_t *src_p, - size_t size); - -/** - * Unpack message Set_All. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_set_all_unpack( - struct PH_set_all_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_0_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_0_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_0_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_1_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_1_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_1_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_2_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_2_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_2_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_3_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_3_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_3_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_4_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_4_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_4_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_5_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_5_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_5_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_6_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_6_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_6_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_7_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_7_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_7_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_8_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_8_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_8_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_9_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_9_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_9_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_10_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_10_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_10_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_11_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_11_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_11_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_12_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_12_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_12_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_13_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_13_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_13_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_14_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_14_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_14_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_set_all_channel_15_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_set_all_channel_15_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_set_all_channel_15_is_in_range(uint8_t value); - -/** - * Pack message Pulse_Once. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_pulse_once_pack( - uint8_t *dst_p, - const struct PH_pulse_once_t *src_p, - size_t size); - -/** - * Unpack message Pulse_Once. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_pulse_once_unpack( - struct PH_pulse_once_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_0_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_0_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_0_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_1_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_1_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_1_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_2_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_2_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_2_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_3_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_3_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_3_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_4_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_4_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_4_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_5_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_5_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_5_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_6_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_6_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_6_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_7_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_7_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_7_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_8_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_8_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_8_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_9_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_9_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_9_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_10_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_10_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_10_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_11_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_11_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_11_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_12_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_12_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_12_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_13_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_13_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_13_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_14_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_14_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_14_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_pulse_once_channel_15_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_channel_15_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_channel_15_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint16_t PH_pulse_once_pulse_length_ms_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_pulse_once_pulse_length_ms_decode(uint16_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_pulse_once_pulse_length_ms_is_in_range(uint16_t value); - -/** - * Pack message Status_0. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_status_0_pack( - uint8_t *dst_p, - const struct PH_status_0_t *src_p, - size_t size); - -/** - * Unpack message Status_0. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_status_0_unpack( - struct PH_status_0_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_0_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_0_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_0_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_1_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_1_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_1_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_2_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_2_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_2_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_3_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_3_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_3_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_4_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_4_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_4_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_5_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_5_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_5_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_6_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_6_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_6_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_7_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_7_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_7_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_8_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_8_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_8_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_9_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_9_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_9_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_10_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_10_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_10_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_11_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_11_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_11_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_12_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_12_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_12_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_13_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_13_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_13_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_14_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_14_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_14_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_15_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_15_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_15_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_analog_0_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_analog_0_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_analog_0_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_analog_1_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_analog_1_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_analog_1_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_digital_sensor_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_digital_sensor_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_digital_sensor_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_brownout_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_brownout_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_brownout_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_compressor_oc_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_compressor_oc_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_compressor_oc_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_compressor_open_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_compressor_open_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_compressor_open_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_solenoid_oc_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_solenoid_oc_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_solenoid_oc_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_can_warning_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_can_warning_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_can_warning_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_hardware_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_hardware_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_hardware_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_0_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_0_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_0_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_1_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_1_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_1_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_2_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_2_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_2_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_3_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_3_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_3_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_4_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_4_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_4_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_5_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_5_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_5_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_6_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_6_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_6_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_7_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_7_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_7_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_8_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_8_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_8_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_9_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_9_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_9_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_10_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_10_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_10_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_11_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_11_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_11_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_12_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_12_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_12_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_13_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_13_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_13_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_14_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_14_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_14_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_channel_15_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_channel_15_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_channel_15_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_compressor_on_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_compressor_on_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_compressor_on_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_system_enabled_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_system_enabled_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_system_enabled_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_robo_rio_present_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_robo_rio_present_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_robo_rio_present_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_0_compressor_config_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_0_compressor_config_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_0_compressor_config_is_in_range(uint8_t value); - -/** - * Pack message Status_1. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_status_1_pack( - uint8_t *dst_p, - const struct PH_status_1_t *src_p, - size_t size); - -/** - * Unpack message Status_1. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_status_1_unpack( - struct PH_status_1_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_v_bus_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_v_bus_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_v_bus_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint16_t PH_status_1_solenoid_voltage_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_solenoid_voltage_decode(uint16_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_solenoid_voltage_is_in_range(uint16_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_compressor_current_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_compressor_current_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_compressor_current_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_solenoid_current_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_solenoid_current_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_solenoid_current_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_brownout_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_brownout_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_brownout_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_compressor_oc_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_compressor_oc_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_compressor_oc_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_compressor_open_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_compressor_open_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_compressor_open_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_solenoid_oc_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_solenoid_oc_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_solenoid_oc_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_can_warning_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_can_warning_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_can_warning_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_can_bus_off_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_can_bus_off_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_can_bus_off_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_hardware_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_hardware_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_hardware_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_firmware_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_firmware_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_firmware_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_sticky_has_reset_fault_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_sticky_has_reset_fault_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_sticky_has_reset_fault_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_status_1_supply_voltage_5_v_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_status_1_supply_voltage_5_v_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_status_1_supply_voltage_5_v_is_in_range(uint8_t value); - -/** - * Pack message Clear_Faults. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_clear_faults_pack( - uint8_t *dst_p, - const struct PH_clear_faults_t *src_p, - size_t size); - -/** - * Unpack message Clear_Faults. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_clear_faults_unpack( - struct PH_clear_faults_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Pack message Version. - * - * @param[out] dst_p Buffer to pack the message into. - * @param[in] src_p Data to pack. - * @param[in] size Size of dst_p. - * - * @return Size of packed data, or negative error code. - */ -int PH_version_pack( - uint8_t *dst_p, - const struct PH_version_t *src_p, - size_t size); - -/** - * Unpack message Version. - * - * @param[out] dst_p Object to unpack the message into. - * @param[in] src_p Message to unpack. - * @param[in] size Size of src_p. - * - * @return zero(0) or negative error code. - */ -int PH_version_unpack( - struct PH_version_t *dst_p, - const uint8_t *src_p, - size_t size); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_version_firmware_fix_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_firmware_fix_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_firmware_fix_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_version_firmware_minor_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_firmware_minor_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_firmware_minor_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_version_firmware_year_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_firmware_year_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_firmware_year_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_version_hardware_minor_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_hardware_minor_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_hardware_minor_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint8_t PH_version_hardware_major_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_hardware_major_decode(uint8_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_hardware_major_is_in_range(uint8_t value); - -/** - * Encode given signal by applying scaling and offset. - * - * @param[in] value Signal to encode. - * - * @return Encoded signal. - */ -uint32_t PH_version_unique_id_encode(double value); - -/** - * Decode given signal by applying scaling and offset. - * - * @param[in] value Signal to decode. - * - * @return Decoded signal. - */ -double PH_version_unique_id_decode(uint32_t value); - -/** - * Check that given signal is in allowed range. - * - * @param[in] value Signal to check. - * - * @return true if in range, false otherwise. - */ -bool PH_version_unique_id_is_in_range(uint32_t value); - - -#ifdef __cplusplus -} -#endif - -#endif +/** + * The MIT License (MIT) + * + * Copyright (c) 2018-2019 Erik Moqvist + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * This file was generated by cantools version + */ + +#ifndef PH_H +#define PH_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#ifndef EINVAL +# define EINVAL 22 +#endif + +/* Frame ids. */ +#define PH_COMPRESSOR_CONFIG_FRAME_ID (0x9050840u) +#define PH_SET_ALL_FRAME_ID (0x9050c00u) +#define PH_PULSE_ONCE_FRAME_ID (0x9050c40u) +#define PH_STATUS_0_FRAME_ID (0x9051800u) +#define PH_STATUS_1_FRAME_ID (0x9051840u) +#define PH_CLEAR_FAULTS_FRAME_ID (0x9051b80u) +#define PH_VERSION_FRAME_ID (0x9052600u) + +/* Frame lengths in bytes. */ +#define PH_COMPRESSOR_CONFIG_LENGTH (5u) +#define PH_SET_ALL_LENGTH (4u) +#define PH_PULSE_ONCE_LENGTH (4u) +#define PH_STATUS_0_LENGTH (8u) +#define PH_STATUS_1_LENGTH (8u) +#define PH_CLEAR_FAULTS_LENGTH (0u) +#define PH_VERSION_LENGTH (8u) + +/* Extended or standard frame types. */ +#define PH_COMPRESSOR_CONFIG_IS_EXTENDED (1) +#define PH_SET_ALL_IS_EXTENDED (1) +#define PH_PULSE_ONCE_IS_EXTENDED (1) +#define PH_STATUS_0_IS_EXTENDED (1) +#define PH_STATUS_1_IS_EXTENDED (1) +#define PH_CLEAR_FAULTS_IS_EXTENDED (1) +#define PH_VERSION_IS_EXTENDED (1) + +/* Frame cycle times in milliseconds. */ + + +/* Signal choices. */ + + +/** + * Signals in message Compressor_Config. + * + * Configures compressor to use digital/analog sensors + * + * All signal values are as on the CAN bus. + */ +struct PH_compressor_config_t { + /** + * Range: 0..5000 (0..5 V) + * Scale: 0.001 + * Offset: 0 + */ + uint16_t minimum_tank_pressure : 16; + + /** + * Range: 0..5000 (0..5 V) + * Scale: 0.001 + * Offset: 0 + */ + uint16_t maximum_tank_pressure : 16; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t force_disable : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t use_digital : 1; +}; + +/** + * Signals in message Set_All. + * + * Set state of all channels + * + * All signal values are as on the CAN bus. + */ +struct PH_set_all_t { + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_0 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_1 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_2 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_3 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_4 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_5 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_6 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_7 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_8 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_9 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_10 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_11 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_12 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_13 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_14 : 2; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_15 : 2; +}; + +/** + * Signals in message Pulse_Once. + * + * Pulse selected channels once + * + * All signal values are as on the CAN bus. + */ +struct PH_pulse_once_t { + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_0 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_1 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_2 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_3 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_4 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_5 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_6 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_7 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_8 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_9 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_10 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_11 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_12 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_13 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_14 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_15 : 1; + + /** + * Range: 0..65535 (0..65535 -) + * Scale: 1 + * Offset: 0 + */ + uint16_t pulse_length_ms : 16; +}; + +/** + * Signals in message Status_0. + * + * Periodic status frame 0 + * + * All signal values are as on the CAN bus. + */ +struct PH_status_0_t { + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_0 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_1 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_2 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_3 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_4 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_5 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_6 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_7 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_8 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_9 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_10 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_11 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_12 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_13 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_14 : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_15 : 1; + + /** + * Range: 0..255 (0..5.00055 V) + * Scale: 0.01961 + * Offset: 0 + */ + uint8_t analog_0 : 8; + + /** + * Range: 0..255 (0..5.00055 V) + * Scale: 0.01961 + * Offset: 0 + */ + uint8_t analog_1 : 8; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t digital_sensor : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t brownout_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t compressor_oc_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t compressor_open_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t solenoid_oc_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t can_warning_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t hardware_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_0_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_1_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_2_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_3_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_4_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_5_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_6_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_7_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_8_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_9_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_10_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_11_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_12_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_13_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_14_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t channel_15_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t compressor_on : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t system_enabled : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t robo_rio_present : 1; + + /** + * Range: 0..3 (0..3 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t compressor_config : 2; +}; + +/** + * Signals in message Status_1. + * + * Periodic status frame 1 + * + * All signal values are as on the CAN bus. + */ +struct PH_status_1_t { + /** + * Range: 0..192 (4..16 V) + * Scale: 0.0625 + * Offset: 4 + */ + uint8_t v_bus : 8; + + /** + * Range: 0..4096 (0..32 V) + * Scale: 0.0078125 + * Offset: 0 + */ + uint16_t solenoid_voltage : 12; + + /** + * Range: 0..256 (0..32 A) + * Scale: 0.125 + * Offset: 0 + */ + uint8_t compressor_current : 8; + + /** + * Range: 0..256 (0..32 A) + * Scale: 0.125 + * Offset: 0 + */ + uint8_t solenoid_current : 8; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_brownout_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_compressor_oc_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_compressor_open_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_solenoid_oc_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_can_warning_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_can_bus_off_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_hardware_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_firmware_fault : 1; + + /** + * Range: 0..1 (0..1 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t sticky_has_reset_fault : 1; + + /** + * Range: 0..128 (4.5..5.5 V) + * Scale: 0.0078125 + * Offset: 4.5 + */ + uint8_t supply_voltage_5_v : 7; +}; + +/** + * Signals in message Clear_Faults. + * + * Clear sticky faults on the device + * + * All signal values are as on the CAN bus. + */ +struct PH_clear_faults_t { + /** + * Dummy signal in empty message. + */ + uint8_t dummy; +}; + +/** + * Signals in message Version. + * + * Get the version of the PH + * + * All signal values are as on the CAN bus. + */ +struct PH_version_t { + /** + * Range: 0..255 (0..255 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t firmware_fix : 8; + + /** + * Range: 0..255 (0..255 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t firmware_minor : 8; + + /** + * Range: 0..255 (0..255 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t firmware_year : 8; + + /** + * Range: 0..255 (0..255 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t hardware_minor : 8; + + /** + * Range: 0..255 (0..255 -) + * Scale: 1 + * Offset: 0 + */ + uint8_t hardware_major : 8; + + /** + * Range: 0..16777215 (0..16777215 -) + * Scale: 1 + * Offset: 0 + */ + uint32_t unique_id : 24; +}; + +/** + * Pack message Compressor_Config. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_compressor_config_pack( + uint8_t *dst_p, + const struct PH_compressor_config_t *src_p, + size_t size); + +/** + * Unpack message Compressor_Config. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_compressor_config_unpack( + struct PH_compressor_config_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint16_t PH_compressor_config_minimum_tank_pressure_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_compressor_config_minimum_tank_pressure_decode(uint16_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_compressor_config_minimum_tank_pressure_is_in_range(uint16_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint16_t PH_compressor_config_maximum_tank_pressure_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_compressor_config_maximum_tank_pressure_decode(uint16_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_compressor_config_maximum_tank_pressure_is_in_range(uint16_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_compressor_config_force_disable_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_compressor_config_force_disable_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_compressor_config_force_disable_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_compressor_config_use_digital_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_compressor_config_use_digital_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_compressor_config_use_digital_is_in_range(uint8_t value); + +/** + * Pack message Set_All. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_set_all_pack( + uint8_t *dst_p, + const struct PH_set_all_t *src_p, + size_t size); + +/** + * Unpack message Set_All. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_set_all_unpack( + struct PH_set_all_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_0_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_0_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_0_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_1_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_1_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_1_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_2_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_2_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_2_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_3_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_3_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_3_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_4_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_4_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_4_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_5_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_5_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_5_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_6_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_6_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_6_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_7_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_7_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_7_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_8_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_8_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_8_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_9_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_9_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_9_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_10_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_10_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_10_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_11_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_11_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_11_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_12_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_12_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_12_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_13_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_13_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_13_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_14_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_14_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_14_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_set_all_channel_15_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_set_all_channel_15_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_set_all_channel_15_is_in_range(uint8_t value); + +/** + * Pack message Pulse_Once. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_pulse_once_pack( + uint8_t *dst_p, + const struct PH_pulse_once_t *src_p, + size_t size); + +/** + * Unpack message Pulse_Once. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_pulse_once_unpack( + struct PH_pulse_once_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_0_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_0_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_0_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_1_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_1_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_1_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_2_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_2_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_2_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_3_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_3_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_3_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_4_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_4_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_4_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_5_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_5_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_5_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_6_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_6_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_6_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_7_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_7_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_7_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_8_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_8_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_8_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_9_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_9_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_9_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_10_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_10_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_10_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_11_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_11_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_11_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_12_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_12_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_12_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_13_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_13_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_13_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_14_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_14_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_14_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_pulse_once_channel_15_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_channel_15_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_channel_15_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint16_t PH_pulse_once_pulse_length_ms_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_pulse_once_pulse_length_ms_decode(uint16_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_pulse_once_pulse_length_ms_is_in_range(uint16_t value); + +/** + * Pack message Status_0. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_status_0_pack( + uint8_t *dst_p, + const struct PH_status_0_t *src_p, + size_t size); + +/** + * Unpack message Status_0. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_status_0_unpack( + struct PH_status_0_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_0_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_0_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_0_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_1_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_1_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_1_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_2_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_2_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_2_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_3_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_3_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_3_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_4_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_4_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_4_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_5_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_5_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_5_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_6_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_6_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_6_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_7_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_7_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_7_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_8_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_8_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_8_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_9_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_9_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_9_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_10_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_10_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_10_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_11_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_11_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_11_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_12_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_12_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_12_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_13_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_13_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_13_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_14_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_14_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_14_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_15_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_15_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_15_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_analog_0_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_analog_0_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_analog_0_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_analog_1_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_analog_1_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_analog_1_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_digital_sensor_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_digital_sensor_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_digital_sensor_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_brownout_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_brownout_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_brownout_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_compressor_oc_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_compressor_oc_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_compressor_oc_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_compressor_open_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_compressor_open_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_compressor_open_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_solenoid_oc_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_solenoid_oc_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_solenoid_oc_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_can_warning_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_can_warning_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_can_warning_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_hardware_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_hardware_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_hardware_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_0_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_0_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_0_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_1_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_1_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_1_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_2_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_2_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_2_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_3_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_3_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_3_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_4_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_4_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_4_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_5_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_5_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_5_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_6_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_6_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_6_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_7_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_7_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_7_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_8_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_8_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_8_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_9_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_9_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_9_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_10_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_10_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_10_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_11_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_11_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_11_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_12_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_12_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_12_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_13_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_13_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_13_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_14_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_14_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_14_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_channel_15_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_channel_15_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_channel_15_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_compressor_on_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_compressor_on_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_compressor_on_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_system_enabled_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_system_enabled_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_system_enabled_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_robo_rio_present_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_robo_rio_present_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_robo_rio_present_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_0_compressor_config_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_0_compressor_config_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_0_compressor_config_is_in_range(uint8_t value); + +/** + * Pack message Status_1. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_status_1_pack( + uint8_t *dst_p, + const struct PH_status_1_t *src_p, + size_t size); + +/** + * Unpack message Status_1. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_status_1_unpack( + struct PH_status_1_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_v_bus_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_v_bus_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_v_bus_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint16_t PH_status_1_solenoid_voltage_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_solenoid_voltage_decode(uint16_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_solenoid_voltage_is_in_range(uint16_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_compressor_current_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_compressor_current_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_compressor_current_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_solenoid_current_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_solenoid_current_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_solenoid_current_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_brownout_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_brownout_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_brownout_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_compressor_oc_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_compressor_oc_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_compressor_oc_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_compressor_open_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_compressor_open_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_compressor_open_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_solenoid_oc_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_solenoid_oc_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_solenoid_oc_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_can_warning_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_can_warning_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_can_warning_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_can_bus_off_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_can_bus_off_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_can_bus_off_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_hardware_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_hardware_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_hardware_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_firmware_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_firmware_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_firmware_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_sticky_has_reset_fault_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_sticky_has_reset_fault_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_sticky_has_reset_fault_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_status_1_supply_voltage_5_v_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_status_1_supply_voltage_5_v_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_status_1_supply_voltage_5_v_is_in_range(uint8_t value); + +/** + * Pack message Clear_Faults. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_clear_faults_pack( + uint8_t *dst_p, + const struct PH_clear_faults_t *src_p, + size_t size); + +/** + * Unpack message Clear_Faults. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_clear_faults_unpack( + struct PH_clear_faults_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Pack message Version. + * + * @param[out] dst_p Buffer to pack the message into. + * @param[in] src_p Data to pack. + * @param[in] size Size of dst_p. + * + * @return Size of packed data, or negative error code. + */ +int PH_version_pack( + uint8_t *dst_p, + const struct PH_version_t *src_p, + size_t size); + +/** + * Unpack message Version. + * + * @param[out] dst_p Object to unpack the message into. + * @param[in] src_p Message to unpack. + * @param[in] size Size of src_p. + * + * @return zero(0) or negative error code. + */ +int PH_version_unpack( + struct PH_version_t *dst_p, + const uint8_t *src_p, + size_t size); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_version_firmware_fix_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_firmware_fix_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_firmware_fix_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_version_firmware_minor_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_firmware_minor_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_firmware_minor_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_version_firmware_year_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_firmware_year_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_firmware_year_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_version_hardware_minor_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_hardware_minor_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_hardware_minor_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint8_t PH_version_hardware_major_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_hardware_major_decode(uint8_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_hardware_major_is_in_range(uint8_t value); + +/** + * Encode given signal by applying scaling and offset. + * + * @param[in] value Signal to encode. + * + * @return Encoded signal. + */ +uint32_t PH_version_unique_id_encode(double value); + +/** + * Decode given signal by applying scaling and offset. + * + * @param[in] value Signal to decode. + * + * @return Decoded signal. + */ +double PH_version_unique_id_decode(uint32_t value); + +/** + * Check that given signal is in allowed range. + * + * @param[in] value Signal to check. + * + * @return true if in range, false otherwise. + */ +bool PH_version_unique_id_is_in_range(uint32_t value); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/roborioteamnumbersetter/src/main/native/cpp/main.cpp b/roborioteamnumbersetter/src/main/native/cpp/main.cpp index 5f1261b00f..3d1a1965f2 100644 --- a/roborioteamnumbersetter/src/main/native/cpp/main.cpp +++ b/roborioteamnumbersetter/src/main/native/cpp/main.cpp @@ -1,25 +1,25 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include - -void Application(std::string_view saveDir); - -#ifdef _WIN32 -int __stdcall WinMain(void* hInstance, void* hPrevInstance, char* pCmdLine, - int nCmdShow) { - int argc = __argc; - char** argv = __argv; -#else -int main(int argc, char** argv) { -#endif - std::string_view saveDir; - if (argc == 2) { - saveDir = argv[1]; - } - - Application(saveDir); - - return 0; -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include + +void Application(std::string_view saveDir); + +#ifdef _WIN32 +int __stdcall WinMain(void* hInstance, void* hPrevInstance, char* pCmdLine, + int nCmdShow) { + int argc = __argc; + char** argv = __argv; +#else +int main(int argc, char** argv) { +#endif + std::string_view saveDir; + if (argc == 2) { + saveDir = argv[1]; + } + + Application(saveDir); + + return 0; +} diff --git a/romiVendordep/src/test/native/cpp/main.cpp b/romiVendordep/src/test/native/cpp/main.cpp index 2d710be58f..a2b90c5913 100644 --- a/romiVendordep/src/test/native/cpp/main.cpp +++ b/romiVendordep/src/test/native/cpp/main.cpp @@ -1,10 +1,10 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/sysid/SysIdRoutine.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/sysid/SysIdRoutine.cpp index 5f677fe2a9..c3a6ce0a7f 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/sysid/SysIdRoutine.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/sysid/SysIdRoutine.cpp @@ -1,64 +1,64 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "frc2/command/sysid/SysIdRoutine.h" - -using namespace frc2::sysid; - -frc2::CommandPtr SysIdRoutine::Quasistatic(Direction direction) { - std::unordered_map stateOptions{ - {Direction::kForward, frc::sysid::State::kQuasistaticForward}, - {Direction::kReverse, frc::sysid::State::kQuasistaticReverse}, - }; - frc::sysid::State state = stateOptions[direction]; - double outputSign = direction == Direction::kForward ? 1.0 : -1.0; - - return m_mechanism.m_subsystem - ->RunOnce([this] { - timer.Reset(); - timer.Start(); - }) - .AndThen( - m_mechanism.m_subsystem - ->Run([this, state, outputSign] { - m_outputVolts = outputSign * timer.Get() * m_config.m_rampRate; - m_mechanism.m_drive(m_outputVolts); - m_mechanism.m_log(this); - m_recordState(state); - }) - .FinallyDo([this] { - m_mechanism.m_drive(0_V); - m_recordState(frc::sysid::State::kNone); - timer.Stop(); - }) - .WithName("sysid-" + - frc::sysid::SysIdRoutineLog::StateEnumToString(state) + - "-" + m_mechanism.m_name) - .WithTimeout(m_config.m_timeout)); -} - -frc2::CommandPtr SysIdRoutine::Dynamic(Direction direction) { - std::unordered_map stateOptions{ - {Direction::kForward, frc::sysid::State::kDynamicForward}, - {Direction::kReverse, frc::sysid::State::kDynamicReverse}, - }; - frc::sysid::State state = stateOptions[direction]; - double outputSign = direction == Direction::kForward ? 1.0 : -1.0; - - return m_mechanism.m_subsystem - ->RunOnce([this] { m_outputVolts = m_config.m_stepVoltage; }) - .AndThen(m_mechanism.m_subsystem->Run([this, state, outputSign] { - m_mechanism.m_drive(m_outputVolts * outputSign); - m_mechanism.m_log(this); - m_recordState(state); - })) - .FinallyDo([this] { - m_mechanism.m_drive(0_V); - m_recordState(frc::sysid::State::kNone); - }) - .WithName("sysid-" + - frc::sysid::SysIdRoutineLog::StateEnumToString(state) + "-" + - m_mechanism.m_name) - .WithTimeout(m_config.m_timeout); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "frc2/command/sysid/SysIdRoutine.h" + +using namespace frc2::sysid; + +frc2::CommandPtr SysIdRoutine::Quasistatic(Direction direction) { + std::unordered_map stateOptions{ + {Direction::kForward, frc::sysid::State::kQuasistaticForward}, + {Direction::kReverse, frc::sysid::State::kQuasistaticReverse}, + }; + frc::sysid::State state = stateOptions[direction]; + double outputSign = direction == Direction::kForward ? 1.0 : -1.0; + + return m_mechanism.m_subsystem + ->RunOnce([this] { + timer.Reset(); + timer.Start(); + }) + .AndThen( + m_mechanism.m_subsystem + ->Run([this, state, outputSign] { + m_outputVolts = outputSign * timer.Get() * m_config.m_rampRate; + m_mechanism.m_drive(m_outputVolts); + m_mechanism.m_log(this); + m_recordState(state); + }) + .FinallyDo([this] { + m_mechanism.m_drive(0_V); + m_recordState(frc::sysid::State::kNone); + timer.Stop(); + }) + .WithName("sysid-" + + frc::sysid::SysIdRoutineLog::StateEnumToString(state) + + "-" + m_mechanism.m_name) + .WithTimeout(m_config.m_timeout)); +} + +frc2::CommandPtr SysIdRoutine::Dynamic(Direction direction) { + std::unordered_map stateOptions{ + {Direction::kForward, frc::sysid::State::kDynamicForward}, + {Direction::kReverse, frc::sysid::State::kDynamicReverse}, + }; + frc::sysid::State state = stateOptions[direction]; + double outputSign = direction == Direction::kForward ? 1.0 : -1.0; + + return m_mechanism.m_subsystem + ->RunOnce([this] { m_outputVolts = m_config.m_stepVoltage; }) + .AndThen(m_mechanism.m_subsystem->Run([this, state, outputSign] { + m_mechanism.m_drive(m_outputVolts * outputSign); + m_mechanism.m_log(this); + m_recordState(state); + })) + .FinallyDo([this] { + m_mechanism.m_drive(0_V); + m_recordState(frc::sysid::State::kNone); + }) + .WithName("sysid-" + + frc::sysid::SysIdRoutineLog::StateEnumToString(state) + "-" + + m_mechanism.m_name) + .WithTimeout(m_config.m_timeout); +} diff --git a/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp b/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp index 2576a4655c..c903e0f8cd 100644 --- a/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp +++ b/wpilibc/src/test/native/cpp/event/EventLoopTest.cpp @@ -1,24 +1,24 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include - -#include "frc/Errors.h" -#include "frc/event/EventLoop.h" - -using namespace frc; - -TEST(EventLoopTest, ConcurrentModification) { - EventLoop loop; - - loop.Bind([&loop] { ASSERT_THROW(loop.Bind([] {}), frc::RuntimeError); }); - - loop.Poll(); - - loop.Clear(); - - loop.Bind([&loop] { ASSERT_THROW(loop.Clear(), frc::RuntimeError); }); - - loop.Poll(); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include + +#include "frc/Errors.h" +#include "frc/event/EventLoop.h" + +using namespace frc; + +TEST(EventLoopTest, ConcurrentModification) { + EventLoop loop; + + loop.Bind([&loop] { ASSERT_THROW(loop.Bind([] {}), frc::RuntimeError); }); + + loop.Poll(); + + loop.Clear(); + + loop.Bind([&loop] { ASSERT_THROW(loop.Clear(), frc::RuntimeError); }); + + loop.Poll(); +} diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp index 5ecb68a4d4..32782b29ae 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/Robot.cpp @@ -1,55 +1,55 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "Robot.h" - -#include - -void Robot::RobotInit() {} - -void Robot::RobotPeriodic() { - frc2::CommandScheduler::GetInstance().Run(); -} - -void Robot::DisabledInit() {} - -void Robot::DisabledPeriodic() {} - -void Robot::DisabledExit() {} - -void Robot::AutonomousInit() { - m_autonomousCommand = m_container.GetAutonomousCommand(); - - if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); - } -} - -void Robot::AutonomousPeriodic() {} - -void Robot::AutonomousExit() {} - -void Robot::TeleopInit() { - if (m_autonomousCommand) { - m_autonomousCommand->Cancel(); - } -} - -void Robot::TeleopPeriodic() {} - -void Robot::TeleopExit() {} - -void Robot::TestInit() { - frc2::CommandScheduler::GetInstance().CancelAll(); -} - -void Robot::TestPeriodic() {} - -void Robot::TestExit() {} - -#ifndef RUNNING_FRC_TESTS -int main() { - return frc::StartRobot(); -} -#endif +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "Robot.h" + +#include + +void Robot::RobotInit() {} + +void Robot::RobotPeriodic() { + frc2::CommandScheduler::GetInstance().Run(); +} + +void Robot::DisabledInit() {} + +void Robot::DisabledPeriodic() {} + +void Robot::DisabledExit() {} + +void Robot::AutonomousInit() { + m_autonomousCommand = m_container.GetAutonomousCommand(); + + if (m_autonomousCommand) { + m_autonomousCommand->Schedule(); + } +} + +void Robot::AutonomousPeriodic() {} + +void Robot::AutonomousExit() {} + +void Robot::TeleopInit() { + if (m_autonomousCommand) { + m_autonomousCommand->Cancel(); + } +} + +void Robot::TeleopPeriodic() {} + +void Robot::TeleopExit() {} + +void Robot::TestInit() { + frc2::CommandScheduler::GetInstance().CancelAll(); +} + +void Robot::TestPeriodic() {} + +void Robot::TestExit() {} + +#ifndef RUNNING_FRC_TESTS +int main() { + return frc::StartRobot(); +} +#endif diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/SysIdRoutineBot.cpp b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/SysIdRoutineBot.cpp index 21f6992ded..45d480fe0b 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/SysIdRoutineBot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/SysIdRoutineBot.cpp @@ -1,30 +1,30 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "SysIdRoutineBot.h" - -#include - -SysIdRoutineBot::SysIdRoutineBot() { - ConfigureBindings(); -} - -void SysIdRoutineBot::ConfigureBindings() { - m_drive.SetDefaultCommand(m_drive.ArcadeDriveCommand( - [this] { return -m_driverController.GetLeftY(); }, - [this] { return -m_driverController.GetRightX(); })); - - m_driverController.A().WhileTrue( - m_drive.SysIdQuasistatic(frc2::sysid::Direction::kForward)); - m_driverController.B().WhileTrue( - m_drive.SysIdQuasistatic(frc2::sysid::Direction::kReverse)); - m_driverController.X().WhileTrue( - m_drive.SysIdDynamic(frc2::sysid::Direction::kForward)); - m_driverController.Y().WhileTrue( - m_drive.SysIdDynamic(frc2::sysid::Direction::kReverse)); -} - -frc2::CommandPtr SysIdRoutineBot::GetAutonomousCommand() { - return m_drive.Run([] {}); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "SysIdRoutineBot.h" + +#include + +SysIdRoutineBot::SysIdRoutineBot() { + ConfigureBindings(); +} + +void SysIdRoutineBot::ConfigureBindings() { + m_drive.SetDefaultCommand(m_drive.ArcadeDriveCommand( + [this] { return -m_driverController.GetLeftY(); }, + [this] { return -m_driverController.GetRightX(); })); + + m_driverController.A().WhileTrue( + m_drive.SysIdQuasistatic(frc2::sysid::Direction::kForward)); + m_driverController.B().WhileTrue( + m_drive.SysIdQuasistatic(frc2::sysid::Direction::kReverse)); + m_driverController.X().WhileTrue( + m_drive.SysIdDynamic(frc2::sysid::Direction::kForward)); + m_driverController.Y().WhileTrue( + m_drive.SysIdDynamic(frc2::sysid::Direction::kReverse)); +} + +frc2::CommandPtr SysIdRoutineBot::GetAutonomousCommand() { + return m_drive.Run([] {}); +} diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/subsystems/Drive.cpp b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/subsystems/Drive.cpp index c7549761be..331c17afc4 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/cpp/subsystems/Drive.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysId/cpp/subsystems/Drive.cpp @@ -1,37 +1,37 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "subsystems/Drive.h" - -#include - -Drive::Drive() { - m_leftMotor.AddFollower(frc::PWMSparkMax{constants::drive::kLeftMotor2Port}); - m_rightMotor.AddFollower( - frc::PWMSparkMax{constants::drive::kRightMotor2Port}); - - m_rightMotor.SetInverted(true); - - m_leftEncoder.SetDistancePerPulse( - constants::drive::kEncoderDistancePerPulse.value()); - m_rightEncoder.SetDistancePerPulse( - constants::drive::kEncoderDistancePerPulse.value()); - - m_drive.SetSafetyEnabled(false); -} - -frc2::CommandPtr Drive::ArcadeDriveCommand(std::function fwd, - std::function rot) { - return frc2::cmd::Run([this, fwd, rot] { m_drive.ArcadeDrive(fwd(), rot()); }, - {this}) - .WithName("Arcade Drive"); -} - -frc2::CommandPtr Drive::SysIdQuasistatic(frc2::sysid::Direction direction) { - return m_sysIdRoutine.Quasistatic(direction); -} - -frc2::CommandPtr Drive::SysIdDynamic(frc2::sysid::Direction direction) { - return m_sysIdRoutine.Dynamic(direction); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include "subsystems/Drive.h" + +#include + +Drive::Drive() { + m_leftMotor.AddFollower(frc::PWMSparkMax{constants::drive::kLeftMotor2Port}); + m_rightMotor.AddFollower( + frc::PWMSparkMax{constants::drive::kRightMotor2Port}); + + m_rightMotor.SetInverted(true); + + m_leftEncoder.SetDistancePerPulse( + constants::drive::kEncoderDistancePerPulse.value()); + m_rightEncoder.SetDistancePerPulse( + constants::drive::kEncoderDistancePerPulse.value()); + + m_drive.SetSafetyEnabled(false); +} + +frc2::CommandPtr Drive::ArcadeDriveCommand(std::function fwd, + std::function rot) { + return frc2::cmd::Run([this, fwd, rot] { m_drive.ArcadeDrive(fwd(), rot()); }, + {this}) + .WithName("Arcade Drive"); +} + +frc2::CommandPtr Drive::SysIdQuasistatic(frc2::sysid::Direction direction) { + return m_sysIdRoutine.Quasistatic(direction); +} + +frc2::CommandPtr Drive::SysIdDynamic(frc2::sysid::Direction direction) { + return m_sysIdRoutine.Dynamic(direction); +} diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/include/Robot.h b/wpilibcExamples/src/main/cpp/examples/SysId/include/Robot.h index b81adf12ec..b6142c2405 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/include/Robot.h +++ b/wpilibcExamples/src/main/cpp/examples/SysId/include/Robot.h @@ -1,35 +1,35 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include - -#include -#include - -#include "SysIdRoutineBot.h" - -class Robot : public frc::TimedRobot { - public: - void RobotInit() override; - void RobotPeriodic() override; - void DisabledInit() override; - void DisabledPeriodic() override; - void DisabledExit() override; - void AutonomousInit() override; - void AutonomousPeriodic() override; - void AutonomousExit() override; - void TeleopInit() override; - void TeleopPeriodic() override; - void TeleopExit() override; - void TestInit() override; - void TestPeriodic() override; - void TestExit() override; - - private: - std::optional m_autonomousCommand; - - SysIdRoutineBot m_container; -}; +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include + +#include +#include + +#include "SysIdRoutineBot.h" + +class Robot : public frc::TimedRobot { + public: + void RobotInit() override; + void RobotPeriodic() override; + void DisabledInit() override; + void DisabledPeriodic() override; + void DisabledExit() override; + void AutonomousInit() override; + void AutonomousPeriodic() override; + void AutonomousExit() override; + void TeleopInit() override; + void TeleopPeriodic() override; + void TeleopExit() override; + void TestInit() override; + void TestPeriodic() override; + void TestExit() override; + + private: + std::optional m_autonomousCommand; + + SysIdRoutineBot m_container; +}; diff --git a/wpilibcExamples/src/main/cpp/examples/SysId/include/SysIdRoutineBot.h b/wpilibcExamples/src/main/cpp/examples/SysId/include/SysIdRoutineBot.h index 6630abd3a6..51b4f8890a 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysId/include/SysIdRoutineBot.h +++ b/wpilibcExamples/src/main/cpp/examples/SysId/include/SysIdRoutineBot.h @@ -1,24 +1,24 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include -#include - -#include "Constants.h" -#include "subsystems/Drive.h" - -class SysIdRoutineBot { - public: - SysIdRoutineBot(); - - frc2::CommandPtr GetAutonomousCommand(); - - private: - void ConfigureBindings(); - frc2::CommandXboxController m_driverController{ - constants::oi::kDriverControllerPort}; - Drive m_drive{}; -}; +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#pragma once + +#include +#include + +#include "Constants.h" +#include "subsystems/Drive.h" + +class SysIdRoutineBot { + public: + SysIdRoutineBot(); + + frc2::CommandPtr GetAutonomousCommand(); + + private: + void ConfigureBindings(); + frc2::CommandXboxController m_driverController{ + constants::oi::kDriverControllerPort}; + Drive m_drive{}; +}; diff --git a/xrpVendordep/src/test/native/cpp/main.cpp b/xrpVendordep/src/test/native/cpp/main.cpp index 2d710be58f..a2b90c5913 100644 --- a/xrpVendordep/src/test/native/cpp/main.cpp +++ b/xrpVendordep/src/test/native/cpp/main.cpp @@ -1,10 +1,10 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include - -int main(int argc, char** argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +#include + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +}