From a99491f9b8371079e20d6eb7e19f664263031538 Mon Sep 17 00:00:00 2001 From: Dmitry Shpak Date: Wed, 1 Dec 2021 13:54:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=81=D0=BD=D0=BE=D0=B2=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=B4=D0=B0=D0=BD=D0=BD=D0=BE=D0=BC=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=D0=B5:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - проект переведён на VectorIDE v1.3 В целях экономии памяти удалены: - модуль управления светодиодами - модуль ШИМ для двигателей SRD - модуль часов реального времени - режим привода для измерения задержки меджу сигналами ШИМ и измерениями токов Добавлены следующие модули: - проект переведён на VectorIDE v1.3 - модуль SPI для абсолютного ДПР - модуль управление реле для заряда ЗПТ - модуль дискретных вводов-выводов - модуль управления вентилятором Одноплатного Инвертора - модуль тормозного резистора Одноплатного Инвертора Прочие изменения: - оптимизирована инициализация регистров периферии - удалено множество неиспользуемых переменных - разрешение работы всех GPIO перенесено в функцию "PeripheralClockEnable" - добавлен счётчик индексной метки энкодера - исправлен сброс прерываний модуля захвата CAP - переработан режим задания постоянного тока статора - исправлены прочие мелкие ошибки в разных модулях --- .settings/language.settings.xml | 4 +- Vinclude/DSP.h | 4 +- Vinclude/Global_time.h | 23 +- Vinclude/SM_CmdLogic.h | 19 +- Vinclude/SM_Sys.h | 10 +- Vinclude/V_AutoOffset.h | 2 - Vinclude/V_BrakeResistor.h | 35 + Vinclude/V_CANtoRS.h | 7 - Vinclude/V_DIO.h | 96 ++ Vinclude/V_DPR_eCAP.h | 40 +- Vinclude/V_Fan.h | 87 ++ Vinclude/V_MBVarsConv.h | 90 -- Vinclude/V_ModBus.h | 126 -- Vinclude/V_QEP.h | 14 +- Vinclude/V_RTC_Clock.h | 83 -- Vinclude/V_SSI_Encoder.h | 16 +- Vinclude/V_UdControl.h | 104 ++ Vinclude/V_adc.h | 35 +- Vinclude/V_common.h | 167 ++- Vinclude/V_event_log.h | 2 +- Vinclude/V_led.h | 68 - Vinclude/V_pid_reg3_pos.h | 108 -- Vinclude/V_relay_reg.h | 67 - Vinclude/build.h | 5 +- Vinclude/main.h | 16 +- Vsrc/CANOpenUDfuncs.c | 13 +- Vsrc/SM_CmdLogic.c | 9 +- Vsrc/SM_Ctrl.c | 116 +- Vsrc/SM_Net.c | 6 +- Vsrc/SM_Protect.c | 31 +- Vsrc/SM_Sys.c | 108 +- Vsrc/V_AutoOffset.c | 5 - Vsrc/V_BrakeResistor.c | 73 ++ Vsrc/V_CANtoRS.c | 31 +- Vsrc/V_DIO.c | 85 ++ Vsrc/V_DPR_eCAP.c | 151 ++- Vsrc/V_Fan.c | 92 ++ Vsrc/V_PWM_Module.c | 274 ++-- Vsrc/V_QEP.c | 4 +- Vsrc/V_RTC_Clock.c | 206 --- Vsrc/V_SSI_Encoder.c | 208 ++-- Vsrc/V_UdControl.c | 129 ++ Vsrc/V_adc.c | 12 +- Vsrc/V_i2cMem.c | 3 +- Vsrc/V_led.c | 78 -- Vsrc/V_pid_reg3_pos.c | 109 -- Vsrc/cood1.c | 2072 ++++++++++++++++--------------- Vsrc/main.c | 99 +- cood.xml | 233 +++- src/system_K1921VK035.c | 34 +- 50 files changed, 2657 insertions(+), 2752 deletions(-) create mode 100644 Vinclude/V_BrakeResistor.h create mode 100644 Vinclude/V_DIO.h create mode 100644 Vinclude/V_Fan.h delete mode 100644 Vinclude/V_MBVarsConv.h delete mode 100644 Vinclude/V_ModBus.h delete mode 100644 Vinclude/V_RTC_Clock.h create mode 100644 Vinclude/V_UdControl.h delete mode 100644 Vinclude/V_led.h delete mode 100644 Vinclude/V_pid_reg3_pos.h delete mode 100644 Vinclude/V_relay_reg.h create mode 100644 Vsrc/V_BrakeResistor.c create mode 100644 Vsrc/V_DIO.c create mode 100644 Vsrc/V_Fan.c delete mode 100644 Vsrc/V_RTC_Clock.c create mode 100644 Vsrc/V_UdControl.c delete mode 100644 Vsrc/V_led.c delete mode 100644 Vsrc/V_pid_reg3_pos.c diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 2c24ef7..813d8e5 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/Vinclude/DSP.h b/Vinclude/DSP.h index c3923e6..dd339f4 100644 --- a/Vinclude/DSP.h +++ b/Vinclude/DSP.h @@ -59,8 +59,8 @@ extern int __isr_vector_ram_end; #define IRQ_PRIORITY_TZ 1 #define IRQ_PRIORITY_ADC 2 -#define IRQ_PRIORITY_10K 3 -#define IRQ_PRIORITY_CAP 4 +#define IRQ_PRIORITY_CAP 3 +#define IRQ_PRIORITY_10K 4 #define IRQ_PRIORITY_CAN 5 #define IRQ_PRIORITY_1K 6 #define IRQ_PRIORITY_EQEP 6 diff --git a/Vinclude/Global_time.h b/Vinclude/Global_time.h index cc2a119..cd48720 100644 --- a/Vinclude/Global_time.h +++ b/Vinclude/Global_time.h @@ -114,7 +114,9 @@ extern "C" { RELATIVE_TIME relative_time1;//! 1 RELATIVE_TIME relative_time2;//! 2 +#ifdef USE_ABSOLUTE_TIME_CLOCK ABSOLUTE_TIME absolute_time;//! +#endif int16 time_type;//! (1 - ) int32 PowerOn_time; //!< int32 PowerOn_time_min; //!< @@ -146,18 +148,15 @@ extern "C" #define ABSOLUTE_TIME_DEFAULTS {0,0,0,0,0} //! TGlobalTime. -#define GLOBAL_TIME_DEFAULTS { RELATIVE_TIME_DEFAULTS,\ - RELATIVE_TIME_DEFAULTS,\ - ABSOLUTE_TIME_DEFAULTS,\ - 1,0,0,0,0,0,0,\ - GlobalTime_init,\ - GlobalTime_calc,\ - GlobalTime_ms_calc,\ - GlobalTime_slow_calc,\ - GlobalTime_read_PowerOn_time, \ - GlobalTime_write_PowerOn_time, \ - GlobalTime_read_oper_time, \ - GlobalTime_write_oper_time,\ +#define GLOBAL_TIME_DEFAULTS { .time_type = 1,\ + .init = GlobalTime_init,\ + .calc = GlobalTime_calc,\ + .ms_calc = GlobalTime_ms_calc,\ + .slow_calc = GlobalTime_slow_calc,\ + .read_PowerOn_time = GlobalTime_read_PowerOn_time, \ + .write_PowerOn_time = GlobalTime_write_PowerOn_time, \ + .read_oper_time = GlobalTime_read_oper_time, \ + .write_oper_time = GlobalTime_write_oper_time,\ } //! \memberof TGlobalTime diff --git a/Vinclude/SM_CmdLogic.h b/Vinclude/SM_CmdLogic.h index 394d9b7..6e9f13c 100644 --- a/Vinclude/SM_CmdLogic.h +++ b/Vinclude/SM_CmdLogic.h @@ -51,15 +51,11 @@ extern "C" //! . TSM_CmdLogic struct SSM_CmdLogic { - int state;//!DATA & (1 << 14)) == 0) // 1 + +#else + +#define D_IN1 0 + +#endif + +// +#ifdef HW_MOTORCONTROLBOARD +#define D_OUT1_ON GPIOA->DATAOUTSET = (1 << 15) +#define D_OUT1_OFF GPIOA->DATAOUTCLR = (1 << 15) +#else +#define D_OUT1_ON +#define D_OUT1_OFF +#endif + + + +// +extern volatile Uint8 output_vect; + +// +extern volatile Uint8 input_vect; + + +void DIO_Init(); + +void DIO_slow_calc(); // + +void DIO_fast_calc(); // 1 10 + + +#ifdef __cplusplus +} +#endif + +#endif + +/*@}*/ diff --git a/Vinclude/V_DPR_eCAP.h b/Vinclude/V_DPR_eCAP.h index c4d69c7..592025e 100644 --- a/Vinclude/V_DPR_eCAP.h +++ b/Vinclude/V_DPR_eCAP.h @@ -85,11 +85,9 @@ Uint16 rsvd: Uint32 PrevTspeed; // Uint32 PrevTspeed1; // . - Uint32 PrevTspeed11; Uint32 PrevTspeed2; // B. - Uint32 PrevTspeed22; Uint32 PrevTspeed3; // C. - Uint32 PrevTspeed33; + int16 CAPCalcEna1; int16 CAPCalcEna2; @@ -136,29 +134,19 @@ Uint16 rsvd: /****************************************************************************** ******************************************************************************/ -#define DPRECAP_DEFAULTS \ - {\ - 0,0,0,0,0,0,0,0,0, \ - 0,0,0,0,0, \ - 0,0,0,0,0,0, \ - 0,0,0,0,0,0,0,\ - 0,0,0,\ - 0,0,0,0,0,\ - 0,0,0,0,\ - 0,0,0,0,0,0,\ - 0,0,\ - &DPReCAP_Init, \ - &DPReCAP_AngleCalc, \ - &DPReCAP_Angle6Calc, \ - &DPReCAP_AngleErrorCalc, \ - &DPReCAP_SpeedCalc, \ - &DPReCAP_CAP1Calc, \ - &DPReCAP_CAP2Calc, \ - &DPReCAP_CAP3Calc, \ - &DPReCAP_HelpCalc, \ - &DPReCAP_SlowCalc, \ - &DPReCAP_msCalc, \ - &DPReCAP_calc_10k\ +#define DPRECAP_DEFAULTS {\ + .Init = DPReCAP_Init, \ + .AngleCalc = DPReCAP_AngleCalc, \ + .Angle6Calc = DPReCAP_Angle6Calc, \ + .AngleErrorCalc = DPReCAP_AngleErrorCalc, \ + .SpeedCalc = DPReCAP_SpeedCalc, \ + .CAP1Calc = DPReCAP_CAP1Calc, \ + .CAP2Calc = DPReCAP_CAP2Calc, \ + .CAP3Calc = DPReCAP_CAP3Calc, \ + .HelpCalc = DPReCAP_HelpCalc, \ + .slow_calc = DPReCAP_SlowCalc, \ + .ms_calc = DPReCAP_msCalc, \ + .calc_10k = DPReCAP_calc_10k\ } /****************************************************************************** diff --git a/Vinclude/V_Fan.h b/Vinclude/V_Fan.h new file mode 100644 index 0000000..589d9c3 --- /dev/null +++ b/Vinclude/V_Fan.h @@ -0,0 +1,87 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_Fan.h + \brief + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + + +#ifndef V_FAN_H +#define V_FAN_H + + +//! +#define FAN_CONTROL_STATE_OFF 0 +//! +#define FAN_CONTROL_STATE_ON 1 +//! +#define FAN_CONTROL_STATE_OVERHEAT 2 + +/* */ +#if defined (HW_MOTORCONTROLBOARD) +#define FAN_ON GPIOB->MASKLB[16].MASKLB = 16 //NT_GPIOA->DATA |= (1 << 13) +#define FAN_OFF GPIOB->MASKLB[16].MASKLB = 0 //NT_GPIOA->DATA &= ~(1 << 13) +#endif + +#if !defined (HW_MOTORCONTROLBOARD) +/* */ +#define FAN_ON +#define FAN_OFF +#endif + + +struct SFanControl{ + Uint16 Enabled; + Uint16 manualOn; // + + int state; //!< + int state_shadow;//!< + int state_prev;//!< + int StateOn;//!< : / + + long T_on;//!< + long T_off;//!< + long T_alarm;//! + long temperature; //! , + + void (*init)(volatile struct SFanControl*); + void (*slow_calc)(volatile struct SFanControl*); +}; + +typedef volatile struct SFanControl TFanControl; + + + +//! \memberof TFanControl +void FanControl_init(TFanControl*); +//! \memberof TFanControl +void FanControl_slow_calc(TFanControl*); // + + +#define FAN_CONTROL_DEFAULTS {0,0,\ + FAN_CONTROL_STATE_OFF,FAN_CONTROL_STATE_OFF,FAN_CONTROL_STATE_OFF,0,\ + _IQ(2.5),_IQ(2), _IQ(4), _IQ(0),\ + FanControl_init,\ + FanControl_slow_calc} + + + +#endif + +/*@}*/ diff --git a/Vinclude/V_MBVarsConv.h b/Vinclude/V_MBVarsConv.h deleted file mode 100644 index 167245b..0000000 --- a/Vinclude/V_MBVarsConv.h +++ /dev/null @@ -1,90 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file v_MBVarsConv.h - \brief Modbus - \author " " - \version v.1.1. 02/03/2017 - - \addtogroup v_ModBus - - @{ -*/ - - - -#ifndef V_MBVARSCONV_H -#define V_MBVARSCONV_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "DSP.h" - -/*! \class TMBVarsConv - \brief Modbus - - \a TMBVarsConv, SMBVarsConv, - 16 Modbus (IQ 24). -*/ - - -struct SMBVars{ - int Command; - int CommandPrev; - int speed_ref; - int CurIs; - int CurSpeed; - int Main_ErrorCode; - int Umax_protect; - }; -//!. TMBVarsConv MBVars -#define SMBVARS_DEFAULTS {0,0,0,0,0,0} - - -struct SMBVarsConv{ - struct SMBVars Vars; - Uint16 NeedForSave; - void (*init)(volatile struct SMBVarsConv*); - void (*calc)(volatile struct SMBVarsConv*); - void (*slow_calc)(volatile struct SMBVarsConv*); - }; - -typedef volatile struct SMBVarsConv TMBVarsConv; - -//! -#define MBVARSCONV_DEFAULTS { SMBVARS_DEFAULTS,\ - 0,\ - MBVarsConv_init,\ - MBVarsConv_calc,\ - MBVarsConv_slow_calc\ - } - -//! \memberof TMBVarsConv -void MBVarsConv_init(TMBVarsConv *p); -//! \memberof TMBVarsConv -void MBVarsConv_calc(TMBVarsConv *p); -//! \memberof TMBVarsConv -void MBVarsConv_slow_calc(TMBVarsConv *p); - - -#ifdef __cplusplus -} -#endif - -#endif - -/*@}*/ diff --git a/Vinclude/V_ModBus.h b/Vinclude/V_ModBus.h deleted file mode 100644 index 69edddd..0000000 --- a/Vinclude/V_ModBus.h +++ /dev/null @@ -1,126 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file V_ModBus.h - \brief ModBus (. TModBus) - \author Alecksey Anuchin - \version v 1.1 24/03/2017 - \defgroup V_ModBus ModBus (. TModBus) - @{ -*/ - -#ifndef V_MODBUS_H -#define V_MODBUS_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "mbod.h" - - -#define MODBUS_MAX_RX_COUNT 10 - -/*! \class TModBus - \brief ModBus - - \a TModBus, SModBus, - RS-485 ModBus (RTU). */ - -//! . TModBus - - - //! modbus - typedef struct {volatile Uint16 In[MODBUS_MAX_RX_COUNT];//!< - volatile Uint16 InCount;//!< - volatile MB_Record /*const*/ *Addr;//!< - volatile Uint16 TimeOut;//!< , - volatile Uint16 TimeOut1_5;//!< 1,5 - volatile Uint16 TimeOut2_5;//!< 2,5 - volatile Uint16 ToSend;//!< - volatile Uint16 NumOfHRs;//!< Holding Registers - volatile Uint16 MiddleOfHRs;//!< Holding Registers - volatile Uint16 InitialStepOfHRs;//!< Holding Registers - volatile Uint16 NumOfIRs;//!< Input Registers - volatile Uint16 MiddleOfIRs;//!< Input Registers - volatile Uint16 InitialStepOfIRs;//!< Input Registers - volatile Uint16 NumOfCs;//!< Coils - volatile Uint16 MiddleOfCs;//!< Coils - volatile Uint16 InitialStepOfCs;//!< Coils - volatile Uint16 NumOfDIs;//!< Discrete Inputs - volatile Uint16 MiddleOfDIs;//!< Discrete Inputs - volatile Uint16 InitialStepOfDIs;//!< Discrete Inputs - volatile Uint16 RxCRC;//!< - volatile Uint16 TxCRC;//!< - volatile Uint16 MagicNumber;//!<... - volatile int16 TxState;//!< - volatile Uint16 temp;//!< - volatile int16 RecievedCounter;//!< - UART_TypeDef *UART;//! UART - } MODBUS_INT; - - #define MODBUS_INT_DEFAULTS {{0},0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\ - 0xFFFF,0xFFFF, 0xA001,-1, 0,0, \ - } - -struct SModBus{Uint32 BaudRate;//!< RS - Uint16 ExecutionFreq;//!< - Uint16 RSNodeID; //!< - Uint16 Enabled; //!< ModBus - Uint16 Refresh; //!< Modbus - int16 error; - int16 errorCode; - int16 AutoRestart; - int16 clear_error; - Uint16 received_data; - Uint16 GPIOsValue; - Uint16 isOnline;//!< ( ) - Uint32 OfflineCounter;//!< ModBus_Execute , - Uint32 OfflineCounterMax;//!< ( OfflineCounter) - Uint16 ReceiveByteCounter;//!< - Uint16 ReceivePacketCounter;//!< - MODBUS_INT MBInternals;//!< ( ) - void (*Init)(volatile struct SModBus*); - void (*Execute)(volatile struct SModBus*); - }; - - -typedef volatile struct SModBus TModBus; - - -#define MODBUS_DEFAULTS {9600,10000, 0x01, 1, 0,\ - 0,0,0,0,0,0,0,0,0,0,0,\ - MODBUS_INT_DEFAULTS,\ - ModBus_Init, \ - ModBus_Execute,\ - } - - -//! \memberof TModBus -void ModBus_Init(TModBus *p); -//! \memberof TModBus -void ModBus_Execute(TModBus *p); -//! \memberof TModBus -int16 ModBus_FindVocAddr(TModBus *p,volatile MB_Record Table[], Uint16 TableSize, int16 Type, Uint16 Index, int16 NumOfIndexs, int16 Mid, int16 Step); - - - -#ifdef __cplusplus -} -#endif - -#endif - -/*@}*/ diff --git a/Vinclude/V_QEP.h b/Vinclude/V_QEP.h index 943cedb..943f01c 100644 --- a/Vinclude/V_QEP.h +++ b/Vinclude/V_QEP.h @@ -184,7 +184,7 @@ Uint16 rsvd: union SPOSSPEED_FLG1 Posspeed_FLG1; union SPOSSPEED_FLG2 Posspeed_FLG2; Uint16 GPIOsValue;//!< GPIO QEP - Uint16 Index_eventFlag; + Uint16 Index_eventCounter; Uint16 UPPS_forWatch;//!< UPPS _iq AngleOffset;//!< int16 RevolutionCounter; // ; @@ -211,13 +211,11 @@ Uint16 rsvd: typedef volatile struct SposspeedEqep TposspeedEqep; //! -. - #define POSSPEED_DEFAULTS {0,0,0,0,0, 0,0,0,0,0,0,0, 0,0,0,0, 0,{0},{0},0,0,FILTER_DEFAULTS,0,\ - 0,0x0790,0,0,0,0,0,0,0,0,0,0,0,\ - 0,0,0,0,0,\ - TposspeedEqep_init,\ - TposspeedEqep_Calc,\ - TposspeedEqep_SlowCalc,\ - TposspeedEqep_IndexEvent,\ + #define POSSPEED_DEFAULTS {.speed_filter = FILTER_DEFAULTS,\ + .init = TposspeedEqep_init,\ + .calc = TposspeedEqep_Calc,\ + .slow_calc = TposspeedEqep_SlowCalc,\ + .index = TposspeedEqep_IndexEvent,\ } //! \memberof TposspeedEqep diff --git a/Vinclude/V_RTC_Clock.h b/Vinclude/V_RTC_Clock.h deleted file mode 100644 index 29a1d9a..0000000 --- a/Vinclude/V_RTC_Clock.h +++ /dev/null @@ -1,83 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file V_RTC_Clock.h - \brief - \author " ". . http://motorcontrol.ru - \version v 2.0 25/03/2016 - - \defgroup V_rmp_ctrl (. TRMPCtrl) - - @{ -*/ -#ifndef V_RTC_CLOCK_H_ -#define V_RTC_CLOCK_H_ - -#define RTC_SLAVE_ADDRESS 0x68 // RTC DS1340 1101 000b = 0x68 ( - // 1101 0000b = 0xD0) -#define RTC_WRITE_ERROR 1 -#define RTC_READ_ERROR 2 -#define RTC_TIMEOUT_ERROR 3 - -#define RTC_TIMEOUT 1000 // -#define RTC_SECOND_WAITING_TIMEOUT 10000 // , ( ). , . - -struct SRTCClock{ - Uint16 ms; // - Uint16 msInDay; // - Uint16 error; // - Uint16 tryCounter; // - - Uint16 second; - Uint16 minute; - Uint16 hour; - - Uint16 DOW; // DayOfWeek - ( , , ?) - Uint16 day; // Date - - Uint16 month; - Uint16 year; - - Uint32 packed_time; // , - Uint32 timeToSet; // , , - - Uint16 setTimeFlag; - Uint16 readTimeFlag; - - Uint16 secondPrev; - Uint16 stoppedCounter; - Uint16 ClockOk; - void (*init)(volatile struct SRTCClock*); // - void (*read)(volatile struct SRTCClock*); // - void (*set)(volatile struct SRTCClock*); // - void (*msCalc)(volatile struct SRTCClock*); - void (*slowCalc)(volatile struct SRTCClock*); -}; - -typedef volatile struct SRTCClock TRTCClock; - -#define RTC_CLOCK_DEFAULTS {0,0,0,0, 0,0,0, 0,0,0,0, 0,0, 0,0, 0,0,0,\ - RTC_Clock_Init,\ - RTC_Clock_Read_Time,\ - RTC_Clock_Set_Time,\ - RTC_Clock_Ms_Calc,\ - RTC_Clock_Slow_Calc} - -void RTC_Clock_Init (TRTCClock *); -void RTC_Clock_Read_Time (TRTCClock *); -void RTC_Clock_Set_Time (TRTCClock *); -void RTC_Clock_Ms_Calc (TRTCClock *); -void RTC_Clock_Slow_Calc (TRTCClock *); - -#endif /* V_I2CCLOCK_H_ */ diff --git a/Vinclude/V_SSI_Encoder.h b/Vinclude/V_SSI_Encoder.h index 0759f8e..8136429 100644 --- a/Vinclude/V_SSI_Encoder.h +++ b/Vinclude/V_SSI_Encoder.h @@ -29,6 +29,13 @@ #ifndef V_SSI_ENCODER_H #define V_SSI_ENCODER_H +// +#define SSI_ENC_RESOLUTION 12 + +// - , 1 , , +// +#define SSI_ENC_DATA_MASK ((1 << SSI_ENC_RESOLUTION) - 1) + #ifdef __cplusplus extern "C" { #endif @@ -83,10 +90,9 @@ extern "C" { typedef volatile struct S_SSI_Encoder TSSI_Encoder; //! -. - #define SSI_ENCODER_DEFAULTS {0,0,0,0, 0,0,0,0, 0,0,0,0,0,0, 0,0, 0,0,0,0,0,\ - SSI_Encoder_init,\ - SSI_Encoder_Calc,\ - SSI_Encoder_Read,\ + #define SSI_ENCODER_DEFAULTS {.init = SSI_Encoder_init,\ + .calc = SSI_Encoder_Calc,\ + .read = SSI_Encoder_Read,\ } //! \memberof TSSI_Encoder @@ -96,7 +102,7 @@ extern "C" { //! \memberof TSSI_Encoder void SSI_Encoder_Read(TSSI_Encoder*); - #ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/Vinclude/V_UdControl.h b/Vinclude/V_UdControl.h new file mode 100644 index 0000000..647bc3c --- /dev/null +++ b/Vinclude/V_UdControl.h @@ -0,0 +1,104 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_UdControl.h + \brief + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + + +#ifndef V_UD_CONTROL_H +#define V_UD_CONTROL_H + + +#include "build.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +//! +#define UD_CONTROL_STATE_OFF 0 +//! +#define UD_CONTROL_STATE_WAIT 1 +//! +#define UD_CONTROL_STATE_ON 2 + + + + + +/*! \class TUdControl + \brief + + \a TUdControl, SUdControl, + , + . : + , + ( ). +*/ + +//!. TUdControl +struct SUdControl{ + Uint16 Enabled; + int fault_start; //!< + int state; //!< + int state_prev;//!< + int E;//!< + int StateCounter;//!< + long fUdc_output_prev;//!< + long U_on;//!< + long U_off;//!< + long Timeout_on;//!< . + long deriv_time_ZPT; //!< + long deriv_const; //!< + int StateOn;//!< : / + TFilter fUdc;//!< + + void (*init)(volatile struct SUdControl*); + void (*calc)(volatile struct SUdControl*); +}; + +typedef volatile struct SUdControl TUdControl; + + + +//! \memberof TUdControl +void UdControl_init(TUdControl*); +//! \memberof TUdControl +void UdControl_calc(TUdControl*); + + +#define UD_CONTROL_DEFAULTS {0,0,UD_CONTROL_STATE_OFF,UD_CONTROL_STATE_OFF,\ + 0,0,0,\ + _IQ(0.8),_IQ(0.5),3000,0,\ + 0,0, FILTER_DEFAULTS,\ + UdControl_init,\ + UdControl_calc} + + +#ifdef __cplusplus +} +#endif + +#endif + + +/*@}*/ + diff --git a/Vinclude/V_adc.h b/Vinclude/V_adc.h index 1cefc1d..70225b7 100644 --- a/Vinclude/V_adc.h +++ b/Vinclude/V_adc.h @@ -53,30 +53,13 @@ extern "C" int32 IaGainNom; //!< . . int32 IA_temp; //!< - int16 IASampleLength; // (- ) - int16 IAPointer; // - int16 IABuf[4]; // - - int16 Imeas_b_gain; int16 Imeas_b_offset; int32 Imeas_b; int32 IbGainNom; int32 IB_temp; - int16 IBSampleLength; // (- ) - int16 IBPointer; // - int16 IBBuf[4]; // - - int16 Imeas_c_gain; - int16 Imeas_c_offset; int32 Imeas_c; - int32 IcGainNom; - int16 IC_temp; - - int16 ICSampleLength; // (- ) - int16 ICPointer; // - int16 ICBuf[4]; // int16 Udc_meas_gain; int16 Udc_meas_offset; @@ -84,14 +67,10 @@ extern "C" int32 UdcGainNom; int16 Udc_temp; - int16 UdcSampleLength; // (- ) - int16 UdcPointer; // - int16 UdcBuf[4]; // - - int16 T_meas_gain; //!< . - int32 T_meas; //!< . - int32 TGainNom; //!< . . - int16 T_temp; //!< + int16 AI_meas_gain; //!< + int32 AI_meas; //!< . + int32 AIGainNom; //!< . . + int16 AI_temp; //!< void (*init)(struct SAdcDrv *); void (*fast_calc)(struct SAdcDrv*); @@ -105,13 +84,9 @@ extern "C" //! . #define ADC_DRV_DEFAULTS {\ 54,0,0,0,0, \ - 4,0,{0}, \ 54,0,0,0,0, \ - 4,0,{0}, \ - 54,0,0,0,0, \ - 4,0,{0}, \ + 0,\ 800,0,0,0,0, \ - 4,0,{0}, \ 100,0,0,0, \ AdcDrv_init,\ AdcDrv_fast_calc,\ diff --git a/Vinclude/V_common.h b/Vinclude/V_common.h index 48cd9ba..6aecc23 100644 --- a/Vinclude/V_common.h +++ b/Vinclude/V_common.h @@ -1,25 +1,25 @@ /*! - Copyright 2017 "" " " +Copyright 2017 "" " " - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. - \file v_common.h - \brief , , - - \author " ". . http://motorcontrol.ru - \version v 2.0 25/03/2016 +\file v_common.h +\brief , , + +\author " ". . http://motorcontrol.ru +\version v 2.0 25/03/2016 - \defgroup v_common +\defgroup v_common @{*/ @@ -33,90 +33,85 @@ extern "C" //! - typedef struct - { - unsigned int ready: - 1; - unsigned int running: - 1; - unsigned int fault: - 1; - unsigned int alarm: - 1; - unsigned int testing: - 1; - unsigned int overheat: - 1; - } DRV_STATUS_BIT; +typedef struct +{ + unsigned int ready :1; + unsigned int running :1; + unsigned int fault :1; + unsigned int alarm :1; + unsigned int testing :1; + unsigned int overheat :1; +} DRV_STATUS_BIT; //! ( DRV_STATUS_BIT) - typedef union - { - int all; - DRV_STATUS_BIT bit; - }TDrvStatus; +typedef union +{ + int all; + DRV_STATUS_BIT bit; +}TDrvStatus; //! - typedef struct - { -unsigned int start: - 1; -unsigned int stop: - 1; -unsigned int trip_reset: - 1; -unsigned int reserved: - 5; - } CMD_BIT; +typedef struct +{ + unsigned int start :1; + unsigned int stop :1; + unsigned int trip_reset :1; + unsigned int reserved :5; +} CMD_BIT; //! ( DRV_STATUS_BIT) - typedef union - { - unsigned int all; - CMD_BIT bit; - }TCmd; +typedef union +{ + unsigned int all; + CMD_BIT bit; +}TCmd; + - //! , - typedef volatile struct - { - long speed_ref;//!< - long Iq_ref;//!< - long i_flux_ref;//!< ( ) - long theta_elec;//!< / +typedef volatile struct +{ + long speed_ref;//!< + long Iq_ref;//!< + long i_flux_ref;//!< ( ) + long theta_elec;//!< / long ua_ref, uf_ref; // long DCMspeed_ref;//!< - } TRefs; +} TRefs; //! , , - typedef struct - { - long Rs;//!< - long Ls;//!< - int p;//!< - int I_nom;//!< () 16.0 - long _1_I_nom;//!< 1/I_nom - int U_nom;//!< () 16.0 - long _1_U_nom;//!< 1/U_nom - int Udc_nom;//!< () 16.0 - long _1_Udc_nom;//!< 1/Udc_nom - int speed_nom;//!< () 16.0 - int freq_nom;//!< () 16.0 - int power;//!< () 16.0 - int sens_type;//!< - } TDrvParams; +typedef struct +{ + long Rs;//!< + long Ls;//!< + int p;//!< + int I_nom;//!< () 16.0 + long _1_I_nom;//!< 1/I_nom + int U_nom;//!< () 16.0 + long _1_U_nom;//!< 1/U_nom + int Udc_nom;//!< () 16.0 + long _1_Udc_nom;//!< 1/Udc_nom + int speed_nom;//!< () 16.0 + int freq_nom;//!< () 16.0 + int power;//!< () 16.0 + int sens_type;//!< +} TDrvParams; - -//! "", , .. -typedef struct { - Uint16 recuperation_ena;//!< - Uint16 rotation_dir;//!< - Uint16 Reboot;//!< - Uint16 AutoOffset;//!< - Uint16 HardwareType;//!< , - Uint16 excitation_ena;//!< - } TSysSwitches; + +struct SsysSwitches { + Uint16 recuperation_ena :1; //!< 0 + Uint16 Reboot :1; //!< 1 + Uint16 AutoOffset :1; //!< 2 + Uint16 use_led :1; //!< 3 JTAG + Uint16 use_led_prev :1; //!< 4 JTAG + Uint16 :11; +}; + + +typedef union { + struct SsysSwitches bit; + Uint16 all; +} TSysSwitches; #ifdef __cplusplus } diff --git a/Vinclude/V_event_log.h b/Vinclude/V_event_log.h index 9ae3bc3..46a8af6 100644 --- a/Vinclude/V_event_log.h +++ b/Vinclude/V_event_log.h @@ -104,7 +104,7 @@ typedef volatile struct SLogger TLogger; //.. ( 30.1), #define LOGGER_DEFAULTS {0,0,0,1,0,\ - (Uint32*)&RTCclock.packed_time,\ + (Uint32*)&global_time.PowerOn_time,\ {0,0,0,0},0,0,0,0,0,\ EVENT_FIFO_DEFAULTS,\ Logger_Init,\ diff --git a/Vinclude/V_led.h b/Vinclude/V_led.h deleted file mode 100644 index d3ca601..0000000 --- a/Vinclude/V_led.h +++ /dev/null @@ -1,68 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file Vled.h - \brief - \author " ". http://motorcontrol.ru - \version v 2.0 25/03/2016 - - */ - -#ifndef VINCLUDE_V_LED_H_ -#define VINCLUDE_V_LED_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif -#include "DSP.h" - -#define LED1 0 -#define LED2 1 -#define LED3 2 -#define LED4 3 -#define LED5 4 -#define LED6 5 - -#define LED_ALL 6 - -struct Sled; -typedef volatile struct Sled Tled; - -struct Sled{ - Uint16 timer1, timer2, timer3, timer4, timer5, timer6; - Uint16 mode, prevMode; - Uint16 mode3counter; - void (*init)(Tled*); - void (*toggle)(Tled*, Uint16); - void (*on)(Tled*, Uint16); - void (*off)(Tled*, Uint16); - void (*msCalc)(Tled*); -}; - - - -#define LED_DEFAULTS {0,0,0,0,0,0,0,0,0, LED_init, LED_toggle, LED_on, LED_off, LED_msCalc} -void LED_init (Tled*); -void LED_toggle (Tled*, Uint16); -void LED_on (Tled*, Uint16); -void LED_off (Tled*, Uint16); -void LED_msCalc (Tled*); - -#ifdef __cplusplus -} -#endif - -#endif /* VINCLUDE_V_LED_H_ */ diff --git a/Vinclude/V_pid_reg3_pos.h b/Vinclude/V_pid_reg3_pos.h deleted file mode 100644 index e37969e..0000000 --- a/Vinclude/V_pid_reg3_pos.h +++ /dev/null @@ -1,108 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file V_pid_reg3.h - \brief - (. TPidReg3) - \author " ". http://motorcontrol.ru - \version v 2.0 25/03/2016 - -\defgroup V_pid_reg3 - - -@{*/ - - - -#ifndef PID_REG3_POS_H -#define PID_REG3_POS_H - -#ifdef __cplusplus -extern "C" { -#endif - - /*! \class TPidReg3 - \brief - - - \a TPidReg3, SPidReg3, - - - . - , . - - */ - -//! . TPidReg3 -typedef struct SPidReg3_pos{ long pid_ref_reg3; //!< Input: Reference input - long pid_fdb_reg3;//!< Input: Feedback input - long e_reg3;//!ALTFUNCSET = (1 << 14) + (1 << 15); //CAN_TX[0], CAN_RX[0] - GPIOB->DENSET = (1 << 14) + (1 << 15); } #endif //CAN_1_ENABLE @@ -268,12 +267,12 @@ void co_RPDO8_Callback(Uint16 nodeID, Uint16 tag_CANnum) //! [5139h.01h] . . , // callback_RTC - . -void callback_RTC(Uint16 par, Uint16 tag_CANnum) { - if (par == 1) { - RTCclock.setTimeFlag = 1; // - - } -} +//void callback_RTC(Uint16 par, Uint16 tag_CANnum) { +// if (par == 1) { +// RTCclock.setTimeFlag = 1; // +// +// } +//} //! dlog.next_value_var . diff --git a/Vsrc/SM_CmdLogic.c b/Vsrc/SM_CmdLogic.c index 2182aef..d57023d 100644 --- a/Vsrc/SM_CmdLogic.c +++ b/Vsrc/SM_CmdLogic.c @@ -70,7 +70,14 @@ void SM_CmdLogicms_Calc(TSM_CmdLogic *p) { if (sm_prot.state == PROT_ON_OK) {// , if ((cmd.bit.start == 1) && (sm_sys.state == SYS_READY))// - p->state = CMD_LOGIC_TURNED_ON; // + if (udControl.Enabled == 0) { // , + p->state = CMD_LOGIC_TURNED_ON; // + } else { + if (udControl.StateOn == 1) // , , + p->state = CMD_LOGIC_TURNED_ON; // + else + udControl.fault_start = 1; // , + } } // diff --git a/Vsrc/SM_Ctrl.c b/Vsrc/SM_Ctrl.c index 28f0040..eb2de5c 100644 --- a/Vsrc/SM_Ctrl.c +++ b/Vsrc/SM_Ctrl.c @@ -144,7 +144,7 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { p->state = CTRL_RUN_U2F; } if (p->run_mode == CTRL_FLUXING) {// ( ) - p->state = CTRL_FLUXING; + p->state = CTRL_RUN_I2F; } if (p->run_mode == CTRL_RUN_I2F) {//- ( ) p->state = CTRL_RUN_I2F; @@ -162,68 +162,13 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { p->state = CTRL_AUTO_SENSOR_TUNING; } - if (p->run_mode == CTRL_RUN_LATENCY_TEST) { // - p->state = CTRL_RUN_LATENCY_TEST; - } + /*DO END*/ break; } - case CTRL_FLUXING: { // - if (p->E == 1) { - /*ENTRY START*/ - pwm.On(&pwm); - pid_id.ui_reg3 = 0; // - pid_iq.ui_reg3 = 0; // - pid_spd.ui_reg3 = 0; - refs.theta_elec = 0;// - 0. , ! - if (dlog.StartBits & (1 << 1)) - dlog.set_mode(1, &dlog); - /*ENTRY END*/ - } - /*DO START*/ - - // - clarke.as = adc.Imeas_a; - clarke.bs = adc.Imeas_b; - clarke.calc(&clarke);// - - // . - // refs.theta_elec - park.ds = clarke.ds; - park.qs = clarke.qs; - park.ang = refs.theta_elec; - park.calc(&park); - - // " " d ( d , ) - pid_id.pid_ref_reg3 = refs.i_flux_ref; // - pid_id.pid_fdb_reg3 = park.de;// - - pid_id.calc(&pid_id); - - // " " q ( q , ) - pid_iq.pid_ref_reg3 = 0;// - - pid_iq.pid_fdb_reg3 = park.qe;park.de;// - - pid_iq.calc(&pid_iq); - - // . - // , refs.theta_elec - ipark.de = pid_id.pid_out_reg3; - ipark.qe = pid_iq.pid_out_reg3; - ipark.ang = refs.theta_elec; - ipark.calc(&ipark); - - // - pwm.UalphaRef = ipark.ds; - pwm.UbetaRef = ipark.qs; - pwm.update(&pwm); - - // - ( d) - cur_par.Is = pid_id.pid_fdb_reg3; - - break; - } case CTRL_RUN_U2F: { // U(f) if (p->E == 1) { @@ -295,18 +240,21 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { cur_par.Ialpha = clarke.ds; cur_par.Ibeta = clarke.qs; - // - rmp.input = refs.speed_ref; - rmp.calc(&rmp);// - - // refs.theta_elec - rmp.output. - // FAST_CALC_TS - - //drv_params.freq_nom ( ) - refs.theta_elec += _IQmpy( - _IQmpyI32(drv_params.freq_nom,FAST_CALC_TS), rmp.output); - cur_par.ThetaRefCurr = refs.theta_elec; - refs.theta_elec &= 0x00FFFFFF;// , IQ (360 ) + // , . + // . . + if (p->run_mode != CTRL_FLUXING) { + // + rmp.input = refs.speed_ref; + rmp.calc(&rmp);// + // refs.theta_elec - rmp.output. + // FAST_CALC_TS - + //drv_params.freq_nom ( ) + refs.theta_elec += _IQmpy( + _IQmpyI32(drv_params.freq_nom,FAST_CALC_TS), rmp.output); + cur_par.ThetaRefCurr = refs.theta_elec; + refs.theta_elec &= 0x00FFFFFF;// , IQ (360 ) + } // , //cur_par.ThetaCurr = posspeedEqep.theta_elecContinouos; @@ -396,7 +344,7 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { pid_spd.pid_out_max = refs.Iq_ref; // - - if (sw.recuperation_ena & 1) // + if (sw.bit.recuperation_ena) // pid_spd.pid_out_min = -refs.Iq_ref; // . . - else // @@ -605,7 +553,7 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { pid_spd.pid_out_max = refs.Iq_ref; // - - if (sw.recuperation_ena & 1) // + if (sw.bit.recuperation_ena) // pid_spd.pid_out_min = -refs.Iq_ref; // . . - else // @@ -743,34 +691,6 @@ void SM_Ctrl_Fast_Calc(TSM_Ctrl *p) { break; } - case CTRL_RUN_LATENCY_TEST: { // - if (p->E == 1) { - /*ENTRY START*/ - pwm.On(&pwm); - p->ctrl_counter = 0; - - if (dlog.StartBits & (1 << 1)) - dlog.set_mode(1, &dlog); - /*ENTRY END*/ - } - /*DO START*/ - p->ctrl_counter++; - pwm.UalphaRef = 0; - pwm.UbetaRef = 0; - DebugW1++; - if (p->ctrl_counter > 100){ - if (labs(adc.Imeas_a)< refs.i_flux_ref){ - pwm.UalphaRef = _IQ(1); - pwm.UbetaRef = 0; - } else { - p->ctrl_counter = 0; - } - } - - pwm.update(&pwm); - break; - } - default: { break; diff --git a/Vsrc/SM_Net.c b/Vsrc/SM_Net.c index c696357..b4ce6a6 100644 --- a/Vsrc/SM_Net.c +++ b/Vsrc/SM_Net.c @@ -52,7 +52,7 @@ void SM_Net_Init(TSM_Net *p) { // : // : 50 // SPI: 3000 - FaultLog.init(&FaultLog, 50, 3000, (Uint32*)&RTCclock.packed_time);// + FaultLog.init(&FaultLog, 50, 3000, (Uint32*)&global_time.PowerOn_time);// //// CANopen UART ( CAN, ) @@ -113,10 +113,6 @@ void SM_Net_Slow_Calc(TSM_Net *p) { MBVarsConv.slow_calc(&MBVarsConv); #endif - if (RTCclock.ClockOk)// ? - FaultLog.time_ptr = (Uint32*)&RTCclock.packed_time;// - else - FaultLog.time_ptr = (Uint32*)&global_time.PowerOn_time;// , } //! diff --git a/Vsrc/SM_Protect.c b/Vsrc/SM_Protect.c index b0ecd43..c6a7914 100644 --- a/Vsrc/SM_Protect.c +++ b/Vsrc/SM_Protect.c @@ -34,7 +34,6 @@ int16 WriteCounter = 0; void SM_Protect_Init(TSM_Protect *p) { p->state_prev = 0xff; p->state = 0x00; - GPIOA->DENSET = (1 << 7);// . } //! . @@ -55,12 +54,15 @@ void SM_Protect_Fast_Calc(TSM_Protect *p) { } /* */ - if (adc.Imeas_a > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_A; - if (adc.Imeas_a < -sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_A; - if (adc.Imeas_b > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_B; - if (adc.Imeas_b < -sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_B; - if (adc.Imeas_c > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_C; - if (adc.Imeas_c < -sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_C; + if (labs(adc.Imeas_a) > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_A; + if (labs(adc.Imeas_b) > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_B; + if (labs(adc.Imeas_c) > sm_prot.Imax_protect) sm_prot.bit_fault2 |= F_CTRL_MAX_I_PH_C; + + // + if (udControl.Enabled == 1) { // , + if (udControl.fault_start == 1) + sm_prot.bit_fault1 |= F_RELAY_START; + } // if (labs(cur_par.speed) > sm_prot.speed_max) { @@ -132,19 +134,16 @@ void SM_Protect_Fast_Calc(TSM_Protect *p) { if (cmd.bit.trip_reset == 1) {// p->state = PROT_ON_OK;// "" p->clearDrvFault = 1; // + + if (udControl.Enabled == 1) { // , + udControl.fault_start = 0; + } + // p->bit_fault1 = 0; p->bit_fault2 = 0; cmd.all = 0;// - // !!! pdp - // , - // - if (PWM0->TZFLG_bit.OST == 1) { // - // - PWM0->TZCLR = 0x7; - PWM1->TZCLR = 0x7; - PWM2->TZCLR = 0x7; - } + } break; } diff --git a/Vsrc/SM_Sys.c b/Vsrc/SM_Sys.c index 948c5a1..a8fac71 100644 --- a/Vsrc/SM_Sys.c +++ b/Vsrc/SM_Sys.c @@ -28,22 +28,28 @@ #if defined ( __CMCPPARM__ ) extern const Uint32 __Vectors; #elif defined (__GNUC__) - + // #endif +#define LED_ON GPIOA->MASKLB[8].MASKLB = 8 +#define LED_OFF GPIOA->MASKLB[8].MASKLB = 0 +void setLedEnabled (Uint8 enabled) { + + // JTAG - - + if (enabled) { + GPIOA->ALTFUNCCLR = 1 << 3; + } else { + GPIOA->ALTFUNCSET = 1 << 3; + } +} + //! //! . //! //! \memberof TSM_Sys void SM_Sys_Init(TSM_Sys *p) { -#if defined (HW_VECTORCARD_DRV8301_EVM) - sw.HardwareType = 0; -#elif defined (HW_VECTORCARD_DRV8312_EVM) - sw.HardwareType = 1; -#elif defined (HW_VECTORCARD_SIMULATOR) - sw.HardwareType = 2; -#endif + cmd.all = 0; drv_status.all = 0; UserMem.init(&UserMem); @@ -54,10 +60,12 @@ void SM_Sys_Init(TSM_Sys *p) { sm_ctrl.init(&sm_ctrl); // pwm.init(&pwm); // cur_par.init(&cur_par); // - leds.init(&leds);// - + udControl.init(&udControl); // ( . ) global_time.init(&global_time); + fanControl.init(&fanControl); + DIO_Init(); + brakeResistor.init(&brakeResistor); if (drv_params.sens_type == POS_SENSOR_TYPE_HALL){ // // DPReCAP.Init(&DPReCAP); // . @@ -173,6 +181,17 @@ void SM_Sys_Init(TSM_Sys *p) { sm_sys.state = SYS_READY; + // : + // , A3 + // , A3 JTAG- + GPIOA->LOCKKEY = 0xaDeadBee; + __NOP();__NOP(); + GPIOA->LOCKCLR = 1 << 3; + GPIOA->OUTENSET = 1 << 3; + // + sw.bit.use_led = FALSE; + + #ifdef WATCHDOG_ON Watchdog.enable(); // , #endif //WATCHDOG_ON @@ -188,25 +207,26 @@ void SM_Sys_Fast_Calc(TSM_Sys *p) { if (drv_params.sens_type == POS_SENSOR_TYPE_ENCODER) // posspeedEqep.calc(&posspeedEqep); // if (drv_params.sens_type == POS_SENSOR_TYPE_HALL){ // - DPReCAP.AngleCalc(&DPReCAP); // , ( DPReCAP.Angle) - DPReCAP.Angle6Calc(&DPReCAP); // , 60 ( DPReCAP.Angle6) - DPReCAP.SpeedCalc(&DPReCAP); // , (DPReCAP.speed) - DPReCAP.calc_10k(&DPReCAP); // , + DPReCAP.AngleCalc(&DPReCAP); // , ( DPReCAP.Angle) + DPReCAP.Angle6Calc(&DPReCAP); // , 60 ( DPReCAP.Angle6) + DPReCAP.SpeedCalc(&DPReCAP); // , (DPReCAP.speed) + DPReCAP.calc_10k(&DPReCAP); // , } if (drv_params.sens_type == POS_SENSOR_TYPE_SSI){ // SSI. ! - SSI_Encoder.calc(&SSI_Encoder);// SSI + SSI_Encoder.calc(&SSI_Encoder); // SSI } - - - sm_prot.fast_calc(&sm_prot); // - sm_ctrl.fast_calc(&sm_ctrl); // + DIO_fast_calc(); // + udControl.calc(&udControl); // + sm_prot.fast_calc(&sm_prot); // + sm_ctrl.fast_calc(&sm_ctrl); // global_time.calc(&global_time); cur_par.calc(&cur_par); // drv_params.sens_type = drv_params.sens_type & 7; // , + brakeResistor.fastCalc(&brakeResistor); #ifdef WATCHDOG_ON // Watchdog.feed();// , #endif //WATCHDOG_ON @@ -217,15 +237,29 @@ void SM_Sys_Fast_Calc(TSM_Sys *p) { //! , //! \memberof TSM_Sys void SM_Sys_ms_Calc(TSM_Sys* p) { - sm_cmd_logic.ms_calc(&sm_cmd_logic); // - sm_net.ms_calc(&sm_net); // - adc.ms_calc(&adc); // + // + if (sm_ctrl.state == CTRL_STOP) p->ledPeriod = 2000; + else p->ledPeriod = 1000; + + p->ledTimer++; + if (p->ledTimer < (p->ledPeriod >> 1)) + LED_ON; + else if (p->ledTimer < p->ledPeriod) + LED_OFF; + else + p->ledTimer = 0; + + + + sm_cmd_logic.ms_calc(&sm_cmd_logic); // + sm_net.ms_calc(&sm_net); // + adc.ms_calc(&adc); // sm_prot.ms_calc(&sm_prot); // AutoOffset.ms_calc(&AutoOffset); // // CANopen. , , dlog // Can2BTInterface.ms_calc(&Can2BTInterface, TMR2->VALUE, &co2_vars); - leds.msCalc(&leds);// - RTCclock.msCalc(&RTCclock);// + fanControl.slow_calc(&fanControl); + UserMem.ms_calc(&UserMem);// if ((drv_params.sens_type == 2) || (drv_params.sens_type == 3)){ // DPReCAP.ms_calc(&DPReCAP); @@ -238,9 +272,13 @@ void SM_Sys_ms_Calc(TSM_Sys* p) { //! //! \memberof TSM_Sys void SM_Sys_Slow_Calc(TSM_Sys *p) { -// Can2BTInterface.slow_calc(&Can2BTInterface);// CANopen, + // + drv_params._1_Udc_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.Udc_nom)); + drv_params._1_I_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.I_nom)); + drv_params._1_U_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.U_nom)); + UserMem.slow_calc(&UserMem);// - RTCclock.slowCalc(&RTCclock);// + sm_prot.slow_calc(&sm_prot);// sm_net.slow_calc(&sm_net); // dlog.background_analizer(&dlog); // @@ -253,14 +291,11 @@ void SM_Sys_Slow_Calc(TSM_Sys *p) { posspeedEqep.slow_calc(&posspeedEqep);// RotorObserver.slow_calc(&RotorObserver);// DPReCAP.slow_calc(&DPReCAP);// + DIO_slow_calc(); // - // - drv_params._1_Udc_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.Udc_nom)); - drv_params._1_I_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.I_nom)); - drv_params._1_U_nom = _IQdiv(_IQ16(1), _IQ16(drv_params.U_nom)); - if (sw.Reboot & 1) { // - sw.Reboot = 0; // + if (sw.bit.Reboot & 1) { // + sw.bit.Reboot = 0; // if (sm_ctrl.state == CTRL_STOP) { // // // ! @@ -270,11 +305,16 @@ void SM_Sys_Slow_Calc(TSM_Sys *p) { // // - if ((sw.AutoOffset & 1) && (sm_ctrl.state == CTRL_STOP)) AutoOffset.Enabled=1; + if ((sw.bit.AutoOffset) && (sm_ctrl.state == CTRL_STOP)) AutoOffset.Enabled=1; else AutoOffset.Enabled=0; + // + if (sw.bit.use_led && !sw.bit.use_led_prev) + setLedEnabled(TRUE); + else if (!sw.bit.use_led && sw.bit.use_led_prev) + setLedEnabled(FALSE); - + sw.bit.use_led_prev = sw.bit.use_led; } /*@}*/ diff --git a/Vsrc/V_AutoOffset.c b/Vsrc/V_AutoOffset.c index f8d67e8..766c748 100644 --- a/Vsrc/V_AutoOffset.c +++ b/Vsrc/V_AutoOffset.c @@ -42,14 +42,12 @@ void AutoOffset_calc(TAutoOffset *p) { // , p->IA_int = p->IA_int + _IQmpy(p->FilterK, adc.Imeas_a); p->IB_int = p->IB_int + _IQmpy(p->FilterK, adc.Imeas_b); - p->IC_int = p->IC_int + _IQmpy(p->FilterK, adc.Imeas_c); } void AutoOffset_slow_calc(TAutoOffset *p) { long IA_pu; long IB_pu; - long IC_pu; if (p->Enabled){// // .. @@ -59,12 +57,9 @@ void AutoOffset_slow_calc(TAutoOffset *p) { IB_pu = -p->IB_int / (_IQ16mpy(adc.Imeas_b_gain, drv_params._1_I_nom)); adc.Imeas_b_offset = IB_pu >> 1; - IC_pu = -p->IC_int / (_IQ16mpy(adc.Imeas_c_gain, drv_params._1_I_nom)); - adc.Imeas_c_offset = IC_pu >> 1; } else {// , p->IA_int=-(((long)adc.Imeas_a_offset)<<1)*_IQ16mpy(adc.Imeas_a_gain, drv_params._1_I_nom); p->IB_int=-(((long)adc.Imeas_b_offset)<<1)*_IQ16mpy(adc.Imeas_b_gain, drv_params._1_I_nom); - p->IC_int=-(((long)adc.Imeas_c_offset)<<1)*_IQ16mpy(adc.Imeas_c_gain, drv_params._1_I_nom); } } diff --git a/Vsrc/V_BrakeResistor.c b/Vsrc/V_BrakeResistor.c new file mode 100644 index 0000000..1030839 --- /dev/null +++ b/Vsrc/V_BrakeResistor.c @@ -0,0 +1,73 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_BrakeResistor.c + \brief + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + +#include +#include "main.h" + +#if defined (HW_MOTORCONTROLBOARD) +#define BR_CONTROL_OFF GPIOB->DATAOUTCLR = (1 << 7); +#define BR_CONTROL_ON GPIOB->DATAOUTSET = (1 << 7); +#else +#define BR_CONTROL_OFF // +#define BR_CONTROL_ON // +#endif + +void BrakeResistor_Init (TbrakeResistor *p) { + p->state = BRAKE_R_STATE_OFF; + + // + BR_CONTROL_OFF; + GPIOB->ALTFUNCCLR = (1 << 7); + GPIOB->OUTENSET = (1 << 7); + +} + +void BrakeResistor_fastCalc (TbrakeResistor *p) { + // ( ) + if (p->bottomLevel >= p->upperLevel) + p->bottomLevel = _IQmpy(p->upperLevel, _IQ(0.95)); + + if (!p->enabled) { + p->state = BRAKE_R_STATE_OFF; + BR_CONTROL_OFF; + return; + } + // , + // - , - + + if (adc.Udc_meas > p->upperLevel){ + p->state = BRAKE_R_STATE_ON; + BR_CONTROL_ON; + + } else if (adc.Udc_meas < p->bottomLevel) { + p->state = BRAKE_R_STATE_OFF; + BR_CONTROL_OFF; + } + + + + + +} + +/*@}*/ diff --git a/Vsrc/V_CANtoRS.c b/Vsrc/V_CANtoRS.c index 9ab0ed9..c855c52 100644 --- a/Vsrc/V_CANtoRS.c +++ b/Vsrc/V_CANtoRS.c @@ -31,11 +31,9 @@ void CANtoRS_init(TCANtoRS *p) { GPIOB->ALTFUNCSET = (1 << 8) + (1 << 9); - GPIOB->DENSET = (1 << 8) + (1 << 9); p->UART=UART1;// UART (0, 1) - p->UART->CR_bit.UARTEN = 1; // UART // : // BaudRate @@ -49,14 +47,25 @@ void CANtoRS_init(TCANtoRS *p) { p->UART->FBRD_bit.DIVFRAC = 8; - p->UART->LCRH_bit.SPS = 0; // - p->UART->LCRH_bit.WLEN = 3; // 8 - p->UART->LCRH_bit.FEN = 1; // FIFO - p->UART->CR_bit.TXE = 1; // - p->UART->CR_bit.RXE = 1; // - p->UART->LCRH_bit.STP2 = 0; // 1 - + //p->UART->LCRH_bit.SPS = 0; // + //p->UART->LCRH_bit.WLEN = 3; // 8 + //p->UART->LCRH_bit.FEN = 1; // FIFO + //p->UART->LCRH_bit.STP2 = 0; // 1 - + // + //p->UART->CR_bit.UARTEN = 1; // UART + //p->UART->CR_bit.TXE = 1; // + //p->UART->CR_bit.RXE = 1; // - p->CounterWrongCRC=0; + p->UART->LCRH = (0 << UART_LCRH_SPS_Pos) | + (3 << UART_LCRH_WLEN_Pos) | + (1 << UART_LCRH_FEN_Pos) | + (0 << UART_LCRH_STP2_Pos); + + p->UART->CR = (1 << UART_CR_UARTEN_Pos) | + (1 << UART_CR_TXE_Pos) | + (1 << UART_CR_RXE_Pos); + + p->CounterWrongCRC=0; p->CounterRes=0; p->CounterSended=0; p->PacketInWait=0; @@ -73,8 +82,8 @@ void CANtoRS_init(TCANtoRS *p) { Uint16 CANtoRS_SendP(Uint16* Data, int16 len, TCANtoRS *p) { volatile int16 i; Uint16 MyCRC; - p->buf_out[0]=0x7E; - for (i=0;ibuf_out[0] = 0x7E; + for (i = 0; i < len; i++) p->buf_out[i+1]=Data[i]; MyCRC=CANtoRS_C_CRC(p,Data,len); p->buf_out[len+1]=MyCRC & 0xFF;// diff --git a/Vsrc/V_DIO.c b/Vsrc/V_DIO.c new file mode 100644 index 0000000..dc97c54 --- /dev/null +++ b/Vsrc/V_DIO.c @@ -0,0 +1,85 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_DIO.c + \brief / + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + + + +#include "main.h" +#include "filter.h" + + + +// +volatile Uint8 output_vect = 0; + +// +volatile Uint8 input_vect = 0; + +// +TFilter fIn1 = FILTER_DEFAULTS; + + + +void DIO_Init() +{ +#if defined (HW_MOTORCONTROLBOARD) + // + GPIOA->ALTFUNCCLR = (1 << 14); + GPIOA->OUTENCLR = (1 << 14); + + // + GPIOA->ALTFUNCCLR = (1 << 15); + GPIOA->OUTENSET = (1 << 15); + + // + fIn1.T = _IQ(0.03); + +#endif + +} + + +void DIO_slow_calc() +{ + // 1 + if (BIT_IS_SET(output_vect, 0)) + D_OUT1_ON; + else + D_OUT1_OFF; + + // 1 + if (fIn1.output > _IQ(0.8)) SET_BIT(input_vect, 0); + if (fIn1.output < _IQ(0.3)) CLEAR_BIT(input_vect, 0); + +} + + +void DIO_fast_calc() +{ + // 1 + fIn1.input = (D_IN1 == 1) ? _IQ(1.0) : 0; + fIn1.calc(&fIn1); + +} + +/*@}*/ + diff --git a/Vsrc/V_DPR_eCAP.c b/Vsrc/V_DPR_eCAP.c index 5ff2393..e2e6399 100644 --- a/Vsrc/V_DPR_eCAP.c +++ b/Vsrc/V_DPR_eCAP.c @@ -41,76 +41,120 @@ void DPReCAP_Init(TDPReCAP* p) { // ECAP1 ECAP0->ECEINT = 0x0000; // Disable all capture interrupts ECAP0->ECCLR = 0xFFFF; // Clear all CAP interrupt flags - ECAP0->ECCTL0_bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads - ECAP0->ECCTL1_bit.TSCTRSTOP = 0; // Make sure the counter is stopped - ECAP0->ECCTL0_bit.PRESCALE = 0; // DIV1 + //ECAP0->ECCTL0 = 0; // Disable CAP1-CAP4 register loads + //ECAP0->ECCTL1 = 0; // Make sure the counter is stopped // Configure peripheral registers - ECAP0->ECCTL1_bit.CONTOST = 0; // continuous mode - ECAP0->ECCTL0_bit.CAP0POL = 0; // rising edge - ECAP0->ECCTL0_bit.CAP1POL = 1; // falling edge - ECAP0->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp - ECAP0->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp - ECAP0->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 -// ECAP0->ECCTL1_bit.SYNCI_EN = 1; // Enable sync in - ECAP0->ECCTL1_bit.SYNCOSEL = 0; // Pass through - ECAP0->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + //ECAP0->ECCTL0_bit.CAP0POL = 0; // rising edge + //ECAP0->ECCTL0_bit.CAP1POL = 1; // falling edge + //ECAP0->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp + //ECAP0->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp + //ECAP0->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + //ECAP0->ECCTL0_bit.PRESCALE = 0; // DIV1 + // + //ECAP0->ECCTL1_bit.CONTOST = 0; // continuous mode + //ECAP0->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 + //ECAP0->ECCTL1_bit.SYNCOSEL = 0; // Pass through + //ECAP0->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter + //ECAP0->ECCTL1_bit.REARM = 0; // Has no effect ( ) + // + //ECAP0->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt + //ECAP0->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt + ECAP0->ECCTL0 = (0 << ECAP_ECCTL0_CAP0POL_Pos) | + (1 << ECAP_ECCTL0_CAP1POL_Pos) | + (0 << ECAP_ECCTL0_CTRRST0_Pos) | + (0 << ECAP_ECCTL0_CTRRST1_Pos) | + (1 << ECAP_ECCTL0_CAPLDEN_Pos) | + (0 << ECAP_ECCTL0_PRESCALE_Pos); + ECAP0->ECCTL1 = (0 << ECAP_ECCTL1_CONTOST_Pos) | + (1 << ECAP_ECCTL1_STOPWRAP_Pos) | + (1 << ECAP_ECCTL1_TSCTRSTOP_Pos) | + (0 << ECAP_ECCTL1_REARM_Pos) | + (0 << ECAP_ECCTL1_SYNCOSEL_Pos); - ECAP0->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter - ECAP0->ECCTL1_bit.REARM = 0; // Has no effect ( ) - ECAP0->ECCTL0_bit.CAPLDEN = 1; // Enable CAP1-CAP4 register loads - ECAP0->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt - ECAP0->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt + ECAP0->ECEINT = (1 << ECAP_ECEINT_CEVT0_Pos) | + (1 << ECAP_ECEINT_CEVT1_Pos); // ECAP2 ECAP1->ECEINT = 0x0000; // Disable all capture interrupts ECAP1->ECCLR = 0xFFFF; // Clear all CAP interrupt flags - ECAP1->ECCTL0_bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads - ECAP1->ECCTL1_bit.TSCTRSTOP = 0; // Make sure the counter is stopped - ECAP1->ECCTL0_bit.PRESCALE = 0; // DIV1 + //ECAP1->ECCTL0_bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads + //ECAP1->ECCTL1_bit.TSCTRSTOP = 0; // Make sure the counter is stopped + // + //// Configure peripheral registers + //ECAP1->ECCTL0_bit.CAP0POL = 0; // rising edge + //ECAP1->ECCTL0_bit.CAP1POL = 1; // falling edge + //ECAP1->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp + //ECAP1->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp + //ECAP1->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + //ECAP1->ECCTL0_bit.PRESCALE = 0; // DIV1 + // + //ECAP1->ECCTL1_bit.CONTOST = 0; // continuous mode + //ECAP1->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 + //ECAP1->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter + //ECAP1->ECCTL1_bit.REARM = 0; // Has no effect ( ) + //ECAP1->ECCTL1_bit.SYNCOSEL = 0; // Pass through + // + //ECAP1->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt + //ECAP1->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt - // Configure peripheral registers - ECAP1->ECCTL1_bit.CONTOST = 0; // continuous mode - ECAP1->ECCTL0_bit.CAP0POL = 0; // rising edge - ECAP1->ECCTL0_bit.CAP1POL = 1; // falling edge - ECAP1->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp - ECAP1->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp - ECAP1->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 -// ECAP1->ECCTL1_bit.SYNCI_EN = 1; // Enable sync in - ECAP1->ECCTL1_bit.SYNCOSEL = 0; // Pass through - ECAP1->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + ECAP1->ECCTL0 = (0 << ECAP_ECCTL0_CAP0POL_Pos) | + (1 << ECAP_ECCTL0_CAP1POL_Pos) | + (0 << ECAP_ECCTL0_CTRRST0_Pos) | + (0 << ECAP_ECCTL0_CTRRST1_Pos) | + (1 << ECAP_ECCTL0_CAPLDEN_Pos) | + (0 << ECAP_ECCTL0_PRESCALE_Pos); + + ECAP1->ECCTL1 = (0 << ECAP_ECCTL1_CONTOST_Pos) | + (1 << ECAP_ECCTL1_STOPWRAP_Pos) | + (1 << ECAP_ECCTL1_TSCTRSTOP_Pos) | + (0 << ECAP_ECCTL1_REARM_Pos) | + (0 << ECAP_ECCTL1_SYNCOSEL_Pos); + + ECAP1->ECEINT = (1 << ECAP_ECEINT_CEVT0_Pos) | + (1 << ECAP_ECEINT_CEVT1_Pos); - ECAP1->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter - ECAP1->ECCTL1_bit.REARM = 0; // Has no effect ( ) - ECAP1->ECCTL0_bit.CAPLDEN = 1; // Enable CAP1-CAP4 register loads - ECAP1->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt - ECAP1->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt // ECap3 ECAP2->ECEINT = 0x0000; // Disable all capture interrupts ECAP2->ECCLR = 0xFFFF; // Clear all CAP interrupt flags - ECAP2->ECCTL0_bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads - ECAP2->ECCTL1_bit.TSCTRSTOP = 0; // Make sure the counter is stopped - ECAP2->ECCTL0_bit.PRESCALE = 0; // DIV1 + //ECAP2->ECCTL0_bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads + //ECAP2->ECCTL1_bit.TSCTRSTOP = 0; // Make sure the counter is stopped + // + //// Configure peripheral registers + //ECAP2->ECCTL0_bit.CAP0POL = 0; // rising edge + //ECAP2->ECCTL0_bit.CAP1POL = 1; // falling edge + //ECAP2->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp + //ECAP2->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp + //ECAP2->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + //ECAP2->ECCTL0_bit.PRESCALE = 0; // DIV1 + // + //ECAP2->ECCTL1_bit.CONTOST = 0; // continuous mode + //ECAP2->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 + //ECAP2->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter + //ECAP2->ECCTL1_bit.REARM = 0; // Has no effect ( ) + //ECAP2->ECCTL1_bit.SYNCOSEL = 0; // Pass through + // + //ECAP2->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt + //ECAP2->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt - // Configure peripheral registers - ECAP2->ECCTL1_bit.CONTOST = 0; // continuous mode - ECAP2->ECCTL0_bit.CAP0POL = 0; // rising edge - ECAP2->ECCTL0_bit.CAP1POL = 1; // falling edge - ECAP2->ECCTL0_bit.CTRRST0 = 0; // absolute time stamp - ECAP2->ECCTL0_bit.CTRRST1 = 0; // absolute time stamp - ECAP2->ECCTL1_bit.STOPWRAP = 1; // Wrap after Capture Event 2 -// ECAP2->ECCTL1_bit.SYNCI_EN = 1; // Enable sync in - ECAP2->ECCTL1_bit.SYNCOSEL = 0; // Pass through - ECAP2->ECCTL0_bit.CAPLDEN = 1; // Enable capture units + ECAP2->ECCTL0 = (0 << ECAP_ECCTL0_CAP0POL_Pos) | + (1 << ECAP_ECCTL0_CAP1POL_Pos) | + (0 << ECAP_ECCTL0_CTRRST0_Pos) | + (0 << ECAP_ECCTL0_CTRRST1_Pos) | + (1 << ECAP_ECCTL0_CAPLDEN_Pos) | + (0 << ECAP_ECCTL0_PRESCALE_Pos); - ECAP2->ECCTL1_bit.TSCTRSTOP = 1; // Start Counter - ECAP2->ECCTL1_bit.REARM = 0; // Has no effect ( ) - ECAP2->ECCTL0_bit.CAPLDEN = 1; // Enable CAP1-CAP4 register loads - ECAP2->ECEINT_bit.CEVT0 = 1; // 1 events = interrupt - ECAP2->ECEINT_bit.CEVT1 = 1; // 2 events = interrupt + ECAP2->ECCTL1 = (0 << ECAP_ECCTL1_CONTOST_Pos) | + (1 << ECAP_ECCTL1_STOPWRAP_Pos) | + (1 << ECAP_ECCTL1_TSCTRSTOP_Pos) | + (0 << ECAP_ECCTL1_REARM_Pos) | + (0 << ECAP_ECCTL1_SYNCOSEL_Pos); + + ECAP2->ECEINT = (1 << ECAP_ECEINT_CEVT0_Pos) | + (1 << ECAP_ECEINT_CEVT1_Pos); p->TsNom = ((SystemCoreClock / (drv_params.speed_nom * drv_params.p)) * 15*2); // / @@ -560,7 +604,6 @@ void DPReCAP_SlowCalc(TDPReCAP* p) { if (p->initialized==0){ p->Init(p); GPIOA->ALTFUNCSET = (1 << 4) + (1 << 5) + (1 << 6); - GPIOA->DENSET = (1 << 4) + (1 << 5) + (1 << 6); SIU->REMAPAF_bit.ECAP0EN = 1; SIU->REMAPAF_bit.ECAP1EN = 1; SIU->REMAPAF_bit.ECAP2EN = 1; diff --git a/Vsrc/V_Fan.c b/Vsrc/V_Fan.c new file mode 100644 index 0000000..4be14b5 --- /dev/null +++ b/Vsrc/V_Fan.c @@ -0,0 +1,92 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_Fan.c + \brief + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + + +#include "main.h" + + +//! \memberof TFanControl +void FanControl_init(TFanControl *p) +{ +#if defined (HW_MOTORCONTROLBOARD) + p->Enabled = 1; // + + // + FAN_OFF; + GPIOB->ALTFUNCCLR = (1 << 4); // . + GPIOB->OUTENSET = (1 << 4); // +#endif +} + +//! \memberof TFanControl +void FanControl_slow_calc(TFanControl *p) { + if (p->Enabled){// + // + p->state_shadow = p->state; + p->state_prev = p->state_shadow; + + switch (p->state_shadow) { + + + case FAN_CONTROL_STATE_OFF: // , T_on + { + FAN_OFF; + p->StateOn = 0; + if ((p->temperature > p->T_on) || (p->manualOn)) + p->state = FAN_CONTROL_STATE_ON; + break; + } + + case FAN_CONTROL_STATE_ON: // , T_on T_alarm + { + FAN_ON; // + p->StateOn = 1; // + + if (p->temperature > p->T_alarm) // , + p->state = FAN_CONTROL_STATE_OVERHEAT; + if ((p->temperature < p->T_off) && (!p->manualOn)) // , + p->state = FAN_CONTROL_STATE_OFF; + break; + } + + case FAN_CONTROL_STATE_OVERHEAT: // T_alarm, , + { + FAN_ON; // + p->StateOn = 1; // + drv_status.bit.overheat = 1; // + if (p->temperature < p->T_alarm) { // , + drv_status.bit.overheat = 0; // + p->state = FAN_CONTROL_STATE_ON; + } + break; + + } + + } + } + + +} + +/*@}*/ + diff --git a/Vsrc/V_PWM_Module.c b/Vsrc/V_PWM_Module.c index fbb9332..cc55b0d 100644 --- a/Vsrc/V_PWM_Module.c +++ b/Vsrc/V_PWM_Module.c @@ -32,10 +32,7 @@ void PWM_Module_Init(TPWM_Module *p) { SIU->PWMSYNC_bit.PRESCRST = 0; // - - -// ------------------------------------------------------------------------ - // ePWM0 - // ------------------------------------------------------------------------ + // if (p->Frequency < PWM_FREQ_MIN) p->Frequency = PWM_FREQ_MIN; if (p->Frequency > PWM_FREQ_MAX) @@ -44,43 +41,58 @@ void PWM_Module_Init(TPWM_Module *p) { p->k_pwm = PWM0->TBPRD; p->FreqPrev = p->Frequency; // + +// ------------------------------------------------------------------------ + // ePWM0 + // ------------------------------------------------------------------------ PWM0->TBPHS_bit.TBPHS = 0x0000; // Phase is 0 PWM0->TBCTR = 0x0000; // Clear counter - // Setup counter mode - PWM0->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 - PWM0->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // Count up-down - PWM0->TBCTL_bit.PHSEN = TB_DISABLE; // Disable phase loading - PWM0->TBCTL_bit.PHSDIR = TB_UP; // - PWM0->TBCTL_bit.HSPCLKDIV = 0; // High Speed Time-base Clock Prescale - PWM0->TBCTL_bit.CLKDIV = 0; // Time-base Clock Prescale - PWM0->TBCTL_bit.SYNCOSEL = TB_CTR_ZERO; // - TBCTR = 0 + // . , + //PWM0->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 + //PWM0->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // - + //PWM0->TBCTL_bit.PHSEN = TB_DISABLE; // + //PWM0->TBCTL_bit.HSPCLKDIV = 0; // ( ) + //PWM0->TBCTL_bit.CLKDIV = 0; // ( ) + //PWM0->TBCTL_bit.SYNCOSEL = TB_CTR_ZERO; // - TBCTR = 0 + //PWM0->TBCTL_bit.FREESOFT = 2; // + //PWM0->TBCTL_bit.SHADOWGLOB = 1; // - // Setup shadowing - PWM0->CMPCTL_bit.SHDWAMODE = CC_SHADOW; // SHADOW - PWM0->CMPCTL_bit.LOADAMODE = CC_CTR_ZERO; // Load on period and zero + PWM0->TBCTL = (TB_SHADOW << PWM_TBCTL_PRDLD_Pos) | + (TB_COUNT_UPDOWN << PWM_TBCTL_CTRMODE_Pos) | + (TB_DISABLE << PWM_TBCTL_PHSEN_Pos) | + (0 << PWM_TBCTL_HSPCLKDIV_Pos) | + (0 << PWM_TBCTL_CLKDIV_Pos) | + (TB_CTR_ZERO << PWM_TBCTL_SYNCOSEL_Pos) | + (2 << PWM_TBCTL_FREESOFT_Pos) | + (1 << PWM_TBCTL_SHDWGLOB_Pos); - PWM0->CMPCTL_bit.SHDWBMODE = CC_SHADOW; // SHADOW - PWM0->CMPCTL_bit.LOADBMODE = CC_CTR_ZERO; // Load on period and zero + // + //PWM0->CMPCTL_bit.SHDWAMODE = CC_SHADOW; // CMPA + //PWM0->CMPCTL_bit.LOADAMODE = CC_CTR_ZERO; // + //PWM0->CMPCTL_bit.SHDWBMODE = CC_SHADOW; // CMPB + //PWM0->CMPCTL_bit.LOADBMODE = CC_CTR_ZERO; // + PWM0->CMPCTL = (CC_SHADOW << PWM_CMPCTL_SHDWAMODE_Pos) | + (CC_CTR_ZERO << PWM_CMPCTL_LOADAMODE_Pos) | + (CC_SHADOW << PWM_CMPCTL_SHDWBMODE_Pos) | + (CC_CTR_ZERO << PWM_CMPCTL_LOADBMODE_Pos); - // Set Compare values + // PWM0->CMPA_bit.CMPA = 0; // Set compare A value - // Set actions - PWM0->AQCTLA = AQ_EPWM_DISABLE; // PWM1A - PWM0->AQCTLA_bit.ZRO = 1; // - PWM0->AQCTLA_bit.CAU = 2; // - PWM0->AQCTLA_bit.CAD = 1; // + // + //PWM0->AQCTLA_bit.ZRO = AQ_CLEAR; // + //PWM0->AQCTLA_bit.CAU = AQ_SET; // + //PWM0->AQCTLA_bit.CAD = AQ_CLEAR; // + PWM0->AQCTLA = (AQ_CLEAR << PWM_AQCTLA_ZRO_Pos) | + (AQ_SET << PWM_AQCTLA_CAU_Pos) | + (AQ_CLEAR << PWM_AQCTLA_CAD_Pos); - // PWMB , PWM. . - PWM0->AQCTLB = PWM0->AQCTLA; // PWM1B - PWM0->AQCTLB_bit.ZRO = PWM0->AQCTLA_bit.ZRO; // - PWM0->AQCTLB_bit.CAU = PWM0->AQCTLA_bit.CAU; // - PWM0->AQCTLB_bit.CAD = PWM0->AQCTLA_bit.CAD; // + // PWMB , A PWM0->AQSFRC_bit.RLDCSF = 0; // 0 - // Setup Deadband + // // DBRED = DBFED = 150 * T_ / 4 PWM0->DBRED = _IQ4mpy(_IQ4(150 / 4), p->DeadBand >> 20) >> 4; PWM0->DBFED = PWM0->DBRED; @@ -92,82 +104,60 @@ void PWM_Module_Init(TPWM_Module *p) { // // OUTMODE:S0 = 1 S1 = 1 PWMA PWMA, // PWMB PWMA - PWM0->DBCTL_bit.INMODE = DBA_ALL; - PWM0->DBCTL_bit.POLSEL = DB_ACTV_HIC; - PWM0->DBCTL_bit.OUTMODE = DB_FULL_ENABLE; + //PWM0->DBCTL_bit.INMODE = DBA_ALL; + //PWM0->DBCTL_bit.POLSEL = DB_ACTV_HIC; + //PWM0->DBCTL_bit.OUTMODE = DB_FULL_ENABLE; + PWM0->DBCTL = (DBA_ALL << PWM_DBCTL_INMODE_Pos) | + (DB_ACTV_HIC << PWM_DBCTL_POLSEL_Pos) | + (DB_FULL_ENABLE << PWM_DBCTL_OUTMODE_Pos); - PWM0->ETSEL_bit.INTSEL = ET_DISABLE; // Disable INT () - PWM0->ETSEL_bit.INTEN = 0; // Disable INT - - - // TZ (one-shot) - // PWM0->TZSEL_bit.OSHT1 = TZ_ENABLE; -// PWM0->TZSEL_bit.OSHT2 = TZ_ENABLE; -// PWM0->TZSEL_bit.OSHT3 = TZ_ENABLE; - - // Trip-Zone - PWM0->TZCTL_bit.TZA = TZ_STATE; // "One-Shot Trip" - PWM0->TZCTL_bit.TZB = TZ_STATE; // - - // VectorCARD ADC - //PWM0->ETSEL_bit.SOCAEN = 1; // - //PWM0->ETSEL_bit.SOCASEL = 1; // CTR == 0 (Underflow) + // Trip-Zone + //PWM0->TZCTL_bit.TZA = TZ_STATE; // "One-Shot Trip" + //PWM0->TZCTL_bit.TZB = TZ_STATE; // () + PWM0->TZCTL = (TZ_STATE << PWM_TZCTL_TZA_Pos) | + (TZ_STATE << PWM_TZCTL_TZB_Pos); // ------------------------------------------------------------------------ // ePWM1 // ------------------------------------------------------------------------ // Setup TBCLK - PWM1->TBPRD = PWM0->TBPRD; // - PWM1->TBPHS_bit.TBPHS = 0x0001; // 1 - - PWM1->TBCTR = 0x0000; // Clear counter + PWM1->TBPRD = PWM0->TBPRD; // + PWM1->TBPHS_bit.TBPHS = 0x0001; // 1 - + PWM1->TBCTR = 0x0000; // Clear counter - // Setup counter mode - PWM1->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 - PWM1->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // Count up-down - PWM1->TBCTL_bit.PHSEN = TB_ENABLE; // Enable phase loading - PWM1->TBCTL_bit.PHSDIR = TB_UP; // - PWM1->TBCTL_bit.HSPCLKDIV = 0; // High Speed Time-base Clock Prescale - PWM1->TBCTL_bit.CLKDIV = 0; // Time-base Clock Prescale - PWM1->TBCTL_bit.SYNCOSEL = TB_SYNC_IN; // - "" + // + //PWM1->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 + //PWM1->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // - + //PWM1->TBCTL_bit.PHSEN = TB_ENABLE; // + //PWM1->TBCTL_bit.PHSDIR = TB_UP; // + //PWM1->TBCTL_bit.HSPCLKDIV = 0; // ( ) + //PWM1->TBCTL_bit.CLKDIV = 0; // ( ) + //PWM1->TBCTL_bit.SYNCOSEL = TB_SYNC_IN; // - "" + //PWM1->TBCTL_bit.FREESOFT = 2; // + //PWM1->TBCTL_bit.SHADOWGLOB = 1; // + PWM1->TBCTL = (TB_SHADOW << PWM_TBCTL_PRDLD_Pos) | + (TB_COUNT_UPDOWN << PWM_TBCTL_CTRMODE_Pos) | + (TB_ENABLE << PWM_TBCTL_PHSEN_Pos) | + (TB_UP << PWM_TBCTL_PHSDIR_Pos) | + (0 << PWM_TBCTL_HSPCLKDIV_Pos) | + (0 << PWM_TBCTL_CLKDIV_Pos) | + (TB_SYNC_IN << PWM_TBCTL_SYNCOSEL_Pos) | + (2 << PWM_TBCTL_FREESOFT_Pos) | + (1 << PWM_TBCTL_SHDWGLOB_Pos); - // Setup shadowing - PWM1->CMPCTL_bit.SHDWAMODE = CC_SHADOW; // SHADOW - PWM1->CMPCTL_bit.LOADAMODE = CC_CTR_ZERO; // Load on period and zero - - PWM1->CMPCTL_bit.SHDWBMODE = CC_SHADOW; // SHADOW - PWM1->CMPCTL_bit.LOADBMODE = CC_CTR_ZERO; // Load on period and zero - - // Set Compare values - PWM1->CMPA_bit.CMPA = 0; // Set compare A value - - // Set actions - PWM1->AQCTLA = AQ_EPWM_DISABLE; // - PWM1->AQCTLA_bit.ZRO = 1; // - PWM1->AQCTLA_bit.CAU = 2; // - PWM1->AQCTLA_bit.CAD = 1; // - - // PWMB , PWM. . - PWM1->AQCTLB = PWM0->AQCTLA; // PWM1B - PWM1->AQCTLB_bit.ZRO = PWM0->AQCTLA_bit.ZRO; // - PWM1->AQCTLB_bit.CAU = PWM0->AQCTLA_bit.CAU; // - PWM1->AQCTLB_bit.CAD = PWM0->AQCTLA_bit.CAD; // - - PWM1->AQSFRC_bit.RLDCSF = 0; // 0 - - // Active high complementary PWMs - Setup Deadband + // , , + // TZ , PWM0 + PWM1->CMPCTL = PWM0->CMPCTL; + PWM1->AQCTLA = PWM0->AQCTLA; PWM1->DBRED = PWM0->DBRED; - PWM1->DBFED = PWM1->DBRED; - PWM1->DBCTL_bit.INMODE = PWM0->DBCTL_bit.INMODE; - PWM1->DBCTL_bit.OUTMODE = PWM0->DBCTL_bit.OUTMODE; - PWM1->DBCTL_bit.POLSEL = PWM0->DBCTL_bit.POLSEL; + PWM1->DBFED = PWM0->DBFED; + PWM1->DBCTL = PWM0->DBCTL; + PWM1->TZCTL = PWM0->TZCTL; + PWM1->ETSEL = PWM0->ETSEL; - // Interrupt where we will change the Compare Values - PWM1->ETSEL_bit.INTSEL = ET_DISABLE; // Disable INT - PWM1->ETSEL_bit.INTEN = 0; // Disable INT - - // Trip-Zone - PWM1->TZCTL_bit.TZA = TZ_STATE; // "One-Shot Trip" - PWM1->TZCTL_bit.TZB = TZ_STATE; // + // + PWM1->CMPA_bit.CMPA = 0; + PWM1->AQSFRC_bit.RLDCSF = 0; // ------------------------------------------------------------------------ // ePWM2 @@ -177,53 +167,31 @@ void PWM_Module_Init(TPWM_Module *p) { PWM2->TBPHS_bit.TBPHS = 0x0001; // 1 - PWM2->TBCTR = 0x0000; // Clear counter - // Setup counter mode - PWM2->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 - PWM2->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // Count up-down - PWM2->TBCTL_bit.PHSEN = TB_ENABLE; // Enable phase loading - PWM2->TBCTL_bit.PHSDIR = TB_UP; // - PWM2->TBCTL_bit.HSPCLKDIV = 0; // High Speed Time-base Clock Prescale - PWM2->TBCTL_bit.CLKDIV = 0; // Time-base Clock Prescale - PWM2->TBCTL_bit.SYNCOSEL = TB_SYNC_IN; // - + // , PWM1 + //PWM2->TBCTL_bit.PRDLD = TB_SHADOW; // TBPRD TBCTR = 0 + //PWM2->TBCTL_bit.CTRMODE = TB_COUNT_UPDOWN; // Count up-down + //PWM2->TBCTL_bit.PHSEN = TB_ENABLE; // Enable phase loading + //PWM2->TBCTL_bit.PHSDIR = TB_UP; // + //PWM2->TBCTL_bit.HSPCLKDIV = 0; // High Speed Time-base Clock Prescale + //PWM2->TBCTL_bit.CLKDIV = 0; // Time-base Clock Prescale + //PWM2->TBCTL_bit.SYNCOSEL = TB_SYNC_IN; // - + //PWM2->TBCTL_bit.FREESOFT = 2; // + //PWM2->TBCTL_bit.SHADOWGLOB = 1; // + PWM2->TBCTL = PWM1->TBCTL; - // Setup shadowing - PWM2->CMPCTL_bit.SHDWAMODE = CC_SHADOW; // SHADOW - PWM2->CMPCTL_bit.LOADAMODE = CC_CTR_ZERO; // Load on period and zero - - PWM2->CMPCTL_bit.SHDWBMODE = CC_SHADOW; // SHADOW - PWM2->CMPCTL_bit.LOADBMODE = CC_CTR_ZERO; // Load on period and zero - - // Set Compare values - PWM2->CMPA_bit.CMPA = 0; // Set compare A value - - // Set actions - PWM2->AQCTLA = AQ_EPWM_DISABLE; // - PWM2->AQCTLA_bit.ZRO = 1; // - PWM2->AQCTLA_bit.CAU = 2; // - PWM2->AQCTLA_bit.CAD = 1; // - - // PWMB , PWM. . - PWM2->AQCTLB = PWM0->AQCTLA; // PWM1B - PWM2->AQCTLB_bit.ZRO = PWM0->AQCTLA_bit.ZRO; // - PWM2->AQCTLB_bit.CAU = PWM0->AQCTLA_bit.CAU; // - PWM2->AQCTLB_bit.CAD = PWM0->AQCTLA_bit.CAD; // - - PWM2->AQSFRC_bit.RLDCSF = 0; // 0 - - // Active high complementary PWMs - Setup Deadband + // , , + // TZ , PWM0 PWM1 + PWM2->CMPCTL = PWM0->CMPCTL; + PWM2->AQCTLA = PWM0->AQCTLA; PWM2->DBRED = PWM0->DBRED; - PWM2->DBFED = PWM2->DBRED; - PWM2->DBCTL_bit.INMODE = PWM0->DBCTL_bit.INMODE; - PWM2->DBCTL_bit.OUTMODE = PWM0->DBCTL_bit.OUTMODE; - PWM2->DBCTL_bit.POLSEL = PWM0->DBCTL_bit.POLSEL; + PWM2->DBFED = PWM0->DBFED; + PWM2->DBCTL = PWM0->DBCTL; + PWM2->TZCTL = PWM0->TZCTL; + PWM2->ETSEL = PWM0->ETSEL; - // Interrupt where we will change the Compare Values - PWM2->ETSEL_bit.INTSEL = ET_DISABLE; // Disable INT - PWM2->ETSEL_bit.INTEN = 0; // Disable INT - - // Trip-Zone - PWM2->TZCTL_bit.TZA = TZ_STATE; // "One-Shot Trip" - PWM2->TZCTL_bit.TZB = TZ_STATE; // + // + PWM2->CMPA_bit.CMPA = 0; + PWM2->AQSFRC_bit.RLDCSF = 0; // @@ -231,12 +199,8 @@ void PWM_Module_Init(TPWM_Module *p) { PWM1->TZFRC_bit.OST = 1; PWM2->TZFRC_bit.OST = 1; - - - //PWM0->TBCTL_bit.FREESOFT = 0; // 6 GPIOA->ALTFUNCSET = (1 << 8) + (1 << 9) + (1 << 10) + (1 << 11) + (1 << 12) + (1 << 13); - GPIOA->DENSET = (1 << 8) + (1 << 9) + (1 << 10) + (1 << 11) + (1 << 12) + (1 << 13); // SIU->PWMSYNC_bit.PRESCRST= 0b111; @@ -480,7 +444,8 @@ void PWM_Module_Sin_Update(TPWM_Module *p) { //! \memberof TPWM_Module void PWM_Module_Separate_Update(TPWM_Module *p) { - _iq PhasePtsA; + // +/* _iq PhasePtsA; _iq PhasePtsB; _iq PhasePtsC; _iq knorm; @@ -497,7 +462,7 @@ void PWM_Module_Separate_Update(TPWM_Module *p) { p->GammaB = _IQmpy(p->k_pwm, PhasePtsB); p->GammaC = _IQmpy(p->k_pwm, PhasePtsC); - /* */ + // if (p->GammaA < 0) p->GammaA = 0; @@ -506,7 +471,7 @@ void PWM_Module_Separate_Update(TPWM_Module *p) { if (p->GammaC < 0) p->GammaC = 0; - if (p->GammaA > p->k_pwm) + if (p->GammaA > p->k_pwm) p->GammaA = p->k_pwm + 1; if (p->GammaB > p->k_pwm) p->GammaB = p->k_pwm + 1; @@ -516,7 +481,7 @@ void PWM_Module_Separate_Update(TPWM_Module *p) { PWM0->CMPA_bit.CMPA = (Uint16) p->GammaB; PWM1->CMPA_bit.CMPA = (Uint16) p->GammaC; PWM2->CMPA_bit.CMPA = (Uint16) p->GammaA; - +*/ } //! @@ -555,8 +520,10 @@ void PWM_Module_Update(TPWM_Module *p) { PWM_Module_Sin_Update(p); break; } - case PWM_TYPE_SRD: { - PWM_Module_Separate_Update(p); + default: { + // + p->PWM_type = PWM_TYPE_6SECT_NO_SV; + PWM_Module_No_SV_Update(p); break; } } @@ -610,15 +577,6 @@ void PWM_Module_SlowCalc(TPWM_Module *p) { PWM2->TBPRD = p->k_pwm; - // , - adc.IASampleLength = (p->Frequency >> 10) / 10; // 22.10, 10 - - if (adc.IASampleLength > 4) // 4 - adc.IASampleLength = 4; - if (adc.IASampleLength < 1) // 1 - adc.IASampleLength = 1; - adc.IBSampleLength = adc.IASampleLength; - adc.ICSampleLength = adc.IASampleLength; - adc.UdcSampleLength = adc.IASampleLength; p->FreqPrev = p->Frequency; // EINT; diff --git a/Vsrc/V_QEP.c b/Vsrc/V_QEP.c index 2a8e7d6..d7e193b 100644 --- a/Vsrc/V_QEP.c +++ b/Vsrc/V_QEP.c @@ -80,10 +80,11 @@ void TposspeedEqep_init(TposspeedEqep *p) { p->resol_inv = 1.0 / ((float) p->resol); + p->Index_eventCounter = 0; + // GPIOB->ALTFUNCSET = (1 << 11) + (1 << 12) + (1 << 13); SIU->REMAPAF_bit.QEPEN = 1; - GPIOB->DENSET = (1 << 11) + (1 << 12) + (1 << 13);// . } //! , @@ -305,6 +306,7 @@ void TposspeedEqep_Calc(TposspeedEqep *p) { //! \memberof TposspeedEqep void TposspeedEqep_IndexEvent(TposspeedEqep *p) { p->Posspeed_FLG2.bit.pos_ident = 1; + p->Index_eventCounter++; } //! \memberof TposspeedEqep diff --git a/Vsrc/V_RTC_Clock.c b/Vsrc/V_RTC_Clock.c deleted file mode 100644 index 5189ce9..0000000 --- a/Vsrc/V_RTC_Clock.c +++ /dev/null @@ -1,206 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file V_RTC_Clock.c - \brief - \author " ". http://motorcontrol.ru - \version v 2.0 25/03/2016 - - */ - -/* - - * - * DS1340 10 / (0x0 ... 0x9). - * 0x0 ... 0x6. - * , ., 0x7 ... 0x9. - * , . - * - , - * , . , - * . , - * , . "" - * , - * (, 0x5) - * 0x5 -> 0x6 -> 0x7 -> 0x0 -> 0x1 -> ... -> 0x7 -> 0x0 - * , . - * - * , , . - * , -, - * , . - * , . - * - * - . - */ - -// (NT_RTC RTC_REG). - . -#include -#include -// . - , -// . - ( ) -//#define USE_RTC - -/* RTC */ -void RTC_Clock_Init(TRTCClock *p) { - -} - -/* */ -void RTC_Clock_Read_Time(TRTCClock *p) { -// Uint16 tempSec, tempMin, tempHour, tempDOW, tempDay, tempMonth, tempYear; -// -// /* */ -// NT_RTC->SHDW = 0x0; -// -// /* */ -// tempSec = NT_RTC->SECOND; -// tempMin = NT_RTC->MINUTE; -// tempHour = NT_RTC->HOUR; -// tempDOW = NT_RTC->WDAY; -// tempDay = NT_RTC->DAY; -// tempMonth = NT_RTC->MONTH; -// tempYear = NT_RTC->YEAR; -// -// /* */ -//// NT_RTC->SHDW = 0x80; -// -// // , .. - () -// p->second = (tempSec & 0xF) + (((tempSec & 0x70) >> 4) * 10); -// p->minute = (tempMin & 0xF) + (((tempMin & 0x70) >> 4) * 10); -// p->hour = (tempHour & 0xF) + (((tempHour & 0x30) >> 4) * 10); -// p->DOW = (tempDOW & 0x7); -// p->day = (tempDay & 0xF) + (((tempDay & 0x30) >> 4) * 10); -// p->month = (tempMonth & 0xF) + (((tempMonth & 0x10) >> 4) * 10); -// p->year = (tempYear & 0xF) + (((tempYear & 0xF0) >> 4) * 10); -// -// // , -// p->packed_time = ((Uint32) p->day << 27) + ((Uint32) p->month << 23) -// + ((Uint32) p->year << 17) + ((Uint32) p->hour << 12) -// + ((Uint32) p->minute << 6) + (Uint32) p->second; - -} - -/* */ -void RTC_Clock_Set_Time(TRTCClock *p) { -// // (, , ...) -// unsigned char tempSec, tempMin, tempHour, tempDOW, tempDay, tempMonth, -// tempYear; -// p->tryCounter = 0; -// -// // -// p->second = p->timeToSet & 0x3F; -// p->minute = (p->timeToSet >> 6) & 0x3F; -// p->hour = (p->timeToSet >> 12) & 0x1F; -// p->year = (p->timeToSet >> 17) & 0x3F; -// p->month = (p->timeToSet >> 23) & 0xF; -// p->day = (p->timeToSet >> 27) & 0x1F; -// -// tempSec = ((p->second / 10) << 4) + ((p->second % 10) & 0xF); -// tempMin = ((p->minute / 10) << 4) + ((p->minute % 10) & 0xF); -// tempHour = ((p->hour / 10) << 4) + ((p->hour % 10) & 0xF); -// tempDOW = p->DOW & 0x3; -// tempDay = ((p->day / 10) << 4) + ((p->day % 10) & 0xF); -// tempMonth = ((p->month / 10) << 4) + ((p->month % 10) & 0xF); -// tempYear = ((p->year / 10) << 4) + ((p->year % 10) & 0xF); -// -// p->msInDay = (Uint32) p->hour * 3600000 + (Uint32) p->minute * 60000 -// + (Uint32) p->second * 1000; -// -// // () -// int16 a = (14 - p->month) / 12; -// int16 y = p->year - a; -// int16 m = p->month + 12 * a - 2; -// p->DOW = (7000 + (p->day + y + y / 4 - y / 100 + y / 400 + (31 * m) / 12)) -// % 7; -// -// NT_RTC->YEAR = tempYear; -// NT_RTC->MONTH = tempMonth; -// NT_RTC->DAY = tempDay; -// NT_RTC->WDAY = tempDOW; -// NT_RTC->HOUR = tempHour; -// NT_RTC->MINUTE = tempMin; -// NT_RTC->SECOND = tempSec; -} - -void RTC_Clock_Ms_Calc(TRTCClock *p) { - p->ms++; - p->msInDay++; -#ifdef USE_RTC - if (p->ms > 999) { - p->ms = 0; - p->readTimeFlag = 1; - } - - // , , - if (p->secondPrev == p->second) // - p->stoppedCounter++; //, - else //, - p->stoppedCounter = 0; - - if ((p->stoppedCounter < RTC_SECOND_WAITING_TIMEOUT) && (p->year<48)) // - 2048 ( ) - p->ClockOk=1; - - else - { - p->ClockOk=0; - p->stoppedCounter = RTC_SECOND_WAITING_TIMEOUT; - } - p->secondPrev = p->second; - - - - - -#else - - if (p->ms == 1000) { - p->ms = 0; - p->second++; - - if (p->second == 60) { - p->second = 0; - p->minute++; - if (p->minute == 60) { - p->minute = 0; - p->hour++; - if (p->hour == 24) { - p->hour = 0; - p->msInDay = 0; - p->day++; - } - } - } - p->packed_time = ((Uint32)p->day << 27) + ((Uint32)p->month << 23) + ((Uint32)p->year << 17) + - ((Uint32)p->hour << 12) + ((Uint32)p->minute << 6) + (Uint32)p->second; - } - -#endif - -} - -void RTC_Clock_Slow_Calc(TRTCClock *p) { - if (p->setTimeFlag == 1) { - p->timeToSet = p->packed_time; - p->set(p); - p->read(p); - p->msInDay = (Uint32) p->hour * 3600000 + (Uint32) p->minute * 60000 - + (Uint32) p->second * 1000; - p->setTimeFlag = 0; - } else if (p->readTimeFlag == 1) { - p->read(p); - p->readTimeFlag = 0; - } -} - - diff --git a/Vsrc/V_SSI_Encoder.c b/Vsrc/V_SSI_Encoder.c index e6f239c..01cbb8a 100644 --- a/Vsrc/V_SSI_Encoder.c +++ b/Vsrc/V_SSI_Encoder.c @@ -32,71 +32,59 @@ //! \memberof TSSI_Encoder void SSI_Encoder_init(TSSI_Encoder *p) { -// volatile long delay; -// volatile Uint32 tempREG; -// -// //SPI-SOMI - VectorCard 88, B15, SPI_RXD2 -// //SPI-SIMO - VectorCard 38, C6, SPI_TXD2 -// //SPI-CLK - VectorCard 39, B14, SPI_CLK2 -// //SPI-STE - VectorCard 89, B13, SPI_FSS2 -// // texas DRV8301-HC-EVM , - . -// // . . -// -// // SPI -// GPIOB->ALTFUNCSET = (1 << 13);//- -// GPIOB->ALTFUNCSET = (1 << 14) | (1 << 15); -// NT_GPIOC->ALTFUNCSET = (1 << 6);//SIMO -// NT_COMMON_REG->GPIOPCTLB_bit.PIN13 = 2;//- -// NT_COMMON_REG->GPIOPCTLB_bit.PIN14 = 2; -// NT_COMMON_REG->GPIOPCTLB_bit.PIN15 = 2; -// NT_COMMON_REG->GPIOPCTLC_bit.PIN6 = 2;//SIMO -// -// -// // SSP -// // 4 , 8 SSP_CLK_CTRL UART_SSP_CLK_SEL -// -// // UART_SSP_CLK_SEL -// // 4- SSP 0x0000XX00 -// // "00" - SSP 100 , f_SSP_IN = SysClk = 100 MHz -// -// // SSP_CLK_CTRL -// // (1 - ) -// // f_SSP_IN (0 - , 1 - ) -// // : -// // X - SSPclk = f_SSP_IN /( 2 * (X +1) ) -// // SSP - , -// // f_SSP_IN > 22.12 MHz, 25 -// /* , DRV8301_SPI -// tempREG = NT_COMMON_REG->UART_SPI_CLK_SEL;// tempREG, , UART'a -// tempREG &= 0xFFFF00FF; -// NT_COMMON_REG->UART_SPI_CLK_SEL = tempREG; -// NT_COMMON_REG->SPI_CLK = 0x07070707;// , , 4 - 25 -// */ -// -// -// // SPI -// // . -// // f_SSP_IN . -// // SSPCPSR - , 2 ... 254, ( 0) -// // SSPCR0.bit.SCR - 0 255. -// // BitRate = f_SSP_IN / ( SSPCPSR * (SCR + 1) ) -// -// SPI2->SPI_CR1 = 0;// - , LoopBack , SSP -// SPI2->SPI_IMSC = 0x0; // -// SPI2->SPI_DMACR = 0; // DMA -// SPI2->SPI_ICR = 0x3; // (" FIFO " " FIFO ") -// -// SPI2->SPI_CPSR = 4; // 4 -> 6,25 MHz -// SPI2->SPI_CR0_bit.DSS = 12; // - 12 -// SPI2->SPI_CR0_bit.SCR = 0x3F; // -// SPI2->SPI_CR0_bit.FRF = 0x0; // - "" Motorola SPI -// SPI2->SPI_CR0_bit.SPH = 0x1; // - "" Motorola SPI -// SPI2->SPI_CR0_bit.SPO = 0x0; // Motorola/TI/Microwire. "0" - Motorola SPI -// SPI2->SPI_CR1_bit.SSE = 1; // -// -// p->resol_inv = 1.0 / ((float) p->resol); -// -// p->read(p); + volatile long delay; + volatile Uint32 tempREG; + + // SPI + GPIOB->ALTFUNCSET = (1 << 5) | (1 << 6); // (SPI_SCK) + + // SPI + // SPI "src/system_K1921VK035.c" fIN = 25 + // . + // SSPCPSR - , 2 ... 254, ( 0) + // SSPCR0.bit.SCR - 0 255. + // BitRate = fIN / ( CPSR * (SCR + 1) ) + + SPI->IMSC = 0x0; // + SPI->DMACR = 0; // DMA + SPI->ICR = 0x3; // (" FIFO " " FIFO ") + + SPI->CPSR = 4; // 4 + + + + // CR0 , . + // + // = 62, f_ssp = 25 / (4 * (62 + 1)) = 99,2 + // + // SPI + // : + // , . + // , + // . , + // . + // , . + // + // 1 , , (12 + 1) = 13 , + // + // , + //SPI->CR0_bit.FRF = 0x0; // SSI SPI, , + //SPI->CR0_bit.SPO = 0x0; // CLK ( ) + //SPI->CR0_bit.SPH = 0x0; // ( ) + //SPI->CR0_bit.SCR = 62; // = 62 + 1 = 63 + //SPI->CR0_bit.DSS = SSI_ENC_RESOLUTION; // 12 + 1 = 13 + SPI->CR0 = (SSI_ENC_RESOLUTION << SPI_CR0_DSS_Pos) | (62 << SPI_CR0_SCR_Pos); + + // , , + // + //SPI->CR1_bit.MS = 0; // - + //SPI->CR1_bit.RXIFLSEL = 0; // FIFO = 0 (FIFO ) + //SPI->CR1_bit.TXIFLSEL = 0; // FIFO = 0 (FIFO ) + //SPI->CR1_bit.SSE = 1; // SPI + SPI->CR1 = (1 << SPI_CR1_SSE_Pos); + p->resol_inv = 1.0 / ((float) p->resol); + + p->read(p); } @@ -110,51 +98,51 @@ void SSI_Encoder_Calc(TSSI_Encoder *p) { void SSI_Encoder_Read(TSSI_Encoder*p) { -// _iq theta_elec_temp; -// Uint16 Data_read=0; -// _iq theta_mech_temp; -// -// if (SPI2->SPI_SR_bit.BSY == 0){//SPI -// Data_read = SPI2->SPI_DR;// ( 0 resol) -// SPI2->SPI_DR = 0xff;// , , -// -// -// if (p->rotation_dir)// -// Data_read=(p->resol-1)-Data_read;// - -// p->Poscnt_res=Data_read; -// } -// -// // -// // float - IQ -// p->theta_mech = _IQ((float )p->Poscnt_res * p->resol_inv); // -// p->theta_mech &= 0x00FFFFFF; -// // -// if (p->theta_mech_filterK!=0){ -// p->theta_mech_filtered=p->theta_mech_filtered+_IQmpy(p->theta_mech_filterK,((p->theta_mech-p->theta_mech_filtered+_IQ(0.5))&0x00FFFFFF)-_IQ(0.5)); -// p->theta_mech_filtered&=0x00FFFFFF; -// }else -// p->theta_mech_filtered=p->theta_mech; -// -// // . -// if (p->prevThetaMech - p->theta_mech_filtered > _IQ(0.5)) -// p->RevolutionCounter++; -// if (p->prevThetaMech - p->theta_mech_filtered < _IQ(-0.5)) -// p->RevolutionCounter--; -// p->prevThetaMech=p->theta_mech_filtered; -// -// // , -// p->Poscnt_resContinouosLong=p->Poscnt_res+(p->resol*p->RevolutionCounter); -// p->Poscnt_resContinouosInt=p->Poscnt_resContinouosLong;// 16 -// p->Poscnt_resContinouosInt8=p->Poscnt_resContinouosLong&0xF;// -// -// // ( ) -// // 127 , -// p->theta_mechContinouos = p->theta_mech_filtered + _IQ(p->RevolutionCounter); // -// p->theta_elecContinouos = p->theta_mechContinouos*p->pole_pairs+ p->AngleOffset;// ( ) -// -// // 360 -// p->theta_el_tmp = p->theta_mech_filtered*p->pole_pairs + p->AngleOffset; -// p->theta_elec = p->theta_el_tmp & 0x00FFFFFF; + _iq theta_elec_temp; + Uint16 Data_read=0; + _iq theta_mech_temp; + + if (SPI->SR_bit.BSY == 0){//SPI + Data_read = SPI->DR & SSI_ENC_DATA_MASK;// ( 0 resol) + SPI->DR = 0xff;// , , + + + if (p->rotation_dir)// + Data_read=(p->resol-1)-Data_read;// - + p->Poscnt_res=Data_read; + } + + // + // float - IQ + p->theta_mech = _IQ((float )p->Poscnt_res * p->resol_inv); // + p->theta_mech &= 0x00FFFFFF; + // + if (p->theta_mech_filterK!=0){ + p->theta_mech_filtered=p->theta_mech_filtered+_IQmpy(p->theta_mech_filterK,((p->theta_mech-p->theta_mech_filtered+_IQ(0.5))&0x00FFFFFF)-_IQ(0.5)); + p->theta_mech_filtered&=0x00FFFFFF; + }else + p->theta_mech_filtered=p->theta_mech; + + // . + if (p->prevThetaMech - p->theta_mech_filtered > _IQ(0.5)) + p->RevolutionCounter++; + if (p->prevThetaMech - p->theta_mech_filtered < _IQ(-0.5)) + p->RevolutionCounter--; + p->prevThetaMech=p->theta_mech_filtered; + + // , + p->Poscnt_resContinouosLong=p->Poscnt_res+(p->resol*p->RevolutionCounter); + p->Poscnt_resContinouosInt=p->Poscnt_resContinouosLong;// 16 + p->Poscnt_resContinouosInt8=p->Poscnt_resContinouosLong&0xF;// + + // ( ) + // 127 , + p->theta_mechContinouos = p->theta_mech_filtered + _IQ(p->RevolutionCounter); // + p->theta_elecContinouos = p->theta_mechContinouos*p->pole_pairs+ p->AngleOffset;// ( ) + + // 360 + p->theta_el_tmp = p->theta_mech_filtered*p->pole_pairs + p->AngleOffset; + p->theta_elec = p->theta_el_tmp & 0x00FFFFFF; } diff --git a/Vsrc/V_UdControl.c b/Vsrc/V_UdControl.c new file mode 100644 index 0000000..85ac4b3 --- /dev/null +++ b/Vsrc/V_UdControl.c @@ -0,0 +1,129 @@ +/*! + Copyright 2017 "" " " + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + \file V_UdControl.c + \brief + \author " ". http://motorcontrol.ru + \version v 1.0 25/08/2017 + + \addtogroup + @{*/ + + +#include "main.h" + + +#if defined (HW_MOTORCONTROLBOARD) +#define UD_CONTROL_OFF GPIOB->DATAOUTCLR = (1 << 10); +#define UD_CONTROL_ON GPIOB->DATAOUTSET = (1 << 10); +#else +#define UD_CONTROL_OFF // +#define UD_CONTROL_ON // +#endif + +//!. +//! , . + +//! \memberof TUdControl +void UdControl_init(TUdControl *p) { + +#ifdef HW_MOTORCONTROLBOARD + p->Enabled = 1; // + + // , + GPIOB->ALTFUNCCLR = (1 << 10); // GPIO + GPIOB->OUTENSET = (1 << 10); // + + UD_CONTROL_OFF; // + p->state = UD_CONTROL_STATE_OFF; // "" + p->StateOn = 0; +#else + p->Enabled = 0; // +#endif +} + +//!. + +//! , . - +//! ( 10). , 1, +//! . : , . +//! . + +//! \memberof TUdControl +void UdControl_calc(TUdControl *p) { + if (p->Enabled){// + p->fUdc.input = adc.Udc_meas; // - + p->fUdc.calc(&(p->fUdc)); + // + + if (p->state_prev != p->state) + p->E = 1; // + else + p->E = 0; + p->state_prev = p->state; + + + switch (p->state) { + case UD_CONTROL_STATE_OFF: // + { + UD_CONTROL_OFF; // + p->StateOn = 0; // + if (adc.Udc_meas > p->U_on) // + p->state = UD_CONTROL_STATE_WAIT; // + break; + } + + case UD_CONTROL_STATE_WAIT: // , + { + if (p->E == 1) // + { + p->StateCounter = 0; + } + p->StateCounter += global_time.relative_time1.delta_millisecond; + UD_CONTROL_OFF; // + p->StateOn = 0; // + if (adc.Udc_meas < p->U_off) // , ... + p->state = UD_CONTROL_STATE_OFF; + + if (global_time.relative_time1.delta_millisecond) { // + // + p->deriv_time_ZPT = (labs(p->fUdc.output - p->fUdc_output_prev))<<11; // 1 + p->fUdc_output_prev = p->fUdc.output; + } + // + if ((p->StateCounter >= p->Timeout_on) && (p->deriv_time_ZPT < p->deriv_const) && (adc.Udc_meas > p->U_off)) { // + p->state = UD_CONTROL_STATE_ON; + p->StateCounter = 0; + } + break; + } + + case UD_CONTROL_STATE_ON: { + if ((adc.Udc_meas < p->U_off) && (drv_status.bit.running == 0)) //-, ... , + p->state = UD_CONTROL_STATE_OFF; + UD_CONTROL_ON; // + p->StateOn = 1; // + break; + + } + + } + } + + +} + +/*@}*/ + diff --git a/Vsrc/V_adc.c b/Vsrc/V_adc.c index 97bb3a6..ca5a60c 100644 --- a/Vsrc/V_adc.c +++ b/Vsrc/V_adc.c @@ -103,19 +103,18 @@ void AdcDrv_fast_calc(TAdcDrv *p) { p->IA_temp = ADC->SEQ[0].SFIFO; p->IB_temp = ADC->SEQ[0].SFIFO; p->Udc_temp = ADC->SEQ[0].SFIFO; - p->T_temp = ADC->SEQ[0].SFIFO; + p->AI_temp = ADC->SEQ[0].SFIFO; // FIFO , - ( ) while (ADC->SEQ[0].SFLOAD) trash = ADC->SEQ[0].SFIFO; - p->Imeas_a = p->IaGainNom * (((p->IA_temp<< 4) + p->Imeas_a_offset)); - p->Imeas_b = p->IbGainNom * (((p->IB_temp<< 4) + p->Imeas_b_offset)); + p->Imeas_a = p->IaGainNom * ((p->IA_temp<< 4) + p->Imeas_a_offset); + p->Imeas_b = p->IbGainNom * ((p->IB_temp<< 4) + p->Imeas_b_offset); p->Udc_meas = p->UdcGainNom * (p->Udc_temp + p->Udc_meas_offset); p->Imeas_c = -p->Imeas_a - p->Imeas_b; - p->T_meas = p->T_temp * p->TGainNom; + p->AI_meas = p->AI_temp * p->AIGainNom; - //ADC->SEQ[0].SCCTL_bit.RAVGEN ^= 1; } //! . @@ -172,9 +171,8 @@ void AdcDrv_slow_calc(TAdcDrv *p) { p->IaGainNom = _IQ16mpy(p->Imeas_a_gain, drv_params._1_I_nom) << 1; p->IbGainNom = _IQ16mpy(p->Imeas_b_gain, drv_params._1_I_nom) << 1; - p->IcGainNom = _IQ16mpy(p->Imeas_c_gain, drv_params._1_I_nom) << 1; p->UdcGainNom = _IQ16mpy(p->Udc_meas_gain, drv_params._1_Udc_nom) << 4; - p->TGainNom = _IQ16mpy(p->T_meas_gain,_IQ(0.05)) << 4; + p->AIGainNom = _IQ16mpy(p->AI_meas_gain, _IQ(1)) << 4; } //! diff --git a/Vsrc/V_i2cMem.c b/Vsrc/V_i2cMem.c index f108954..fca28ab 100644 --- a/Vsrc/V_i2cMem.c +++ b/Vsrc/V_i2cMem.c @@ -248,8 +248,7 @@ Uint16 i2c_readArray(Uint16 address, Uint16* readDataPtr_u16, Uint16 length_u8){ // I2C GPIO, void I2CMEM_Init(TI2cMem*p){ // 0 1 - GPIOA->DENSET |= 0x3; - GPIOA->ALTFUNCSET |= 0x3; + GPIOA->ALTFUNCSET = 0x3; // I2C // Fi2c = Fcpu / (4 * SCLFRQ), Fcpu 035 = 100 diff --git a/Vsrc/V_led.c b/Vsrc/V_led.c deleted file mode 100644 index eaf49b3..0000000 --- a/Vsrc/V_led.c +++ /dev/null @@ -1,78 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file Vled.c - \brief - \author " ". http://motorcontrol.ru - \version v 2.0 25/03/2016 - - \addtogroup led - */ - -#include "DSP.h" -#include "main.h" - - -void LED_init(Tled *p) { - -} - -void LED_toggle(Tled *p, Uint16 led) { - -} - -void LED_on(Tled *p, Uint16 led) { - -} - -void LED_off(Tled *p, Uint16 led) { - -} - -void LED_clearAll(Tled *p) { - -} - -void LED_mode0(Tled *p) { - -} - -void LED_mode1(Tled *p) { - -} - -void LED_mode2(Tled *p) { - -} - -void LED_mode3(Tled *p) { - -} - -void LED_msCalc(Tled *p) { - -} - - - - - - - - - - - - diff --git a/Vsrc/V_pid_reg3_pos.c b/Vsrc/V_pid_reg3_pos.c deleted file mode 100644 index 64060e0..0000000 --- a/Vsrc/V_pid_reg3_pos.c +++ /dev/null @@ -1,109 +0,0 @@ -/*! - Copyright 2017 "" " " - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - \file V_pid_reg3.c - \brief - (. TPidReg3) - \author " ". http://motorcontrol.ru - \version v 2.0 25/03/2016 - - \addtogroup V_pid_reg3 - @{*/ - -#include "V_IQmath.h" // Include header for IQmath library -#include "V_pid_reg3_pos.h" -#include "stdlib.h" -#include "main.h" -//! -//! -//! , pid_reg3.pdf - -//! pid_ref_reg3 - , pid_fdb_reg3 - -//! pid_out_reg3. - -//! \memberof TPidReg3 -void pid_reg3_calc_pos(TPidReg3_pos *v) { - v->e_reg3 = v->pid_ref_reg3 - v->pid_fdb_reg3;// - - v->e_reg3Dz=v->e_reg3;// - - if (v->DeadZone!=0){// - if (v->e_reg3Dz>0){// - v->e_reg3Dz=v->e_reg3Dz-v->DeadZone;// - if (v->e_reg3Dz<0)// , - v->e_reg3Dz=0; - } - if (v->e_reg3Dz<0){ - v->e_reg3Dz=v->e_reg3Dz+v->DeadZone; - if (v->e_reg3Dz>0) - v->e_reg3Dz=0; - } - } - - v->up_reg3 = _IQmpy(v->Kp_reg3, v->e_reg3Dz); - - v->uprsat_reg3 = v->up_reg3 + v->ui_reg3 + v->ud_reg3; - - if (v->uprsat_reg3 > v->pid_out_max) - v->pid_out_reg3 = v->pid_out_max; - else if (v->uprsat_reg3 < v->pid_out_min) - v->pid_out_reg3 = v->pid_out_min; - else - v->pid_out_reg3 = v->uprsat_reg3; - - v->saterr_reg3 = v->pid_out_reg3 - v->uprsat_reg3 + v->saterr_reg3Add; - - // . . , . - if (v->Kf_d == 0){ - v->e_reg3_filterOut = v->e_reg3;// - } - else{// - v->e_reg3_filterOut = posspeedEqep.speed_elec; - } - - if ((v->DiffCounter++ + 1) >= v->DiffDelim) {// . - if (v->KdFilterInitFlag==1){// - v->e_reg3_filterOut = posspeedEqep.speed_elec;// - v->KdFilterInitFlag=0;// - } - //v->ud_reg3 = _IQmpy(v->Kd_reg3, (v->e_reg3_filterOut - v->up1_reg3)<<6);// - v->ud_reg3 = _IQmpy(v->Kd_reg3,-posspeedEqep.speed_filter.output); - v->DiffCounter = 0; - } - - if (v->Ki_reg3 != 0)// - v->ui_reg3 = v->ui_reg3 - + _IQmpy(v->Ki_reg3, - v->up_reg3) + _IQmpy(v->Kc_reg3,v->saterr_reg3); - else - v->ui_reg3 = 0; - - if (v->Kc_reg3 == 0) { - if (v->ui_reg3 > v->pid_out_max) - v->ui_reg3 = v->pid_out_max; - else if (v->ui_reg3 < v->pid_out_min) - v->ui_reg3 = v->pid_out_min; - } - -} - - -//! \memberof TPidReg3 -void pid_reg3_reset_pos(TPidReg3_pos *v) { - v->pid_fdb_reg3=0; - v->pid_ref_reg3=0; - v->ui_reg3=0; - v->KdFilterInitFlag=1; -} - -/*@}*/ diff --git a/Vsrc/cood1.c b/Vsrc/cood1.c index 02caf91..0a2a350 100644 --- a/Vsrc/cood1.c +++ b/Vsrc/cood1.c @@ -1,7 +1,7 @@ // : -// : D:\GIT\motorcontroldemo_035\cood.xml +// : W:\ProjectsGit\motorcontroldemo_035\cood.xml // : -// : 24.09.2019 11:31:33 +// : 25.12.2020 9:40:25 // : default // COODEdit Basic v.7.3.8 #include "DSP.h" @@ -9,655 +9,670 @@ #include "cood1.h" #include "co_ODvars.h" -// 119 -// 741 -Uint16 const co1_numOfInd = 119; +// 122 +// 760 +Uint16 const co1_numOfInd = 122; // Uint16 const co1_groupEnum = 15; // -: -Uint32 const co1_odHash[4] = {0x9F1C7C00, 0x93ACC9A0, 0x52405691, 0x7C174CEB}; +Uint32 const co1_odHash[4] = {0x5997F190, 0x22AC056B, 0xB47A12F6, 0xCDE7A7F7}; // long const CO1_OD_TBL3[] = { -(long)(&co1_vars.co_deviceType), //[1000h.00h], : , : Device Type, : CAN -(long)(&co1_vars.co_errorRegister), //[1001h.00h], : , : ErrReg, : CAN -(long)(&co1_vars.co_deviceState), //[1002h.00h], : Manufacturer Status Register, : DevSta, : CAN -(long)(&co1_vars.co_emcyCOBID), //[1014h.00h], : COB-ID Emergency Object, : eCOBID, : CAN -(long)(&co1_vars.co_CHBT), //[1016h.01h], : Heartbeat, : CHBT, : CAN -(long)(&co1_vars.co_PHBT), //[1017h.00h], : Heartbeat, : PHBT, : CAN -(long)(&co1_vars.co_vendorID), //[1018h.01h], : , : VendID, : CAN -(long)(&co1_vars.co_productCode), //[1018h.02h], : , : PrCode, : CAN -(long)(&co1_vars.co_revisionNumber), //[1018h.03h], : , : RevNum, : CAN -(long)(&co1_vars.co_serialNumber), //[1018h.04h], : , : SerNum, : CAN -(long)(&co1_vars.co_csrxCOBID), //[1200h.01h], : COB-ID Client->Server(rx), : CSRXID, : CAN -(long)(&co1_vars.co_sctxCOBID), //[1200h.02h], : COB-ID Server->Client(tx), : SCTXID, : CAN -(long)(&co1_vars.co_cstxCOBID), //[1280h.01h], : COB-ID Client->Server(tx), : CSTXID, : CAN -(long)(&co1_vars.co_scrxCOBID), //[1280h.02h], : COB-ID Server->Client(rx), : SCRXID, : CAN -(long)(&co1_vars.co_ssNODEID), //[1280h.03h], : NODE-ID on SDO server, : SDOSID, : CAN -(long)(&co1_vars.co_RPDO1COBID), //[1400h.01h], : COB-ID for RPDO1, : IRPDO1, : CAN -(long)(&co1_vars.co_transType), //[1400h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO2COBID), //[1401h.01h], : COB-ID for RPDO2, : IRPDO2, : CAN -(long)(&co1_vars.co_transType), //[1401h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO3COBID), //[1402h.01h], : COB-ID for RPDO3, : IRPDO3, : CAN -(long)(&co1_vars.co_transType), //[1402h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO4COBID), //[1403h.01h], : COB-ID for RPDO4, : IRPDO4, : CAN -(long)(&co1_vars.co_transType), //[1403h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO5COBID), //[1404h.01h], : COB-ID for RPDO5, : IRPDO5, : CAN -(long)(&co1_vars.co_transType), //[1404h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO6COBID), //[1405h.01h], : COB-ID for RPDO6, : IRPDO6, : CAN -(long)(&co1_vars.co_transType), //[1405h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO7COBID), //[1406h.01h], : COB-ID for RPDO7, : IRPDO7, : CAN -(long)(&co1_vars.co_transType), //[1406h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO8COBID), //[1407h.01h], : COB-ID for RPDO8, : IRPDO8, : CAN -(long)(&co1_vars.co_transType), //[1407h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_RPDO1_1Mapping), //[1600h.01h], : RPDO1-1 Mapping, : RPM11, : CAN -(long)(&co1_vars.co_RPDO1_2Mapping), //[1600h.02h], : RPDO1-2 Mapping, : RPM12, : CAN -(long)(&co1_vars.co_RPDO1_3Mapping), //[1600h.03h], : RPDO1-3 Mapping, : RPM13, : CAN -(long)(&co1_vars.co_RPDO1_4Mapping), //[1600h.04h], : RPDO1-4 Mapping, : RPM14, : CAN -(long)(&co1_vars.co_RPDO2_1Mapping), //[1601h.01h], : RPDO2-1 Mapping, : RPM21, : CAN -(long)(&co1_vars.co_RPDO2_2Mapping), //[1601h.02h], : RPDO2-2 Mapping, : RPM22, : CAN -(long)(&co1_vars.co_RPDO2_3Mapping), //[1601h.03h], : RPDO2-3 Mapping, : RPM23, : CAN -(long)(&co1_vars.co_RPDO2_4Mapping), //[1601h.04h], : RPDO2-4 Mapping, : RPM24, : CAN -(long)(&co1_vars.co_RPDO3_1Mapping), //[1602h.01h], : RPDO3-1 Mapping, : RPM31, : CAN -(long)(&co1_vars.co_RPDO3_2Mapping), //[1602h.02h], : RPDO3-2 Mapping, : RPM32, : CAN -(long)(&co1_vars.co_RPDO3_3Mapping), //[1602h.03h], : RPDO3-3 Mapping, : RPM33, : CAN -(long)(&co1_vars.co_RPDO3_4Mapping), //[1602h.04h], : RPDO3-4 Mapping, : RPM34, : CAN -(long)(&co1_vars.co_RPDO4_1Mapping), //[1603h.01h], : RPDO4-1 Mapping, : RPM41, : CAN -(long)(&co1_vars.co_RPDO4_2Mapping), //[1603h.02h], : RPDO4-2 Mapping, : RPM42, : CAN -(long)(&co1_vars.co_RPDO4_3Mapping), //[1603h.03h], : RPDO4-3 Mapping, : RPM43, : CAN -(long)(&co1_vars.co_RPDO4_4Mapping), //[1603h.04h], : RPDO4-4 Mapping, : RPM44, : CAN -(long)(&co1_vars.co_RPDO5_1Mapping), //[1604h.01h], : RPDO5-1 Mapping, : RPM51, : CAN -(long)(&co1_vars.co_RPDO5_2Mapping), //[1604h.02h], : RPDO5-2 Mapping, : RPM52, : CAN -(long)(&co1_vars.co_RPDO5_3Mapping), //[1604h.03h], : RPDO5-3 Mapping, : RPM53, : CAN -(long)(&co1_vars.co_RPDO5_4Mapping), //[1604h.04h], : RPDO5-4 Mapping, : RPM54, : CAN -(long)(&co1_vars.co_RPDO6_1Mapping), //[1605h.01h], : RPDO6-1 Mapping, : RPM61, : CAN -(long)(&co1_vars.co_RPDO6_2Mapping), //[1605h.02h], : RPDO6-2 Mapping, : RPM62, : CAN -(long)(&co1_vars.co_RPDO6_3Mapping), //[1605h.03h], : RPDO6-3 Mapping, : RPM63, : CAN -(long)(&co1_vars.co_RPDO6_4Mapping), //[1605h.04h], : RPDO6-4 Mapping, : RPM64, : CAN -(long)(&co1_vars.co_RPDO7_1Mapping), //[1606h.01h], : RPDO7-1 Mapping, : RPM71, : CAN -(long)(&co1_vars.co_RPDO7_2Mapping), //[1606h.02h], : RPDO7-2 Mapping, : RPM72, : CAN -(long)(&co1_vars.co_RPDO7_3Mapping), //[1606h.03h], : RPDO7-3 Mapping, : RPM73, : CAN -(long)(&co1_vars.co_RPDO7_4Mapping), //[1606h.04h], : RPDO7-4 Mapping, : RPM74, : CAN -(long)(&co1_vars.co_RPDO8_1Mapping), //[1607h.01h], : RPDO8-1 Mapping, : RPM81, : CAN -(long)(&co1_vars.co_RPDO8_2Mapping), //[1607h.02h], : RPDO8-2 Mapping, : RPM82, : CAN -(long)(&co1_vars.co_RPDO8_3Mapping), //[1607h.03h], : RPDO8-3 Mapping, : RPM83, : CAN -(long)(&co1_vars.co_RPDO8_4Mapping), //[1607h.04h], : RPDO8-4 Mapping, : RPM84, : CAN -(long)(&co1_vars.co_TPDO1COBID), //[1800h.01h], : COB-ID for TPDO1, : ITPDO1, : CAN -(long)(&co1_vars.co_transType), //[1800h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO1ITime), //[1800h.03h], : Inhibit Time 1, : ITime1, : CAN -(long)(&co1_vars.co_compatEntry), //[1800h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO1EventTimer), //[1800h.05h], : Event Timer 1, : EvTmr1, : CAN -(long)(&co1_vars.co_TPDO2COBID), //[1801h.01h], : COB-ID for TPDO2, : ITPDO2, : CAN -(long)(&co1_vars.co_transType), //[1801h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO2ITime), //[1801h.03h], : Inhibit Time 2, : ITime2, : CAN -(long)(&co1_vars.co_compatEntry), //[1801h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO2EventTimer), //[1801h.05h], : Event Timer 2, : EvTmr2, : CAN -(long)(&co1_vars.co_TPDO3COBID), //[1802h.01h], : COB-ID for TPDO3, : ITPDO3, : CAN -(long)(&co1_vars.co_transType), //[1802h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO3ITime), //[1802h.03h], : Inhibit Time 3, : ITime3, : CAN -(long)(&co1_vars.co_compatEntry), //[1802h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO3EventTimer), //[1802h.05h], : Event Timer 3, : EvTmr3, : CAN -(long)(&co1_vars.co_TPDO4COBID), //[1803h.01h], : COB-ID for TPDO4, : ITPDO4, : CAN -(long)(&co1_vars.co_transType), //[1803h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO4ITime), //[1803h.03h], : Inhibit Time 4, : ITime4, : CAN -(long)(&co1_vars.co_compatEntry), //[1803h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO4EventTimer), //[1803h.05h], : Event Timer 4, : EvTmr4, : CAN -(long)(&co1_vars.co_TPDO5COBID), //[1804h.01h], : COB-ID for TPDO5, : ITPDO5, : CAN -(long)(&co1_vars.co_transType), //[1804h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO5ITime), //[1804h.03h], : Inhibit Time 5, : ITime5, : CAN -(long)(&co1_vars.co_compatEntry), //[1804h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO5EventTimer), //[1804h.05h], : Event Timer 5, : EvTmr5, : CAN -(long)(&co1_vars.co_TPDO6COBID), //[1805h.01h], : COB-ID for TPDO6, : ITPDO6, : CAN -(long)(&co1_vars.co_transType), //[1805h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO6ITime), //[1805h.03h], : Inhibit Time 6, : ITime6, : CAN -(long)(&co1_vars.co_compatEntry), //[1805h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO6EventTimer), //[1805h.05h], : Event Timer 6, : EvTmr6, : CAN -(long)(&co1_vars.co_TPDO7COBID), //[1806h.01h], : COB-ID for TPDO7, : ITPDO7, : CAN -(long)(&co1_vars.co_transType), //[1806h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO7ITime), //[1806h.03h], : Inhibit Time 7, : ITime7, : CAN -(long)(&co1_vars.co_compatEntry), //[1806h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO7EventTimer), //[1806h.05h], : Event Timer 7, : EvTmr7, : CAN -(long)(&co1_vars.co_TPDO8COBID), //[1807h.01h], : COB-ID for TPDO8, : ITPDO8, : CAN -(long)(&co1_vars.co_transType), //[1807h.02h], : , : TransT, : CAN -(long)(&co1_vars.co_TPDO8ITime), //[1807h.03h], : Inhibit Time 8, : ITime8, : CAN -(long)(&co1_vars.co_compatEntry), //[1807h.04h], : Compatibility Entry, : CompEn, : CAN -(long)(&co1_vars.co_TPDO8EventTimer), //[1807h.05h], : Event Timer 8, : EvTmr8, : CAN -(long)(&co1_vars.co_TPDO1_1Mapping), //[1A00h.01h], : TPDO1-1 Mapping, : TPM11, : CAN -(long)(&co1_vars.co_TPDO1_2Mapping), //[1A00h.02h], : TPDO1-2 Mapping, : TPM12, : CAN -(long)(&co1_vars.co_TPDO1_3Mapping), //[1A00h.03h], : TPDO1-3 Mapping, : TPM13, : CAN -(long)(&co1_vars.co_TPDO1_4Mapping), //[1A00h.04h], : TPDO1-4 Mapping, : TPM14, : CAN -(long)(&co1_vars.co_TPDO2_1Mapping), //[1A01h.01h], : TPDO2-1 Mapping, : TPM21, : CAN -(long)(&co1_vars.co_TPDO2_2Mapping), //[1A01h.02h], : TPDO2-2 Mapping, : TPM22, : CAN -(long)(&co1_vars.co_TPDO2_3Mapping), //[1A01h.03h], : TPDO2-3 Mapping, : TPM23, : CAN -(long)(&co1_vars.co_TPDO2_4Mapping), //[1A01h.04h], : TPDO2-4 Mapping, : TPM24, : CAN -(long)(&co1_vars.co_TPDO3_1Mapping), //[1A02h.01h], : TPDO3-1 Mapping, : TPM31, : CAN -(long)(&co1_vars.co_TPDO3_2Mapping), //[1A02h.02h], : TPDO3-2 Mapping, : TPM32, : CAN -(long)(&co1_vars.co_TPDO3_3Mapping), //[1A02h.03h], : TPDO3-3 Mapping, : TPM33, : CAN -(long)(&co1_vars.co_TPDO3_4Mapping), //[1A02h.04h], : TPDO3-4 Mapping, : TPM34, : CAN -(long)(&co1_vars.co_TPDO4_1Mapping), //[1A03h.01h], : TPDO4-1 Mapping, : TPM41, : CAN -(long)(&co1_vars.co_TPDO4_2Mapping), //[1A03h.02h], : TPDO4-2 Mapping, : TPM42, : CAN -(long)(&co1_vars.co_TPDO4_3Mapping), //[1A03h.03h], : TPDO4-3 Mapping, : TPM43, : CAN -(long)(&co1_vars.co_TPDO4_4Mapping), //[1A03h.04h], : TPDO4-4 Mapping, : TPM44, : CAN -(long)(&co1_vars.co_TPDO5_1Mapping), //[1A04h.01h], : TPDO5-1 Mapping, : TPM51, : CAN -(long)(&co1_vars.co_TPDO5_2Mapping), //[1A04h.02h], : TPDO5-2 Mapping, : TPM52, : CAN -(long)(&co1_vars.co_TPDO5_3Mapping), //[1A04h.03h], : TPDO5-3 Mapping, : TPM53, : CAN -(long)(&co1_vars.co_TPDO5_4Mapping), //[1A04h.04h], : TPDO5-4 Mapping, : TPM54, : CAN -(long)(&co1_vars.co_TPDO6_1Mapping), //[1A05h.01h], : TPDO6-1 Mapping, : TPM61, : CAN -(long)(&co1_vars.co_TPDO6_2Mapping), //[1A05h.02h], : TPDO6-2 Mapping, : TPM62, : CAN -(long)(&co1_vars.co_TPDO6_3Mapping), //[1A05h.03h], : TPDO6-3 Mapping, : TPM63, : CAN -(long)(&co1_vars.co_TPDO6_4Mapping), //[1A05h.04h], : TPDO6-4 Mapping, : TPM64, : CAN -(long)(&co1_vars.co_TPDO7_1Mapping), //[1A06h.01h], : TPDO7-1 Mapping, : TPM71, : CAN -(long)(&co1_vars.co_TPDO7_2Mapping), //[1A06h.02h], : TPDO7-2 Mapping, : TPM72, : CAN -(long)(&co1_vars.co_TPDO7_3Mapping), //[1A06h.03h], : TPDO7-3 Mapping, : TPM73, : CAN -(long)(&co1_vars.co_TPDO7_4Mapping), //[1A06h.04h], : TPDO7-4 Mapping, : TPM74, : CAN -(long)(&co1_vars.co_TPDO8_1Mapping), //[1A07h.01h], : TPDO8-1 Mapping, : TPM81, : CAN -(long)(&co1_vars.co_TPDO8_2Mapping), //[1A07h.02h], : TPDO8-2 Mapping, : TPM82, : CAN -(long)(&co1_vars.co_TPDO8_3Mapping), //[1A07h.03h], : TPDO8-3 Mapping, : TPM83, : CAN -(long)(&co1_vars.co_TPDO8_4Mapping), //[1A07h.04h], : TPDO8-4 Mapping, : TPM84, : CAN -(long)(&co1_vars.co_nodeID), //[2000h.00h], : CAN NODE-ID, : NodeID, : CAN -(long)(&co1_vars.co_bitRate), //[2001h.00h], : CAN Bit Rate, : CANBR, : CAN, 0 2: 0000000000000111b -(long)(&co1_vars.co_vendorID), //[2002h.01h], : , : VendID, : CAN -(long)(&co1_vars.co_productCode), //[2002h.02h], : , : PrCode, : CAN -(long)(&co1_vars.co_revisionNumber), //[2002h.03h], : , : RevNum, : CAN -(long)(&co1_vars.co_serialNumber), //[2002h.04h], : , : SerNum, : CAN -(long)(&co1_vars.co_specialData1), //[2003h.01h], : Special Data 1, : SpDat1, : CAN -(long)(&co1_vars.co_specialData2), //[2003h.02h], : Special Data 2, : SpDat2, : CAN -(long)(&co1_vars.co_specialData3), //[2003h.03h], : Special Data 3, : SpDat3, : CAN -(long)(&co1_vars.co_specialData4), //[2003h.04h], : Special Data 4, : SpDat4, : CAN -(long)(&co1_vars.co_secretCode), //[2004h.00h], : Secret Code, : Secret, : CAN -(long)(&co1_vars.co_protectBit), //[2005h.00h], : Protect Bit, : ProtBt, : CAN, 0 0: 0000000000000001b -(long)(&co1_odHash[0]), //[2007h.01h], : md5_hash_0, : md5_hash_0, : CAN -(long)(&co1_odHash[1]), //[2007h.02h], : md5_hash_1, : md5_hash_1, : CAN -(long)(&co1_odHash[2]), //[2007h.03h], : md5_hash_2, : md5_hash_2, : CAN -(long)(&co1_odHash[3]), //[2007h.04h], : md5_hash_3, : md5_hash_3, : CAN -(long)(&co1_vars.co_heartbeatFlag0), //[2010h.01h], : Heartbeat Flag 0-31, : HFlag0, : CAN -(long)(&co1_vars.co_heartbeatFlag1), //[2010h.02h], : Heartbeat Flag 32-63, : HFlag1, : CAN -(long)(&co1_vars.co_heartbeatFlag2), //[2010h.03h], : Heartbeat Flag 64-95, : HFlag2, : CAN -(long)(&co1_vars.co_heartbeatFlag3), //[2010h.04h], : Heartbeat Flag 96-127, : HFlag3, : CAN -(long)(&co1_vars.co_heartbeatMask0), //[2011h.01h], : Heartbeat Mask 0-31, : HMask0, : CAN -(long)(&co1_vars.co_heartbeatMask1), //[2011h.02h], : Heartbeat Mask 32-63, : HMask1, : CAN -(long)(&co1_vars.co_heartbeatMask2), //[2011h.03h], : Heartbeat Mask 64-95, : HMask2, : CAN -(long)(&co1_vars.co_heartbeatMask3), //[2011h.04h], : Heartbeat Mask 96-127, : HMask3, : CAN -(long)(&co1_vars.co_heartbeatAutoStart), //[2012h.00h], : Heartbeat Autostart, : HBASta, : CAN, 0 0: 0000000000000001b -(long)(&co1_vars.co_heartbeatAutoRecovery), //[2014h.00h], : Heartbeat Autorecovery, : HBARec, : CAN, 0 0: 0000000000000001b -(long)(&co1_vars.co_nodeState), //[2015h.00h], : CAN-Open, : State, : CAN -(long)(&co1_vars.co_emergencyErrorCode), //[2016h.00h], : Emergency Error Code, : EmErCo, : CAN -(long)(&co1_vars.co_deviceErrorState), //[2017h.00h], : Device Error State, : DeErSt, : CAN -(long)(&co1_vars.co_ODCommand), //[2080h.01h], : Object Dictionary Command, : ODComm, : CAN -(long)(&co1_vars.co_currentODIndex), //[2080h.02h], : Current OD Index, : ODCInd, : CAN -(long)(&co1_vars.co_currentODSubIndex), //[2080h.03h], : Current OD Sub-Index, : ODCSub, : CAN -(long)(&co1_vars.co_currentODEText), //[2080h.04h], : Current OD Element Text, : ODCTxt, : CAN -(long)(&co1_vars.co_currentODEFormat), //[2080h.05h], : Current OD Element Format, : ODCFrm, : CAN -(long)(&co1_vars.co_currentODEMin), //[2080h.06h], : Current OD Element Min, : ODCMin, : CAN -(long)(&co1_vars.co_currentODEMax), //[2080h.07h], : Current OD Element Max, : ODCMax, : CAN -(long)(&co1_vars.co_currentODEDefault), //[2080h.08h], : Current OD Element Default, : ODCDef, : CAN -(long)(&co1_vars.co_currentODEMinLow), //[2080h.09h], : Current OD Element MinLow, : ODCMiL, : CAN -(long)(&co1_vars.co_currentODEMaxLow), //[2080h.0Ah], : Current OD Element MaxLow, : ODCMaL, : CAN -(long)(&co1_vars.co_currentODEDefaultLow), //[2080h.0Bh], : Current OD Element Default Low, : ODCDeL, : CAN -(long)(&co1_vars.co_currentODEAddrLow), //[2080h.0Ch], : Current OD Element Address, : ODCAdr, : CAN -(long)(&co1_vars.co_currentODEAddrLow), //[2080h.0Dh], : Current OD Element Address, : ODCAdr, : CAN -(long)(&co1_vars.co_currentODEType), //[2080h.0Eh], : , : , : CAN -(long)(&co1_vars.co_odIndexSize), //[2081h.00h], : , : , : CAN -(long)(&co1_vars.co_defaultIndex1), //[2082h.01h], : Default Index 1, : DfInd1, : CAN -(long)(&co1_vars.co_defaultIndex2), //[2082h.02h], : Default Index 2, : DfInd2, : CAN -(long)(&co1_vars.co_maskElement01), //[2083h.01h], : Mask Element, : MskEl0, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElement01), //[2083h.02h], : Mask Element, : MskEl1, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElement23), //[2083h.03h], : Mask Element, : MskEl2, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElement23), //[2083h.04h], : Mask Element, : MskEl3, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElement45), //[2083h.05h], : Mask Element, : MskEl4, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElement45), //[2083h.06h], : Mask Element, : MskEl5, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElement67), //[2083h.07h], : Mask Element, : MskEl6, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElement67), //[2083h.08h], : Mask Element, : MskEl7, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElement89), //[2083h.09h], : Mask Element, : MskEl8, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElement89), //[2083h.0Ah], : Mask Element, : MskEl9, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElementAB), //[2083h.0Bh], : Mask Element, : MskElA, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElementAB), //[2083h.0Ch], : Mask Element, : MskElB, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElementCD), //[2083h.0Dh], : Mask Element, : MskElC, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElementCD), //[2083h.0Eh], : Mask Element, : MskElD, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_maskElementEF), //[2083h.0Fh], : Mask Element, : MskElE, : CAN, 0 7: 0000000011111111b -(long)(&co1_vars.co_maskElementEF), //[2083h.10h], : Mask Element, : MskElF, : CAN, 8 15: 1111111100000000b -(long)(&co1_vars.co_scaleNum0), //[2100h.01h], : Scale Number 0, : SN0, : CAN -(long)(&co1_vars.co_scaleNum0Format), //[2100h.02h], : Scale Number 0 Format, : S0Fmt, : CAN -(long)(&co1_vars.co_scaleNum0Format), //[2100h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum0Format), //[2100h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum0Format), //[2100h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum0Format), //[2100h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum1), //[2101h.01h], : Scale Number 1, : SN1, : CAN -(long)(&co1_vars.co_scaleNum1Format), //[2101h.02h], : Scale Number 1 Format, : S1Fmt, : CAN -(long)(&co1_vars.co_scaleNum1Format), //[2101h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum1Format), //[2101h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum1Format), //[2101h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum1Format), //[2101h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum2), //[2102h.01h], : Scale Number 2, : SN2, : CAN -(long)(&co1_vars.co_scaleNum2Format), //[2102h.02h], : Scale Number 2 Format, : S2Fmt, : CAN -(long)(&co1_vars.co_scaleNum2Format), //[2102h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum2Format), //[2102h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum2Format), //[2102h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum2Format), //[2102h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum3), //[2103h.01h], : Scale Number 3, : SN3, : CAN -(long)(&co1_vars.co_scaleNum3Format), //[2103h.02h], : Scale Number 3 Format, : S3Fmt, : CAN -(long)(&co1_vars.co_scaleNum3Format), //[2103h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum3Format), //[2103h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum3Format), //[2103h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum3Format), //[2103h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum4), //[2104h.01h], : Scale Number 4, : SN4, : CAN -(long)(&co1_vars.co_scaleNum4Format), //[2104h.02h], : Scale Number 4 Format, : S4Fmt, : CAN -(long)(&co1_vars.co_scaleNum4Format), //[2104h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum4Format), //[2104h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum4Format), //[2104h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum4Format), //[2104h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum5), //[2105h.01h], : Scale Number 5, : SN5, : CAN -(long)(&co1_vars.co_scaleNum5Format), //[2105h.02h], : Scale Number 5 Format, : S5Fmt, : CAN -(long)(&co1_vars.co_scaleNum5Format), //[2105h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum5Format), //[2105h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum5Format), //[2105h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum5Format), //[2105h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum6), //[2106h.01h], : Scale Number 6, : SN6, : CAN -(long)(&co1_vars.co_scaleNum6Format), //[2106h.02h], : Scale Number 6 Format, : S6Fmt, : CAN -(long)(&co1_vars.co_scaleNum6Format), //[2106h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum6Format), //[2106h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum6Format), //[2106h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum6Format), //[2106h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum7), //[2107h.01h], : Scale Number 7, : SN7, : CAN -(long)(&co1_vars.co_scaleNum7Format), //[2107h.02h], : Scale Number 7 Format, : S7Fmt, : CAN -(long)(&co1_vars.co_scaleNum7Format), //[2107h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum7Format), //[2107h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum7Format), //[2107h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum7Format), //[2107h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum8), //[2108h.01h], : Scale Number 8, : SN8, : CAN -(long)(&co1_vars.co_scaleNum8Format), //[2108h.02h], : Scale Number 8 Format, : S8Fmt, : CAN -(long)(&co1_vars.co_scaleNum8Format), //[2108h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum8Format), //[2108h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum8Format), //[2108h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum8Format), //[2108h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum9), //[2109h.01h], : Scale Number 9, : SN9, : CAN -(long)(&co1_vars.co_scaleNum9Format), //[2109h.02h], : Scale Number 9 Format, : S9Fmt, : CAN -(long)(&co1_vars.co_scaleNum9Format), //[2109h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum9Format), //[2109h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum9Format), //[2109h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum9Format), //[2109h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumA), //[210Ah.01h], : Scale Number A, : SNA, : CAN -(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.02h], : Scale Number A Format, : SAFmt, : CAN -(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumB), //[210Bh.01h], : Scale Number B, : SNB, : CAN -(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.02h], : Scale Number B Format, : SBFmt, : CAN -(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumC), //[210Ch.01h], : Scale Number C, : SNC, : CAN -(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.02h], : Scale Number C Format, : SCFmt, : CAN -(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumD), //[210Dh.01h], : Scale Number D, : SND, : CAN -(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.02h], : Scale Number D Format, : SDFmt, : CAN -(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumE), //[210Eh.01h], : Scale Number E, : SNE, : CAN -(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.02h], : Scale Number E Format, : SEFmt, : CAN -(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNumF), //[210Fh.01h], : Scale Number F, : SNF, : CAN -(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.02h], : Scale Number F Format, : SFFmt, : CAN -(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum10), //[2110h.01h], : Scale Number 10, : SN10, : CAN -(long)(&co1_vars.co_scaleNum10Format), //[2110h.02h], : Scale Number 10 Format, : S10Fmt, : CAN -(long)(&co1_vars.co_scaleNum10Format), //[2110h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum10Format), //[2110h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum10Format), //[2110h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum10Format), //[2110h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum11), //[2111h.01h], : Scale Number 11, : SN11, : CAN -(long)(&co1_vars.co_scaleNum11Format), //[2111h.02h], : Scale Number 11 Format, : S11Fmt, : CAN -(long)(&co1_vars.co_scaleNum11Format), //[2111h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum11Format), //[2111h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum11Format), //[2111h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum11Format), //[2111h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum12), //[2112h.01h], : Scale Number 12, : SN12, : CAN -(long)(&co1_vars.co_scaleNum12Format), //[2112h.02h], : Scale Number 12 Format, : S12Fmt, : CAN -(long)(&co1_vars.co_scaleNum12Format), //[2112h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum12Format), //[2112h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum12Format), //[2112h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum12Format), //[2112h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum13), //[2113h.01h], : Scale Number 13, : SN13, : CAN -(long)(&co1_vars.co_scaleNum13Format), //[2113h.02h], : Scale Number 13 Format, : S13Fmt, : CAN -(long)(&co1_vars.co_scaleNum13Format), //[2113h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum13Format), //[2113h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum13Format), //[2113h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum13Format), //[2113h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum14), //[2114h.01h], : Scale Number 14, : SN14, : CAN -(long)(&co1_vars.co_scaleNum14Format), //[2114h.02h], : Scale Number 14 Format, : S14Fmt, : CAN -(long)(&co1_vars.co_scaleNum14Format), //[2114h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum14Format), //[2114h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum14Format), //[2114h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum14Format), //[2114h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum15), //[2115h.01h], : Scale Number 15, : SN15, : CAN -(long)(&co1_vars.co_scaleNum15Format), //[2115h.02h], : Scale Number 15Format, : S15Fmt, : CAN -(long)(&co1_vars.co_scaleNum15Format), //[2115h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum15Format), //[2115h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum15Format), //[2115h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum15Format), //[2115h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum16), //[2116h.01h], : Scale Number 16, : SN16, : CAN -(long)(&co1_vars.co_scaleNum16Format), //[2116h.02h], : Scale Number 16Format, : S16Fmt, : CAN -(long)(&co1_vars.co_scaleNum16Format), //[2116h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum16Format), //[2116h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum16Format), //[2116h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum16Format), //[2116h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum17), //[2117h.01h], : Scale Number 17, : SN17, : CAN -(long)(&co1_vars.co_scaleNum17Format), //[2117h.02h], : Scale Number 17Format, : S17Fmt, : CAN -(long)(&co1_vars.co_scaleNum17Format), //[2117h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum17Format), //[2117h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum17Format), //[2117h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum17Format), //[2117h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum18), //[2118h.01h], : Scale Number 18, : SN18, : CAN -(long)(&co1_vars.co_scaleNum18Format), //[2118h.02h], : Scale Number 18Format, : S18Fmt, : CAN -(long)(&co1_vars.co_scaleNum18Format), //[2118h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum18Format), //[2118h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum18Format), //[2118h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum18Format), //[2118h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum19), //[2119h.01h], : Scale Number 19, : SN19, : CAN -(long)(&co1_vars.co_scaleNum19Format), //[2119h.02h], : Scale Number 19Format, : S19Fmt, : CAN -(long)(&co1_vars.co_scaleNum19Format), //[2119h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum19Format), //[2119h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum19Format), //[2119h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum19Format), //[2119h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum1A), //[211Ah.01h], : Scale Number 1A, : SN1A, : CAN -(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.02h], : Scale Number 1AFormat, : S1AFmt, : CAN -(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum1B), //[211Bh.01h], : Scale Number 1B, : SN1B, : CAN -(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.02h], : Scale Number 1BFormat, : S1BFmt, : CAN -(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum1C), //[211Ch.01h], : Scale Number 1C, : SN1C, : CAN -(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.02h], : Scale Number 1C Format, : S1CFmt, : CAN -(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&co1_vars.co_scaleNum1D), //[211Dh.01h], : Scale Number 1D, : SN1D, : CAN -(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.02h], : Scale Number 1D Format, : S1DFmt, : CAN -(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b -(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b -(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b -(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b -(long)(&cmd.all), //[2502h.01h], : , : , : , 0 0: 0000000000000001b -(long)(&cmd.all), //[2502h.02h], : , : , : , 1 1: 0000000000000010b -(long)(&cmd.all), //[2502h.03h], : , : , : , 2 2: 0000000000000100b -(long)(&cmd.all), //[2502h.04h], : CAN, : CAN, : -(long)(&drv_interface.req_data), //[2506h.01h], : , : OfflineCounterMax, : -(long)(&drv_interface.ans_data), //[2506h.02h], : , : OfflineCounter, : -(long)(&drv_interface.data_Low), //[2506h.03h], : data_Low, : data_L, : -(long)(&drv_interface.data_High), //[2506h.04h], : data_High, : data_H, : -(long)(&RTCclock.packed_time), //[250Fh.00h], : , : RTC, : -(long)(&sm_prot.Main_ErrorCode), //[2532h.01h], : ARM, : ARM, : . , 0 7: 0000000011111111b -(long)(&sm_prot.Main_ErrorCode), //[2532h.02h], : , : +, : . , 8 15: 1111111100000000b -(long)(&sm_prot.Main_Flags), //[2532h.03h], : , : System, : . , 0 0: 0000000000000001b -(long)(&disp_group_number), //[2534h.01h], : , : , : CAN -(long)(&VendorToken), //[2600h.01h], : VendorToken, : VendorToken, : -(long)(&drv_status.all), //[3000h.00h], : , : , : , 0 5: 0000000000111111b -(long)(&msCounter), //[3100h.01h], : 1 , : ..1 , : -(long)(&FastCounter), //[3100h.02h], : 10 , : ..10 , : -(long)(&LoopCounter), //[3100h.03h], : BackgroundCounter, : BackgroundCounter, : -(long)(&TIsr10), //[3100h.04h], : T_10, : T_10, : -(long)(&TIsr1), //[3100h.05h], : T_1, : T_1, : -(long)(&rmp.T), //[5000h.01h], : T , : rmpT, : -(long)(&rmp.input), //[5000h.02h], : , : , : -(long)(&rmp.output), //[5000h.03h], : , : , : -(long)(&pid_id.pid_ref_reg3), //[5100h.01h], : , : -, : . Id -(long)(&pid_id.pid_fdb_reg3), //[5100h.02h], : , : ., : . Id -(long)(&pid_id.Kp_reg3), //[5100h.03h], : . . Kp, : Kp, : . Id -(long)(&pid_id.pid_out_max), //[5100h.04h], : , : Max, : . Id -(long)(&pid_id.pid_out_min), //[5100h.05h], : , : Min, : . Id -(long)(&pid_id.Ki_reg3), //[5100h.06h], : . Ki, : Ki, : . Id -(long)(&pid_id.Kd_reg3), //[5100h.07h], : . . Kd, : Kd, : . Id -(long)(&pid_id.Kc_reg3), //[5100h.08h], : .., : Kc, : . Id -(long)(&pid_id.e_reg3), //[5100h.09h], : , : , : . Id -(long)(&pid_id.pid_out_reg3), //[5100h.0Ah], : , : , : . Id -(long)(&pid_id.up_reg3), //[5100h.0Bh], : .., : .., : . Id -(long)(&pid_id.ui_reg3), //[5100h.0Ch], : .., : .., : . Id -(long)(&pid_id.ud_reg3), //[5100h.0Dh], : .., : .., : . Id -(long)(&pid_spd.pid_ref_reg3), //[5101h.01h], : , : pisref, : . -(long)(&pid_spd.pid_fdb_reg3), //[5101h.02h], : , : pisfbd, : . -(long)(&pid_spd.Kp_reg3), //[5101h.03h], : . . Kp, : Kp, : . -(long)(&pid_spd.pid_out_max), //[5101h.04h], : , : Max, : . -(long)(&pid_spd.pid_out_min), //[5101h.05h], : , : Min, : . -(long)(&pid_spd.Ki_reg3), //[5101h.06h], : . Ki, : Ki, : . -(long)(&pid_spd.Kd_reg3), //[5101h.07h], : . . Kd, : pisKd, : . -(long)(&pid_spd.Kc_reg3), //[5101h.08h], : .., : Kc, : . -(long)(&pid_spd.e_reg3), //[5101h.09h], : , : , : . -(long)(&pid_spd.pid_out_reg3), //[5101h.0Ah], : , : pisout, : . -(long)(&pid_spd.up_reg3), //[5101h.0Bh], : .., : .., : . -(long)(&pid_spd.ui_reg3), //[5101h.0Ch], : .., : .., : . -(long)(&pid_spd.ud_reg3), //[5101h.0Dh], : .., : .., : . -(long)(&pid_spd.saterr_reg3), //[5101h.0Eh], : , : . , : . -(long)(&pid_iq.pid_ref_reg3), //[5102h.01h], : , : -, : . Iq -(long)(&pid_iq.pid_fdb_reg3), //[5102h.02h], : , : ., : . Iq -(long)(&pid_iq.Kp_reg3), //[5102h.03h], : . . Kp, : Kp, : . Iq -(long)(&pid_iq.pid_out_max), //[5102h.04h], : , : Max, : . Iq -(long)(&pid_iq.pid_out_min), //[5102h.05h], : , : Min, : . Iq -(long)(&pid_iq.Ki_reg3), //[5102h.06h], : . Ki, : Ki, : . Iq -(long)(&pid_iq.Kd_reg3), //[5102h.07h], : . . Kd, : Kd, : . Iq -(long)(&pid_iq.Kc_reg3), //[5102h.08h], : .., : Kc, : . Iq -(long)(&pid_iq.e_reg3), //[5102h.09h], : , : , : . Iq -(long)(&pid_iq.pid_out_reg3), //[5102h.0Ah], : , : , : . Iq -(long)(&pid_iq.up_reg3), //[5102h.0Bh], : .., : .., : . Iq -(long)(&pid_iq.ui_reg3), //[5102h.0Ch], : .., : .., : . Iq -(long)(&pid_iq.ud_reg3), //[5102h.0Dh], : .., : .., : . Iq -(long)(&pid_pos.pid_ref_reg3), //[5103h.01h], : , : pisref, : . -(long)(&pid_pos.pid_ref_reg3), //[5103h.02h], : , : pisref, : . -(long)(&pid_pos.pid_fdb_reg3), //[5103h.03h], : , : pisfbd, : . -(long)(&pid_pos.pid_fdb_reg3), //[5103h.04h], : , : pisfbd, : . -(long)(&pid_pos.Kp_reg3), //[5103h.05h], : . . Kp, : Kp, : . -(long)(&pid_pos.pid_out_max), //[5103h.06h], : , : Max, : . -(long)(&pid_pos.pid_out_min), //[5103h.07h], : , : Min, : . -(long)(&pid_pos.Ki_reg3), //[5103h.08h], : . Ki, : Ki, : . -(long)(&pid_pos.Kd_reg3), //[5103h.09h], : . . Kd, : pisKd, : . -(long)(&pid_pos.DiffDelim), //[5103h.0Ah], : . . , : . . , : . -(long)(&pid_pos.Kf_d), //[5103h.0Bh], : . , : . , : . -(long)(&pid_pos.Kc_reg3), //[5103h.0Ch], : .., : Kc, : . -(long)(&pid_pos.DeadZone), //[5103h.0Dh], : , : , : . -(long)(&pid_pos.e_reg3), //[5103h.0Eh], : , : , : . -(long)(&pid_spd.saterr_reg3), //[5103h.0Fh], : , : . , : . -(long)(&pid_pos.pid_out_reg3), //[5103h.10h], : , : pisout, : . -(long)(&pid_pos.up_reg3), //[5103h.11h], : .., : .., : . -(long)(&pid_pos.ui_reg3), //[5103h.12h], : .., : .., : . -(long)(&pid_pos.ud_reg3), //[5103h.13h], : .., : .., : . -(long)(&pid_pos.e_reg3_filterOut), //[5103h.14h], : , : , : . -(long)(&pwm.UalphaRef), //[5105h.01h], : Ua, : Ua, : -(long)(&pwm.UbetaRef), //[5105h.02h], : Ub, : Ub, : -(long)(&pwm.U_lim), //[5105h.03h], : U_, : U_, : -(long)(&pwm.GammaA), //[5105h.04h], : GammaA, : GmA, : -(long)(&pwm.GammaB), //[5105h.05h], : GammaB, : GmB, : -(long)(&pwm.GammaC), //[5105h.06h], : GammaC, : GmC, : -(long)(&pwm.k_pwm), //[5105h.07h], : TPWM, : TPWM, : -(long)(&pwm.DeadBand), //[5105h.08h], : (), : . , : -(long)(&pwm.MinGammaLimit), //[5105h.09h], : . ., : GamLim, : -(long)(&pwm.UdCompK), //[5105h.0Ah], : . Ud, : UdK, : -(long)(&pwm.UdCompEnable), //[5105h.0Bh], : Ud, : Ud, : , 0 0: 0000000000000001b -(long)(&pwm.PWM_type), //[5105h.0Ch], : , : , : -(long)(&pwm.ULimitation), //[5105h.0Dh], : ULimitation, : ULimitation, : -(long)(&pwm.Frequency), //[5105h.0Eh], : , : F, : -(long)(&pwm.sector), //[5105h.0Fh], : , : , : -(long)(&pwm.U_mag), //[5105h.10h], : U_, : U_, : -(long)(&pwm.PDP_Fault), //[5105h.11h], : , : F_bits, : -(long)(&sm_ctrl.state), //[510Bh.01h], : sm_state, : smstat, : sm_ctrl -(long)(&drv_status_code), //[510Bh.02h], : drv_status_code, : stcode, : sm_ctrl, 0 7: 0000000011111111b -(long)(&sm_prot.bit_fault1), //[510Eh.01h], : 1, : bitF_1, : -(long)(&sm_prot.bit_fault2), //[510Eh.02h], : 2, : bitF_2, : -(long)(&sm_prot.mask_fault1), //[510Eh.03h], : 1L, : mask1L, : , 0 7: 0000000011111111b -(long)(&sm_prot.mask_fault1), //[510Eh.04h], : 1H, : mask1H, : , 8 15: 1111111100000000b -(long)(&sm_prot.mask_fault2), //[510Eh.05h], : 2L, : mask2L, : , 0 7: 0000000011111111b -(long)(&sm_prot.mask_fault2), //[510Eh.06h], : 2H, : mask2H, : , 8 15: 1111111100000000b -(long)(&sm_prot.Imax_protect), //[510Eh.07h], : , : ., : -(long)(&sm_prot.Umax_protect), //[510Eh.08h], : , : Ud_max, : -(long)(&sm_prot.Umin_protect), //[510Eh.09h], : , : Ud_min, : -(long)(&sm_prot.speed_max), //[510Eh.0Ah], : , : speed_max, : -(long)(&sm_prot.T_max), //[510Eh.0Bh], : , : t_max, : -(long)(&refs.speed_ref), //[5112h.01h], : , : _, : -(long)(&refs.Iq_ref), //[5112h.02h], : . , : , : -(long)(&refs.i_flux_ref), //[5112h.03h], : , : , : -(long)(&refs.theta_elec), //[5112h.04h], : theta_elec, : , : -(long)(&refs.uf_ref), //[5112h.05h], : , : Uf_ref, : -(long)(&drv_params.p), //[5113h.01h], : , : , : . -(long)(&drv_params.I_nom), //[5113h.02h], : , : I, : . -(long)(&drv_params.U_nom), //[5113h.03h], : ., : U_, : . -(long)(&drv_params.speed_nom), //[5113h.04h], : , : , : . -(long)(&drv_params.Udc_nom), //[5113h.05h], : , : Udc, : . -(long)(&drv_params.Rs), //[5113h.06h], : Rs, : Rs, : . -(long)(&drv_params.Ls), //[5113h.07h], : Ls, : Ls, : . -(long)(&drv_params.freq_nom), //[5113h.08h], : , : .., : . -(long)(&drv_params.sens_type), //[5113h.09h], : , : Sens_type, : . , 0 2: 0000000000000111b -(long)(&sw.HardwareType), //[5114h.01h], : , : HardwareType, : , 0 7: 0000000011111111b -(long)(&sm_ctrl.run_mode), //[5114h.02h], : , : , : -(long)(&sw.recuperation_ena), //[5114h.03h], : , : , : -(long)(&sw.AutoOffset), //[5114h.04h], : ., : , : -(long)(&sw.Reboot), //[5114h.05h], : , : , : -(long)(&sw.excitation_ena), //[5114h.06h], : , : , : -(long)(&adc.Imeas_a_gain), //[5116h.01h], : , : Ia, : -(long)(&adc.Imeas_a_offset), //[5116h.02h], : , : Ia, : -(long)(&adc.Imeas_a), //[5116h.03h], : , : Ia_, : -(long)(&adc.Imeas_b_gain), //[5116h.04h], : , : Ib, : -(long)(&adc.Imeas_b_offset), //[5116h.05h], : , : Ib, : -(long)(&adc.Imeas_b), //[5116h.06h], : , : Ib_, : -(long)(&adc.Imeas_c_gain), //[5116h.07h], : C, : Ic, : -(long)(&adc.Imeas_c_offset), //[5116h.08h], : C, : Ic, : -(long)(&adc.Imeas_c), //[5116h.09h], : , : Ic_, : -(long)(&adc.Udc_meas_gain), //[5116h.0Ah], : , : Ud, : -(long)(&adc.Udc_meas_offset), //[5116h.0Bh], : . , : Ud, : -(long)(&adc.Udc_meas), //[5116h.0Ch], : , : Ud, : -(long)(&adc.T_meas_gain), //[5116h.0Dh], : , : t_gain, : -(long)(&adc.T_meas), //[5116h.0Eh], : , : t, : -(long)(&vhz.freq), //[511Ah.01h], : , : F_, : U-f -(long)(&vhz.vout), //[511Ah.02h], : , : U_, : U-f -(long)(&vhz.FL), //[511Ah.03h], : , : f [0], : U-f -(long)(&vhz.Vmin), //[511Ah.04h], : , : U [0], : U-f -(long)(&vhz.FH), //[511Ah.05h], : , : f [1], : U-f -(long)(&vhz.Vmax), //[511Ah.06h], : , : U [1], : U-f -(long)(&vhz.Fmax), //[511Ah.07h], : , : f max, : U-f -(long)(&cur_par.speed), //[5138h.01h], : , : , : -(long)(&cur_par.power), //[5138h.02h], : . , : , : -(long)(&cur_par.Is), //[5138h.03h], : , : , : -(long)(&cur_par.ThetaRefCurr), //[5138h.04h], : , : , : -(long)(&cur_par.ThetaCurr), //[5138h.05h], : , : , : -(long)(&cur_par.IsRef), //[5138h.06h], : , : , : -(long)(&global_time.PowerOn_time_min), //[5138h.07h], : , , : Power On Time, : -(long)(&global_time.operational_time_min), //[5138h.08h], : , , : Work Time, : -(long)(&dlog.mode_reset), //[5150h.01h], : dlog.mode_reset, : mode, : dlog -(long)(&dlog.control), //[5150h.02h], : dlog.control, : dlcont, : dlog -(long)(&dlog.ind_subind1), //[5150h.03h], : dlog.ind_subind1, : dlisi1, : dlog -(long)(&dlog.ind_subind2), //[5150h.04h], : dlog.ind_subind2, : dlisi2, : dlog -(long)(&dlog.ind_subind3), //[5150h.05h], : dlog.ind_subind3, : dlisi3, : dlog -(long)(&dlog.ind_subind4), //[5150h.06h], : dlog.ind_subind4, : dlisi4, : dlog -(long)(&dlog.StartBits), //[5150h.07h], : StartBitL, : StrtBL, : dlog, 0 7: 0000000011111111b -(long)(&dlog.StartBits), //[5150h.08h], : StartBitH, : StrtBH, : dlog, 8 15: 1111111100000000b -(long)(&dlog.OneShotOperation), //[5150h.09h], : OneShotOperation, : OneShotOp, : dlog, 0 0: 0000000000000001b -(long)(&dlog.trig_shift), //[5150h.0Ah], : , : N ., : dlog -(long)(&dlog.next_value_var), //[5151h.00h], : dlog.next_value_var, : dlnval, : -(long)(&posspeedEqep.resol), //[5152h.01h], : - , : - , : - -(long)(&posspeedEqep.Posspeed_CTL.all), //[5152h.02h], : , : , : -, 2 2: 0000000000000100b -(long)(&posspeedEqep.SpeedCalcType), //[5152h.03h], : , : SpeedCalcType, : - -(long)(&posspeedEqep.AngleOffset), //[5152h.04h], : , : , : - -(long)(&posspeedEqep.Poscnt_res), //[5152h.05h], : . , : . , : - -(long)(&posspeedEqep.Poscnt_res16), //[5152h.06h], : . , : . , : - -(long)(&posspeedEqep.speed_elec), //[5152h.07h], : , : , : - -(long)(&posspeedEqep.theta_elec), //[5152h.08h], : . ., : . ., : - -(long)(&posspeedEqep.theta_mech), //[5152h.09h], : ., : ., : - -(long)(&posspeedEqep.Posspeed_CTL.all), //[5152h.0Ah], : ., : ., : -, 4 4: 0000000000010000b -(long)(&posspeedEqep.speed_filter.T), //[5152h.0Bh], : , : . , : - -(long)(&posspeedEqep.Posspeed_FLG1.all), //[5152h.0Ch], : Posspeed_FLG1, : Posspeed_FLG1, : - -(long)(&posspeedEqep.GPIOsValue), //[5152h.0Dh], : GPIOsValue, : GPIOsValue, : - -(long)(&posspeedEqep.UPPS_forWatch), //[5152h.0Eh], : UPPS, : UPPS, : - -(long)(&posspeedEqep.Qcprdlat_tmp), //[5152h.0Fh], : QCPRD, : QCPRD, : - -(long)(&posspeedEqep.Qcprdlat16_tmp), //[5152h.10h], : QCPRD, : QCPRD, : - -(long)(&posspeedEqep.QEPSTS), //[5152h.11h], : QEPSTS, : QEPSTS, : - -(long)(&posspeedEqep.RevolutionCounter), //[5152h.12h], : , : revolCounter, : - -(long)(&posspeedEqep.Poscnt_resContinouosInt8), //[5152h.13h], : . , : qcAbsPos, : - -(long)(&posspeedEqep.Poscnt_resContinouosInt), //[5152h.14h], : . , : qcAbsPos, : - -(long)(&posspeedEqep.Poscnt_resContinouosLong), //[5152h.15h], : . , : qcAbsPos, : - -(long)(&posspeedEqep.theta_mechContinouos), //[5152h.16h], : ., : .._, : - -(long)(&posspeedEqep.theta_elecContinouos), //[5152h.17h], : ., : .._, : - -(long)(&DPReCAP.enabled), //[5155h.01h], : , : , : - -(long)(&DPReCAP.Angle), //[5155h.02h], : , : , : - -(long)(&DPReCAP.speed), //[5155h.03h], : , : , : - -(long)(&DPReCAP.speedMIN), //[5155h.04h], : , : , : - -(long)(&DPReCAP.Angle6), //[5155h.05h], : 6, : 6, : - -(long)(&DPReCAP.DPReCAP_FLG1.all), //[5155h.06h], : - , : - , : -, 0 0: 0000000000000001b -(long)(&DPReCAP.milsecREF), //[5155h.07h], : , : , : - -(long)(&DPReCAP.speedMinREF), //[5155h.08h], : ., : ., : - -(long)(&DPReCAP.CAP_WrongEdgeCnt), //[5155h.09h], : , : , : - -(long)(&DPReCAP.HallCode), //[5155h.0Ah], : , : , : -, 0 2: 0000000000000111b -(long)(&DPReCAP.AngleOffset), //[5155h.0Bh], : , : , : - -(long)(&DPReCAP.ErrorLevel), //[5155h.0Ch], : , : , : - -(long)(&DPReCAP.CAP_WrongEdgeCnt1), //[5155h.0Dh], : 1 , : _1_., : - -(long)(&DPReCAP.CAP_WrongEdgeCnt2), //[5155h.0Eh], : 2 , : _2_., : - -(long)(&DPReCAP.CAP_WrongEdgeCnt3), //[5155h.0Fh], : 3 , : _3_., : - -(long)(&DPReCAP.UserDirection), //[5155h.10h], : , : , : -, 2 2: 0000000000000100b -(long)(&DPReCAP.WrongCodeCounterLimitPerSec), //[5155h.11h], : . , : .., : - -(long)(&DPReCAP.WrongCodeCounter), //[5155h.12h], : - , : ., : - -(long)(&CounterCAP_isr), //[5155h.13h], : , : .Rx.Int., : - -(long)(&cap0_counter), //[5155h.14h], : CAP1, : ..CAP1, : - -(long)(&cap1_counter), //[5155h.15h], : CAP2, : ..CAP2, : - -(long)(&cap2_counter), //[5155h.16h], : CAP3, : ..CAP3, : - -(long)(&SSI_Encoder.resol), //[5157h.01h], : , : qepTik, : -SSI -(long)(&SSI_Encoder.AngleOffset), //[5157h.02h], : , : , : -SSI -(long)(&SSI_Encoder.Poscnt_res), //[5157h.03h], : . , : . , : -SSI -(long)(&SSI_Encoder.speed_elec), //[5157h.04h], : , : , : -SSI -(long)(&SSI_Encoder.theta_elec), //[5157h.05h], : . ., : . ., : -SSI -(long)(&SSI_Encoder.theta_mech), //[5157h.06h], : ., : ., : -SSI -(long)(&SSI_Encoder.theta_mech_filtered), //[5157h.07h], : . , : theta_mech_filtered, : -SSI -(long)(&SSI_Encoder.theta_mech_filterK), //[5157h.08h], : , : . , : -SSI -(long)(&SSI_Encoder.RevolutionCounter), //[5157h.09h], : , : revolCounter, : -SSI -(long)(&SSI_Encoder.Poscnt_resContinouosLong), //[5157h.0Ah], : . , : qcAbsPos, : -SSI -(long)(&SSI_Encoder.Poscnt_resContinouosInt8), //[5157h.0Bh], : . , : qcAbsPos, : -SSI -(long)(&SSI_Encoder.Poscnt_resContinouosInt), //[5157h.0Ch], : . , : qcAbsPos, : -SSI -(long)(&SSI_Encoder.theta_mechContinouos), //[5157h.0Dh], : ., : .._, : -SSI -(long)(&SSI_Encoder.theta_elecContinouos), //[5157h.0Eh], : ., : .._, : -SSI -(long)(&Debug1), //[5174h.01h], : DebugL1, : DebugL1, : -(long)(&Debug1), //[5174h.02h], : DebugL1, : DebugL1, : -(long)(&Debug2), //[5174h.03h], : DebugL2, : DebugL2, : -(long)(&Debug2), //[5174h.04h], : DebugL2, : DebugL2, : -(long)(&Debug3), //[5174h.05h], : DebugI3, : DebugI3, : -(long)(&Debug3), //[5174h.06h], : DebugI3, : DebugI3, : -(long)(&Debug4), //[5174h.07h], : DebugI4, : DebugI4, : -(long)(&Debug4), //[5174h.08h], : DebugI4, : DebugI4, : -(long)(&DebugW1), //[5174h.09h], : DebugW1, : DebugW1, : -(long)(&DebugW1), //[5174h.0Ah], : DebugW1, : DebugW1, : -(long)(&DebugW2), //[5174h.0Bh], : DebugW2, : DebugW2, : -(long)(&DebugW2), //[5174h.0Ch], : DebugW2, : DebugW2, : -(long)(&DebugW3), //[5174h.0Dh], : DebugW3, : DebugW3, : -(long)(&DebugW3), //[5174h.0Eh], : DebugW3, : DebugW3, : -(long)(&DebugW4), //[5174h.0Fh], : DebugW4, : DebugW4, : -(long)(&DebugW4), //[5174h.10h], : DebugW4, : DebugW4, : -(long)(&DebugF1), //[5174h.11h], : DebugF1, : DebugF1, : -(long)(&DebugF2), //[5174h.12h], : DebugF2, : DebugF2, : -(long)(&DebugF3), //[5174h.13h], : DebugF3, : DebugF3, : -(long)(&DebugF4), //[5174h.14h], : DebugF4, : DebugF4, : -(long)(&refs.DCMspeed_ref), //[5185h.01h], : (. .), : . ., : . . -(long)(&refs.ua_ref), //[5185h.02h], : , : Ua_ref, : . . -(long)(&refs.uf_ref), //[5185h.03h], : , : Uf_ref, : . . -(long)(&RotorObserver.Tr), //[5B04h.01h], : . , : Tr, : -(long)(&RotorObserver.FluxCurrentRatio), //[5B04h.02h], : . X Y, : FluxCurrentRatio, : -(long)(&RotorObserver.FluxCurrentMin), //[5B04h.03h], : , : FluxCurrentMin, : -(long)(&RotorObserver.id), //[5B04h.04h], : D, : IsD, : -(long)(&RotorObserver.iq), //[5B04h.05h], : Q, : IsQ, : -(long)(&RotorObserver.psi_d), //[5B04h.06h], : D, : PsiRD, : -(long)(&RotorObserver.psi_q), //[5B04h.07h], : Q, : PsiRQ, : -(long)(&RotorObserver.theta_psi_elec), //[5B04h.08h], : , : psiRalpha, : +(long)(&co1_vars.co_deviceType), //[1000h.00h], : , : Device Type, : CAN +(long)(&co1_vars.co_errorRegister), //[1001h.00h], : , : ErrReg, : CAN +(long)(&co1_vars.co_deviceState), //[1002h.00h], : Manufacturer Status Register, : DevSta, : CAN +(long)(&co1_vars.co_emcyCOBID), //[1014h.00h], : COB-ID Emergency Object, : eCOBID, : CAN +(long)(&co1_vars.co_CHBT), //[1016h.01h], : Heartbeat, : CHBT, : CAN +(long)(&co1_vars.co_PHBT), //[1017h.00h], : Heartbeat, : PHBT, : CAN +(long)(&co1_vars.co_vendorID), //[1018h.01h], : , : VendID, : CAN +(long)(&co1_vars.co_productCode), //[1018h.02h], : , : PrCode, : CAN +(long)(&co1_vars.co_revisionNumber), //[1018h.03h], : , : RevNum, : CAN +(long)(&co1_vars.co_serialNumber), //[1018h.04h], : , : SerNum, : CAN +(long)(&co1_vars.co_csrxCOBID), //[1200h.01h], : COB-ID Client->Server(rx), : CSRXID, : CAN +(long)(&co1_vars.co_sctxCOBID), //[1200h.02h], : COB-ID Server->Client(tx), : SCTXID, : CAN +(long)(&co1_vars.co_cstxCOBID), //[1280h.01h], : COB-ID Client->Server(tx), : CSTXID, : CAN +(long)(&co1_vars.co_scrxCOBID), //[1280h.02h], : COB-ID Server->Client(rx), : SCRXID, : CAN +(long)(&co1_vars.co_ssNODEID), //[1280h.03h], : NODE-ID on SDO server, : SDOSID, : CAN +(long)(&co1_vars.co_RPDO1COBID), //[1400h.01h], : COB-ID for RPDO1, : IRPDO1, : CAN +(long)(&co1_vars.co_transType), //[1400h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO2COBID), //[1401h.01h], : COB-ID for RPDO2, : IRPDO2, : CAN +(long)(&co1_vars.co_transType), //[1401h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO3COBID), //[1402h.01h], : COB-ID for RPDO3, : IRPDO3, : CAN +(long)(&co1_vars.co_transType), //[1402h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO4COBID), //[1403h.01h], : COB-ID for RPDO4, : IRPDO4, : CAN +(long)(&co1_vars.co_transType), //[1403h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO5COBID), //[1404h.01h], : COB-ID for RPDO5, : IRPDO5, : CAN +(long)(&co1_vars.co_transType), //[1404h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO6COBID), //[1405h.01h], : COB-ID for RPDO6, : IRPDO6, : CAN +(long)(&co1_vars.co_transType), //[1405h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO7COBID), //[1406h.01h], : COB-ID for RPDO7, : IRPDO7, : CAN +(long)(&co1_vars.co_transType), //[1406h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO8COBID), //[1407h.01h], : COB-ID for RPDO8, : IRPDO8, : CAN +(long)(&co1_vars.co_transType), //[1407h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_RPDO1_1Mapping), //[1600h.01h], : RPDO1-1 Mapping, : RPM11, : CAN +(long)(&co1_vars.co_RPDO1_2Mapping), //[1600h.02h], : RPDO1-2 Mapping, : RPM12, : CAN +(long)(&co1_vars.co_RPDO1_3Mapping), //[1600h.03h], : RPDO1-3 Mapping, : RPM13, : CAN +(long)(&co1_vars.co_RPDO1_4Mapping), //[1600h.04h], : RPDO1-4 Mapping, : RPM14, : CAN +(long)(&co1_vars.co_RPDO2_1Mapping), //[1601h.01h], : RPDO2-1 Mapping, : RPM21, : CAN +(long)(&co1_vars.co_RPDO2_2Mapping), //[1601h.02h], : RPDO2-2 Mapping, : RPM22, : CAN +(long)(&co1_vars.co_RPDO2_3Mapping), //[1601h.03h], : RPDO2-3 Mapping, : RPM23, : CAN +(long)(&co1_vars.co_RPDO2_4Mapping), //[1601h.04h], : RPDO2-4 Mapping, : RPM24, : CAN +(long)(&co1_vars.co_RPDO3_1Mapping), //[1602h.01h], : RPDO3-1 Mapping, : RPM31, : CAN +(long)(&co1_vars.co_RPDO3_2Mapping), //[1602h.02h], : RPDO3-2 Mapping, : RPM32, : CAN +(long)(&co1_vars.co_RPDO3_3Mapping), //[1602h.03h], : RPDO3-3 Mapping, : RPM33, : CAN +(long)(&co1_vars.co_RPDO3_4Mapping), //[1602h.04h], : RPDO3-4 Mapping, : RPM34, : CAN +(long)(&co1_vars.co_RPDO4_1Mapping), //[1603h.01h], : RPDO4-1 Mapping, : RPM41, : CAN +(long)(&co1_vars.co_RPDO4_2Mapping), //[1603h.02h], : RPDO4-2 Mapping, : RPM42, : CAN +(long)(&co1_vars.co_RPDO4_3Mapping), //[1603h.03h], : RPDO4-3 Mapping, : RPM43, : CAN +(long)(&co1_vars.co_RPDO4_4Mapping), //[1603h.04h], : RPDO4-4 Mapping, : RPM44, : CAN +(long)(&co1_vars.co_RPDO5_1Mapping), //[1604h.01h], : RPDO5-1 Mapping, : RPM51, : CAN +(long)(&co1_vars.co_RPDO5_2Mapping), //[1604h.02h], : RPDO5-2 Mapping, : RPM52, : CAN +(long)(&co1_vars.co_RPDO5_3Mapping), //[1604h.03h], : RPDO5-3 Mapping, : RPM53, : CAN +(long)(&co1_vars.co_RPDO5_4Mapping), //[1604h.04h], : RPDO5-4 Mapping, : RPM54, : CAN +(long)(&co1_vars.co_RPDO6_1Mapping), //[1605h.01h], : RPDO6-1 Mapping, : RPM61, : CAN +(long)(&co1_vars.co_RPDO6_2Mapping), //[1605h.02h], : RPDO6-2 Mapping, : RPM62, : CAN +(long)(&co1_vars.co_RPDO6_3Mapping), //[1605h.03h], : RPDO6-3 Mapping, : RPM63, : CAN +(long)(&co1_vars.co_RPDO6_4Mapping), //[1605h.04h], : RPDO6-4 Mapping, : RPM64, : CAN +(long)(&co1_vars.co_RPDO7_1Mapping), //[1606h.01h], : RPDO7-1 Mapping, : RPM71, : CAN +(long)(&co1_vars.co_RPDO7_2Mapping), //[1606h.02h], : RPDO7-2 Mapping, : RPM72, : CAN +(long)(&co1_vars.co_RPDO7_3Mapping), //[1606h.03h], : RPDO7-3 Mapping, : RPM73, : CAN +(long)(&co1_vars.co_RPDO7_4Mapping), //[1606h.04h], : RPDO7-4 Mapping, : RPM74, : CAN +(long)(&co1_vars.co_RPDO8_1Mapping), //[1607h.01h], : RPDO8-1 Mapping, : RPM81, : CAN +(long)(&co1_vars.co_RPDO8_2Mapping), //[1607h.02h], : RPDO8-2 Mapping, : RPM82, : CAN +(long)(&co1_vars.co_RPDO8_3Mapping), //[1607h.03h], : RPDO8-3 Mapping, : RPM83, : CAN +(long)(&co1_vars.co_RPDO8_4Mapping), //[1607h.04h], : RPDO8-4 Mapping, : RPM84, : CAN +(long)(&co1_vars.co_TPDO1COBID), //[1800h.01h], : COB-ID for TPDO1, : ITPDO1, : CAN +(long)(&co1_vars.co_transType), //[1800h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO1ITime), //[1800h.03h], : Inhibit Time 1, : ITime1, : CAN +(long)(&co1_vars.co_compatEntry), //[1800h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO1EventTimer), //[1800h.05h], : Event Timer 1, : EvTmr1, : CAN +(long)(&co1_vars.co_TPDO2COBID), //[1801h.01h], : COB-ID for TPDO2, : ITPDO2, : CAN +(long)(&co1_vars.co_transType), //[1801h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO2ITime), //[1801h.03h], : Inhibit Time 2, : ITime2, : CAN +(long)(&co1_vars.co_compatEntry), //[1801h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO2EventTimer), //[1801h.05h], : Event Timer 2, : EvTmr2, : CAN +(long)(&co1_vars.co_TPDO3COBID), //[1802h.01h], : COB-ID for TPDO3, : ITPDO3, : CAN +(long)(&co1_vars.co_transType), //[1802h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO3ITime), //[1802h.03h], : Inhibit Time 3, : ITime3, : CAN +(long)(&co1_vars.co_compatEntry), //[1802h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO3EventTimer), //[1802h.05h], : Event Timer 3, : EvTmr3, : CAN +(long)(&co1_vars.co_TPDO4COBID), //[1803h.01h], : COB-ID for TPDO4, : ITPDO4, : CAN +(long)(&co1_vars.co_transType), //[1803h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO4ITime), //[1803h.03h], : Inhibit Time 4, : ITime4, : CAN +(long)(&co1_vars.co_compatEntry), //[1803h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO4EventTimer), //[1803h.05h], : Event Timer 4, : EvTmr4, : CAN +(long)(&co1_vars.co_TPDO5COBID), //[1804h.01h], : COB-ID for TPDO5, : ITPDO5, : CAN +(long)(&co1_vars.co_transType), //[1804h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO5ITime), //[1804h.03h], : Inhibit Time 5, : ITime5, : CAN +(long)(&co1_vars.co_compatEntry), //[1804h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO5EventTimer), //[1804h.05h], : Event Timer 5, : EvTmr5, : CAN +(long)(&co1_vars.co_TPDO6COBID), //[1805h.01h], : COB-ID for TPDO6, : ITPDO6, : CAN +(long)(&co1_vars.co_transType), //[1805h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO6ITime), //[1805h.03h], : Inhibit Time 6, : ITime6, : CAN +(long)(&co1_vars.co_compatEntry), //[1805h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO6EventTimer), //[1805h.05h], : Event Timer 6, : EvTmr6, : CAN +(long)(&co1_vars.co_TPDO7COBID), //[1806h.01h], : COB-ID for TPDO7, : ITPDO7, : CAN +(long)(&co1_vars.co_transType), //[1806h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO7ITime), //[1806h.03h], : Inhibit Time 7, : ITime7, : CAN +(long)(&co1_vars.co_compatEntry), //[1806h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO7EventTimer), //[1806h.05h], : Event Timer 7, : EvTmr7, : CAN +(long)(&co1_vars.co_TPDO8COBID), //[1807h.01h], : COB-ID for TPDO8, : ITPDO8, : CAN +(long)(&co1_vars.co_transType), //[1807h.02h], : , : TransT, : CAN +(long)(&co1_vars.co_TPDO8ITime), //[1807h.03h], : Inhibit Time 8, : ITime8, : CAN +(long)(&co1_vars.co_compatEntry), //[1807h.04h], : Compatibility Entry, : CompEn, : CAN +(long)(&co1_vars.co_TPDO8EventTimer), //[1807h.05h], : Event Timer 8, : EvTmr8, : CAN +(long)(&co1_vars.co_TPDO1_1Mapping), //[1A00h.01h], : TPDO1-1 Mapping, : TPM11, : CAN +(long)(&co1_vars.co_TPDO1_2Mapping), //[1A00h.02h], : TPDO1-2 Mapping, : TPM12, : CAN +(long)(&co1_vars.co_TPDO1_3Mapping), //[1A00h.03h], : TPDO1-3 Mapping, : TPM13, : CAN +(long)(&co1_vars.co_TPDO1_4Mapping), //[1A00h.04h], : TPDO1-4 Mapping, : TPM14, : CAN +(long)(&co1_vars.co_TPDO2_1Mapping), //[1A01h.01h], : TPDO2-1 Mapping, : TPM21, : CAN +(long)(&co1_vars.co_TPDO2_2Mapping), //[1A01h.02h], : TPDO2-2 Mapping, : TPM22, : CAN +(long)(&co1_vars.co_TPDO2_3Mapping), //[1A01h.03h], : TPDO2-3 Mapping, : TPM23, : CAN +(long)(&co1_vars.co_TPDO2_4Mapping), //[1A01h.04h], : TPDO2-4 Mapping, : TPM24, : CAN +(long)(&co1_vars.co_TPDO3_1Mapping), //[1A02h.01h], : TPDO3-1 Mapping, : TPM31, : CAN +(long)(&co1_vars.co_TPDO3_2Mapping), //[1A02h.02h], : TPDO3-2 Mapping, : TPM32, : CAN +(long)(&co1_vars.co_TPDO3_3Mapping), //[1A02h.03h], : TPDO3-3 Mapping, : TPM33, : CAN +(long)(&co1_vars.co_TPDO3_4Mapping), //[1A02h.04h], : TPDO3-4 Mapping, : TPM34, : CAN +(long)(&co1_vars.co_TPDO4_1Mapping), //[1A03h.01h], : TPDO4-1 Mapping, : TPM41, : CAN +(long)(&co1_vars.co_TPDO4_2Mapping), //[1A03h.02h], : TPDO4-2 Mapping, : TPM42, : CAN +(long)(&co1_vars.co_TPDO4_3Mapping), //[1A03h.03h], : TPDO4-3 Mapping, : TPM43, : CAN +(long)(&co1_vars.co_TPDO4_4Mapping), //[1A03h.04h], : TPDO4-4 Mapping, : TPM44, : CAN +(long)(&co1_vars.co_TPDO5_1Mapping), //[1A04h.01h], : TPDO5-1 Mapping, : TPM51, : CAN +(long)(&co1_vars.co_TPDO5_2Mapping), //[1A04h.02h], : TPDO5-2 Mapping, : TPM52, : CAN +(long)(&co1_vars.co_TPDO5_3Mapping), //[1A04h.03h], : TPDO5-3 Mapping, : TPM53, : CAN +(long)(&co1_vars.co_TPDO5_4Mapping), //[1A04h.04h], : TPDO5-4 Mapping, : TPM54, : CAN +(long)(&co1_vars.co_TPDO6_1Mapping), //[1A05h.01h], : TPDO6-1 Mapping, : TPM61, : CAN +(long)(&co1_vars.co_TPDO6_2Mapping), //[1A05h.02h], : TPDO6-2 Mapping, : TPM62, : CAN +(long)(&co1_vars.co_TPDO6_3Mapping), //[1A05h.03h], : TPDO6-3 Mapping, : TPM63, : CAN +(long)(&co1_vars.co_TPDO6_4Mapping), //[1A05h.04h], : TPDO6-4 Mapping, : TPM64, : CAN +(long)(&co1_vars.co_TPDO7_1Mapping), //[1A06h.01h], : TPDO7-1 Mapping, : TPM71, : CAN +(long)(&co1_vars.co_TPDO7_2Mapping), //[1A06h.02h], : TPDO7-2 Mapping, : TPM72, : CAN +(long)(&co1_vars.co_TPDO7_3Mapping), //[1A06h.03h], : TPDO7-3 Mapping, : TPM73, : CAN +(long)(&co1_vars.co_TPDO7_4Mapping), //[1A06h.04h], : TPDO7-4 Mapping, : TPM74, : CAN +(long)(&co1_vars.co_TPDO8_1Mapping), //[1A07h.01h], : TPDO8-1 Mapping, : TPM81, : CAN +(long)(&co1_vars.co_TPDO8_2Mapping), //[1A07h.02h], : TPDO8-2 Mapping, : TPM82, : CAN +(long)(&co1_vars.co_TPDO8_3Mapping), //[1A07h.03h], : TPDO8-3 Mapping, : TPM83, : CAN +(long)(&co1_vars.co_TPDO8_4Mapping), //[1A07h.04h], : TPDO8-4 Mapping, : TPM84, : CAN +(long)(&co1_vars.co_nodeID), //[2000h.00h], : CAN NODE-ID, : NodeID, : CAN +(long)(&co1_vars.co_bitRate), //[2001h.00h], : CAN Bit Rate, : CANBR, : CAN, 0 2: 0000000000000111b +(long)(&co1_vars.co_vendorID), //[2002h.01h], : , : VendID, : CAN +(long)(&co1_vars.co_productCode), //[2002h.02h], : , : PrCode, : CAN +(long)(&co1_vars.co_revisionNumber), //[2002h.03h], : , : RevNum, : CAN +(long)(&co1_vars.co_serialNumber), //[2002h.04h], : , : SerNum, : CAN +(long)(&co1_vars.co_specialData1), //[2003h.01h], : Special Data 1, : SpDat1, : CAN +(long)(&co1_vars.co_specialData2), //[2003h.02h], : Special Data 2, : SpDat2, : CAN +(long)(&co1_vars.co_specialData3), //[2003h.03h], : Special Data 3, : SpDat3, : CAN +(long)(&co1_vars.co_specialData4), //[2003h.04h], : Special Data 4, : SpDat4, : CAN +(long)(&co1_vars.co_secretCode), //[2004h.00h], : Secret Code, : Secret, : CAN +(long)(&co1_vars.co_protectBit), //[2005h.00h], : Protect Bit, : ProtBt, : CAN, 0 0: 0000000000000001b +(long)(&co1_odHash[0]), //[2007h.01h], : md5_hash_0, : md5_hash_0, : CAN +(long)(&co1_odHash[1]), //[2007h.02h], : md5_hash_1, : md5_hash_1, : CAN +(long)(&co1_odHash[2]), //[2007h.03h], : md5_hash_2, : md5_hash_2, : CAN +(long)(&co1_odHash[3]), //[2007h.04h], : md5_hash_3, : md5_hash_3, : CAN +(long)(&co1_vars.co_heartbeatFlag0), //[2010h.01h], : Heartbeat Flag 0-31, : HFlag0, : CAN +(long)(&co1_vars.co_heartbeatFlag1), //[2010h.02h], : Heartbeat Flag 32-63, : HFlag1, : CAN +(long)(&co1_vars.co_heartbeatFlag2), //[2010h.03h], : Heartbeat Flag 64-95, : HFlag2, : CAN +(long)(&co1_vars.co_heartbeatFlag3), //[2010h.04h], : Heartbeat Flag 96-127, : HFlag3, : CAN +(long)(&co1_vars.co_heartbeatMask0), //[2011h.01h], : Heartbeat Mask 0-31, : HMask0, : CAN +(long)(&co1_vars.co_heartbeatMask1), //[2011h.02h], : Heartbeat Mask 32-63, : HMask1, : CAN +(long)(&co1_vars.co_heartbeatMask2), //[2011h.03h], : Heartbeat Mask 64-95, : HMask2, : CAN +(long)(&co1_vars.co_heartbeatMask3), //[2011h.04h], : Heartbeat Mask 96-127, : HMask3, : CAN +(long)(&co1_vars.co_heartbeatAutoStart), //[2012h.00h], : Heartbeat Autostart, : HBASta, : CAN, 0 0: 0000000000000001b +(long)(&co1_vars.co_heartbeatAutoRecovery), //[2014h.00h], : Heartbeat Autorecovery, : HBARec, : CAN, 0 0: 0000000000000001b +(long)(&co1_vars.co_nodeState), //[2015h.00h], : CAN-Open, : State, : CAN +(long)(&co1_vars.co_emergencyErrorCode), //[2016h.00h], : Emergency Error Code, : EmErCo, : CAN +(long)(&co1_vars.co_deviceErrorState), //[2017h.00h], : Device Error State, : DeErSt, : CAN +(long)(&co1_vars.co_ODCommand), //[2080h.01h], : Object Dictionary Command, : ODComm, : CAN +(long)(&co1_vars.co_currentODIndex), //[2080h.02h], : Current OD Index, : ODCInd, : CAN +(long)(&co1_vars.co_currentODSubIndex), //[2080h.03h], : Current OD Sub-Index, : ODCSub, : CAN +(long)(&co1_vars.co_currentODEText), //[2080h.04h], : Current OD Element Text, : ODCTxt, : CAN +(long)(&co1_vars.co_currentODEFormat), //[2080h.05h], : Current OD Element Format, : ODCFrm, : CAN +(long)(&co1_vars.co_currentODEMin), //[2080h.06h], : Current OD Element Min, : ODCMin, : CAN +(long)(&co1_vars.co_currentODEMax), //[2080h.07h], : Current OD Element Max, : ODCMax, : CAN +(long)(&co1_vars.co_currentODEDefault), //[2080h.08h], : Current OD Element Default, : ODCDef, : CAN +(long)(&co1_vars.co_currentODEMinLow), //[2080h.09h], : Current OD Element MinLow, : ODCMiL, : CAN +(long)(&co1_vars.co_currentODEMaxLow), //[2080h.0Ah], : Current OD Element MaxLow, : ODCMaL, : CAN +(long)(&co1_vars.co_currentODEDefaultLow), //[2080h.0Bh], : Current OD Element Default Low, : ODCDeL, : CAN +(long)(&co1_vars.co_currentODEAddrLow), //[2080h.0Ch], : Current OD Element Address, : ODCAdr, : CAN +(long)(&co1_vars.co_currentODEAddrLow), //[2080h.0Dh], : Current OD Element Address, : ODCAdr, : CAN +(long)(&co1_vars.co_currentODEType), //[2080h.0Eh], : , : , : CAN +(long)(&co1_vars.co_odIndexSize), //[2081h.00h], : , : , : CAN +(long)(&co1_vars.co_defaultIndex1), //[2082h.01h], : Default Index 1, : DfInd1, : CAN +(long)(&co1_vars.co_defaultIndex2), //[2082h.02h], : Default Index 2, : DfInd2, : CAN +(long)(&co1_vars.co_maskElement01), //[2083h.01h], : Mask Element, : MskEl0, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElement01), //[2083h.02h], : Mask Element, : MskEl1, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElement23), //[2083h.03h], : Mask Element, : MskEl2, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElement23), //[2083h.04h], : Mask Element, : MskEl3, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElement45), //[2083h.05h], : Mask Element, : MskEl4, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElement45), //[2083h.06h], : Mask Element, : MskEl5, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElement67), //[2083h.07h], : Mask Element, : MskEl6, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElement67), //[2083h.08h], : Mask Element, : MskEl7, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElement89), //[2083h.09h], : Mask Element, : MskEl8, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElement89), //[2083h.0Ah], : Mask Element, : MskEl9, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElementAB), //[2083h.0Bh], : Mask Element, : MskElA, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElementAB), //[2083h.0Ch], : Mask Element, : MskElB, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElementCD), //[2083h.0Dh], : Mask Element, : MskElC, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElementCD), //[2083h.0Eh], : Mask Element, : MskElD, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_maskElementEF), //[2083h.0Fh], : Mask Element, : MskElE, : CAN, 0 7: 0000000011111111b +(long)(&co1_vars.co_maskElementEF), //[2083h.10h], : Mask Element, : MskElF, : CAN, 8 15: 1111111100000000b +(long)(&co1_vars.co_scaleNum0), //[2100h.01h], : Scale Number 0, : SN0, : CAN +(long)(&co1_vars.co_scaleNum0Format), //[2100h.02h], : Scale Number 0 Format, : S0Fmt, : CAN +(long)(&co1_vars.co_scaleNum0Format), //[2100h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum0Format), //[2100h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum0Format), //[2100h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum0Format), //[2100h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum1), //[2101h.01h], : Scale Number 1, : SN1, : CAN +(long)(&co1_vars.co_scaleNum1Format), //[2101h.02h], : Scale Number 1 Format, : S1Fmt, : CAN +(long)(&co1_vars.co_scaleNum1Format), //[2101h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum1Format), //[2101h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum1Format), //[2101h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum1Format), //[2101h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum2), //[2102h.01h], : Scale Number 2, : SN2, : CAN +(long)(&co1_vars.co_scaleNum2Format), //[2102h.02h], : Scale Number 2 Format, : S2Fmt, : CAN +(long)(&co1_vars.co_scaleNum2Format), //[2102h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum2Format), //[2102h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum2Format), //[2102h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum2Format), //[2102h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum3), //[2103h.01h], : Scale Number 3, : SN3, : CAN +(long)(&co1_vars.co_scaleNum3Format), //[2103h.02h], : Scale Number 3 Format, : S3Fmt, : CAN +(long)(&co1_vars.co_scaleNum3Format), //[2103h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum3Format), //[2103h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum3Format), //[2103h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum3Format), //[2103h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum4), //[2104h.01h], : Scale Number 4, : SN4, : CAN +(long)(&co1_vars.co_scaleNum4Format), //[2104h.02h], : Scale Number 4 Format, : S4Fmt, : CAN +(long)(&co1_vars.co_scaleNum4Format), //[2104h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum4Format), //[2104h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum4Format), //[2104h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum4Format), //[2104h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum5), //[2105h.01h], : Scale Number 5, : SN5, : CAN +(long)(&co1_vars.co_scaleNum5Format), //[2105h.02h], : Scale Number 5 Format, : S5Fmt, : CAN +(long)(&co1_vars.co_scaleNum5Format), //[2105h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum5Format), //[2105h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum5Format), //[2105h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum5Format), //[2105h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum6), //[2106h.01h], : Scale Number 6, : SN6, : CAN +(long)(&co1_vars.co_scaleNum6Format), //[2106h.02h], : Scale Number 6 Format, : S6Fmt, : CAN +(long)(&co1_vars.co_scaleNum6Format), //[2106h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum6Format), //[2106h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum6Format), //[2106h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum6Format), //[2106h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum7), //[2107h.01h], : Scale Number 7, : SN7, : CAN +(long)(&co1_vars.co_scaleNum7Format), //[2107h.02h], : Scale Number 7 Format, : S7Fmt, : CAN +(long)(&co1_vars.co_scaleNum7Format), //[2107h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum7Format), //[2107h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum7Format), //[2107h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum7Format), //[2107h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum8), //[2108h.01h], : Scale Number 8, : SN8, : CAN +(long)(&co1_vars.co_scaleNum8Format), //[2108h.02h], : Scale Number 8 Format, : S8Fmt, : CAN +(long)(&co1_vars.co_scaleNum8Format), //[2108h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum8Format), //[2108h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum8Format), //[2108h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum8Format), //[2108h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum9), //[2109h.01h], : Scale Number 9, : SN9, : CAN +(long)(&co1_vars.co_scaleNum9Format), //[2109h.02h], : Scale Number 9 Format, : S9Fmt, : CAN +(long)(&co1_vars.co_scaleNum9Format), //[2109h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum9Format), //[2109h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum9Format), //[2109h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum9Format), //[2109h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumA), //[210Ah.01h], : Scale Number A, : SNA, : CAN +(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.02h], : Scale Number A Format, : SAFmt, : CAN +(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumAFormat), //[210Ah.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumB), //[210Bh.01h], : Scale Number B, : SNB, : CAN +(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.02h], : Scale Number B Format, : SBFmt, : CAN +(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumBFormat), //[210Bh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumC), //[210Ch.01h], : Scale Number C, : SNC, : CAN +(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.02h], : Scale Number C Format, : SCFmt, : CAN +(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumCFormat), //[210Ch.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumD), //[210Dh.01h], : Scale Number D, : SND, : CAN +(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.02h], : Scale Number D Format, : SDFmt, : CAN +(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumDFormat), //[210Dh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumE), //[210Eh.01h], : Scale Number E, : SNE, : CAN +(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.02h], : Scale Number E Format, : SEFmt, : CAN +(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumEFormat), //[210Eh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNumF), //[210Fh.01h], : Scale Number F, : SNF, : CAN +(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.02h], : Scale Number F Format, : SFFmt, : CAN +(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNumFFormat), //[210Fh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum10), //[2110h.01h], : Scale Number 10, : SN10, : CAN +(long)(&co1_vars.co_scaleNum10Format), //[2110h.02h], : Scale Number 10 Format, : S10Fmt, : CAN +(long)(&co1_vars.co_scaleNum10Format), //[2110h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum10Format), //[2110h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum10Format), //[2110h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum10Format), //[2110h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum11), //[2111h.01h], : Scale Number 11, : SN11, : CAN +(long)(&co1_vars.co_scaleNum11Format), //[2111h.02h], : Scale Number 11 Format, : S11Fmt, : CAN +(long)(&co1_vars.co_scaleNum11Format), //[2111h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum11Format), //[2111h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum11Format), //[2111h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum11Format), //[2111h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum12), //[2112h.01h], : Scale Number 12, : SN12, : CAN +(long)(&co1_vars.co_scaleNum12Format), //[2112h.02h], : Scale Number 12 Format, : S12Fmt, : CAN +(long)(&co1_vars.co_scaleNum12Format), //[2112h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum12Format), //[2112h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum12Format), //[2112h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum12Format), //[2112h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum13), //[2113h.01h], : Scale Number 13, : SN13, : CAN +(long)(&co1_vars.co_scaleNum13Format), //[2113h.02h], : Scale Number 13 Format, : S13Fmt, : CAN +(long)(&co1_vars.co_scaleNum13Format), //[2113h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum13Format), //[2113h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum13Format), //[2113h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum13Format), //[2113h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum14), //[2114h.01h], : Scale Number 14, : SN14, : CAN +(long)(&co1_vars.co_scaleNum14Format), //[2114h.02h], : Scale Number 14 Format, : S14Fmt, : CAN +(long)(&co1_vars.co_scaleNum14Format), //[2114h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum14Format), //[2114h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum14Format), //[2114h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum14Format), //[2114h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum15), //[2115h.01h], : Scale Number 15, : SN15, : CAN +(long)(&co1_vars.co_scaleNum15Format), //[2115h.02h], : Scale Number 15Format, : S15Fmt, : CAN +(long)(&co1_vars.co_scaleNum15Format), //[2115h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum15Format), //[2115h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum15Format), //[2115h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum15Format), //[2115h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum16), //[2116h.01h], : Scale Number 16, : SN16, : CAN +(long)(&co1_vars.co_scaleNum16Format), //[2116h.02h], : Scale Number 16Format, : S16Fmt, : CAN +(long)(&co1_vars.co_scaleNum16Format), //[2116h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum16Format), //[2116h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum16Format), //[2116h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum16Format), //[2116h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum17), //[2117h.01h], : Scale Number 17, : SN17, : CAN +(long)(&co1_vars.co_scaleNum17Format), //[2117h.02h], : Scale Number 17Format, : S17Fmt, : CAN +(long)(&co1_vars.co_scaleNum17Format), //[2117h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum17Format), //[2117h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum17Format), //[2117h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum17Format), //[2117h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum18), //[2118h.01h], : Scale Number 18, : SN18, : CAN +(long)(&co1_vars.co_scaleNum18Format), //[2118h.02h], : Scale Number 18Format, : S18Fmt, : CAN +(long)(&co1_vars.co_scaleNum18Format), //[2118h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum18Format), //[2118h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum18Format), //[2118h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum18Format), //[2118h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum19), //[2119h.01h], : Scale Number 19, : SN19, : CAN +(long)(&co1_vars.co_scaleNum19Format), //[2119h.02h], : Scale Number 19Format, : S19Fmt, : CAN +(long)(&co1_vars.co_scaleNum19Format), //[2119h.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum19Format), //[2119h.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum19Format), //[2119h.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum19Format), //[2119h.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum1A), //[211Ah.01h], : Scale Number 1A, : SN1A, : CAN +(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.02h], : Scale Number 1AFormat, : S1AFmt, : CAN +(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum1AFormat), //[211Ah.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum1B), //[211Bh.01h], : Scale Number 1B, : SN1B, : CAN +(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.02h], : Scale Number 1BFormat, : S1BFmt, : CAN +(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum1BFormat), //[211Bh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum1C), //[211Ch.01h], : Scale Number 1C, : SN1C, : CAN +(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.02h], : Scale Number 1C Format, : S1CFmt, : CAN +(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum1CFormat), //[211Ch.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&co1_vars.co_scaleNum1D), //[211Dh.01h], : Scale Number 1D, : SN1D, : CAN +(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.02h], : Scale Number 1D Format, : S1DFmt, : CAN +(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.03h], : Scale Number Format Q, : Q-type, : CAN, 0 4: 0000000000011111b +(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.04h], : Scale Number Format NumOfFloat, : NFloat, : CAN, 5 6: 0000000001100000b +(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.05h], : Scale Number Format Prefix, : Prefix, : CAN, 7 9: 0000001110000000b +(long)(&co1_vars.co_scaleNum1DFormat), //[211Dh.06h], : Scale Number Format Units, : Units, : CAN, 10 15: 1111110000000000b +(long)(&cmd.all), //[2502h.01h], : , : , : , 0 0: 0000000000000001b +(long)(&cmd.all), //[2502h.02h], : , : , : , 1 1: 0000000000000010b +(long)(&cmd.all), //[2502h.03h], : , : , : , 2 2: 0000000000000100b +(long)(&cmd.all), //[2502h.04h], : CAN, : CAN, : +(long)(&drv_interface.req_data), //[2506h.01h], : , : OfflineCounterMax, : +(long)(&drv_interface.ans_data), //[2506h.02h], : , : OfflineCounter, : +(long)(&drv_interface.data_Low), //[2506h.03h], : data_Low, : data_L, : +(long)(&drv_interface.data_High), //[2506h.04h], : data_High, : data_H, : +(long)(&sm_prot.Main_ErrorCode), //[2532h.01h], : ARM, : ARM, : . , 0 7: 0000000011111111b +(long)(&sm_prot.Main_ErrorCode), //[2532h.02h], : , : +, : . , 8 15: 1111111100000000b +(long)(&sm_prot.Main_Flags), //[2532h.03h], : , : System, : . , 0 0: 0000000000000001b +(long)(&disp_group_number), //[2534h.01h], : , : , : CAN +(long)(&VendorToken), //[2600h.01h], : VendorToken, : VendorToken, : +(long)(&drv_status.all), //[3000h.00h], : , : , : , 0 5: 0000000000111111b +(long)(&msCounter), //[3100h.01h], : 1 , : ..1 , : +(long)(&FastCounter), //[3100h.02h], : 10 , : ..10 , : +(long)(&LoopCounter), //[3100h.03h], : BackgroundCounter, : BackgroundCounter, : +(long)(&TIsr10), //[3100h.04h], : T_10, : T_10, : +(long)(&TIsr1), //[3100h.05h], : T_1, : T_1, : +(long)(&rmp.T), //[5000h.01h], : T , : rmpT, : +(long)(&rmp.input), //[5000h.02h], : , : , : +(long)(&rmp.output), //[5000h.03h], : , : , : +(long)(&pid_id.pid_ref_reg3), //[5100h.01h], : , : -, : . Id +(long)(&pid_id.pid_fdb_reg3), //[5100h.02h], : , : ., : . Id +(long)(&pid_id.Kp_reg3), //[5100h.03h], : . . Kp, : Kp, : . Id +(long)(&pid_id.pid_out_max), //[5100h.04h], : , : Max, : . Id +(long)(&pid_id.pid_out_min), //[5100h.05h], : , : Min, : . Id +(long)(&pid_id.Ki_reg3), //[5100h.06h], : . Ki, : Ki, : . Id +(long)(&pid_id.Kd_reg3), //[5100h.07h], : . . Kd, : Kd, : . Id +(long)(&pid_id.Kc_reg3), //[5100h.08h], : .., : Kc, : . Id +(long)(&pid_id.e_reg3), //[5100h.09h], : , : , : . Id +(long)(&pid_id.pid_out_reg3), //[5100h.0Ah], : , : , : . Id +(long)(&pid_id.up_reg3), //[5100h.0Bh], : .., : .., : . Id +(long)(&pid_id.ui_reg3), //[5100h.0Ch], : .., : .., : . Id +(long)(&pid_id.ud_reg3), //[5100h.0Dh], : .., : .., : . Id +(long)(&pid_spd.pid_ref_reg3), //[5101h.01h], : , : pisref, : . +(long)(&pid_spd.pid_fdb_reg3), //[5101h.02h], : , : pisfbd, : . +(long)(&pid_spd.Kp_reg3), //[5101h.03h], : . . Kp, : Kp, : . +(long)(&pid_spd.pid_out_max), //[5101h.04h], : , : Max, : . +(long)(&pid_spd.pid_out_min), //[5101h.05h], : , : Min, : . +(long)(&pid_spd.Ki_reg3), //[5101h.06h], : . Ki, : Ki, : . +(long)(&pid_spd.Kd_reg3), //[5101h.07h], : . . Kd, : pisKd, : . +(long)(&pid_spd.Kc_reg3), //[5101h.08h], : .., : Kc, : . +(long)(&pid_spd.e_reg3), //[5101h.09h], : , : , : . +(long)(&pid_spd.pid_out_reg3), //[5101h.0Ah], : , : pisout, : . +(long)(&pid_spd.up_reg3), //[5101h.0Bh], : .., : .., : . +(long)(&pid_spd.ui_reg3), //[5101h.0Ch], : .., : .., : . +(long)(&pid_spd.ud_reg3), //[5101h.0Dh], : .., : .., : . +(long)(&pid_spd.saterr_reg3), //[5101h.0Eh], : , : . , : . +(long)(&pid_iq.pid_ref_reg3), //[5102h.01h], : , : -, : . Iq +(long)(&pid_iq.pid_fdb_reg3), //[5102h.02h], : , : ., : . Iq +(long)(&pid_iq.Kp_reg3), //[5102h.03h], : . . Kp, : Kp, : . Iq +(long)(&pid_iq.pid_out_max), //[5102h.04h], : , : Max, : . Iq +(long)(&pid_iq.pid_out_min), //[5102h.05h], : , : Min, : . Iq +(long)(&pid_iq.Ki_reg3), //[5102h.06h], : . Ki, : Ki, : . Iq +(long)(&pid_iq.Kd_reg3), //[5102h.07h], : . . Kd, : Kd, : . Iq +(long)(&pid_iq.Kc_reg3), //[5102h.08h], : .., : Kc, : . Iq +(long)(&pid_iq.e_reg3), //[5102h.09h], : , : , : . Iq +(long)(&pid_iq.pid_out_reg3), //[5102h.0Ah], : , : , : . Iq +(long)(&pid_iq.up_reg3), //[5102h.0Bh], : .., : .., : . Iq +(long)(&pid_iq.ui_reg3), //[5102h.0Ch], : .., : .., : . Iq +(long)(&pid_iq.ud_reg3), //[5102h.0Dh], : .., : .., : . Iq +(long)(&pid_pos.pid_ref_reg3), //[5103h.01h], : , : pisref, : . +(long)(&pid_pos.pid_ref_reg3), //[5103h.02h], : , : pisref, : . +(long)(&pid_pos.pid_fdb_reg3), //[5103h.03h], : , : pisfbd, : . +(long)(&pid_pos.pid_fdb_reg3), //[5103h.04h], : , : pisfbd, : . +(long)(&pid_pos.Kp_reg3), //[5103h.05h], : . . Kp, : Kp, : . +(long)(&pid_pos.pid_out_max), //[5103h.06h], : , : Max, : . +(long)(&pid_pos.pid_out_min), //[5103h.07h], : , : Min, : . +(long)(&pid_pos.Ki_reg3), //[5103h.08h], : . Ki, : Ki, : . +(long)(&pid_pos.Kd_reg3), //[5103h.09h], : . . Kd, : pisKd, : . +(long)(&pid_pos.DiffDelim), //[5103h.0Ah], : . . , : . . , : . +(long)(&pid_pos.Kf_d), //[5103h.0Bh], : . , : . , : . +(long)(&pid_pos.Kc_reg3), //[5103h.0Ch], : .., : Kc, : . +(long)(&pid_pos.DeadZone), //[5103h.0Dh], : , : , : . +(long)(&pid_pos.e_reg3), //[5103h.0Eh], : , : , : . +(long)(&pid_spd.saterr_reg3), //[5103h.0Fh], : , : . , : . +(long)(&pid_pos.pid_out_reg3), //[5103h.10h], : , : pisout, : . +(long)(&pid_pos.up_reg3), //[5103h.11h], : .., : .., : . +(long)(&pid_pos.ui_reg3), //[5103h.12h], : .., : .., : . +(long)(&pid_pos.ud_reg3), //[5103h.13h], : .., : .., : . +(long)(&pid_pos.e_reg3_filterOut), //[5103h.14h], : , : , : . +(long)(&pwm.UalphaRef), //[5105h.01h], : Ua, : Ua, : +(long)(&pwm.UbetaRef), //[5105h.02h], : Ub, : Ub, : +(long)(&pwm.U_lim), //[5105h.03h], : U_, : U_, : +(long)(&pwm.GammaA), //[5105h.04h], : GammaA, : GmA, : +(long)(&pwm.GammaB), //[5105h.05h], : GammaB, : GmB, : +(long)(&pwm.GammaC), //[5105h.06h], : GammaC, : GmC, : +(long)(&pwm.k_pwm), //[5105h.07h], : TPWM, : TPWM, : +(long)(&pwm.DeadBand), //[5105h.08h], : (), : . , : +(long)(&pwm.MinGammaLimit), //[5105h.09h], : . ., : GamLim, : +(long)(&pwm.UdCompK), //[5105h.0Ah], : . Ud, : UdK, : +(long)(&pwm.UdCompEnable), //[5105h.0Bh], : Ud, : Ud, : , 0 0: 0000000000000001b +(long)(&pwm.PWM_type), //[5105h.0Ch], : , : , : +(long)(&pwm.ULimitation), //[5105h.0Dh], : ULimitation, : ULimitation, : +(long)(&pwm.Frequency), //[5105h.0Eh], : , : F, : +(long)(&pwm.sector), //[5105h.0Fh], : , : , : +(long)(&pwm.U_mag), //[5105h.10h], : U_, : U_, : +(long)(&pwm.PDP_Fault), //[5105h.11h], : , : F_bits, : +(long)(&sm_ctrl.state), //[510Bh.01h], : sm_state, : smstat, : sm_ctrl +(long)(&drv_status_code), //[510Bh.02h], : drv_status_code, : stcode, : sm_ctrl, 0 7: 0000000011111111b +(long)(&sm_prot.bit_fault1), //[510Eh.01h], : 1, : bitF_1, : +(long)(&sm_prot.bit_fault2), //[510Eh.02h], : 2, : bitF_2, : +(long)(&sm_prot.mask_fault1), //[510Eh.03h], : 1L, : mask1L, : , 0 7: 0000000011111111b +(long)(&sm_prot.mask_fault1), //[510Eh.04h], : 1H, : mask1H, : , 8 15: 1111111100000000b +(long)(&sm_prot.mask_fault2), //[510Eh.05h], : 2L, : mask2L, : , 0 7: 0000000011111111b +(long)(&sm_prot.mask_fault2), //[510Eh.06h], : 2H, : mask2H, : , 8 15: 1111111100000000b +(long)(&sm_prot.Imax_protect), //[510Eh.07h], : , : ., : +(long)(&sm_prot.Umax_protect), //[510Eh.08h], : , : Ud_max, : +(long)(&sm_prot.Umin_protect), //[510Eh.09h], : , : Ud_min, : +(long)(&sm_prot.speed_max), //[510Eh.0Ah], : , : speed_max, : +(long)(&sm_prot.T_max), //[510Eh.0Bh], : , : t_max, : +(long)(&refs.speed_ref), //[5112h.01h], : , : _, : +(long)(&refs.Iq_ref), //[5112h.02h], : . , : , : +(long)(&refs.i_flux_ref), //[5112h.03h], : , : , : +(long)(&refs.theta_elec), //[5112h.04h], : theta_elec, : , : +(long)(&refs.uf_ref), //[5112h.05h], : , : Uf_ref, : +(long)(&drv_params.p), //[5113h.01h], : , : , : . +(long)(&drv_params.I_nom), //[5113h.02h], : , : I, : . +(long)(&drv_params.U_nom), //[5113h.03h], : ., : U_, : . +(long)(&drv_params.speed_nom), //[5113h.04h], : , : , : . +(long)(&drv_params.Udc_nom), //[5113h.05h], : , : Udc, : . +(long)(&drv_params.Rs), //[5113h.06h], : Rs, : Rs, : . +(long)(&drv_params.Ls), //[5113h.07h], : Ls, : Ls, : . +(long)(&drv_params.freq_nom), //[5113h.08h], : , : .., : . +(long)(&drv_params.sens_type), //[5113h.09h], : , : Sens_type, : . , 0 2: 0000000000000111b +(long)(&sm_ctrl.run_mode), //[5114h.01h], : , : , : +(long)(&sw.all), //[5114h.02h], : , : , : , 0 0: 0000000000000001b +(long)(&sw.all), //[5114h.03h], : ., : , : , 2 2: 0000000000000100b +(long)(&sw.all), //[5114h.04h], : , : , : , 1 1: 0000000000000010b +(long)(&sw.all), //[5114h.05h], : JTAG, : (null), : , 3 3: 0000000000001000b +(long)(&adc.Imeas_a_gain), //[5116h.01h], : , : Ia, : +(long)(&adc.Imeas_a_offset), //[5116h.02h], : , : Ia, : +(long)(&adc.Imeas_a), //[5116h.03h], : , : Ia_, : +(long)(&adc.Imeas_b_gain), //[5116h.04h], : , : Ib, : +(long)(&adc.Imeas_b_offset), //[5116h.05h], : , : Ib, : +(long)(&adc.Imeas_b), //[5116h.06h], : , : Ib_, : +(long)(&adc.Imeas_c), //[5116h.07h], : , : Ic_, : +(long)(&adc.Udc_meas_gain), //[5116h.08h], : , : Ud, : +(long)(&adc.Udc_meas_offset), //[5116h.09h], : . , : Ud, : +(long)(&adc.Udc_meas), //[5116h.0Ah], : , : Ud, : +(long)(&adc.AI_meas_gain), //[5116h.0Bh], : , : (null), : +(long)(&adc.AI_meas), //[5116h.0Ch], : 1, : ADC_ext1, : +(long)(&vhz.freq), //[511Ah.01h], : , : F_, : U-f +(long)(&vhz.vout), //[511Ah.02h], : , : U_, : U-f +(long)(&vhz.FL), //[511Ah.03h], : , : f [0], : U-f +(long)(&vhz.Vmin), //[511Ah.04h], : , : U [0], : U-f +(long)(&vhz.FH), //[511Ah.05h], : , : f [1], : U-f +(long)(&vhz.Vmax), //[511Ah.06h], : , : U [1], : U-f +(long)(&vhz.Fmax), //[511Ah.07h], : , : f max, : U-f +(long)(&cur_par.speed), //[5138h.01h], : , : , : +(long)(&cur_par.power), //[5138h.02h], : . , : , : +(long)(&cur_par.Is), //[5138h.03h], : , : , : +(long)(&cur_par.ThetaRefCurr), //[5138h.04h], : , : , : +(long)(&cur_par.ThetaCurr), //[5138h.05h], : , : , : +(long)(&cur_par.IsRef), //[5138h.06h], : , : , : +(long)(&global_time.PowerOn_time_min), //[5138h.07h], : , , : Power On Time, : +(long)(&global_time.operational_time_min), //[5138h.08h], : , , : Work Time, : +(long)(&dlog.mode_reset), //[5150h.01h], : dlog.mode_reset, : mode, : dlog +(long)(&dlog.control), //[5150h.02h], : dlog.control, : dlcont, : dlog +(long)(&dlog.ind_subind1), //[5150h.03h], : dlog.ind_subind1, : dlisi1, : dlog +(long)(&dlog.ind_subind2), //[5150h.04h], : dlog.ind_subind2, : dlisi2, : dlog +(long)(&dlog.ind_subind3), //[5150h.05h], : dlog.ind_subind3, : dlisi3, : dlog +(long)(&dlog.ind_subind4), //[5150h.06h], : dlog.ind_subind4, : dlisi4, : dlog +(long)(&dlog.StartBits), //[5150h.07h], : StartBitL, : StrtBL, : dlog, 0 7: 0000000011111111b +(long)(&dlog.StartBits), //[5150h.08h], : StartBitH, : StrtBH, : dlog, 8 15: 1111111100000000b +(long)(&dlog.OneShotOperation), //[5150h.09h], : OneShotOperation, : OneShotOp, : dlog, 0 0: 0000000000000001b +(long)(&dlog.trig_shift), //[5150h.0Ah], : , : N ., : dlog +(long)(&dlog.next_value_var), //[5151h.00h], : dlog.next_value_var, : dlnval, : +(long)(&posspeedEqep.resol), //[5152h.01h], : - , : - , : - +(long)(&posspeedEqep.Posspeed_CTL.all), //[5152h.02h], : , : , : -, 2 2: 0000000000000100b +(long)(&posspeedEqep.SpeedCalcType), //[5152h.03h], : , : SpeedCalcType, : - +(long)(&posspeedEqep.AngleOffset), //[5152h.04h], : , : , : - +(long)(&posspeedEqep.Poscnt_res), //[5152h.05h], : . , : . , : - +(long)(&posspeedEqep.Poscnt_res16), //[5152h.06h], : . , : . , : - +(long)(&posspeedEqep.speed_elec), //[5152h.07h], : , : , : - +(long)(&posspeedEqep.theta_elec), //[5152h.08h], : . ., : . ., : - +(long)(&posspeedEqep.theta_mech), //[5152h.09h], : ., : ., : - +(long)(&posspeedEqep.Posspeed_CTL.all), //[5152h.0Ah], : ., : ., : -, 4 4: 0000000000010000b +(long)(&posspeedEqep.speed_filter.T), //[5152h.0Bh], : , : . , : - +(long)(&posspeedEqep.Posspeed_FLG1.all), //[5152h.0Ch], : Posspeed_FLG1, : Posspeed_FLG1, : - +(long)(&posspeedEqep.GPIOsValue), //[5152h.0Dh], : GPIOsValue, : GPIOsValue, : - +(long)(&posspeedEqep.UPPS_forWatch), //[5152h.0Eh], : UPPS, : UPPS, : - +(long)(&posspeedEqep.Qcprdlat_tmp), //[5152h.0Fh], : QCPRD, : QCPRD, : - +(long)(&posspeedEqep.Qcprdlat16_tmp), //[5152h.10h], : QCPRD, : QCPRD, : - +(long)(&posspeedEqep.QEPSTS), //[5152h.11h], : QEPSTS, : QEPSTS, : - +(long)(&posspeedEqep.RevolutionCounter), //[5152h.12h], : , : revolCounter, : - +(long)(&posspeedEqep.Poscnt_resContinouosInt8), //[5152h.13h], : . , : qcAbsPos, : - +(long)(&posspeedEqep.Poscnt_resContinouosInt), //[5152h.14h], : . , : qcAbsPos, : - +(long)(&posspeedEqep.Poscnt_resContinouosLong), //[5152h.15h], : . , : qcAbsPos, : - +(long)(&posspeedEqep.theta_mechContinouos), //[5152h.16h], : ., : .._, : - +(long)(&posspeedEqep.theta_elecContinouos), //[5152h.17h], : ., : .._, : - +(long)(&posspeedEqep.Index_eventCounter), //[5152h.18h], : , : (null), : - +(long)(&DPReCAP.enabled), //[5155h.01h], : , : , : - +(long)(&DPReCAP.Angle), //[5155h.02h], : , : , : - +(long)(&DPReCAP.speed), //[5155h.03h], : , : , : - +(long)(&DPReCAP.speedMIN), //[5155h.04h], : , : , : - +(long)(&DPReCAP.Angle6), //[5155h.05h], : 6, : 6, : - +(long)(&DPReCAP.DPReCAP_FLG1.all), //[5155h.06h], : - , : - , : -, 0 0: 0000000000000001b +(long)(&DPReCAP.milsecREF), //[5155h.07h], : , : , : - +(long)(&DPReCAP.speedMinREF), //[5155h.08h], : ., : ., : - +(long)(&DPReCAP.CAP_WrongEdgeCnt), //[5155h.09h], : , : , : - +(long)(&DPReCAP.HallCode), //[5155h.0Ah], : , : , : -, 0 2: 0000000000000111b +(long)(&DPReCAP.AngleOffset), //[5155h.0Bh], : , : , : - +(long)(&DPReCAP.ErrorLevel), //[5155h.0Ch], : , : , : - +(long)(&DPReCAP.CAP_WrongEdgeCnt1), //[5155h.0Dh], : 1 , : _1_., : - +(long)(&DPReCAP.CAP_WrongEdgeCnt2), //[5155h.0Eh], : 2 , : _2_., : - +(long)(&DPReCAP.CAP_WrongEdgeCnt3), //[5155h.0Fh], : 3 , : _3_., : - +(long)(&DPReCAP.UserDirection), //[5155h.10h], : , : , : -, 2 2: 0000000000000100b +(long)(&DPReCAP.WrongCodeCounterLimitPerSec), //[5155h.11h], : . , : .., : - +(long)(&DPReCAP.WrongCodeCounter), //[5155h.12h], : - , : ., : - +(long)(&CounterCAP_isr), //[5155h.13h], : , : .Rx.Int., : - +(long)(&cap0_counter), //[5155h.14h], : CAP1, : ..CAP1, : - +(long)(&cap1_counter), //[5155h.15h], : CAP2, : ..CAP2, : - +(long)(&cap2_counter), //[5155h.16h], : CAP3, : ..CAP3, : - +(long)(&SSI_Encoder.resol), //[5157h.01h], : , : qepTik, : -SSI +(long)(&SSI_Encoder.AngleOffset), //[5157h.02h], : , : , : -SSI +(long)(&SSI_Encoder.Poscnt_res), //[5157h.03h], : . , : . , : -SSI +(long)(&SSI_Encoder.speed_elec), //[5157h.04h], : , : , : -SSI +(long)(&SSI_Encoder.theta_elec), //[5157h.05h], : . ., : . ., : -SSI +(long)(&SSI_Encoder.theta_mech), //[5157h.06h], : ., : ., : -SSI +(long)(&SSI_Encoder.theta_mech_filtered), //[5157h.07h], : . , : theta_mech_filtered, : -SSI +(long)(&SSI_Encoder.theta_mech_filterK), //[5157h.08h], : , : . , : -SSI +(long)(&SSI_Encoder.RevolutionCounter), //[5157h.09h], : , : revolCounter, : -SSI +(long)(&SSI_Encoder.Poscnt_resContinouosLong), //[5157h.0Ah], : . , : qcAbsPos, : -SSI +(long)(&SSI_Encoder.Poscnt_resContinouosInt8), //[5157h.0Bh], : . , : qcAbsPos, : -SSI +(long)(&SSI_Encoder.Poscnt_resContinouosInt), //[5157h.0Ch], : . , : qcAbsPos, : -SSI +(long)(&SSI_Encoder.theta_mechContinouos), //[5157h.0Dh], : ., : .._, : -SSI +(long)(&SSI_Encoder.theta_elecContinouos), //[5157h.0Eh], : ., : .._, : -SSI +(long)(&Debug1), //[5174h.01h], : DebugL1, : DebugL1, : +(long)(&Debug1), //[5174h.02h], : DebugL1, : DebugL1, : +(long)(&Debug2), //[5174h.03h], : DebugL2, : DebugL2, : +(long)(&Debug2), //[5174h.04h], : DebugL2, : DebugL2, : +(long)(&Debug3), //[5174h.05h], : DebugI3, : DebugI3, : +(long)(&Debug3), //[5174h.06h], : DebugI3, : DebugI3, : +(long)(&Debug4), //[5174h.07h], : DebugI4, : DebugI4, : +(long)(&Debug4), //[5174h.08h], : DebugI4, : DebugI4, : +(long)(&DebugW1), //[5174h.09h], : DebugW1, : DebugW1, : +(long)(&DebugW1), //[5174h.0Ah], : DebugW1, : DebugW1, : +(long)(&DebugW2), //[5174h.0Bh], : DebugW2, : DebugW2, : +(long)(&DebugW2), //[5174h.0Ch], : DebugW2, : DebugW2, : +(long)(&DebugW3), //[5174h.0Dh], : DebugW3, : DebugW3, : +(long)(&DebugW3), //[5174h.0Eh], : DebugW3, : DebugW3, : +(long)(&DebugW4), //[5174h.0Fh], : DebugW4, : DebugW4, : +(long)(&DebugW4), //[5174h.10h], : DebugW4, : DebugW4, : +(long)(&DebugF1), //[5174h.11h], : DebugF1, : DebugF1, : +(long)(&DebugF2), //[5174h.12h], : DebugF2, : DebugF2, : +(long)(&DebugF3), //[5174h.13h], : DebugF3, : DebugF3, : +(long)(&DebugF4), //[5174h.14h], : DebugF4, : DebugF4, : +(long)(&refs.DCMspeed_ref), //[5185h.01h], : (. .), : . ., : . . +(long)(&refs.ua_ref), //[5185h.02h], : , : Ua_ref, : . . +(long)(&refs.uf_ref), //[5185h.03h], : , : Uf_ref, : . . +(long)(&RotorObserver.Tr), //[5B04h.01h], : . , : Tr, : +(long)(&RotorObserver.FluxCurrentRatio), //[5B04h.02h], : . X Y, : FluxCurrentRatio, : +(long)(&RotorObserver.FluxCurrentMin), //[5B04h.03h], : , : FluxCurrentMin, : +(long)(&RotorObserver.id), //[5B04h.04h], : D, : IsD, : +(long)(&RotorObserver.iq), //[5B04h.05h], : Q, : IsQ, : +(long)(&RotorObserver.psi_d), //[5B04h.06h], : D, : PsiRD, : +(long)(&RotorObserver.psi_q), //[5B04h.07h], : Q, : PsiRQ, : +(long)(&RotorObserver.theta_psi_elec), //[5B04h.08h], : , : psiRalpha, : +(long)(&udControl.StateOn), //[5B05h.01h], : , : Relay_state, : +(long)(&udControl.Timeout_on), //[5B05h.02h], : , , : relay on-delay, : +(long)(&udControl.U_on), //[5B05h.03h], : , , : on-voltage, : +(long)(&udControl.U_off), //[5B05h.04h], : , , : off-voltage, : +(long)(&udControl.deriv_time_ZPT), //[5B05h.05h], : , : derivative_voltage, : +(long)(&udControl.deriv_const), //[5B05h.06h], : , : derivative_const, : +(long)(&input_vect), //[5B06h.01h], : , : , : , 0 7: 0000000011111111b +(long)(&output_vect), //[5B06h.02h], : , : dout, : , 0 7: 0000000011111111b +(long)(&fanControl.StateOn), //[5B07h.01h], : , : fan_state, : +(long)(&fanControl.T_on), //[5B07h.02h], : , : t_on, : +(long)(&fanControl.T_off), //[5B07h.03h], : , : t_off, : +(long)(&fanControl.T_alarm), //[5B07h.04h], : , : t_alarm, : +(long)(&fanControl.temperature), //[5B07h.05h], : , : t, : +(long)(&fanControl.manualOn), //[5B07h.06h], : , : (null), : +(long)(&brakeResistor.enabled), //[5B08h.01h], : , : , : +(long)(&brakeResistor.upperLevel), //[5B08h.02h], : , , : on-voltage, : +(long)(&brakeResistor.bottomLevel), //[5B08h.03h], : , , : off-voltage, : +(long)(&brakeResistor.state), //[5B08h.04h], : , : , : }; Uint16 const CO1_OD_TBL2[] = { 32045, 1, 0, @@ -1716,57 +1731,55 @@ Uint16 const CO1_OD_TBL2[] = { (Uint16)(0), (((Uint32)0)>>16), 48417, 753, 384, (Uint16)(0), (((Uint32)0)>>16), -48401, 311, 385, -(Uint16)(438392299), (((Uint32)438392299)>>16), 28236, 312, 1, -20169, 313, 386, -18737, 314, 387, -20153, 312, 388, +20169, 313, 385, +18737, 314, 386, +20153, 312, 387, 28238, 315, 2, -45261, 316, 389, +45261, 316, 388, (Uint16)(15), 27822, 577, 3, -45357, 577, 390, +45357, 577, 389, (Uint16)(0x11111111), (((Uint32)0x11111111)>>16), -20749, 317, 391, +20749, 317, 390, 3762, 312, 2, -47917, 318, 392, +47917, 318, 391, (Uint16)(58002), -47917, 319, 393, +47917, 319, 392, (Uint16)(14349), -47917, 320, 394, +47917, 320, 393, (Uint16)(64364), -47917, 321, 395, +47917, 321, 394, (Uint16)(3745), -47917, 322, 396, +47917, 322, 395, (Uint16)(1832), 28848, 323, 7, -58853, 324, 397, +58853, 324, 396, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(_IQ(120.0)), (((Uint32)_IQ(120.0))>>16), -26437, 325, 398, +26437, 325, 397, 0, 0, 0, 0, 0, 0, -26437, 326, 399, +26437, 326, 398, 0, 0, 0, @@ -1777,67 +1790,67 @@ Uint16 const CO1_OD_TBL2[] = { 20154, 327, 7, -25925, 328, 400, +25925, 328, 399, 0, 0, 0, 0, 0, 0, -25925, 329, 401, +25925, 329, 400, 0, 0, 0, 0, 0, 0, -9381, 330, 402, +9381, 330, 401, (Uint16)(335544), (((Uint32)335544)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9509, 331, 403, +9509, 331, 402, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(_IQ(-1.0)), (((Uint32)_IQ(-1.0))>>16), (Uint16)(_IQ(1.0)), (((Uint32)_IQ(1.0))>>16), -9509, 332, 404, +9509, 332, 403, (Uint16)(-16777216), (((Uint32)-16777216)>>16), (Uint16)(_IQ(-1.0)), (((Uint32)_IQ(-1.0))>>16), (Uint16)(_IQ(1.0)), (((Uint32)_IQ(1.0))>>16), -9381, 333, 405, +9381, 333, 404, (Uint16)(2684354), (((Uint32)2684354)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9381, 334, 406, +9381, 334, 405, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9381, 335, 407, +9381, 335, 406, (Uint16)(8388608), (((Uint32)8388608)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -25925, 336, 408, +25925, 336, 407, 0, 0, 0, 0, 0, 0, -25893, 337, 409, +25893, 337, 408, 0, 0, 0, 0, 0, 0, -25893, 338, 410, +25893, 338, 409, 0, 0, 0, 0, 0, 0, -25893, 339, 411, +25893, 339, 410, 0, 0, 0, 0, 0, 0, -25893, 340, 412, +25893, 340, 411, 0, 0, 0, @@ -1848,74 +1861,74 @@ Uint16 const CO1_OD_TBL2[] = { 20155, 341, 7, -26437, 342, 413, +26437, 342, 412, 0, 0, 0, 0, 0, 0, -26437, 343, 414, +26437, 343, 413, 0, 0, 0, 0, 0, 0, -9381, 330, 415, +9381, 330, 414, (Uint16)(3355443), (((Uint32)3355443)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9541, 331, 416, +9541, 331, 415, (Uint16)(13421772), (((Uint32)13421772)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9541, 332, 417, +9541, 332, 416, (Uint16)(-13421772), (((Uint32)-13421772)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9381, 333, 418, +9381, 333, 417, (Uint16)(16777), (((Uint32)16777)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9381, 344, 419, +9381, 344, 418, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9381, 335, 420, +9381, 335, 419, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -26437, 336, 421, +26437, 336, 420, 0, 0, 0, 0, 0, 0, -25925, 345, 422, +25925, 345, 421, 0, 0, 0, 0, 0, 0, -25925, 338, 423, +25925, 338, 422, 0, 0, 0, 0, 0, 0, -25925, 339, 424, +25925, 339, 423, 0, 0, 0, 0, 0, 0, -25925, 340, 425, +25925, 340, 424, 0, 0, 0, 0, 0, 0, -25925, 346, 426, +25925, 346, 425, 0, 0, 0, @@ -1926,67 +1939,67 @@ Uint16 const CO1_OD_TBL2[] = { 20154, 347, 7, -25921, 348, 427, +25921, 348, 426, 0, 0, 0, 0, 0, 0, -25921, 349, 428, +25921, 349, 427, 0, 0, 0, 0, 0, 0, -9377, 350, 429, +9377, 350, 428, (Uint16)(335544), (((Uint32)335544)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9505, 351, 430, +9505, 351, 429, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(_IQ(-1.0)), (((Uint32)_IQ(-1.0))>>16), (Uint16)(_IQ(1.0)), (((Uint32)_IQ(1.0))>>16), -9505, 352, 431, +9505, 352, 430, (Uint16)(-16777216), (((Uint32)-16777216)>>16), (Uint16)(_IQ(-1.0)), (((Uint32)_IQ(-1.0))>>16), (Uint16)(_IQ(1.0)), (((Uint32)_IQ(1.0))>>16), -9377, 353, 432, +9377, 353, 431, (Uint16)(2684354), (((Uint32)2684354)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9377, 354, 433, +9377, 354, 432, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9377, 335, 434, +9377, 335, 433, (Uint16)(8388608), (((Uint32)8388608)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -25921, 336, 435, +25921, 336, 434, 0, 0, 0, 0, 0, 0, -25889, 355, 436, +25889, 355, 435, 0, 0, 0, 0, 0, 0, -25889, 338, 437, +25889, 338, 436, 0, 0, 0, 0, 0, 0, -25889, 339, 438, +25889, 339, 437, 0, 0, 0, 0, 0, 0, -25889, 340, 439, +25889, 340, 438, 0, 0, 0, @@ -1997,102 +2010,102 @@ Uint16 const CO1_OD_TBL2[] = { 20157, 356, 7, -15401, 342, 440, +15401, 342, 439, (Uint16)(0), (((Uint32)0)>>16), 0, 0, 0, 0, -10017, 342, 441, +10017, 342, 440, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -26401, 343, 442, +26401, 343, 441, 0, 0, 0, 0, 0, 0, -31785, 343, 443, +31785, 343, 442, 0, 0, 0, 0, 0, 0, -9377, 330, 444, +9377, 330, 443, (Uint16)(1174405120), (((Uint32)1174405120)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10049, 331, 445, +10049, 331, 444, (Uint16)(100663296), (((Uint32)100663296)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10049, 332, 446, +10049, 332, 445, (Uint16)(-100663296), (((Uint32)-100663296)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9377, 333, 447, +9377, 333, 446, (Uint16)(83886), (((Uint32)83886)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9377, 344, 448, +9377, 344, 447, (Uint16)(167772160), (((Uint32)167772160)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15401, 357, 449, +15401, 357, 448, (Uint16)(0), (((Uint32)0)>>16), 0, 0, 0, 0, -9377, 358, 450, +9377, 358, 449, (Uint16)(8388608), (((Uint32)8388608)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9377, 335, 451, +9377, 335, 450, (Uint16)(8388608), (((Uint32)8388608)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10017, 359, 452, +10017, 359, 451, (Uint16)(13981), (((Uint32)13981)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -26401, 336, 453, +26401, 336, 452, 0, 0, 0, 0, 0, 0, -25761, 346, 454, +25761, 346, 453, 0, 0, 0, 0, 0, 0, -26433, 345, 455, +26433, 345, 454, 0, 0, 0, 0, 0, 0, -26433, 338, 456, +26433, 338, 455, 0, 0, 0, 0, 0, 0, -26433, 339, 457, +26433, 339, 456, 0, 0, 0, 0, 0, 0, -26433, 340, 458, +26433, 340, 457, 0, 0, 0, 0, 0, 0, -26401, 360, 459, +26401, 360, 458, 0, 0, 0, @@ -2103,99 +2116,99 @@ Uint16 const CO1_OD_TBL2[] = { 20156, 362, 7, -25893, 363, 460, +25893, 363, 459, 0, 0, 0, 0, 0, 0, -25893, 364, 461, +25893, 364, 460, 0, 0, 0, 0, 0, 0, -8901, 365, 462, +8901, 365, 461, (Uint16)(14529069), (((Uint32)14529069)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0x01000000), (((Uint32)0x01000000)>>16), -31533, 366, 463, +31533, 366, 462, 0, 0, 0, 0, 0, 0, -31533, 367, 464, +31533, 367, 463, 0, 0, 0, 0, 0, 0, -31533, 368, 465, +31533, 368, 464, 0, 0, 0, 0, 0, 0, -31533, 369, 466, +31533, 369, 465, 0, 0, 0, 0, 0, 0, -11429, 370, 467, +11429, 370, 466, (Uint16)(33554432), (((Uint32)33554432)>>16), (Uint16)(_IQ(2.0)), (((Uint32)_IQ(2.0))>>16), (Uint16)(_IQ(10.0)), (((Uint32)_IQ(10.0))>>16), -11429, 371, 468, +11429, 371, 467, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(_IQ(10)), (((Uint32)_IQ(10))>>16), -8901, 372, 469, +8901, 372, 468, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -11965, 373, 470, +11965, 373, 469, (Uint16)(1), 0, 0, 0, 0, 0, -15149, 374, 471, +15149, 374, 470, (Uint16)(1), 0, 0, 0, 0, 0, -31661, 375, 472, +31661, 375, 471, 0, 0, 0, 0, 0, 0, -9367, 376, 473, +9367, 376, 472, (Uint16)(20480), (((Uint32)20480)>>16), (Uint16)(2048), (((Uint32)2048)>>16), (Uint16)(10240), (((Uint32)10240)>>16), -31277, 377, 474, +31277, 377, 473, 0, 0, 0, 0, 0, 0, -25893, 378, 475, +25893, 378, 474, 0, 0, 0, 0, 0, 0, -31533, 379, 476, +31533, 379, 475, 0, 0, 0, @@ -2206,139 +2219,139 @@ Uint16 const CO1_OD_TBL2[] = { 20143, 380, 2, -31273, 381, 477, +31273, 381, 476, 0, -53545, 382, 478, +53545, 382, 477, (Uint16)(1), 20132, 383, 7, -15121, 384, 479, +15121, 384, 478, (Uint16)(0), 0, 0, 0, 0, 0, -15121, 385, 480, +15121, 385, 479, (Uint16)(0), 0, 0, 0, 0, 0, -53265, 386, 481, +53265, 386, 480, (Uint16)(255), 0, 0, 0, 0, 0, -53289, 387, 482, +53289, 387, 481, (Uint16)(255), 0, 0, 0, 0, 0, -53265, 388, 483, +53265, 388, 482, (Uint16)(255), 0, 0, 0, 0, 0, -53289, 389, 484, +53289, 389, 483, (Uint16)(255), 0, 0, 0, 0, 0, -9529, 390, 485, +9529, 390, 484, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9625, 391, 486, +9625, 391, 485, (Uint16)(18454938), (((Uint32)18454938)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9625, 392, 487, +9625, 392, 486, (Uint16)(6990506), (((Uint32)6990506)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10041, 393, 488, +10041, 393, 487, (Uint16)(100663296), (((Uint32)100663296)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9721, 639, 489, +9721, 639, 488, (Uint16)(75497472), (((Uint32)75497472)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), 20146, 394, 7, -10017, 395, 490, +10017, 395, 489, (Uint16)(67108), (((Uint32)67108)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9505, 396, 491, +9505, 396, 490, (Uint16)(3355443), (((Uint32)3355443)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9505, 397, 492, +9505, 397, 491, (Uint16)(3355443), (((Uint32)3355443)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9985, 398, 493, +9985, 398, 492, (Uint16)(720992), (((Uint32)720992)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9601, 559, 494, +9601, 559, 493, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), 20144, 399, 7, -15241, 400, 495, +15241, 400, 494, (Uint16)(2), (Uint16)(1), (Uint16)(50), 0, 0, 0, -8265, 401, 496, +8265, 401, 495, (Uint16)(5), (Uint16)(0), (Uint16)(0), 0, 0, 0, -24617, 402, 497, +24617, 402, 496, 0, 0, 0, 0, 0, 0, -9129, 403, 498, +9129, 403, 497, (Uint16)(500), (Uint16)(0), (Uint16)(0), 0, 0, 0, -8233, 404, 499, +8233, 404, 498, (Uint16)(36), (Uint16)(0), (Uint16)(1000), 0, 0, 0, -10113, 405, 500, +10113, 405, 499, (Uint16)(1048576), (((Uint32)1048576)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10145, 406, 501, +10145, 406, 500, (Uint16)(16777), (((Uint32)16777)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -24713, 407, 502, +24713, 407, 501, 0, 0, 0, 0, 0, 0, -11993, 408, 503, +11993, 408, 502, (Uint16)(1), 0, 0, @@ -2346,80 +2359,61 @@ Uint16 const CO1_OD_TBL2[] = { 0, 0, -20107, +20106, 409, -4, -4365, 410, 504, -0, -0, -0, -15117, 411, 505, +2, +15117, 411, 503, (Uint16)(4), -0, -0, -15117, 412, 506, +53693, 412, 504, (Uint16)(0), -0, -0, -15117, 413, 507, +53695, 413, 505, (Uint16)(1), -0, -0, -14477, 414, 508, -(Uint16)(0), -(Uint16)(0), (Uint16)(1), -15117, 590, 509, -(Uint16)(0), -0, -0, +53694, 414, 506, +(Uint16)(256), +53688, 710, 507, +(Uint16)(256), -20147, +20149, 415, 4, -8257, 416, 510, +8257, 416, 508, (Uint16)(81), (Uint16)(0), (Uint16)(0), -16001, 417, 511, +16001, 417, 509, (Uint16)(-14592), (Uint16)(0), (Uint16)(0), -25913, 418, 512, +25913, 418, 510, 0, 0, 0, -8257, 419, 513, +8257, 419, 511, (Uint16)(81), (Uint16)(0), (Uint16)(0), -16001, 420, 514, +16001, 420, 512, (Uint16)(-14592), (Uint16)(0), (Uint16)(0), -25913, 421, 515, +25913, 421, 513, 0, 0, 0, -8257, 422, 516, -(Uint16)(40), -(Uint16)(0), (Uint16)(0), -16001, 423, 517, -(Uint16)(62836), -(Uint16)(0), (Uint16)(0), -25913, 424, 518, +25913, 424, 514, 0, 0, 0, -8225, 425, 519, +8225, 425, 515, (Uint16)(2050), (Uint16)(0), (Uint16)(0), -16001, 426, 520, +16001, 426, 516, (Uint16)(0), (Uint16)(0), (Uint16)(0), -26009, 427, 521, +26009, 427, 517, 0, 0, 0, -9185, 633, 522, -(Uint16)(1500), +16001, 711, 518, +(Uint16)(15), (Uint16)(0), (Uint16)(0), -26105, 634, 523, +25273, 641, 519, 0, 0, 0, @@ -2427,412 +2421,419 @@ Uint16 const CO1_OD_TBL2[] = { 20096, 428, 7, -26417, 429, 524, +26417, 429, 520, 0, 0, 0, 0, 0, 0, -25873, 430, 525, +25873, 430, 521, 0, 0, 0, 0, 0, 0, -10033, 431, 526, +10033, 431, 522, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9489, 432, 527, +9489, 432, 523, (Uint16)(419430), (((Uint32)419430)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10033, 433, 528, +10033, 433, 524, (Uint16)(100663296), (((Uint32)100663296)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9489, 434, 529, +9489, 434, 525, (Uint16)(12582912), (((Uint32)12582912)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -10033, 435, 530, +10033, 435, 526, (Uint16)(100663296), (((Uint32)100663296)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), 20037, 436, 1, -26421, 437, 531, -26037, 438, 532, -25909, 439, 533, -25813, 440, 534, -25813, 441, 535, -25909, 442, 536, -28141, 613, 537, -28141, 614, 538, +26421, 437, 527, +26037, 438, 528, +25909, 439, 529, +25813, 440, 530, +25813, 441, 531, +25909, 442, 532, +28141, 613, 533, +28141, 614, 534, 20023, 443, 7, -14477, 444, 539, +14477, 444, 535, (Uint16)(0), 0, 0, 0, 0, 0, -14989, 445, 540, +14989, 445, 536, (Uint16)(192), (((Uint32)192)>>16), 0, 0, 0, 0, -14989, 446, 541, +14989, 446, 537, (Uint16)(1359151123), (((Uint32)1359151123)>>16), 0, 0, 0, 0, -14989, 447, 542, +14989, 447, 538, (Uint16)(1359085569), (((Uint32)1359085569)>>16), 0, 0, 0, 0, -14989, 448, 543, +14989, 448, 539, (Uint16)(1359151122), (((Uint32)1359151122)>>16), 0, 0, 0, 0, -14989, 449, 544, +14989, 449, 540, (Uint16)(1359020033), (((Uint32)1359020033)>>16), 0, 0, 0, 0, -53645, 450, 545, +53645, 450, 541, (Uint16)(0), 0, 0, 0, 0, 0, -53685, 451, 546, +53685, 451, 542, (Uint16)(1), 0, 0, 0, 0, 0, -11837, 452, 547, +11837, 452, 543, (Uint16)(0), 0, 0, 0, 0, 0, -10949, 453, 548, +10949, 453, 544, (Uint16)(6710886), (((Uint32)6710886)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15757, 454, 549, +15757, 454, 545, (Uint16)(50461787), (((Uint32)50461787)>>16), -20000, +20001, 455, 7, -14985, 456, 550, +14985, 456, 546, (Uint16)(1000), (((Uint32)1000)>>16), 0, 0, 0, 0, -11839, 457, 551, +11839, 457, 547, (Uint16)(2), 0, 0, 0, 0, 0, -14473, 458, 552, +14473, 458, 548, (Uint16)(1), 0, 0, 0, 0, 0, -9345, 459, 553, +9345, 459, 549, (Uint16)(9298387), (((Uint32)9298387)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -31369, 460, 554, +31369, 460, 550, 0, 0, 0, 0, 0, 0, -30857, 460, 555, +30857, 460, 551, 0, 0, 0, 0, 0, 0, -25761, 461, 556, +25761, 461, 552, 0, 0, 0, 0, 0, 0, -25729, 462, 557, +25729, 462, 553, 0, 0, 0, 0, 0, 0, -25729, 463, 558, +25729, 463, 554, 0, 0, 0, 0, 0, 0, -53565, 464, 559, +53565, 464, 555, (Uint16)(0), 0, 0, 0, 0, 0, -9217, 465, 560, +9217, 465, 556, (Uint16)(838860), (((Uint32)838860)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(65535), (((Uint32)65535)>>16), -30857, 466, 561, +30857, 466, 557, 0, 0, 0, 0, 0, 0, -30857, 467, 562, +30857, 467, 558, 0, 0, 0, 0, 0, 0, -30857, 468, 563, +30857, 468, 559, 0, 0, 0, 0, 0, 0, -31369, 469, 564, +31369, 469, 560, 0, 0, 0, 0, 0, 0, -30857, 469, 565, +30857, 469, 561, 0, 0, 0, 0, 0, 0, -30857, 470, 566, +30857, 470, 562, 0, 0, 0, 0, 0, 0, -15241, 471, 567, +15241, 471, 563, (Uint16)(0), 0, 0, 0, 0, 0, -15241, 472, 568, +15241, 472, 564, (Uint16)(7), 0, 0, 0, 0, 0, -15241, 472, 569, +15241, 472, 565, (Uint16)(7335), 0, 0, 0, 0, 0, -15753, 472, 570, +15753, 472, 566, (Uint16)(1973415), (((Uint32)1973415)>>16), 0, 0, 0, 0, -25729, 473, 571, +25729, 473, 567, 0, 0, 0, 0, 0, 0, -25729, 474, 572, +25729, 474, 568, 0, 0, 0, 0, 0, 0, +14473, 714, 569, +(Uint16)(0), +0, +0, +0, +0, +0, 20027, 475, 7, -15245, 589, 573, +15245, 589, 570, (Uint16)(0), 0, 0, 0, 0, 0, -25733, 441, 574, +25733, 441, 571, 0, 0, 0, 0, 0, 0, -25765, 461, 575, +25765, 461, 572, 0, 0, 0, 0, 0, 0, -9381, 476, 576, +9381, 476, 573, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -25733, 477, 577, +25733, 477, 574, 0, 0, 0, 0, 0, 0, -11837, 478, 578, +11837, 478, 575, (Uint16)(81), 0, 0, 0, 0, 0, -14989, 479, 579, +14989, 479, 576, (Uint16)(500), (((Uint32)500)>>16), 0, 0, 0, 0, -25765, 480, 580, +25765, 480, 577, 0, 0, 0, 0, 0, 0, -30861, 481, 581, +30861, 481, 578, 0, 0, 0, 0, 0, 0, -4573, 482, 582, +4573, 482, 579, 0, 0, 0, 0, 0, 0, -9349, 459, 583, +9349, 459, 580, (Uint16)(4869970), (((Uint32)4869970)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -30861, 483, 584, +30861, 483, 581, 0, 0, 0, 0, 0, 0, -30861, 484, 585, +30861, 484, 582, 0, 0, 0, 0, 0, 0, -30861, 485, 586, +30861, 485, 583, 0, 0, 0, 0, 0, 0, -30861, 486, 587, +30861, 486, 584, 0, 0, 0, 0, 0, 0, -53567, 487, 588, +53567, 487, 585, (Uint16)(0), 0, 0, 0, 0, 0, -14477, 488, 589, +14477, 488, 586, (Uint16)(10), 0, 0, 0, 0, 0, -30861, 489, 590, +30861, 489, 587, 0, 0, 0, 0, 0, 0, -30861, 490, 591, +30861, 490, 588, 0, 0, 0, 0, 0, 0, -30861, 491, 592, +30861, 491, 589, 0, 0, 0, 0, 0, 0, -30861, 492, 593, +30861, 492, 590, 0, 0, 0, 0, 0, 0, -30861, 493, 594, +30861, 493, 591, 0, 0, 0, @@ -2843,88 +2844,88 @@ Uint16 const CO1_OD_TBL2[] = { 20019, 455, 7, -14977, 494, 595, +14977, 494, 592, (Uint16)(4096), (((Uint32)4096)>>16), 0, 0, 0, 0, -9369, 459, 596, +9369, 459, 593, (Uint16)(9298387), (((Uint32)9298387)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -30849, 460, 597, +30849, 460, 594, 0, 0, 0, 0, 0, 0, -25785, 461, 598, +25785, 461, 595, 0, 0, 0, 0, 0, 0, -25753, 462, 599, +25753, 462, 596, 0, 0, 0, 0, 0, 0, -25753, 463, 600, +25753, 463, 597, 0, 0, 0, 0, 0, 0, -25753, 495, 601, +25753, 495, 598, 0, 0, 0, 0, 0, 0, -9241, 496, 602, +9241, 496, 599, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15233, 471, 603, +15233, 471, 600, (Uint16)(0), 0, 0, 0, 0, 0, -15745, 472, 604, +15745, 472, 601, (Uint16)(1973415), (((Uint32)1973415)>>16), 0, 0, 0, 0, -15233, 472, 605, +15233, 472, 602, (Uint16)(7), 0, 0, 0, 0, 0, -15233, 472, 606, +15233, 472, 603, (Uint16)(7335), 0, 0, 0, 0, 0, -25753, 473, 607, +25753, 473, 604, 0, 0, 0, 0, 0, 0, -25753, 474, 608, +25753, 474, 605, 0, 0, 0, @@ -2935,165 +2936,265 @@ Uint16 const CO1_OD_TBL2[] = { 20025, 497, 7, -25669, 498, 609, +25669, 498, 606, 0, 0, 0, 0, 0, 0, -32205, 498, 610, +32205, 498, 607, 0, 0, 0, 0, 0, 0, -25669, 499, 611, +25669, 499, 608, 0, 0, 0, 0, 0, 0, -32205, 499, 612, +32205, 499, 609, 0, 0, 0, 0, 0, 0, -30925, 500, 613, +30925, 500, 610, 0, 0, 0, 0, 0, 0, -31693, 500, 614, +31693, 500, 611, 0, 0, 0, 0, 0, 0, -30925, 501, 615, +30925, 501, 612, 0, 0, 0, 0, 0, 0, -31693, 501, 616, +31693, 501, 613, 0, 0, 0, 0, 0, 0, -9285, 502, 617, +9285, 502, 614, (Uint16)(16777), (((Uint32)16777)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15821, 502, 618, +15821, 502, 615, (Uint16)(16777), (((Uint32)16777)>>16), 0, 0, 0, 0, -9285, 503, 619, +9285, 503, 616, (Uint16)(-190048), (((Uint32)-190048)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15821, 503, 620, +15821, 503, 617, (Uint16)(-190048), (((Uint32)-190048)>>16), 0, 0, 0, 0, -9285, 504, 621, +9285, 504, 618, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15821, 504, 622, +15821, 504, 619, (Uint16)(0), (((Uint32)0)>>16), 0, 0, 0, 0, -9285, 505, 623, +9285, 505, 620, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -15821, 505, 624, +15821, 505, 621, (Uint16)(0), (((Uint32)0)>>16), 0, 0, 0, 0, -50253, 506, 625, +50253, 506, 622, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -50253, 507, 626, +50253, 507, 623, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -50253, 508, 627, +50253, 508, 624, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -50253, 509, 628, +50253, 509, 625, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), 20142, 556, 7, -9285, 557, 629, +9285, 557, 626, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9637, 558, 630, +9637, 558, 627, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -9637, 559, 631, +9637, 559, 628, (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), 20149, 399, 7, -12453, 571, 632, +12453, 571, 629, (Uint16)(16777216), (((Uint32)16777216)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -12453, 572, 633, +12453, 572, 630, (Uint16)(5033165), (((Uint32)5033165)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -12613, 573, 634, +12613, 573, 631, (Uint16)(5033165), (((Uint32)5033165)>>16), (Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), -28997, 574, 635, +28997, 574, 632, 0, 0, 0, 0, 0, 0, -28997, 575, 636, +28997, 575, 633, 0, 0, 0, 0, 0, 0, -28837, 536, 637, +28837, 536, 634, 0, 0, 0, 0, 0, 0, -28837, 537, 638, +28837, 537, 635, 0, 0, 0, 0, 0, 0, -30501, 576, 639, +30501, 576, 636, +0, +0, +0, +0, +0, +0, + +20139, +626, +7, +17709, 631, 637, +0, +0, +0, +0, +0, +0, +15149, 627, 638, +(Uint16)(2000), +0, +0, +0, +0, +0, +10661, 628, 639, +(Uint16)(15099494), (((Uint32)15099494)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +10661, 629, 640, +(Uint16)(11744051), (((Uint32)11744051)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +28837, 630, 641, +0, +0, +0, +0, +0, +0, +12453, 632, 642, +(Uint16)(16777216), (((Uint32)16777216)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), + +20143, +482, +2, +27681, 482, 643, +0, +11297, 694, 644, +(Uint16)(0), + +20139, +635, +7, +31521, 636, 645, +0, +0, +0, +0, +0, +0, +12793, 637, 646, +(Uint16)(41943040), (((Uint32)41943040)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +12793, 638, 647, +(Uint16)(25165824), (((Uint32)25165824)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +12793, 640, 648, +(Uint16)(67108864), (((Uint32)67108864)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +29177, 634, 649, +0, +0, +0, +0, +0, +0, +15137, 712, 650, +(Uint16)(0), +0, +0, +0, +0, +0, + +20129, +713, +7, +15149, 589, 651, +(Uint16)(0), +0, +0, +0, +0, +0, +12693, 628, 652, +(Uint16)(0), (((Uint32)0)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +12693, 629, 653, +(Uint16)(0), (((Uint32)0)>>16), +(Uint16)(0), (((Uint32)0)>>16), (Uint16)(0), (((Uint32)0)>>16), +31533, 570, 654, 0, 0, 0, @@ -3194,34 +3295,37 @@ int16 const CO1_OD_TBL1[] = { 8477, 1759, 9474, 1786, 9478, 1813, -9487, 1836, -9522, 1841, -9524, 1853, -9728, 1860, -12288, 1868, -12544, 1871, -20480, 1894, -20736, 1924, -20737, 2044, -20738, 2173, -20739, 2293, -20741, 2476, -20747, 2632, -20750, 2643, -20754, 2745, -20755, 2793, -20756, 2877, -20758, 2916, -20762, 3003, -20792, 3069, -20816, 3096, -20817, 3189, -20818, 3194, -20821, 3404, -20823, 3605, -20852, 3734, -20869, 3917, -23300, 3947, +9522, 1836, +9524, 1848, +9728, 1855, +12288, 1863, +12544, 1866, +20480, 1889, +20736, 1919, +20737, 2039, +20738, 2168, +20739, 2288, +20741, 2471, +20747, 2627, +20750, 2638, +20754, 2740, +20755, 2788, +20756, 2872, +20758, 2895, +20762, 2970, +20792, 3036, +20816, 3063, +20817, 3156, +20818, 3161, +20821, 3380, +20823, 3581, +20852, 3710, +20869, 3893, +23300, 3923, +23301, 3998, +23302, 4055, +23303, 4066, +23304, 4123, }; Uint16 const co1_SPIrange1rw = CO1_SPI_START_ADDR+0; Uint16 const co1_SPIrange1rwCRC = CO1_SPI_START_ADDR+8; @@ -3230,34 +3334,34 @@ Uint16 const co1_SPIrange1rwpCRC = CO1_SPI_START_ADDR+336; Uint16 const co1_SPIrange1rwps = CO1_SPI_START_ADDR+338; Uint16 const co1_SPIrange1rwpsCRC = CO1_SPI_START_ADDR+338; Uint16 const co1_SPIrange2rw = CO1_SPI_START_ADDR+340; -Uint16 const co1_SPIrange2rwCRC = CO1_SPI_START_ADDR+581; -Uint16 const co1_SPIrange2rwp = CO1_SPI_START_ADDR+583; -Uint16 const co1_SPIrange2rwpCRC = CO1_SPI_START_ADDR+608; -Uint16 const co1_SPIrange2rwps = CO1_SPI_START_ADDR+610; -Uint16 const co1_SPIrange2rwpsCRC = CO1_SPI_START_ADDR+610; -Uint16 const co1_SPIrange3rw = CO1_SPI_START_ADDR+612; -Uint16 const co1_SPIrange3rwCRC = CO1_SPI_START_ADDR+622; -Uint16 const co1_SPIrange3rwp = CO1_SPI_START_ADDR+624; -Uint16 const co1_SPIrange3rwpCRC = CO1_SPI_START_ADDR+624; -Uint16 const co1_SPIrange3rwps = CO1_SPI_START_ADDR+626; -Uint16 const co1_SPIrange3rwpsCRC = CO1_SPI_START_ADDR+626; -Uint16 const co1_SPIrange4rw = CO1_SPI_START_ADDR+628; -Uint16 const co1_SPIrange4rwCRC = CO1_SPI_START_ADDR+628; -Uint16 const co1_SPIrange4rwp = CO1_SPI_START_ADDR+630; -Uint16 const co1_SPIrange4rwpCRC = CO1_SPI_START_ADDR+630; -Uint16 const co1_SPIrange4rwps = CO1_SPI_START_ADDR+632; -Uint16 const co1_SPIrange4rwpsCRC = CO1_SPI_START_ADDR+632; -Uint16 const co1_SPIrange5rw = CO1_SPI_START_ADDR+634; -Uint16 const co1_SPIrange5rwCRC = CO1_SPI_START_ADDR+1058; -Uint16 const co1_SPIrange5rwp = CO1_SPI_START_ADDR+1060; -Uint16 const co1_SPIrange5rwpCRC = CO1_SPI_START_ADDR+1064; -Uint16 const co1_SPIrange5rwps = CO1_SPI_START_ADDR+1066; -Uint16 const co1_SPIrange5rwpsCRC = CO1_SPI_START_ADDR+1066; +Uint16 const co1_SPIrange2rwCRC = CO1_SPI_START_ADDR+577; +Uint16 const co1_SPIrange2rwp = CO1_SPI_START_ADDR+579; +Uint16 const co1_SPIrange2rwpCRC = CO1_SPI_START_ADDR+604; +Uint16 const co1_SPIrange2rwps = CO1_SPI_START_ADDR+606; +Uint16 const co1_SPIrange2rwpsCRC = CO1_SPI_START_ADDR+606; +Uint16 const co1_SPIrange3rw = CO1_SPI_START_ADDR+608; +Uint16 const co1_SPIrange3rwCRC = CO1_SPI_START_ADDR+618; +Uint16 const co1_SPIrange3rwp = CO1_SPI_START_ADDR+620; +Uint16 const co1_SPIrange3rwpCRC = CO1_SPI_START_ADDR+620; +Uint16 const co1_SPIrange3rwps = CO1_SPI_START_ADDR+622; +Uint16 const co1_SPIrange3rwpsCRC = CO1_SPI_START_ADDR+622; +Uint16 const co1_SPIrange4rw = CO1_SPI_START_ADDR+624; +Uint16 const co1_SPIrange4rwCRC = CO1_SPI_START_ADDR+624; +Uint16 const co1_SPIrange4rwp = CO1_SPI_START_ADDR+626; +Uint16 const co1_SPIrange4rwpCRC = CO1_SPI_START_ADDR+626; +Uint16 const co1_SPIrange4rwps = CO1_SPI_START_ADDR+628; +Uint16 const co1_SPIrange4rwpsCRC = CO1_SPI_START_ADDR+628; +Uint16 const co1_SPIrange5rw = CO1_SPI_START_ADDR+630; +Uint16 const co1_SPIrange5rwCRC = CO1_SPI_START_ADDR+1087; +Uint16 const co1_SPIrange5rwp = CO1_SPI_START_ADDR+1089; +Uint16 const co1_SPIrange5rwpCRC = CO1_SPI_START_ADDR+1093; +Uint16 const co1_SPIrange5rwps = CO1_SPI_START_ADDR+1095; +Uint16 const co1_SPIrange5rwpsCRC = CO1_SPI_START_ADDR+1095; Uint16 const co1_first1000 = 0; Uint16 const co1_first2000 = 82; -Uint16 const co1_first3000 = 190; -Uint16 const co1_first4000 = 194; -Uint16 const co1_first5000 = 194; +Uint16 const co1_first3000 = 188; +Uint16 const co1_first4000 = 192; +Uint16 const co1_first5000 = 192; // Uint16 const CO1_TYPE_DEF_TABLE[] = { (Uint16)4,\ @@ -3351,7 +3455,6 @@ Uint16 const CO1_TYPE_DEF_TABLE[] = { (Uint16)4,\ (Uint16)5,\ (Uint16)0,\ - (Uint16)-1,\ (Uint16)10,\ (Uint16)4,\ (Uint16)0,\ @@ -3379,6 +3482,10 @@ Uint16 const CO1_TYPE_DEF_TABLE[] = { (Uint16)27,\ (Uint16)19,\ (Uint16)20,\ + (Uint16)46,\ + (Uint16)2,\ + (Uint16)45,\ + (Uint16)44,\ }; // CALLBACK- //************************************************************** @@ -3474,7 +3581,6 @@ long const CO1_OD_CALLBACK_TBL[]={ 0, // 211Dh.00h 0, // 2502h.00h 0, // 2506h.00h -(long)((void(*)(long))callback_RTC), // 250Fh.00h 0, // 2532h.00h 0, // 2534h.00h 0, // 2600h.00h @@ -3502,6 +3608,10 @@ long const CO1_OD_CALLBACK_TBL[]={ 0, // 5174h.00h 0, // 5185h.00h 0, // 5B04h.00h +0, // 5B05h.00h +0, // 5B06h.00h +0, // 5B07h.00h +0, // 5B08h.00h }; // CANopen diff --git a/Vsrc/main.c b/Vsrc/main.c index d59a801..8cb1191 100644 --- a/Vsrc/main.c +++ b/Vsrc/main.c @@ -26,52 +26,49 @@ #include // memcpy -TClarke clarke = CLARKE_DEFAULTS; //!< -TPark park = PARK_DEFAULTS; //!< -TIPark ipark = IPARK_DEFAULTS; //!< -TPidReg3 pid_id = PIDREG3_DEFAULTS; //!<. d -TPidReg3 pid_iq = PIDREG3_DEFAULTS; //!<. q -TPidReg3 pid_ia = PIDREG3_DEFAULTS; //!<. -TPidReg3 pid_spd = PIDREG3_DEFAULTS; //!<. -TPidReg3_pos pid_pos = PIDREG3_DEFAULTS_POS; //!<. -TVhzProf vhz = VHZPROF_DEFAULTS; //!< U/f=const -TSM_Sys sm_sys = SM_Sys_DEFAULTS; //!< -Uint16 disp_group_number = 0; //!< CANOpen Unicon -TDataLog dlog = DATALOG_DEFAULTS; //!< CANOpen -TSM_Protect sm_prot = SM_PROTECT_DEFAULTS; //!< +TClarke clarke = CLARKE_DEFAULTS; //!< +TPark park = PARK_DEFAULTS; //!< +TIPark ipark = IPARK_DEFAULTS; //!< +TPidReg3 pid_id = PIDREG3_DEFAULTS; //!<. d +TPidReg3 pid_iq = PIDREG3_DEFAULTS; //!<. q +TPidReg3 pid_ia = PIDREG3_DEFAULTS; //!<. +TPidReg3 pid_spd = PIDREG3_DEFAULTS; //!<. +TPidReg3 pid_pos = PIDREG3_DEFAULTS; //!<. +TVhzProf vhz = VHZPROF_DEFAULTS; //!< U/f=const +TSM_Sys sm_sys = SM_Sys_DEFAULTS; //!< +Uint16 disp_group_number = 0; //!< CANOpen Unicon +TDataLog dlog = DATALOG_DEFAULTS; //!< CANOpen +TSM_Protect sm_prot = SM_PROTECT_DEFAULTS; //!< +TSM_Ctrl sm_ctrl = SM_CTRL_DEFAULTS; //!< , +TSM_CmdLogic sm_cmd_logic = SM_CMD_LOGIC_DEFAULTS; //!< +TSM_Net sm_net = SM_NET_DEFAULTS; //!< +TRMPCtrl rmp = V_RMP_CTRL_DEFAULTS; //!< +TAdcDrv adc = ADC_DRV_DEFAULTS; //!< +TPWM_Module pwm = PWM_Module_DEFAULTS; //!< +TDPReCAP DPReCAP = DPRECAP_DEFAULTS; //!< +TposspeedEqep posspeedEqep = POSSPEED_DEFAULTS; //!< +TCurPar cur_par = TCUR_PAR_DEFAULTS; //!< - , +TUserMemory UserMem = USERMEMORY_DEFAULTS; //!< . +TUdControl udControl = UD_CONTROL_DEFAULTS; //!< +TAutoOffset AutoOffset = AUTO_OFFSET_DEFAULTS; //!< +TSSI_Encoder SSI_Encoder = SSI_ENCODER_DEFAULTS; //!< SSI +TRotorObserver RotorObserver = ROTOR_OBSERVER_DEFAULTS; //!< +TCANtoRS CANtoRS = CAN_TO_RS_DEFAULTS; //!< CANopen UART (RS). CAN UART +TDrvInterface drv_interface = DRV_INTERFACE_DEFAULTS; //!< , .. +TLogger FaultLog = LOGGER_DEFAULTS; //!< +TGlobalTime global_time = GLOBAL_TIME_DEFAULTS; //!< +TFanControl fanControl = FAN_CONTROL_DEFAULTS; //!< +TbrakeResistor brakeResistor = BRAKE_RESISTOR_DEFAULTS; //! TBitsToEnumNums pult_faults_lister = BITS_TO_ENUM_NUMS_DEFAULTS; //!< Unicon -TSM_Ctrl sm_ctrl = SM_CTRL_DEFAULTS; //!< , -TSM_CmdLogic sm_cmd_logic = SM_CMD_LOGIC_DEFAULTS; //!< -TSM_Net sm_net = SM_NET_DEFAULTS; //!< -TRMPCtrl rmp = V_RMP_CTRL_DEFAULTS; //!< -TAdcDrv adc = ADC_DRV_DEFAULTS; //!< -TPWM_Module pwm = PWM_Module_DEFAULTS; //!< -TDPReCAP DPReCAP = DPRECAP_DEFAULTS; //!< -TposspeedEqep posspeedEqep = POSSPEED_DEFAULTS; //!< -TCurPar cur_par = TCUR_PAR_DEFAULTS; //!< - , -TUserMemory UserMem = USERMEMORY_DEFAULTS; //!< . -Tled leds = LED_DEFAULTS; //!< -//TCanBTInterface Can2BTInterface = T_CANBT_INTERFACE_DEFAULTS;//!< CANopen -TRTCClock RTCclock = RTC_CLOCK_DEFAULTS; //!< . "spi" - -TAutoOffset AutoOffset = AUTO_OFFSET_DEFAULTS; //!< -TSSI_Encoder SSI_Encoder = SSI_ENCODER_DEFAULTS; //!< SSI -//TMotorModel model = MOTOR_MODEL_DEFAULTS; //!< " " -TRotorObserver RotorObserver = ROTOR_OBSERVER_DEFAULTS; //!< -TCANtoRS CANtoRS = CAN_TO_RS_DEFAULTS; //!< CANopen UART (RS). CAN UART -//TModBus ModBus = MODBUS_DEFAULTS; //!< MODBUS -//TMBVarsConv MBVarsConv = MBVARSCONV_DEFAULTS;//!< 16 Modbus (IQ 24) -TDrvInterface drv_interface = DRV_INTERFACE_DEFAULTS; //!< , .. -TLogger FaultLog = LOGGER_DEFAULTS; //!< -TGlobalTime global_time = GLOBAL_TIME_DEFAULTS; //!< -TRefs refs; //!< (, ) -TCmd cmd = { 0 }; //!< -TDrvStatus drv_status = { 0 }; //!< -TDrvParams drv_params; //!< -TSysSwitches sw; //!< +TRefs refs; //!< (, ) +TCmd cmd = { 0 }; //!< +TDrvStatus drv_status = { 0 }; //!< +TDrvParams drv_params; //!< +TSysSwitches sw; //!< -Uint32 VendorToken=0x11111111;//!< , UniCON COODEdit -int drv_status_code; //!< (, ..) +Uint32 VendorToken=0x11111111; //!< , UniCON COODEdit +int drv_status_code; //!< (, ..) // - CANOpen, // @@ -216,11 +213,7 @@ void CAP0_IRQHandler(void) // () DPReCAP.CAP1Calc(&DPReCAP); - // - ECAP0->ECCLR_bit.CEVT0 = 1; - ECAP0->ECCLR_bit.CEVT1 = 1; - ECAP0->ECCLR_bit.INT = 1; - + // 10 } //!, CAP1 @@ -247,10 +240,7 @@ void CAP1_IRQHandler(void) DPReCAP.Angle6Calc(&DPReCAP); DPReCAP.CAP2Calc(&DPReCAP); - // - ECAP1->ECCLR_bit.CEVT0 = 1; - ECAP1->ECCLR_bit.CEVT1 = 1; - ECAP1->ECCLR_bit.INT = 1; + // 10 } @@ -278,10 +268,7 @@ void CAP2_IRQHandler(void) DPReCAP.Angle6Calc(&DPReCAP); // , , , Angle6Calc DPReCAP.CAP3Calc(&DPReCAP); - // - ECAP2->ECCLR_bit.CEVT0 = 1; - ECAP2->ECCLR_bit.CEVT1 = 1; - ECAP2->ECCLR_bit.INT = 1; + // 10 } //!, () QEP diff --git a/cood.xml b/cood.xml index b26b8c7..4b8e890 100644 --- a/cood.xml +++ b/cood.xml @@ -2861,12 +2861,6 @@ - - - - - - @@ -3667,42 +3661,36 @@ - - - - - - - + - - - + + + - - - + + + - - - + + + + + + + + + - - - - - - @@ -3745,54 +3733,42 @@ - - - - - - - - - - - - - + - - + + - - + + - - + + - - - - - + + + + + - - - - + + + + - + @@ -4111,6 +4087,13 @@ + + + + + + @@ -4543,6 +4526,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/system_K1921VK035.c b/src/system_K1921VK035.c index 9175bc2..d5885e9 100644 --- a/src/system_K1921VK035.c +++ b/src/system_K1921VK035.c @@ -162,19 +162,41 @@ void FPUInit() // void PeripheralClockEnable(){ - // + // RCU->HCLKCFG = 0b00000111; // CAN, GPIOA, GPIOB RCU->PCLKCFG = 0b0000111111111111; // PWM, CAP, QEP, I2C - RCU->UARTCFG[1].UARTCFG_bit.CLKEN = 1;// UART - RCU->UARTCFG[1].UARTCFG_bit.CLKSEL = 1;//PLL = 100 - RCU->UARTCFG[1].UARTCFG_bit.DIVEN = 1;// - RCU->UARTCFG[1].UARTCFG_bit.DIVN = 1;// 4 N = 2*(DIVN+1) - RCU->UARTCFG[1].UARTCFG_bit.RSTDIS = 1; // + // UART + //RCU->UARTCFG[1].UARTCFG_bit.CLKEN = 1; // UART + //RCU->UARTCFG[1].UARTCFG_bit.CLKSEL = 1; // PLL = 100 + //RCU->UARTCFG[1].UARTCFG_bit.DIVEN = 1; // + //RCU->UARTCFG[1].UARTCFG_bit.DIVN = 1; // 4 N = 2*(DIVN+1), 25 + //RCU->UARTCFG[1].UARTCFG_bit.RSTDIS = 1; // + RCU->UARTCFG[1].UARTCFG = (1 << RCU_UARTCFG_UARTCFG_CLKEN_Pos) | + (1 << RCU_UARTCFG_UARTCFG_CLKSEL_Pos) | + (1 << RCU_UARTCFG_UARTCFG_DIVEN_Pos) | + (1 << RCU_UARTCFG_UARTCFG_DIVN_Pos) | + (1 << RCU_UARTCFG_UARTCFG_RSTDIS_Pos); + + // SPI + //RCU->SPICFG_bit.CLKEN = 1; // SPI + //RCU->SPICFG_bit.CLKSEL = 1; // PLL = 100 + //RCU->SPICFG_bit.DIVEN = 1; // + //RCU->SPICFG_bit.DIVN = 1; // 4 N = 2*(DIVN+1), 25 + //RCU->SPICFG_bit.RSTDIS = 1; // + RCU->SPICFG = (1 << RCU_SPICFG_CLKEN_Pos) | + (1 << RCU_SPICFG_CLKSEL_Pos) | + (1 << RCU_SPICFG_DIVEN_Pos) | + (1 << RCU_SPICFG_DIVN_Pos) | + (1 << RCU_SPICFG_RSTDIS_Pos); // RCU->HRSTCFG = 0b00000111; // CAN, GPIOA, GPIOB RCU->PRSTCFG = 0b0000111111111111; // PWM, CAP, QEP, I2C + + // GPIO + GPIOA->DENSET = 0xFFFF; + GPIOB->DENSET = 0xFFFF; } void SystemInit(void)