/* Includes --------------------------------------------------------------------------------------------------- */ /** * @file TypeDefines.h * * @brief Global data type definition * * Copyright © 2020, maxon motor ag * All rights reserved. * */ /* Includes --------------------------------------------------------------------------------------------------- */ /*****************************************************************************/ /* STDINT.H */ /* */ /* Copyright (c) 2002 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* _STDINT40.H */ /* */ /* Copyright (c) 2018 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /* According to footnotes in the 1999 C standard, "C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before is included." */ /* 7.18.1.1 Exact-width integer types */ typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; /* 7.18.1.2 Minimum-width integer types */ typedef int16_t int_least8_t; typedef uint16_t uint_least8_t; typedef int16_t int_least16_t; typedef uint16_t uint_least16_t; typedef int32_t int_least32_t; typedef uint32_t uint_least32_t; typedef int64_t int_least64_t; typedef uint64_t uint_least64_t; /* 7.18.1.3 Fastest minimum-width integer types */ typedef int16_t int_fast8_t; typedef uint16_t uint_fast8_t; typedef int16_t int_fast16_t; typedef uint16_t uint_fast16_t; typedef int32_t int_fast32_t; typedef uint32_t uint_fast32_t; typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; /* 7.18.1.4 Integer types capable of holding object pointers */ typedef long intptr_t; typedef unsigned long uintptr_t; /* 7.18.1.5 Greatest-width integer types */ typedef long long intmax_t; typedef unsigned long long uintmax_t; /* According to footnotes in the 1999 C standard, "C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before is included." */ /* 7.18.2 Limits of specified width integer types */ /* 7.18.3 Limits of other integer types */ /* 7.18.4.1 Macros for minimum-width integer constants */ /* There is a defect report filed against the C99 standard concerning how the (U)INTN_C macros should be implemented. Please refer to -- http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm for more information. These macros are implemented according to the suggestion given at this web site. */ /* 7.18.4.2 Macros for greatest-width integer constants */ /*****************************************************************************/ /* stddef.h */ /* */ /* Copyright (c) 1993 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* _ti_config.h */ /* */ /* Copyright (c) 2017 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") #pragma CHECK_MISRA("-19.1") /* Common definitions */ /* C */ /* C89/C99 */ /* _TI_NOEXCEPT_CPP14 is defined to noexcept only when compiling for C++14. It is intended to be used for functions like abort and atexit that are supposed to be declared noexcept only in C++14 mode. */ /* Target-specific definitions */ /*****************************************************************************/ /* linkage.h */ /* */ /* Copyright (c) 1998 Texas Instruments Incorporated */ /* http://www.ti.com/ */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* Neither the name of Texas Instruments Incorporated nor the names */ /* of its contributors may be used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* */ /*****************************************************************************/ #pragma diag_push #pragma CHECK_MISRA("-19.4") /* macros required for implementation */ /* No modifiers needed to access code */ /*--------------------------------------------------------------------------*/ /* Define _DATA_ACCESS ==> how to access RTS global or static data */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* Define _OPTIMIZE_FOR_SPACE ==> Always optimize for space. */ /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ /* Define _IDECL ==> how inline functions are declared */ /*--------------------------------------------------------------------------*/ #pragma diag_pop #pragma diag_pop #pragma diag_push #pragma CHECK_MISRA("-19.7") /* macros required for implementation */ #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */ #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */ typedef long ptrdiff_t; typedef unsigned long size_t; typedef unsigned int wchar_t; /*----------------------------------------------------------------------------*/ /* C++11 and C11 required max_align_t to be defined. The libc++ cstddef */ /* header expects the macro __DEFINED_max_align_t to be defined if it is to */ /* use the definintion of max_align_t from stddef.h. Only define it if */ /* compiling for C11 or we're in non strict ansi mode. */ /*----------------------------------------------------------------------------*/ typedef long double max_align_t; #pragma diag_push #pragma CHECK_MISRA("-19.10") /* need types as macro arguments */ #pragma diag_pop #pragma diag_pop /* * Copyright (c) 2000 Jeroen Ruigrok van der Werven * All rights reserved. * * Copyright (c) 2014-2014 Texas Instruments Incorporated * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD: release/10.0.0/include/stdbool.h 228878 2011-12-25 20:15:41Z ed $ */ /* Exported defines & macros ---------------------------------------------------------------------------------- */ /* Exported types --------------------------------------------------------------------------------------------- */ typedef _Bool bool_t; typedef long fixed16_t; typedef fixed16_t triple_fixed16_t[3U]; typedef uint16_t triple_uint16_t[3U]; typedef struct { uint32_t a:8; uint32_t b:8; uint32_t c:8; } triple_8_bit_field_t; typedef union { uint32_t dword; triple_8_bit_field_t fields; } triplicated_8_bit_field_t; typedef struct { fixed16_t d; fixed16_t q; } vector_dq_t; typedef struct { fixed16_t alpha; fixed16_t beta; } vector_albe_t; typedef struct { fixed16_t a; fixed16_t b; fixed16_t c; } vector_abc_t; typedef struct { fixed16_t cosx; fixed16_t sinx; } vector_sincos_t; typedef struct { uint16_t phase_a; uint16_t phase_b; uint16_t phase_c; } vector_pwm_t; //lint -esym(9018,*can_message_frame_t*) suppress 'declaration of symbol X with union base type X' //Justification: we accept the usage of selected unions as portability is not required typedef union { uint32_t dword[2]; uint64_t qword; } can_message_frame_t; typedef enum { OBJECT_READ, OBJECT_WRITE } object_access_t; typedef struct { fixed16_t lower; fixed16_t upper; } object_limits_fixed16_t; /** * Fault bits. * Make sure to keep the order as specified in DIRS as the order in the bitfield will be used to generate the fault code! */ typedef struct { //lint --e{46} suppress 'field type should be _Bool, unsigned int or signed int' //Justification: we accept the usage of uint32_t bitfields as they are proven to work with the given compiler and portability is not required uint32_t driver:1; /**< Bit 0: DRIVER_FLT */ uint32_t exception_flt:1; /**< Bit 1: EXCEPTION_FLT */ uint32_t valve_sensor_unreal_pos_step_flt:1; /**< Bit 2: VAL_POS_SENS_UNREAL_POS_STEP_FLT */ uint32_t critical_internal_sw_flt:1; /**< Bit 3: CRITICAL_INTERNAL_SW_FLT */ uint32_t valve_sensor_out_of_range_flt:1; /**< Bit 4: VAL_POS_OOR_FLT */ uint32_t valve_sensor_data_invalid:1; /**< Bit 5: POS_SENS_DATA_INVALID_FLT */ uint32_t motor_unresponsive:1; /**< Bit 6: UNRESPON_MTR_FLT */ uint32_t can_bus_off_error:1; /**< Bit 7: CAN_BUS_OFF_FLT */ uint32_t can_passive_error:1; /**< Bit 8: CAN_PASSIVE_ERROR_FLT */ uint32_t motor_uncommanded:1; /**< Bit 9: UNCOMM_MTR_FLT */ uint32_t motor_misdirection:1; /**< Bit 10: MTR_MISDIR_FLT */ uint32_t motor_sensor_data_invalid:1; /**< Bit 11: MTR_POS_ILLEGAL_ENC_FB_FLT */ uint32_t motor_sensor_under_voltage:1; /**< Bit 12: MTR_POS_LOSS_ENC_EXC_VOLT_FLT */ uint32_t ram_flt:1; /**< Bit 13: RAM_FLT */ uint32_t motor_power_flt:1; /**< Bit 14: MTR_PWR_FLT */ uint32_t pos_sens_health_flt:1; /**< Bit 15: POS_SENS_HEALTH_FLT */ uint32_t over_current_flt:1; /**< Bit 16: OVER_CURRENT_FLT */ uint32_t vpower_over_voltage:1; /**< Bit 17: PS_28V_OVER_VOLT_FLT */ uint32_t vpower_under_voltage:1; /**< Bit 18: PS_28V_UNDER_VOLT_FLT */ uint32_t power_valid_flt:1; /**< Bit 19: PWR_FLT */ uint32_t vdd_power_supply:1; /**< Bit 20: PS_5V_FLT */ uint32_t overrun_flt:1; /**< Bit 21: OVERRUN_BIT_FLT */ uint32_t prgm_checksum_bit_flt:1; /**< Bit 22: PRGM_CHECKSUM_BIT_FLT */ uint32_t mtr_over_current_flt:1; /**< Bit 23: MTR_OVER_CURRENT_FLT */ uint32_t watchdog_flt:1; /**< Bit 24: WD_FAULT */ uint32_t critical:1; /**< Bit 25: AMC_CRITICAL_FAULT */ uint32_t non_critical:1; /**< Bit 26: AMC_NON_CRITICAL_FAULT */ uint32_t cpu:1; /**< Bit 27: CPU_FAULT */ uint32_t critical_or_cpu:1; /**< Bit 28: AMC_FAULT */ uint32_t watchdog_reset:1; /**< Bit 29: WD_RESET_FAULT */ uint32_t padding:2; /**< Bit 30 & 31: unused bits*/ //lint -esym(768, fault_bits_t::padding) suppress 'local struct member '____' not referenced, Justification: padding are only used for padding' } fault_bits_t; typedef enum { AMC1 = 1, AMC2 = 2 } valve_location_t; typedef enum { WATCHDOG_PWR_BOOT = 0x0U, /* default pattern, will not be written*/ WATCHDOG_PRE_TRIGGER = 0x8BADF00DU, /* pattern to detect premature triggering */ WATCHDOG_TEST_TRIP = 0xDEADBEEFU, /* pattern to detect correct self test trip */ WATCHDOG_EVENT_TRIP = 0xDABBAD00U /* pattern to detect real watchdog trip event */ } watchdog_trip_reason_t; typedef enum { WATCHDOG_NOT_FORCED = 0x0U, WATCHDOG_STACK_OVERFLOW = 0x8BADF00DU, WATCHDOG_ILLEGAL_INSTR = 0xDEADBEEFU, WATCHDOG_DIV_BY_ZERO = 0xDABBAD00U, WATCHDOG_DIV_NEG_OVERFLOW = 0xFACEFEEDU, WATCHDOG_DIV_POS_OVERFLOW = 0xFEEDC0DEU, WATCHDOG_CAN_INIT_FAULT = 0xDEADBABEU, WATCHDOG_PLL_FAULT = 0xDEAFBABAU, WATCHDOG_SEU = 0xD0D0CACAU, WATCHDOG_OVERRUN = 0xABAD1DEAU } watchdog_force_reason_t; /* Exported variables ----------------------------------------------------------------------------------------- */ /* Exported functions prototypes ------------------------------------------------------------------------------ */ /** * @file CyclicChecks.h * * @brief Cyclic checks module interface * * Copyright © 2020, maxon motor ag * All rights reserved. * */ /* Includes --------------------------------------------------------------------------------------------------- */ /* Exported defines & macros ---------------------------------------------------------------------------------- */ /* Exported types --------------------------------------------------------------------------------------------- */ /* Exported variables ----------------------------------------------------------------------------------------- */ /* Exported functions prototypes ------------------------------------------------------------------------------ */ void cyclic_checks_init_module(void); void cyclic_checks_motion_control(void); void cyclic_checks_commutation(void); void cyclic_checks_background(void); /* Internal variables ----------------------------------------------------------------------------------------- */ static const fixed16_t cyclic_checks_current_threshold = 262144L; /* The value represents 4[A²] which corresponds to the square of the threshold of 2[A] * 2^16, 2[A] is equivalent to 1638 counts */ static const fixed16_t cyclic_checks_current_peak_threshold = 1048576L; /* The value represents 16[A²] which corresponds to the square of the threshold of 4[A] * 2^16, 4[A] is equivalent to 1229 counts */ static const fixed16_t cyclic_checks_phase_current_lower_threshold = -536084L; /* -536084 = -8.18[A] * 2^16, -8.18[A] is equivalent to 3723 counts */ static const fixed16_t cyclic_checks_phase_current_upper_threshold = 536084L; /* 536084 = 8.18[A] * 2^16, 8.18[A] is equivalent to 373 counts */ static const uint16_t cyclic_checks_vdd_lower_threshold = 2792U; /* The value of 2792 is equal to 4.5V */ static const fixed16_t cyclic_checks_vdd_ext_lower_threshold = 294912L; /* 4.5V * 2^16 */ static const fixed16_t cyclic_checks_misdirection_dem_speed_lower_threshold = -2237000L; /* -2'237'000 [inc/Ts] => -500 [rpm]*/ static const fixed16_t cyclic_checks_misdirection_dem_speed_upper_threshold = 2237000L; /* +2'237'000 [inc/Ts] => +500 [rpm]*/ static const fixed16_t cyclic_checks_misdirection_act_speed_threshold = 0L; /* 0 [inc/Ts] => 0 [rpm] */ static const fixed16_t cyclic_checks_unresponsive_velocity = 13422000L; /* 13'422'000 [inc/Ts] => 3000 [rpm] */ static const fixed16_t cyclic_checks_unresponsive_threshold = 447400L; /* 447'400 [inc/Ts] => 100 [rpm] */ static const fixed16_t cyclic_checks_undervoltage_limit = 917504L; /* Undervoltage limit for driver current fault suppression 14V * 2^16 = 917504 */ static const uint16_t cyclic_checks_motor_current_threshold = 500U; static const uint16_t cyclic_checks_motor_peak_current_threshold = 10U; static const uint16_t cyclic_checks_motor_power_threshold = 200U; static const uint16_t cyclic_checks_can_passive_filter_threshold = 250U; static const uint16_t cyclic_checks_vdd_power_supply_filter_threshold = 500U; static const uint16_t cyclic_checks_valve_sensor_data_invalid_threshold = 50U; static const uint16_t cyclic_checks_valve_sensor_out_of_range_threshold = 100U; static const uint16_t cyclic_checks_power_valid_state_filter_threshold = 500U; static const uint16_t cyclic_checks_vdd_ext_filter_threshold = 250U; static const uint16_t cyclic_checks_motor_unresponsive_filter_threshold = 10U; static const uint16_t cyclic_checks_speed_misdirection_filter_threshold = 10U; static const uint16_t cyclic_checks_motor_sensor_healthy_filter_threshold = 250U; */ static bool_t cyclic_checks_drv_fault_reminder = 0; static volatile fault_handler_recoverable_faults_t cyclic_check_recoverable_faults_report[3U]; static volatile fault_handler_bgnd_faults_t cyclic_checks_background_faults_report[3U]; /* Initializes module */ void cyclic_checks_init_module(void) { /* Nothing to do here, but function required to meet design pattern. */ return }