123
Fork of LG by
Revision 198:78dd6d14d108, committed 2017-02-08
- Comitter:
- Diletant
- Date:
- Wed Feb 08 06:33:40 2017 +0000
- Parent:
- 197:7a05523bf588
- Commit message:
- DeviceXXX.XXX files moved to: https://developer.mbed.org/users/Diletant/code/H4/
Changed in this revision
diff -r 7a05523bf588 -r 78dd6d14d108 Device.c --- a/Device.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3146 +0,0 @@ -#include "Device.h" -#include <stdio.h> - -extern unsigned int SystemCoreClock1; -Device device; -HashParam hashParamTable[HASH_PARAM_COUNT]; -HashFunc hashFuncTable[HASH_FUNC_COUNT]; - -// -//Measurement cycle definitions and functions -// -void DeviceInitMeasurementCycleDefaultSettings(void){ -} - -void DeviceInitMeasurementCycleState(void){ - device.measurement.counter = 0; - device.measurement.length = 32; -} - -void DeviceMeasurementInterruptHandler(void) { - //Read QEI - qeiProcess(); //Memo: call first to read data immediately - - //Raw counters processing - countersProcess(); - - //Receive ADCs samples using SSP - sspReceive(); - //Process temperature sense system - tssProcess(); //Memo: call before temperature-dependent systems - //Process current control system - ccsProcess(); //Memo: call before current-dependent systems - //Process ACS - isacsProcess(); - plcsProcess(); - //Transmit DACs values using SSP - sspTransmit(device.measurement.counter & 1); - - sequencerProcess(); - - //Process dither ACS - ditherProcess(); //Memo: call after counters processing - - //Process error model - emProcess(); //Memo: process error model with updated device state parameters, therefore AFTER other systems processing - - //Update measurement cycle counter - device.measurement.counter++; - if (device.measurement.counter == device.measurement.length) device.measurement.counter = 0; - //Reset dither 10mks resolution counter - if (device.measurement.counter == 0) device.dither.pulse.state.counter = 0; //First dither half period - if (device.measurement.counter == 16) device.dither.pulse.state.counter = 0;//Second dither half period -} - -// -//Regular cycle definitions and functions -// -void DeviceInitRegularCycleDefaultSettings(void) { -} - -void DeviceInitRegularCycleState(void) { - device.regular.event1Hz = 0; - device.regular.event500Hz = 0; - device.regular.event1K = 0; - device.regular.event10K = 0; - device.regular.event100K = 0; - device.regular.time100K = 0; - device.regular.time10K = 0; - device.regular.time1K = 0; - device.regular.time500Hz = 0; - device.regular.time1Hz = 0; - timersSetRegularPeriod(257); //257 -} - -void DeviceStartRegularCycle(void) { - DeviceStartRegularTimer(); -} - -void DeviceRegularEvent1Hz(void) { - if (device.regular.event1Hz) { - device.regular.event1Hz--; - device.regular.time1Hz++; - - DeviceLightUpDoCycle(); - } -} - -void DeviceRegularEvent500Hz(void) { - if (device.regular.event500Hz) { - device.regular.event500Hz--; - } -} - -void DeviceRegularEvent1KHz(void) { - if (device.regular.event1K) { - device.regular.event1K--; - device.regular.time1K++; - device.regular.time500Hz++; - if (device.regular.time1K == 1000) { - device.regular.time1K = 0; - device.regular.event1Hz++; - } - if (device.regular.time500Hz == 2) { - device.regular.time500Hz = 0; - device.regular.event500Hz++; - } - } -} - -void DeviceRegularEvent10KHz(void) { - if (device.regular.event10K) { - device.regular.event10K--; - device.regular.time10K++; - if (device.regular.time10K == 10){ - device.regular.time10K = 0; - device.regular.event1K++; - } - - if ((device.user.response.type == RESPONSE_DELAYED) || (device.user.response.type == RESPONSE_PERIODIC)){ - device.user.response.counter += 100; - if (device.user.response.counter >= device.user.response.trigger) { - device.user.response.triggered = 1; - device.user.response.counter = 0; - } - } - } -} - -void DeviceRegularEvent100KHz(void) { - if (device.regular.event100K) { - device.regular.event100K--; - - device.regular.time100K++; - if (device.regular.time100K == 10) { - device.regular.time100K = 0; - device.regular.event10K++; - } - - //ditherCycle(); //Set/reset vibro 1/2 pins - } -} - -void DeviceRegularInterruptHandler(void) { - device.regular.event100K++; - device.dither.pulse.state.counter++; //Dither 10 mks resolution counter - - ditherCycle(); //Set/reset vibro 1/2 pins -} - -// -//Main cycle definitions and functions -// -void deviceCycle(void) { - //Service port communication - Concole(); - - if (ReadConcole()) { - if (device.service.buffer[0] == 'h') { - sprintf(device.service.buffer,"Compiled: %s %s.",__DATE__, __TIME__ ); WriteConcole(); - sprintf(device.service.buffer,"--%03d:%03d:%02d:%02d--\r\n",device.regular.time1Hz,device.regular.time1K,device.regular.time10K,device.regular.time100K); WriteConcole(); - } else if (device.service.buffer[0] == 'w') { - //Header - device.user.request.buffer.data[0] = 0xcc; - //Address - device.user.request.buffer.data[1] = 0x00; - //H_PARAM8_W: write 1-byte hash param - device.user.request.buffer.data[2] = 0xff; - device.user.request.buffer.data[3] = 0x10; - //Hash - device.user.request.buffer.data[4] = 0x60; - device.user.request.buffer.data[5] = 0x0f; - device.user.request.buffer.data[6] = 0x16; - device.user.request.buffer.data[7] = 0xe4; - //Value - device.user.request.buffer.data[8] = 0x01; - //Control sum - device.user.request.buffer.data[9] = 0x02; - device.user.request.buffer.data[10] = 0x79; - //Init buffer positions - device.user.request.buffer.start = 0; - device.user.request.buffer.end = 11; - device.user.request.buffer.empty = 0; - device.user.decoder.canceled = 0; - - //Development message - sprintf(device.service.buffer,"Hash access request emulated: write address\r\n"); WriteConcole(); - } else if (device.service.buffer[0] == 'r') { - //Header - device.user.request.buffer.data[0] = 0xcc; - //Address - device.user.request.buffer.data[1] = 0x00; - //H_PARAM8_R: read 1-byte hash param - device.user.request.buffer.data[2] = 0xff; - device.user.request.buffer.data[3] = 0x00; - //Hash - device.user.request.buffer.data[4] = 0x60; - device.user.request.buffer.data[5] = 0x0f; - device.user.request.buffer.data[6] = 0x16; - device.user.request.buffer.data[7] = 0xe4; - //Control sum - device.user.request.buffer.data[8] = 0x02; - device.user.request.buffer.data[9] = 0x68; - //Init buffer positions - device.user.request.buffer.start = 0; - device.user.request.buffer.end = 10; - device.user.request.buffer.empty = 0; - device.user.decoder.canceled = 0; - - //Development message - sprintf(device.service.buffer,"Hash access request emulated: read address\r\n"); WriteConcole(); - } else if (device.service.buffer[0] == 'l') { - DeviceStartLightUp(); - - //Development message - sprintf(device.service.buffer,"Light-up emulated\r\n"); WriteConcole(); - } - } - - //Host port communication - userReceive(); //Receive request from host - userDecodeRequests();//Decode host requests - userDecodePin(); - userEncodeResponse();//Encode host response - userTransmit(); //Transmit response to host - - i2cProcess(); - - //Process regular events - DeviceRegularEvent100KHz(); - DeviceRegularEvent10KHz(); - DeviceRegularEvent1KHz(); - DeviceRegularEvent500Hz(); - DeviceRegularEvent1Hz(); -} - -// -//Device definitions and functions -// -void DeviceInitDefaultSettings(void){ - device.user.address = 0; - - //Init controller - InitControllerDefaultSettings(); - - //Init units - DeviceInitMeasurementCycleDefaultSettings(); - DeviceInitRegularCycleDefaultSettings(); - InitCountersDefaultSettings(); - InitDitherDefaultSettings(); - InitLightUpDefaultSettings(); - InitISACSDefaultSettings(); - InitSequencerDefaultSettings(); - InitPathLengthControlSystemDefaultSettings(); - InitTSSDefaultSettings(); - InitCCSDefaultSettings(); - InitUserDefaultSettings(); - InitEMDefaultSettings(); - - #ifdef __DEVICE_DEBUG_H__ - InitDebugDefaultSettings(); - #endif -} - -void DeviceInitState(void) { - //Init controller - InitControllerState(); - //Init measurement cycle - DeviceInitMeasurementCycleState(); - //Init regular cycle - DeviceInitRegularCycleState(); - //Init counters - InitCountersState(); - //Init dither - InitDitherState(); - //Init light-up and back light unit - InitLightUpState(); - //Init information signal amplitude control system - InitISACSState(); - //Init sequencer - InitSequencerState(); - //Init path length control system - InitPathLengthControlSystemState(); - //Init temperature sense system - InitTSSState(); - //Init current control system - InitCCSState(); - //Init host communication protocol - InitUserState(); - //Init error model - InitEMState(); - - #ifdef __DEVICE_DEBUG_H__ - InitDebugState(); - #endif -} - -void DeviceInit(void) { - //Init system - SystemInit1(); // Инициализация контроллера: установка тактовых частот - SystemCoreClockUpdate1(); // расчет тактовой частоты процессора перед инициализацией UART - 100MHz - - //Init hash table - InitHashParamTable(); - InitHashFuncTable(); - - //Load default settings - DeviceInitDefaultSettings(); - - //Load from flash - override default settings - DeviceFlashReadAll(); - - //Init state from settings - DeviceInitState(); -} - -void DeviceStart(void) { - DeviceStartController(); - DeviceStartRegularCycle(); - DeviceStartTSS(); - DeviceStartCCS(); - DeviceStartCounters(); - DeviceStartDither(); - DeviceStartISACS(); - DeviceStartLightUp(); - DeviceStartSequencer(); - DeviceStartPLCS(); - DeviceStartUser(); - DeviceStartEM(); - #ifdef __DEVICE_DEBUG_H__ - DeviceStartDebug(); - #endif -} - -/* -int32_t FindByHash(uint32_t hash){ - for (uint32_t i = 0; i < HASH_PARAM_COUNT; i++){ - if (hashParamTable[i].hash == hash) return i; - } - return -1; -} -*/ - -void InitHashParamTable(void){ - hashParamTable[0].hash = 0x1049db13; - hashParamTable[0].ref = &device.controller.uart[0].state.DLM; - hashParamTable[0].size = sizeof(device.controller.uart[0].state.DLM); - hashParamTable[1].hash = 0x112bb416; - hashParamTable[1].ref = &device.plcs.feedback.settings.transfer.normalized[0]; - hashParamTable[1].size = sizeof(device.plcs.feedback.settings.transfer.normalized[0]); - hashParamTable[2].hash = 0x11a33e2c; - hashParamTable[2].ref = &device.isacs.regulator.settings.transfer.correction[1]; - hashParamTable[2].size = sizeof(device.isacs.regulator.settings.transfer.correction[1]); - hashParamTable[3].hash = 0x11b36a70; - hashParamTable[3].ref = &device.plcs.bias.settings.transfer.normalized[13]; - hashParamTable[3].size = sizeof(device.plcs.bias.settings.transfer.normalized[13]); - hashParamTable[4].hash = 0x11fc88be; - hashParamTable[4].ref = &device.tss.temperature.settings.transfer.celsius[8]; - hashParamTable[4].size = sizeof(device.tss.temperature.settings.transfer.celsius[8]); - hashParamTable[5].hash = 0x12372990; - hashParamTable[5].ref = &device.plcs.reset.down.settings.environment.target[3]; - hashParamTable[5].size = sizeof(device.plcs.reset.down.settings.environment.target[3]); - hashParamTable[6].hash = 0x127b8c3c; - hashParamTable[6].ref = &device.plcs.feedback.settings.transfer.normalized[14]; - hashParamTable[6].size = sizeof(device.plcs.feedback.settings.transfer.normalized[14]); - hashParamTable[7].hash = 0x1295d56a; - hashParamTable[7].ref = &device.plcs.reset.up.settings.environment.temperature[15]; - hashParamTable[7].size = sizeof(device.plcs.reset.up.settings.environment.temperature[15]); - hashParamTable[8].hash = 0x12be4a8; - hashParamTable[8].ref = &device.plcs.reset.up.settings.environment.target[1]; - hashParamTable[8].size = sizeof(device.plcs.reset.up.settings.environment.target[1]); - hashParamTable[9].hash = 0x12e85f36; - hashParamTable[9].ref = &device.dither.amplitude.settings.transfer.error[14]; - hashParamTable[9].size = sizeof(device.dither.amplitude.settings.transfer.error[14]); - hashParamTable[10].hash = 0x12e884f8; - hashParamTable[10].ref = &device.plcs.regulator.state.enabled; - hashParamTable[10].size = sizeof(device.plcs.regulator.state.enabled); - hashParamTable[11].hash = 0x13519c41; - hashParamTable[11].ref = &device.plcs.reset.down.settings.environment.points; - hashParamTable[11].size = sizeof(device.plcs.reset.down.settings.environment.points); - hashParamTable[12].hash = 0x1356106d; - hashParamTable[12].ref = &device.plcs.reset.down.settings.environment.trigger[14]; - hashParamTable[12].size = sizeof(device.plcs.reset.down.settings.environment.trigger[14]); - hashParamTable[13].hash = 0x13d3f0df; - hashParamTable[13].ref = &device.dither.noise.state.period; - hashParamTable[13].size = sizeof(device.dither.noise.state.period); - hashParamTable[14].hash = 0x14092a5e; - hashParamTable[14].ref = &device.plcs.reset.up.settings.environment.trigger[6]; - hashParamTable[14].size = sizeof(device.plcs.reset.up.settings.environment.trigger[6]); - hashParamTable[15].hash = 0x142a336b; - hashParamTable[15].ref = &device.isacs.input.settings.transfer.V[7]; - hashParamTable[15].size = sizeof(device.isacs.input.settings.transfer.V[7]); - hashParamTable[16].hash = 0x1433bae6; - hashParamTable[16].ref = &device.counters.meander.state.angle[0]; - hashParamTable[16].size = sizeof(device.counters.meander.state.angle[0]); - hashParamTable[17].hash = 0x14b109a0; - hashParamTable[17].ref = &device.plcs.reset.down.settings.environment.trigger[5]; - hashParamTable[17].size = sizeof(device.plcs.reset.down.settings.environment.trigger[5]); - hashParamTable[18].hash = 0x14ca9b91; - hashParamTable[18].ref = &device.controller.uart[0].state.LCR; - hashParamTable[18].size = sizeof(device.controller.uart[0].state.LCR); - hashParamTable[19].hash = 0x14d5dbbc; - hashParamTable[19].ref = &device.dither.detector.settings.filter.factor[6]; - hashParamTable[19].size = sizeof(device.dither.detector.settings.filter.factor[6]); - hashParamTable[20].hash = 0x14e02957; - hashParamTable[20].ref = &device.counters.dither.state.delta[13]; - hashParamTable[20].size = sizeof(device.counters.dither.state.delta[13]); - hashParamTable[21].hash = 0x14f73474; - hashParamTable[21].ref = &device.ccs.current[0].settings.transfer.mA[9]; - hashParamTable[21].size = sizeof(device.ccs.current[0].settings.transfer.mA[9]); - hashParamTable[22].hash = 0x15e391e5; - hashParamTable[22].ref = &device.dither.amplitude.settings.transfer.error[1]; - hashParamTable[22].size = sizeof(device.dither.amplitude.settings.transfer.error[1]); - hashParamTable[23].hash = 0x162f9f2b; - hashParamTable[23].ref = &device.plcs.output.settings.transfer.code[0]; - hashParamTable[23].size = sizeof(device.plcs.output.settings.transfer.code[0]); - hashParamTable[24].hash = 0x166063b7; - hashParamTable[24].ref = &device.plcs.regulator.settings.transfer.correction[7]; - hashParamTable[24].size = sizeof(device.plcs.regulator.settings.transfer.correction[7]); - hashParamTable[25].hash = 0x16a6970e; - hashParamTable[25].ref = &device.counters.dither.state.delta[23]; - hashParamTable[25].size = sizeof(device.counters.dither.state.delta[23]); - hashParamTable[26].hash = 0x16d42bd; - hashParamTable[26].ref = &device.isacs.output.settings.transfer.voltage[11]; - hashParamTable[26].size = sizeof(device.isacs.output.settings.transfer.voltage[11]); - hashParamTable[27].hash = 0x16ed2d61; - hashParamTable[27].ref = &device.dither.frequency.settings.transfer.correction[11]; - hashParamTable[27].size = sizeof(device.dither.frequency.settings.transfer.correction[11]); - hashParamTable[28].hash = 0x177a9e0f; - hashParamTable[28].ref = &device.sequencer.output.analog.settings.transfer.code[8]; - hashParamTable[28].size = sizeof(device.sequencer.output.analog.settings.transfer.code[8]); - hashParamTable[29].hash = 0x17bcf2b9; - hashParamTable[29].ref = &device.controller.SSP.in[4]; - hashParamTable[29].size = sizeof(device.controller.SSP.in[4]); - hashParamTable[30].hash = 0x17e39986; - hashParamTable[30].ref = &device.counters.zero.state.a; - hashParamTable[30].size = sizeof(device.counters.zero.state.a); - hashParamTable[31].hash = 0x1830d5e9; - hashParamTable[31].ref = &device.plcs.reset.up.settings.environment.target[0]; - hashParamTable[31].size = sizeof(device.plcs.reset.up.settings.environment.target[0]); - hashParamTable[32].hash = 0x183f50e6; - hashParamTable[32].ref = &device.plcs.reference.settings.sequencer; - hashParamTable[32].size = sizeof(device.plcs.reference.settings.sequencer); - hashParamTable[33].hash = 0x185d59f; - hashParamTable[33].ref = &device.isacs.regulator.settings.transfer.error[4]; - hashParamTable[33].size = sizeof(device.isacs.regulator.settings.transfer.error[4]); - hashParamTable[34].hash = 0x187673fc; - hashParamTable[34].ref = &device.isacs.output.settings.transfer.voltage[10]; - hashParamTable[34].size = sizeof(device.isacs.output.settings.transfer.voltage[10]); - hashParamTable[35].hash = 0x189ee4de; - hashParamTable[35].ref = &device.isacs.regulator.settings.transfer.error[5]; - hashParamTable[35].size = sizeof(device.isacs.regulator.settings.transfer.error[5]); - hashParamTable[36].hash = 0x18c9d3e9; - hashParamTable[36].ref = &device.controller.I2C.state.trigger; - hashParamTable[36].size = sizeof(device.controller.I2C.state.trigger); - hashParamTable[37].hash = 0x18fd0ab4; - hashParamTable[37].ref = &device.plcs.feedback.settings.transfer.raw[0]; - hashParamTable[37].size = sizeof(device.plcs.feedback.settings.transfer.raw[0]); - hashParamTable[38].hash = 0x18ff0dee; - hashParamTable[38].ref = &device.plcs.bias.settings.transfer.raw[0]; - hashParamTable[38].size = sizeof(device.plcs.bias.settings.transfer.raw[0]); - hashParamTable[39].hash = 0x195b9d0a; - hashParamTable[39].ref = &device.dither.amplitude.state.enabled; - hashParamTable[39].size = sizeof(device.dither.amplitude.state.enabled); - hashParamTable[40].hash = 0x195d1e47; - hashParamTable[40].ref = &device.controller.uart[0].state.FCR; - hashParamTable[40].size = sizeof(device.controller.uart[0].state.FCR); - hashParamTable[41].hash = 0x19a3142e; - hashParamTable[41].ref = &device.dither.detector.settings.transfer.raw[3]; - hashParamTable[41].size = sizeof(device.dither.detector.settings.transfer.raw[3]); - hashParamTable[42].hash = 0x1a3e671e; - hashParamTable[42].ref = &device.dither.noise.state.counter; - hashParamTable[42].size = sizeof(device.dither.noise.state.counter); - hashParamTable[43].hash = 0x1a91aa6e; - hashParamTable[43].ref = &device.plcs.reset.up.settings.environment.target[14]; - hashParamTable[43].size = sizeof(device.plcs.reset.up.settings.environment.target[14]); - hashParamTable[44].hash = 0x1ad3d89e; - hashParamTable[44].ref = &device.dither.detector.settings.transfer.points; - hashParamTable[44].size = sizeof(device.dither.detector.settings.transfer.points); - hashParamTable[45].hash = 0x1b179781; - hashParamTable[45].ref = &device.isacs.output.settings.transfer.voltage[0]; - hashParamTable[45].size = sizeof(device.isacs.output.settings.transfer.voltage[0]); - hashParamTable[46].hash = 0x1b1f5569; - hashParamTable[46].ref = &device.sequencer.sampler.state.position[1]; - hashParamTable[46].size = sizeof(device.sequencer.sampler.state.position[1]); - hashParamTable[47].hash = 0x1b2739a8; - hashParamTable[47].ref = &device.dither.frequency.settings.transfer.error[12]; - hashParamTable[47].size = sizeof(device.dither.frequency.settings.transfer.error[12]); - hashParamTable[48].hash = 0x1c0aa7e8; - hashParamTable[48].ref = &device.dither.detector.settings.filter.factor[15]; - hashParamTable[48].size = sizeof(device.dither.detector.settings.filter.factor[15]); - hashParamTable[49].hash = 0x1c0e0ea7; - hashParamTable[49].ref = &device.tss.gradient.state.sum; - hashParamTable[49].size = sizeof(device.tss.gradient.state.sum); - hashParamTable[50].hash = 0x1c4e6380; - hashParamTable[50].ref = &device.plcs.output.settings.transfer.code[12]; - hashParamTable[50].size = sizeof(device.plcs.output.settings.transfer.code[12]); - hashParamTable[51].hash = 0x1c69e16a; - hashParamTable[51].ref = &device.sequencer.output.analog.settings.transfer.code[10]; - hashParamTable[51].size = sizeof(device.sequencer.output.analog.settings.transfer.code[10]); - hashParamTable[52].hash = 0x1d42170c; - hashParamTable[52].ref = &device.dither.frequency.settings.min; - hashParamTable[52].size = sizeof(device.dither.frequency.settings.min); - hashParamTable[53].hash = 0x1d4f6e8a; - hashParamTable[53].ref = &device.plcs.reset.up.settings.environment.trigger[12]; - hashParamTable[53].size = sizeof(device.plcs.reset.up.settings.environment.trigger[12]); - hashParamTable[54].hash = 0x1d922ce1; - hashParamTable[54].ref = &device.sequencer.sampler.settings.enabled; - hashParamTable[54].size = sizeof(device.sequencer.sampler.settings.enabled); - hashParamTable[55].hash = 0x1da5514e; - hashParamTable[55].ref = &device.tss.gradient.settings.transfer.celsius[3]; - hashParamTable[55].size = sizeof(device.tss.gradient.settings.transfer.celsius[3]); - hashParamTable[56].hash = 0x1dee6c5d; - hashParamTable[56].ref = &device.isacs.input.settings.transfer.raw[7]; - hashParamTable[56].size = sizeof(device.isacs.input.settings.transfer.raw[7]); - hashParamTable[57].hash = 0x1e0c4982; - hashParamTable[57].ref = &device.ccs.current[0].settings.transfer.raw[5]; - hashParamTable[57].size = sizeof(device.ccs.current[0].settings.transfer.raw[5]); - hashParamTable[58].hash = 0x1e281aa4; - hashParamTable[58].ref = &device.dither.frequency.state.frequency; - hashParamTable[58].size = sizeof(device.dither.frequency.state.frequency); - hashParamTable[59].hash = 0x1e43caf; - hashParamTable[59].ref = &device.plcs.bias.settings.transfer.raw[1]; - hashParamTable[59].size = sizeof(device.plcs.bias.settings.transfer.raw[1]); - hashParamTable[60].hash = 0x1e4c19b1; - hashParamTable[60].ref = &device.dither.detector.settings.filter.factor[25]; - hashParamTable[60].size = sizeof(device.dither.detector.settings.filter.factor[25]); - hashParamTable[61].hash = 0x1e4d2311; - hashParamTable[61].ref = &device.tss.temperature.settings.transfer.raw[0]; - hashParamTable[61].size = sizeof(device.tss.temperature.settings.transfer.raw[0]); - hashParamTable[62].hash = 0x1e63bf5; - hashParamTable[62].ref = &device.plcs.feedback.settings.transfer.raw[1]; - hashParamTable[62].size = sizeof(device.plcs.feedback.settings.transfer.raw[1]); - hashParamTable[63].hash = 0x1ea9caa2; - hashParamTable[63].ref = &device.plcs.reset.state.voltage; - hashParamTable[63].size = sizeof(device.plcs.reset.state.voltage); - hashParamTable[64].hash = 0x1eb95b78; - hashParamTable[64].ref = &device.controller.I2C.state.position; - hashParamTable[64].size = sizeof(device.controller.I2C.state.position); - hashParamTable[65].hash = 0x1f1130fd; - hashParamTable[65].ref = &device.plcs.regulator.settings.transfer.error[11]; - hashParamTable[65].size = sizeof(device.plcs.regulator.settings.transfer.error[11]); - hashParamTable[66].hash = 0x1f21213f; - hashParamTable[66].ref = &device.tss.gradient.settings.transfer.celsius[13]; - hashParamTable[66].size = sizeof(device.tss.gradient.settings.transfer.celsius[13]); - hashParamTable[67].hash = 0x1f6efd73; - hashParamTable[67].ref = &device.plcs.reset.up.settings.environment.temperature[1]; - hashParamTable[67].size = sizeof(device.plcs.reset.up.settings.environment.temperature[1]); - hashParamTable[68].hash = 0x1f99ad84; - hashParamTable[68].ref = &device.sensor.settings.id; - hashParamTable[68].size = sizeof(device.sensor.settings.id); - hashParamTable[69].hash = 0x1fa53157; - hashParamTable[69].ref = &device.dither.amplitude.settings.transfer.correction[7]; - hashParamTable[69].size = sizeof(device.dither.amplitude.settings.transfer.correction[7]); - hashParamTable[70].hash = 0x1fd038c3; - hashParamTable[70].ref = &device.controller.I2C.state.buffer[4]; - hashParamTable[70].size = sizeof(device.controller.I2C.state.buffer[4]); - hashParamTable[71].hash = 0x20014b12; - hashParamTable[71].ref = &device.plcs.reset.down.settings.environment.target[1]; - hashParamTable[71].size = sizeof(device.plcs.reset.down.settings.environment.target[1]); - hashParamTable[72].hash = 0x2005a050; - hashParamTable[72].ref = &device.dither.frequency.settings.scale; - hashParamTable[72].size = sizeof(device.dither.frequency.settings.scale); - hashParamTable[73].hash = 0x2046428; - hashParamTable[73].ref = &device.sequencer.sampler.state.position[0]; - hashParamTable[73].size = sizeof(device.sequencer.sampler.state.position[0]); - hashParamTable[74].hash = 0x204e2ba9; - hashParamTable[74].ref = &device.plcs.regulator.settings.transfer.error[8]; - hashParamTable[74].size = sizeof(device.plcs.regulator.settings.transfer.error[8]); - hashParamTable[75].hash = 0x2089da7e; - hashParamTable[75].ref = &device.plcs.bias.settings.transfer.normalized[9]; - hashParamTable[75].size = sizeof(device.plcs.bias.settings.transfer.normalized[9]); - hashParamTable[76].hash = 0x209ea7fe; - hashParamTable[76].ref = &device.isacs.input.settings.transfer.V[15]; - hashParamTable[76].size = sizeof(device.isacs.input.settings.transfer.V[15]); - hashParamTable[77].hash = 0x20ca6c0; - hashParamTable[77].ref = &device.isacs.output.settings.transfer.voltage[1]; - hashParamTable[77].size = sizeof(device.isacs.output.settings.transfer.voltage[1]); - hashParamTable[78].hash = 0x20f3e78e; - hashParamTable[78].ref = &device.tss.gradient.settings.transfer.raw[9]; - hashParamTable[78].size = sizeof(device.tss.gradient.settings.transfer.raw[9]); - hashParamTable[79].hash = 0x212c331a; - hashParamTable[79].ref = &device.dither.detector.settings.transfer.raw[15]; - hashParamTable[79].size = sizeof(device.dither.detector.settings.transfer.raw[15]); - hashParamTable[80].hash = 0x214f2855; - hashParamTable[80].ref = &device.dither.frequency.settings.max; - hashParamTable[80].size = sizeof(device.dither.frequency.settings.max); - hashParamTable[81].hash = 0x218db848; - hashParamTable[81].ref = &device.plcs.reset.down.settings.environment.temperature[9]; - hashParamTable[81].size = sizeof(device.plcs.reset.down.settings.environment.temperature[9]); - hashParamTable[82].hash = 0x21ad307b; - hashParamTable[82].ref = &device.dither.detector.settings.transfer.restored[15]; - hashParamTable[82].size = sizeof(device.dither.detector.settings.transfer.restored[15]); - hashParamTable[83].hash = 0x221dec1a; - hashParamTable[83].ref = &device.dither.amplitude.state.correction; - hashParamTable[83].size = sizeof(device.dither.amplitude.state.correction); - hashParamTable[84].hash = 0x2297782a; - hashParamTable[84].ref = &device.dither.amplitude.settings.scale; - hashParamTable[84].size = sizeof(device.dither.amplitude.settings.scale); - hashParamTable[85].hash = 0x231dd694; - hashParamTable[85].ref = &device.plcs.feedback.settings.transfer.normalized[2]; - hashParamTable[85].size = sizeof(device.plcs.feedback.settings.transfer.normalized[2]); - hashParamTable[86].hash = 0x238508f2; - hashParamTable[86].ref = &device.plcs.bias.settings.transfer.normalized[11]; - hashParamTable[86].size = sizeof(device.plcs.bias.settings.transfer.normalized[11]); - hashParamTable[87].hash = 0x23955cae; - hashParamTable[87].ref = &device.isacs.regulator.settings.transfer.correction[3]; - hashParamTable[87].size = sizeof(device.isacs.regulator.settings.transfer.correction[3]); - hashParamTable[88].hash = 0x23b95340; - hashParamTable[88].ref = &device.sequencer.output.analog.settings.transfer.voltage[9]; - hashParamTable[88].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[9]); - hashParamTable[89].hash = 0x23c08e9; - hashParamTable[89].ref = &device.dither.frequency.settings.transfer.error[13]; - hashParamTable[89].size = sizeof(device.dither.frequency.settings.transfer.error[13]); - hashParamTable[90].hash = 0x2419fda9; - hashParamTable[90].ref = &device.plcs.output.settings.transfer.code[2]; - hashParamTable[90].size = sizeof(device.plcs.output.settings.transfer.code[2]); - hashParamTable[91].hash = 0x24560135; - hashParamTable[91].ref = &device.plcs.regulator.settings.transfer.correction[5]; - hashParamTable[91].size = sizeof(device.plcs.regulator.settings.transfer.correction[5]); - hashParamTable[92].hash = 0x2481a096; - hashParamTable[92].ref = &device.isacs.regulator.settings.regular.scale; - hashParamTable[92].size = sizeof(device.isacs.regulator.settings.regular.scale); - hashParamTable[93].hash = 0x2490f58c; - hashParamTable[93].ref = &device.counters.dither.state.delta[21]; - hashParamTable[93].size = sizeof(device.counters.dither.state.delta[21]); - hashParamTable[94].hash = 0x24db4fe3; - hashParamTable[94].ref = &device.dither.frequency.settings.transfer.correction[13]; - hashParamTable[94].size = sizeof(device.dither.frequency.settings.transfer.correction[13]); - hashParamTable[95].hash = 0x25529fbb; - hashParamTable[95].ref = &device.counters.dither.state.delta[31]; - hashParamTable[95].size = sizeof(device.counters.dither.state.delta[31]); - hashParamTable[96].hash = 0x25e7a824; - hashParamTable[96].ref = &device.plcs.reset.down.settings.environment.duration[9]; - hashParamTable[96].size = sizeof(device.plcs.reset.down.settings.environment.duration[9]); - hashParamTable[97].hash = 0x261c51e9; - hashParamTable[97].ref = &device.isacs.input.settings.transfer.V[5]; - hashParamTable[97].size = sizeof(device.isacs.input.settings.transfer.V[5]); - hashParamTable[98].hash = 0x263f48dc; - hashParamTable[98].ref = &device.plcs.reset.up.settings.environment.trigger[4]; - hashParamTable[98].size = sizeof(device.plcs.reset.up.settings.environment.trigger[4]); - hashParamTable[99].hash = 0x267b13b1; - hashParamTable[99].ref = &device.dither.noise.settings.range; - hashParamTable[99].size = sizeof(device.dither.noise.settings.range); - hashParamTable[100].hash = 0x26876b22; - hashParamTable[100].ref = &device.plcs.reset.down.settings.environment.trigger[7]; - hashParamTable[100].size = sizeof(device.plcs.reset.down.settings.environment.trigger[7]); - hashParamTable[101].hash = 0x26d64bd5; - hashParamTable[101].ref = &device.counters.dither.state.delta[11]; - hashParamTable[101].size = sizeof(device.counters.dither.state.delta[11]); - hashParamTable[102].hash = 0x26e3b93e; - hashParamTable[102].ref = &device.dither.detector.settings.filter.factor[4]; - hashParamTable[102].size = sizeof(device.dither.detector.settings.filter.factor[4]); - hashParamTable[103].hash = 0x27d5f367; - hashParamTable[103].ref = &device.dither.amplitude.settings.transfer.error[3]; - hashParamTable[103].size = sizeof(device.dither.amplitude.settings.transfer.error[3]); - hashParamTable[104].hash = 0x27e577b1; - hashParamTable[104].ref = &device.dither.frequency.settings.enabled; - hashParamTable[104].size = sizeof(device.dither.frequency.settings.enabled); - hashParamTable[105].hash = 0x281feb12; - hashParamTable[105].ref = &device.plcs.reset.down.settings.environment.target[15]; - hashParamTable[105].size = sizeof(device.plcs.reset.down.settings.environment.target[15]); - hashParamTable[106].hash = 0x2837dd6d; - hashParamTable[106].ref = &device.sequencer.sampler.settings.sequence[18]; - hashParamTable[106].size = sizeof(device.sequencer.sampler.settings.sequence[18]); - hashParamTable[107].hash = 0x29115b2a; - hashParamTable[107].ref = &device.dither.frequency.settings.transfer.error[10]; - hashParamTable[107].size = sizeof(device.dither.frequency.settings.transfer.error[10]); - hashParamTable[108].hash = 0x2921f503; - hashParamTable[108].ref = &device.isacs.output.settings.transfer.voltage[2]; - hashParamTable[108].size = sizeof(device.isacs.output.settings.transfer.voltage[2]); - hashParamTable[109].hash = 0x2944ed54; - hashParamTable[109].ref = &device.sequencer.sampler.settings.sequence[8]; - hashParamTable[109].size = sizeof(device.sequencer.sampler.settings.sequence[8]); - hashParamTable[110].hash = 0x296ccefa; - hashParamTable[110].ref = &device.plcs.feedback.settings.output; - hashParamTable[110].size = sizeof(device.plcs.feedback.settings.output); - hashParamTable[111].hash = 0x2a06b76b; - hashParamTable[111].ref = &device.plcs.reset.up.settings.environment.target[2]; - hashParamTable[111].size = sizeof(device.plcs.reset.up.settings.environment.target[2]); - hashParamTable[112].hash = 0x2a1b86c5; - hashParamTable[112].ref = &device.dither.amplitude.settings.transfer.correction[15]; - hashParamTable[112].size = sizeof(device.dither.amplitude.settings.transfer.correction[15]); - hashParamTable[113].hash = 0x2a40117e; - hashParamTable[113].ref = &device.isacs.output.settings.transfer.voltage[12]; - hashParamTable[113].size = sizeof(device.isacs.output.settings.transfer.voltage[12]); - hashParamTable[114].hash = 0x2a716334; - hashParamTable[114].ref = &device.sequencer.sampler.settings.sequence[28]; - hashParamTable[114].size = sizeof(device.sequencer.sampler.settings.sequence[28]); - hashParamTable[115].hash = 0x2aa8865c; - hashParamTable[115].ref = &device.isacs.regulator.settings.transfer.error[7]; - hashParamTable[115].size = sizeof(device.isacs.regulator.settings.transfer.error[7]); - hashParamTable[116].hash = 0x2aaa9846; - hashParamTable[116].ref = &device.plcs.feedback.settings.transfer.raw[14]; - hashParamTable[116].size = sizeof(device.plcs.feedback.settings.transfer.raw[14]); - hashParamTable[117].hash = 0x2ac96f6c; - hashParamTable[117].ref = &device.plcs.bias.settings.transfer.raw[2]; - hashParamTable[117].size = sizeof(device.plcs.bias.settings.transfer.raw[2]); - hashParamTable[118].hash = 0x2acb6836; - hashParamTable[118].ref = &device.plcs.feedback.settings.transfer.raw[2]; - hashParamTable[118].size = sizeof(device.plcs.feedback.settings.transfer.raw[2]); - hashParamTable[119].hash = 0x2aeb3625; - hashParamTable[119].ref = &device.isacs.output.settings.transfer.code[9]; - hashParamTable[119].size = sizeof(device.isacs.output.settings.transfer.code[9]); - hashParamTable[120].hash = 0x2b8b20c3; - hashParamTable[120].ref = &device.counters.latch.state.clock; - hashParamTable[120].size = sizeof(device.counters.latch.state.clock); - hashParamTable[121].hash = 0x2b9576ac; - hashParamTable[121].ref = &device.dither.detector.settings.transfer.raw[1]; - hashParamTable[121].size = sizeof(device.dither.detector.settings.transfer.raw[1]); - hashParamTable[122].hash = 0x2bb30903; - hashParamTable[122].ref = &device.sequencer.sampler.settings.sequence[38]; - hashParamTable[122].size = sizeof(device.sequencer.sampler.settings.sequence[38]); - hashParamTable[123].hash = 0x2c3a2b00; - hashParamTable[123].ref = &device.ccs.current[0].settings.transfer.raw[7]; - hashParamTable[123].size = sizeof(device.ccs.current[0].settings.transfer.raw[7]); - hashParamTable[124].hash = 0x2c7a7b33; - hashParamTable[124].ref = &device.dither.detector.settings.filter.factor[27]; - hashParamTable[124].size = sizeof(device.dither.detector.settings.filter.factor[27]); - hashParamTable[125].hash = 0x2c7b4193; - hashParamTable[125].ref = &device.tss.temperature.settings.transfer.raw[2]; - hashParamTable[125].size = sizeof(device.tss.temperature.settings.transfer.raw[2]); - hashParamTable[126].hash = 0x2d1743bd; - hashParamTable[126].ref = &device.tss.gradient.settings.transfer.celsius[11]; - hashParamTable[126].size = sizeof(device.tss.gradient.settings.transfer.celsius[11]); - hashParamTable[127].hash = 0x2d27527f; - hashParamTable[127].ref = &device.plcs.regulator.settings.transfer.error[13]; - hashParamTable[127].size = sizeof(device.plcs.regulator.settings.transfer.error[13]); - hashParamTable[128].hash = 0x2d2d0382; - hashParamTable[128].ref = &device.sequencer.output.logic.state.level; - hashParamTable[128].size = sizeof(device.sequencer.output.logic.state.level); - hashParamTable[129].hash = 0x2d589ff1; - hashParamTable[129].ref = &device.plcs.reset.up.settings.environment.temperature[3]; - hashParamTable[129].size = sizeof(device.plcs.reset.up.settings.environment.temperature[3]); - hashParamTable[130].hash = 0x2d9353d5; - hashParamTable[130].ref = &device.dither.amplitude.settings.transfer.correction[5]; - hashParamTable[130].size = sizeof(device.dither.amplitude.settings.transfer.correction[5]); - hashParamTable[131].hash = 0x2e3cc56a; - hashParamTable[131].ref = &device.dither.detector.settings.filter.factor[17]; - hashParamTable[131].size = sizeof(device.dither.detector.settings.filter.factor[17]); - hashParamTable[132].hash = 0x2e5f83e8; - hashParamTable[132].ref = &device.sequencer.output.analog.settings.transfer.code[12]; - hashParamTable[132].size = sizeof(device.sequencer.output.analog.settings.transfer.code[12]); - hashParamTable[133].hash = 0x2e780102; - hashParamTable[133].ref = &device.plcs.output.settings.transfer.code[10]; - hashParamTable[133].size = sizeof(device.plcs.output.settings.transfer.code[10]); - hashParamTable[134].hash = 0x2e976286; - hashParamTable[134].ref = &device.plcs.output.settings.transfer.voltage[9]; - hashParamTable[134].size = sizeof(device.plcs.output.settings.transfer.voltage[9]); - hashParamTable[135].hash = 0x2efc1f86; - hashParamTable[135].ref = &device.sequencer.sampler.settings.sequence[48]; - hashParamTable[135].size = sizeof(device.sequencer.sampler.settings.sequence[48]); - hashParamTable[136].hash = 0x2f3e75b1; - hashParamTable[136].ref = &device.sequencer.sampler.settings.sequence[58]; - hashParamTable[136].size = sizeof(device.sequencer.sampler.settings.sequence[58]); - hashParamTable[137].hash = 0x2f790c08; - hashParamTable[137].ref = &device.plcs.reset.up.settings.environment.trigger[10]; - hashParamTable[137].size = sizeof(device.plcs.reset.up.settings.environment.trigger[10]); - hashParamTable[138].hash = 0x2f9333cc; - hashParamTable[138].ref = &device.tss.gradient.settings.transfer.celsius[1]; - hashParamTable[138].size = sizeof(device.tss.gradient.settings.transfer.celsius[1]); - hashParamTable[139].hash = 0x2fd80edf; - hashParamTable[139].ref = &device.isacs.input.settings.transfer.raw[5]; - hashParamTable[139].size = sizeof(device.isacs.input.settings.transfer.raw[5]); - hashParamTable[140].hash = 0x300a6a6b; - hashParamTable[140].ref = &device.dither.frequency.settings.transfer.error[11]; - hashParamTable[140].size = sizeof(device.dither.frequency.settings.transfer.error[11]); - hashParamTable[141].hash = 0x303ac442; - hashParamTable[141].ref = &device.isacs.output.settings.transfer.voltage[3]; - hashParamTable[141].size = sizeof(device.isacs.output.settings.transfer.voltage[3]); - hashParamTable[142].hash = 0x305fdc15; - hashParamTable[142].ref = &device.sequencer.sampler.settings.sequence[9]; - hashParamTable[142].size = sizeof(device.sequencer.sampler.settings.sequence[9]); - hashParamTable[143].hash = 0x30a095c7; - hashParamTable[143].ref = &device.plcs.feedback.settings.transfer.points; - hashParamTable[143].size = sizeof(device.plcs.feedback.settings.transfer.points); - hashParamTable[144].hash = 0x30a2929d; - hashParamTable[144].ref = &device.plcs.bias.settings.transfer.points; - hashParamTable[144].size = sizeof(device.plcs.bias.settings.transfer.points); - hashParamTable[145].hash = 0x3104da53; - hashParamTable[145].ref = &device.plcs.reset.down.settings.environment.target[14]; - hashParamTable[145].size = sizeof(device.plcs.reset.down.settings.environment.target[14]); - hashParamTable[146].hash = 0x312cec2c; - hashParamTable[146].ref = &device.sequencer.sampler.settings.sequence[19]; - hashParamTable[146].size = sizeof(device.sequencer.sampler.settings.sequence[19]); - hashParamTable[147].hash = 0x323b0650; - hashParamTable[147].ref = &device.ccs.current[0].state.raw; - hashParamTable[147].size = sizeof(device.ccs.current[0].state.raw); - hashParamTable[148].hash = 0x324b61ef; - hashParamTable[148].ref = &device.tss.temperature.state.celsius; - hashParamTable[148].size = sizeof(device.tss.temperature.state.celsius); - hashParamTable[149].hash = 0x328e47ed; - hashParamTable[149].ref = &device.dither.detector.settings.transfer.raw[0]; - hashParamTable[149].size = sizeof(device.dither.detector.settings.transfer.raw[0]); - hashParamTable[150].hash = 0x3292d5ec; - hashParamTable[150].ref = &device.dither.frequency.state.max; - hashParamTable[150].size = sizeof(device.dither.frequency.state.max); - hashParamTable[151].hash = 0x32a83842; - hashParamTable[151].ref = &device.sequencer.sampler.settings.sequence[39]; - hashParamTable[151].size = sizeof(device.sequencer.sampler.settings.sequence[39]); - hashParamTable[152].hash = 0x3300b784; - hashParamTable[152].ref = &device.dither.amplitude.settings.transfer.correction[14]; - hashParamTable[152].size = sizeof(device.dither.amplitude.settings.transfer.correction[14]); - hashParamTable[153].hash = 0x331d862a; - hashParamTable[153].ref = &device.plcs.reset.up.settings.environment.target[3]; - hashParamTable[153].size = sizeof(device.plcs.reset.up.settings.environment.target[3]); - hashParamTable[154].hash = 0x335b203f; - hashParamTable[154].ref = &device.isacs.output.settings.transfer.voltage[13]; - hashParamTable[154].size = sizeof(device.isacs.output.settings.transfer.voltage[13]); - hashParamTable[155].hash = 0x336a5275; - hashParamTable[155].ref = &device.sequencer.sampler.settings.sequence[29]; - hashParamTable[155].size = sizeof(device.sequencer.sampler.settings.sequence[29]); - hashParamTable[156].hash = 0x33b1a907; - hashParamTable[156].ref = &device.plcs.feedback.settings.transfer.raw[15]; - hashParamTable[156].size = sizeof(device.plcs.feedback.settings.transfer.raw[15]); - hashParamTable[157].hash = 0x33b3b71d; - hashParamTable[157].ref = &device.isacs.regulator.settings.transfer.error[6]; - hashParamTable[157].size = sizeof(device.isacs.regulator.settings.transfer.error[6]); - hashParamTable[158].hash = 0x33d05977; - hashParamTable[158].ref = &device.plcs.feedback.settings.transfer.raw[3]; - hashParamTable[158].size = sizeof(device.plcs.feedback.settings.transfer.raw[3]); - hashParamTable[159].hash = 0x33d25e2d; - hashParamTable[159].ref = &device.plcs.bias.settings.transfer.raw[3]; - hashParamTable[159].size = sizeof(device.plcs.bias.settings.transfer.raw[3]); - hashParamTable[160].hash = 0x33f00764; - hashParamTable[160].ref = &device.isacs.output.settings.transfer.code[8]; - hashParamTable[160].size = sizeof(device.isacs.output.settings.transfer.code[8]); - hashParamTable[161].hash = 0x340c72fc; - hashParamTable[161].ref = &device.tss.gradient.settings.transfer.celsius[10]; - hashParamTable[161].size = sizeof(device.tss.gradient.settings.transfer.celsius[10]); - hashParamTable[162].hash = 0x343c633e; - hashParamTable[162].ref = &device.plcs.regulator.settings.transfer.error[12]; - hashParamTable[162].size = sizeof(device.plcs.regulator.settings.transfer.error[12]); - hashParamTable[163].hash = 0x3443aeb0; - hashParamTable[163].ref = &device.plcs.reset.up.settings.environment.temperature[2]; - hashParamTable[163].size = sizeof(device.plcs.reset.up.settings.environment.temperature[2]); - hashParamTable[164].hash = 0x34886294; - hashParamTable[164].ref = &device.dither.amplitude.settings.transfer.correction[4]; - hashParamTable[164].size = sizeof(device.dither.amplitude.settings.transfer.correction[4]); - hashParamTable[165].hash = 0x35211a41; - hashParamTable[165].ref = &device.ccs.current[0].settings.transfer.raw[6]; - hashParamTable[165].size = sizeof(device.ccs.current[0].settings.transfer.raw[6]); - hashParamTable[166].hash = 0x356070d2; - hashParamTable[166].ref = &device.tss.temperature.settings.transfer.raw[3]; - hashParamTable[166].size = sizeof(device.tss.temperature.settings.transfer.raw[3]); - hashParamTable[167].hash = 0x35614a72; - hashParamTable[167].ref = &device.dither.detector.settings.filter.factor[26]; - hashParamTable[167].size = sizeof(device.dither.detector.settings.filter.factor[26]); - hashParamTable[168].hash = 0x35bb1bb7; - hashParamTable[168].ref = &device.plcs.reset.up.state.target; - hashParamTable[168].size = sizeof(device.plcs.reset.up.state.target); - hashParamTable[169].hash = 0x35df3163; - hashParamTable[169].ref = &device.plcs.output.settings.transfer.points; - hashParamTable[169].size = sizeof(device.plcs.output.settings.transfer.points); - hashParamTable[170].hash = 0x3610bc62; - hashParamTable[170].ref = &device.tss.temperature.settings.transfer.points; - hashParamTable[170].size = sizeof(device.tss.temperature.settings.transfer.points); - hashParamTable[171].hash = 0x361a129e; - hashParamTable[171].ref = &device.isacs.output.settings.reset.voltage; - hashParamTable[171].size = sizeof(device.isacs.output.settings.reset.voltage); - hashParamTable[172].hash = 0x362544f0; - hashParamTable[172].ref = &device.sequencer.sampler.settings.sequence[59]; - hashParamTable[172].size = sizeof(device.sequencer.sampler.settings.sequence[59]); - hashParamTable[173].hash = 0x36623d49; - hashParamTable[173].ref = &device.plcs.reset.up.settings.environment.trigger[11]; - hashParamTable[173].size = sizeof(device.plcs.reset.up.settings.environment.trigger[11]); - hashParamTable[174].hash = 0x3688028d; - hashParamTable[174].ref = &device.tss.gradient.settings.transfer.celsius[0]; - hashParamTable[174].size = sizeof(device.tss.gradient.settings.transfer.celsius[0]); - hashParamTable[175].hash = 0x36c33f9e; - hashParamTable[175].ref = &device.isacs.input.settings.transfer.raw[4]; - hashParamTable[175].size = sizeof(device.isacs.input.settings.transfer.raw[4]); - hashParamTable[176].hash = 0x36ee331; - hashParamTable[176].ref = &device.isacs.regulator.state.enabled; - hashParamTable[176].size = sizeof(device.isacs.regulator.state.enabled); - hashParamTable[177].hash = 0x3727f42b; - hashParamTable[177].ref = &device.dither.detector.settings.filter.factor[16]; - hashParamTable[177].size = sizeof(device.dither.detector.settings.filter.factor[16]); - hashParamTable[178].hash = 0x3744b2a9; - hashParamTable[178].ref = &device.sequencer.output.analog.settings.transfer.code[13]; - hashParamTable[178].size = sizeof(device.sequencer.output.analog.settings.transfer.code[13]); - hashParamTable[179].hash = 0x3760b966; - hashParamTable[179].ref = &device.dither.pulse.state.width; - hashParamTable[179].size = sizeof(device.dither.pulse.state.width); - hashParamTable[180].hash = 0x37633043; - hashParamTable[180].ref = &device.plcs.output.settings.transfer.code[11]; - hashParamTable[180].size = sizeof(device.plcs.output.settings.transfer.code[11]); - hashParamTable[181].hash = 0x378c53c7; - hashParamTable[181].ref = &device.plcs.output.settings.transfer.voltage[8]; - hashParamTable[181].size = sizeof(device.plcs.output.settings.transfer.voltage[8]); - hashParamTable[182].hash = 0x37e72ec7; - hashParamTable[182].ref = &device.sequencer.sampler.settings.sequence[49]; - hashParamTable[182].size = sizeof(device.sequencer.sampler.settings.sequence[49]); - hashParamTable[183].hash = 0x3837025b; - hashParamTable[183].ref = &device.dither.detector.settings.transfer.raw[14]; - hashParamTable[183].size = sizeof(device.dither.detector.settings.transfer.raw[14]); - hashParamTable[184].hash = 0x3871bb0f; - hashParamTable[184].ref = &device.counters.latch.state.angle; - hashParamTable[184].size = sizeof(device.counters.latch.state.angle); - hashParamTable[185].hash = 0x38968909; - hashParamTable[185].ref = &device.plcs.reset.down.settings.environment.temperature[8]; - hashParamTable[185].size = sizeof(device.plcs.reset.down.settings.environment.temperature[8]); - hashParamTable[186].hash = 0x38a9b2f; - hashParamTable[186].ref = &device.plcs.reset.up.settings.environment.target[15]; - hashParamTable[186].size = sizeof(device.plcs.reset.up.settings.environment.target[15]); - hashParamTable[187].hash = 0x38b6013a; - hashParamTable[187].ref = &device.dither.detector.settings.transfer.restored[14]; - hashParamTable[187].size = sizeof(device.dither.detector.settings.transfer.restored[14]); - hashParamTable[188].hash = 0x391a7a53; - hashParamTable[188].ref = &device.plcs.reset.down.settings.environment.target[0]; - hashParamTable[188].size = sizeof(device.plcs.reset.down.settings.environment.target[0]); - hashParamTable[189].hash = 0x39551ae8; - hashParamTable[189].ref = &device.plcs.regulator.settings.transfer.error[9]; - hashParamTable[189].size = sizeof(device.plcs.regulator.settings.transfer.error[9]); - hashParamTable[190].hash = 0x398596bf; - hashParamTable[190].ref = &device.isacs.input.settings.transfer.V[14]; - hashParamTable[190].size = sizeof(device.isacs.input.settings.transfer.V[14]); - hashParamTable[191].hash = 0x3992eb3f; - hashParamTable[191].ref = &device.plcs.bias.settings.transfer.normalized[8]; - hashParamTable[191].size = sizeof(device.plcs.bias.settings.transfer.normalized[8]); - hashParamTable[192].hash = 0x39e8d6cf; - hashParamTable[192].ref = &device.tss.gradient.settings.transfer.raw[8]; - hashParamTable[192].size = sizeof(device.tss.gradient.settings.transfer.raw[8]); - hashParamTable[193].hash = 0x3a06e7d5; - hashParamTable[193].ref = &device.plcs.feedback.settings.transfer.normalized[3]; - hashParamTable[193].size = sizeof(device.plcs.feedback.settings.transfer.normalized[3]); - hashParamTable[194].hash = 0x3a3ecdeb; - hashParamTable[194].ref = &device.dither.pulse.state.min; - hashParamTable[194].size = sizeof(device.dither.pulse.state.min); - hashParamTable[195].hash = 0x3a8e6def; - hashParamTable[195].ref = &device.isacs.regulator.settings.transfer.correction[2]; - hashParamTable[195].size = sizeof(device.isacs.regulator.settings.transfer.correction[2]); - hashParamTable[196].hash = 0x3a9e39b3; - hashParamTable[196].ref = &device.plcs.bias.settings.transfer.normalized[10]; - hashParamTable[196].size = sizeof(device.plcs.bias.settings.transfer.normalized[10]); - hashParamTable[197].hash = 0x3aa26201; - hashParamTable[197].ref = &device.sequencer.output.analog.settings.transfer.voltage[8]; - hashParamTable[197].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[8]); - hashParamTable[198].hash = 0x3ad87ebd; - hashParamTable[198].ref = &device.dither.amplitude.state.reference; - hashParamTable[198].size = sizeof(device.dither.amplitude.state.reference); - hashParamTable[199].hash = 0x3b012deb; - hashParamTable[199].ref = &device.dither.pulse.settings.max; - hashParamTable[199].size = sizeof(device.dither.pulse.settings.max); - hashParamTable[200].hash = 0x3c49aefa; - hashParamTable[200].ref = &device.counters.dither.state.delta[30]; - hashParamTable[200].size = sizeof(device.counters.dither.state.delta[30]); - hashParamTable[201].hash = 0x3cc046e7; - hashParamTable[201].ref = &device.plcs.reset.up.settings.environment.points; - hashParamTable[201].size = sizeof(device.plcs.reset.up.settings.environment.points); - hashParamTable[202].hash = 0x3cfc9965; - hashParamTable[202].ref = &device.plcs.reset.down.settings.environment.duration[8]; - hashParamTable[202].size = sizeof(device.plcs.reset.down.settings.environment.duration[8]); - hashParamTable[203].hash = 0x3d02cce8; - hashParamTable[203].ref = &device.plcs.output.settings.transfer.code[3]; - hashParamTable[203].size = sizeof(device.plcs.output.settings.transfer.code[3]); - hashParamTable[204].hash = 0x3d4d3074; - hashParamTable[204].ref = &device.plcs.regulator.settings.transfer.correction[4]; - hashParamTable[204].size = sizeof(device.plcs.regulator.settings.transfer.correction[4]); - hashParamTable[205].hash = 0x3d58b0a8; - hashParamTable[205].ref = &device.isacs.regulator.settings.regular.enabled; - hashParamTable[205].size = sizeof(device.isacs.regulator.settings.regular.enabled); - hashParamTable[206].hash = 0x3d8bc4cd; - hashParamTable[206].ref = &device.counters.dither.state.delta[20]; - hashParamTable[206].size = sizeof(device.counters.dither.state.delta[20]); - hashParamTable[207].hash = 0x3dc07ea2; - hashParamTable[207].ref = &device.dither.frequency.settings.transfer.correction[12]; - hashParamTable[207].size = sizeof(device.dither.frequency.settings.transfer.correction[12]); - hashParamTable[208].hash = 0x3ecec226; - hashParamTable[208].ref = &device.dither.amplitude.settings.transfer.error[2]; - hashParamTable[208].size = sizeof(device.dither.amplitude.settings.transfer.error[2]); - hashParamTable[209].hash = 0x3f0760a8; - hashParamTable[209].ref = &device.isacs.input.settings.transfer.V[4]; - hashParamTable[209].size = sizeof(device.isacs.input.settings.transfer.V[4]); - hashParamTable[210].hash = 0x3f24799d; - hashParamTable[210].ref = &device.plcs.reset.up.settings.environment.trigger[5]; - hashParamTable[210].size = sizeof(device.plcs.reset.up.settings.environment.trigger[5]); - hashParamTable[211].hash = 0x3f9c5a63; - hashParamTable[211].ref = &device.plcs.reset.down.settings.environment.trigger[6]; - hashParamTable[211].size = sizeof(device.plcs.reset.down.settings.environment.trigger[6]); - hashParamTable[212].hash = 0x3fcd7a94; - hashParamTable[212].ref = &device.counters.dither.state.delta[10]; - hashParamTable[212].size = sizeof(device.counters.dither.state.delta[10]); - hashParamTable[213].hash = 0x3ff8887f; - hashParamTable[213].ref = &device.dither.detector.settings.filter.factor[5]; - hashParamTable[213].size = sizeof(device.dither.detector.settings.filter.factor[5]); - hashParamTable[214].hash = 0x401d1b93; - hashParamTable[214].ref = &device.plcs.feedback.settings.input; - hashParamTable[214].size = sizeof(device.plcs.feedback.settings.input); - hashParamTable[215].hash = 0x403ac431; - hashParamTable[215].ref = &device.plcs.regulator.settings.transfer.correction[1]; - hashParamTable[215].size = sizeof(device.plcs.regulator.settings.transfer.correction[1]); - hashParamTable[216].hash = 0x407538ad; - hashParamTable[216].ref = &device.plcs.output.settings.transfer.code[6]; - hashParamTable[216].size = sizeof(device.plcs.output.settings.transfer.code[6]); - hashParamTable[217].hash = 0x40fc3088; - hashParamTable[217].ref = &device.counters.dither.state.delta[25]; - hashParamTable[217].size = sizeof(device.counters.dither.state.delta[25]); - hashParamTable[218].hash = 0x412613ac; - hashParamTable[218].ref = &device.plcs.regulator.state.reference; - hashParamTable[218].size = sizeof(device.plcs.regulator.state.reference); - hashParamTable[219].hash = 0x41cdcbe5; - hashParamTable[219].ref = &device.plcs.output.settings.enabled; - hashParamTable[219].size = sizeof(device.plcs.output.settings.enabled); - hashParamTable[220].hash = 0x41e6553f; - hashParamTable[220].ref = &device.controller.SSP.in[2]; - hashParamTable[220].size = sizeof(device.controller.SSP.in[2]); - hashParamTable[221].hash = 0x42538dd8; - hashParamTable[221].ref = &device.plcs.reset.up.settings.environment.trigger[0]; - hashParamTable[221].size = sizeof(device.plcs.reset.up.settings.environment.trigger[0]); - hashParamTable[222].hash = 0x427094ed; - hashParamTable[222].ref = &device.isacs.input.settings.transfer.V[1]; - hashParamTable[222].size = sizeof(device.isacs.input.settings.transfer.V[1]); - hashParamTable[223].hash = 0x428f7c3a; - hashParamTable[223].ref = &device.dither.detector.settings.filter.factor[0]; - hashParamTable[223].size = sizeof(device.dither.detector.settings.filter.factor[0]); - hashParamTable[224].hash = 0x42ba8ed1; - hashParamTable[224].ref = &device.counters.dither.state.delta[15]; - hashParamTable[224].size = sizeof(device.counters.dither.state.delta[15]); - hashParamTable[225].hash = 0x42ebae26; - hashParamTable[225].ref = &device.plcs.reset.down.settings.environment.trigger[3]; - hashParamTable[225].size = sizeof(device.plcs.reset.down.settings.environment.trigger[3]); - hashParamTable[226].hash = 0x435238e3; - hashParamTable[226].ref = &device.plcs.detector.state.out; - hashParamTable[226].size = sizeof(device.plcs.detector.state.out); - hashParamTable[227].hash = 0x43b93663; - hashParamTable[227].ref = &device.dither.amplitude.settings.transfer.error[7]; - hashParamTable[227].size = sizeof(device.dither.amplitude.settings.transfer.error[7]); - hashParamTable[228].hash = 0x44212bba; - hashParamTable[228].ref = &device.plcs.feedback.settings.transfer.normalized[12]; - hashParamTable[228].size = sizeof(device.plcs.feedback.settings.transfer.normalized[12]); - hashParamTable[229].hash = 0x4435fa83; - hashParamTable[229].ref = &device.service.port.state.baud; - hashParamTable[229].size = sizeof(device.service.port.state.baud); - hashParamTable[230].hash = 0x446d8e16; - hashParamTable[230].ref = &device.plcs.reset.down.settings.environment.target[5]; - hashParamTable[230].size = sizeof(device.plcs.reset.down.settings.environment.target[5]); - hashParamTable[231].hash = 0x44b2f8b0; - hashParamTable[231].ref = &device.dither.amplitude.settings.transfer.error[12]; - hashParamTable[231].size = sizeof(device.dither.amplitude.settings.transfer.error[12]); - hashParamTable[232].hash = 0x44cf72ec; - hashParamTable[232].ref = &device.plcs.reset.up.settings.environment.temperature[13]; - hashParamTable[232].size = sizeof(device.plcs.reset.up.settings.environment.temperature[13]); - hashParamTable[233].hash = 0x44f262fa; - hashParamTable[233].ref = &device.isacs.input.settings.transfer.V[11]; - hashParamTable[233].size = sizeof(device.isacs.input.settings.transfer.V[11]); - hashParamTable[234].hash = 0x450cb7eb; - hashParamTable[234].ref = &device.plcs.reset.down.settings.environment.trigger[12]; - hashParamTable[234].size = sizeof(device.plcs.reset.down.settings.environment.trigger[12]); - hashParamTable[235].hash = 0x4540f61e; - hashParamTable[235].ref = &device.dither.detector.settings.transfer.raw[11]; - hashParamTable[235].size = sizeof(device.dither.detector.settings.transfer.raw[11]); - hashParamTable[236].hash = 0x4545fcb; - hashParamTable[236].ref = &device.plcs.reset.up.settings.environment.trigger[13]; - hashParamTable[236].size = sizeof(device.plcs.reset.up.settings.environment.trigger[13]); - hashParamTable[237].hash = 0x45a15cba; - hashParamTable[237].ref = &device.sensor.settings.block; - hashParamTable[237].size = sizeof(device.sensor.settings.block); - hashParamTable[238].hash = 0x45c1f57f; - hashParamTable[238].ref = &device.dither.detector.settings.transfer.restored[11]; - hashParamTable[238].size = sizeof(device.dither.detector.settings.transfer.restored[11]); - hashParamTable[239].hash = 0x47502484; - hashParamTable[239].ref = &device.sequencer.sampler.state.voltage; - hashParamTable[239].size = sizeof(device.sequencer.sampler.state.voltage); - hashParamTable[240].hash = 0x47711390; - hashParamTable[240].ref = &device.plcs.feedback.settings.transfer.normalized[6]; - hashParamTable[240].size = sizeof(device.plcs.feedback.settings.transfer.normalized[6]); - hashParamTable[241].hash = 0x47e9cdf6; - hashParamTable[241].ref = &device.plcs.bias.settings.transfer.normalized[15]; - hashParamTable[241].size = sizeof(device.plcs.bias.settings.transfer.normalized[15]); - hashParamTable[242].hash = 0x47f999aa; - hashParamTable[242].ref = &device.isacs.regulator.settings.transfer.correction[7]; - hashParamTable[242].size = sizeof(device.isacs.regulator.settings.transfer.correction[7]); - hashParamTable[243].hash = 0x4816be37; - hashParamTable[243].ref = &device.dither.detector.settings.filter.factor[23]; - hashParamTable[243].size = sizeof(device.dither.detector.settings.filter.factor[23]); - hashParamTable[244].hash = 0x48178497; - hashParamTable[244].ref = &device.tss.temperature.settings.transfer.raw[6]; - hashParamTable[244].size = sizeof(device.tss.temperature.settings.transfer.raw[6]); - hashParamTable[245].hash = 0x4856ee04; - hashParamTable[245].ref = &device.ccs.current[0].settings.transfer.raw[3]; - hashParamTable[245].size = sizeof(device.ccs.current[0].settings.transfer.raw[3]); - hashParamTable[246].hash = 0x48d63285; - hashParamTable[246].ref = &device.plcs.regulator.state.correction; - hashParamTable[246].size = sizeof(device.plcs.regulator.state.correction); - hashParamTable[247].hash = 0x49345af5; - hashParamTable[247].ref = &device.plcs.reset.up.settings.environment.temperature[7]; - hashParamTable[247].size = sizeof(device.plcs.reset.up.settings.environment.temperature[7]); - hashParamTable[248].hash = 0x497b86b9; - hashParamTable[248].ref = &device.tss.gradient.settings.transfer.celsius[15]; - hashParamTable[248].size = sizeof(device.tss.gradient.settings.transfer.celsius[15]); - hashParamTable[249].hash = 0x498a9f45; - hashParamTable[249].ref = &device.controller.I2C.state.buffer[2]; - hashParamTable[249].size = sizeof(device.controller.I2C.state.buffer[2]); - hashParamTable[250].hash = 0x49ff96d1; - hashParamTable[250].ref = &device.dither.amplitude.settings.transfer.correction[1]; - hashParamTable[250].size = sizeof(device.dither.amplitude.settings.transfer.correction[1]); - hashParamTable[251].hash = 0x4a14c406; - hashParamTable[251].ref = &device.plcs.output.settings.transfer.code[14]; - hashParamTable[251].size = sizeof(device.plcs.output.settings.transfer.code[14]); - hashParamTable[252].hash = 0x4a50006e; - hashParamTable[252].ref = &device.dither.detector.settings.filter.factor[13]; - hashParamTable[252].size = sizeof(device.dither.detector.settings.filter.factor[13]); - hashParamTable[253].hash = 0x4a6cfb0b; - hashParamTable[253].ref = &device.plcs.reset.up.state.trigger; - hashParamTable[253].size = sizeof(device.plcs.reset.up.state.trigger); - hashParamTable[254].hash = 0x4a75ad0c; - hashParamTable[254].ref = &device.dither.pulse.settings.width; - hashParamTable[254].size = sizeof(device.dither.pulse.settings.width); - hashParamTable[255].hash = 0x4adc0b31; - hashParamTable[255].ref = &device.plcs.reset.down.state.target; - hashParamTable[255].size = sizeof(device.plcs.reset.down.state.target); - hashParamTable[256].hash = 0x4b097ccb; - hashParamTable[256].ref = &device.controller.SSP.out[0]; - hashParamTable[256].size = sizeof(device.controller.SSP.out[0]); - hashParamTable[257].hash = 0x4b15c90c; - hashParamTable[257].ref = &device.plcs.reset.up.settings.environment.trigger[14]; - hashParamTable[257].size = sizeof(device.plcs.reset.up.settings.environment.trigger[14]); - hashParamTable[258].hash = 0x4b2622b4; - hashParamTable[258].ref = &device.ccs.current[0].settings.transfer.points; - hashParamTable[258].size = sizeof(device.ccs.current[0].settings.transfer.points); - hashParamTable[259].hash = 0x4bb4cbdb; - hashParamTable[259].ref = &device.isacs.input.settings.transfer.raw[1]; - hashParamTable[259].size = sizeof(device.isacs.input.settings.transfer.raw[1]); - hashParamTable[260].hash = 0x4be600f; - hashParamTable[260].ref = &device.tss.gradient.settings.transfer.celsius[2]; - hashParamTable[260].size = sizeof(device.tss.gradient.settings.transfer.celsius[2]); - hashParamTable[261].hash = 0x4bfff6c8; - hashParamTable[261].ref = &device.tss.gradient.settings.transfer.celsius[5]; - hashParamTable[261].size = sizeof(device.tss.gradient.settings.transfer.celsius[5]); - hashParamTable[262].hash = 0x4c732e16; - hashParamTable[262].ref = &device.plcs.reset.down.settings.environment.target[11]; - hashParamTable[262].size = sizeof(device.plcs.reset.down.settings.environment.target[11]); - hashParamTable[263].hash = 0x4ccb0de8; - hashParamTable[263].ref = &device.plcs.reset.up.settings.environment.target[12]; - hashParamTable[263].size = sizeof(device.plcs.reset.up.settings.environment.target[12]); - hashParamTable[264].hash = 0x4d4d3007; - hashParamTable[264].ref = &device.isacs.output.settings.transfer.voltage[6]; - hashParamTable[264].size = sizeof(device.isacs.output.settings.transfer.voltage[6]); - hashParamTable[265].hash = 0x4d730bd4; - hashParamTable[265].ref = &device.dither.frequency.settings.transfer.error[9]; - hashParamTable[265].size = sizeof(device.dither.frequency.settings.transfer.error[9]); - hashParamTable[266].hash = 0x4d7d9e2e; - hashParamTable[266].ref = &device.dither.frequency.settings.transfer.error[14]; - hashParamTable[266].size = sizeof(device.dither.frequency.settings.transfer.error[14]); - hashParamTable[267].hash = 0x4e6a726f; - hashParamTable[267].ref = &device.plcs.reset.up.settings.environment.target[6]; - hashParamTable[267].size = sizeof(device.plcs.reset.up.settings.environment.target[6]); - hashParamTable[268].hash = 0x4e7743c1; - hashParamTable[268].ref = &device.dither.amplitude.settings.transfer.correction[11]; - hashParamTable[268].size = sizeof(device.dither.amplitude.settings.transfer.correction[11]); - hashParamTable[269].hash = 0x4ea5aa68; - hashParamTable[269].ref = &device.plcs.bias.settings.transfer.raw[6]; - hashParamTable[269].size = sizeof(device.plcs.bias.settings.transfer.raw[6]); - hashParamTable[270].hash = 0x4ea7ad32; - hashParamTable[270].ref = &device.plcs.feedback.settings.transfer.raw[6]; - hashParamTable[270].size = sizeof(device.plcs.feedback.settings.transfer.raw[6]); - hashParamTable[271].hash = 0x4ec44358; - hashParamTable[271].ref = &device.isacs.regulator.settings.transfer.error[3]; - hashParamTable[271].size = sizeof(device.isacs.regulator.settings.transfer.error[3]); - hashParamTable[272].hash = 0x4ec65d42; - hashParamTable[272].ref = &device.plcs.feedback.settings.transfer.raw[10]; - hashParamTable[272].size = sizeof(device.plcs.feedback.settings.transfer.raw[10]); - hashParamTable[273].hash = 0x4ec8ba0e; - hashParamTable[273].ref = &device.plcs.reset.down.state.trigger; - hashParamTable[273].size = sizeof(device.plcs.reset.down.state.trigger); - hashParamTable[274].hash = 0x4f55d1c; - hashParamTable[274].ref = &device.isacs.input.settings.transfer.raw[6]; - hashParamTable[274].size = sizeof(device.isacs.input.settings.transfer.raw[6]); - hashParamTable[275].hash = 0x4fd98d13; - hashParamTable[275].ref = &device.isacs.output.settings.start.voltage; - hashParamTable[275].size = sizeof(device.isacs.output.settings.start.voltage); - hashParamTable[276].hash = 0x4ff9b3a8; - hashParamTable[276].ref = &device.dither.detector.settings.transfer.raw[5]; - hashParamTable[276].size = sizeof(device.dither.detector.settings.transfer.raw[5]); - hashParamTable[277].hash = 0x502f6bb4; - hashParamTable[277].ref = &device.plcs.reset.up.settings.environment.temperature[6]; - hashParamTable[277].size = sizeof(device.plcs.reset.up.settings.environment.temperature[6]); - hashParamTable[278].hash = 0x5060b7f8; - hashParamTable[278].ref = &device.tss.gradient.settings.transfer.celsius[14]; - hashParamTable[278].size = sizeof(device.tss.gradient.settings.transfer.celsius[14]); - hashParamTable[279].hash = 0x5091ae04; - hashParamTable[279].ref = &device.controller.I2C.state.buffer[3]; - hashParamTable[279].size = sizeof(device.controller.I2C.state.buffer[3]); - hashParamTable[280].hash = 0x50e4a790; - hashParamTable[280].ref = &device.dither.amplitude.settings.transfer.correction[0]; - hashParamTable[280].size = sizeof(device.dither.amplitude.settings.transfer.correction[0]); - hashParamTable[281].hash = 0x510cb5d6; - hashParamTable[281].ref = &device.tss.temperature.settings.transfer.raw[7]; - hashParamTable[281].size = sizeof(device.tss.temperature.settings.transfer.raw[7]); - hashParamTable[282].hash = 0x510d8f76; - hashParamTable[282].ref = &device.dither.detector.settings.filter.factor[22]; - hashParamTable[282].size = sizeof(device.dither.detector.settings.filter.factor[22]); - hashParamTable[283].hash = 0x51196a9; - hashParamTable[283].ref = &device.dither.detector.settings.filter.factor[14]; - hashParamTable[283].size = sizeof(device.dither.detector.settings.filter.factor[14]); - hashParamTable[284].hash = 0x514ddf45; - hashParamTable[284].ref = &device.ccs.current[0].settings.transfer.raw[2]; - hashParamTable[284].size = sizeof(device.ccs.current[0].settings.transfer.raw[2]); - hashParamTable[285].hash = 0x520ef84d; - hashParamTable[285].ref = &device.plcs.reset.up.settings.environment.trigger[15]; - hashParamTable[285].size = sizeof(device.plcs.reset.up.settings.environment.trigger[15]); - hashParamTable[286].hash = 0x52124d8a; - hashParamTable[286].ref = &device.controller.SSP.out[1]; - hashParamTable[286].size = sizeof(device.controller.SSP.out[1]); - hashParamTable[287].hash = 0x525b6730; - hashParamTable[287].ref = &device.controller.I2C.state.enabled; - hashParamTable[287].size = sizeof(device.controller.I2C.state.enabled); - hashParamTable[288].hash = 0x528cd113; - hashParamTable[288].ref = &device.plcs.feedback.state.input; - hashParamTable[288].size = sizeof(device.plcs.feedback.state.input); - hashParamTable[289].hash = 0x52affa9a; - hashParamTable[289].ref = &device.isacs.input.settings.transfer.raw[0]; - hashParamTable[289].size = sizeof(device.isacs.input.settings.transfer.raw[0]); - hashParamTable[290].hash = 0x52e4c789; - hashParamTable[290].ref = &device.tss.gradient.settings.transfer.celsius[4]; - hashParamTable[290].size = sizeof(device.tss.gradient.settings.transfer.celsius[4]); - hashParamTable[291].hash = 0x530ff547; - hashParamTable[291].ref = &device.plcs.output.settings.transfer.code[15]; - hashParamTable[291].size = sizeof(device.plcs.output.settings.transfer.code[15]); - hashParamTable[292].hash = 0x534b312f; - hashParamTable[292].ref = &device.dither.detector.settings.filter.factor[12]; - hashParamTable[292].size = sizeof(device.dither.detector.settings.filter.factor[12]); - hashParamTable[293].hash = 0x542e0c62; - hashParamTable[293].ref = &device.controller.flash.settings.hashSector; - hashParamTable[293].size = sizeof(device.controller.flash.settings.hashSector); - hashParamTable[294].hash = 0x54560146; - hashParamTable[294].ref = &device.isacs.output.settings.transfer.voltage[7]; - hashParamTable[294].size = sizeof(device.isacs.output.settings.transfer.voltage[7]); - hashParamTable[295].hash = 0x5466af6f; - hashParamTable[295].ref = &device.dither.frequency.settings.transfer.error[15]; - hashParamTable[295].size = sizeof(device.dither.frequency.settings.transfer.error[15]); - hashParamTable[296].hash = 0x54683a95; - hashParamTable[296].ref = &device.dither.frequency.settings.transfer.error[8]; - hashParamTable[296].size = sizeof(device.dither.frequency.settings.transfer.error[8]); - hashParamTable[297].hash = 0x55552c1; - hashParamTable[297].ref = &device.plcs.output.settings.transfer.code[13]; - hashParamTable[297].size = sizeof(device.plcs.output.settings.transfer.code[13]); - hashParamTable[298].hash = 0x55681f57; - hashParamTable[298].ref = &device.plcs.reset.down.settings.environment.target[10]; - hashParamTable[298].size = sizeof(device.plcs.reset.down.settings.environment.target[10]); - hashParamTable[299].hash = 0x55893f99; - hashParamTable[299].ref = &device.dither.pulse.state.counter; - hashParamTable[299].size = sizeof(device.dither.pulse.state.counter); - hashParamTable[300].hash = 0x55d03ca9; - hashParamTable[300].ref = &device.plcs.reset.up.settings.environment.target[13]; - hashParamTable[300].size = sizeof(device.plcs.reset.up.settings.environment.target[13]); - hashParamTable[301].hash = 0x56e282e9; - hashParamTable[301].ref = &device.dither.detector.settings.transfer.raw[4]; - hashParamTable[301].size = sizeof(device.dither.detector.settings.transfer.raw[4]); - hashParamTable[302].hash = 0x572d02b; - hashParamTable[302].ref = &device.sequencer.output.analog.settings.transfer.code[11]; - hashParamTable[302].size = sizeof(device.sequencer.output.analog.settings.transfer.code[11]); - hashParamTable[303].hash = 0x575791d2; - hashParamTable[303].ref = &device.dither.amplitude.settings.reference; - hashParamTable[303].size = sizeof(device.dither.amplitude.settings.reference); - hashParamTable[304].hash = 0x576c7280; - hashParamTable[304].ref = &device.dither.amplitude.settings.transfer.correction[10]; - hashParamTable[304].size = sizeof(device.dither.amplitude.settings.transfer.correction[10]); - hashParamTable[305].hash = 0x5771432e; - hashParamTable[305].ref = &device.plcs.reset.up.settings.environment.target[7]; - hashParamTable[305].size = sizeof(device.plcs.reset.up.settings.environment.target[7]); - hashParamTable[306].hash = 0x57bc9c73; - hashParamTable[306].ref = &device.plcs.feedback.settings.transfer.raw[7]; - hashParamTable[306].size = sizeof(device.plcs.feedback.settings.transfer.raw[7]); - hashParamTable[307].hash = 0x57be9b29; - hashParamTable[307].ref = &device.plcs.bias.settings.transfer.raw[7]; - hashParamTable[307].size = sizeof(device.plcs.bias.settings.transfer.raw[7]); - hashParamTable[308].hash = 0x57dd6c03; - hashParamTable[308].ref = &device.plcs.feedback.settings.transfer.raw[11]; - hashParamTable[308].size = sizeof(device.plcs.feedback.settings.transfer.raw[11]); - hashParamTable[309].hash = 0x57df7219; - hashParamTable[309].ref = &device.isacs.regulator.settings.transfer.error[2]; - hashParamTable[309].size = sizeof(device.isacs.regulator.settings.transfer.error[2]); - hashParamTable[310].hash = 0x58fd647e; - hashParamTable[310].ref = &device.controller.SSP.in[3]; - hashParamTable[310].size = sizeof(device.controller.SSP.in[3]); - hashParamTable[311].hash = 0x5921f570; - hashParamTable[311].ref = &device.plcs.regulator.settings.transfer.correction[0]; - hashParamTable[311].size = sizeof(device.plcs.regulator.settings.transfer.correction[0]); - hashParamTable[312].hash = 0x596e09ec; - hashParamTable[312].ref = &device.plcs.output.settings.transfer.code[7]; - hashParamTable[312].size = sizeof(device.plcs.output.settings.transfer.code[7]); - hashParamTable[313].hash = 0x599f579b; - hashParamTable[313].ref = &device.tss.gradient.state.celsius; - hashParamTable[313].size = sizeof(device.tss.gradient.state.celsius); - hashParamTable[314].hash = 0x59e701c9; - hashParamTable[314].ref = &device.counters.dither.state.delta[24]; - hashParamTable[314].size = sizeof(device.counters.dither.state.delta[24]); - hashParamTable[315].hash = 0x5aa20722; - hashParamTable[315].ref = &device.dither.amplitude.settings.transfer.error[6]; - hashParamTable[315].size = sizeof(device.dither.amplitude.settings.transfer.error[6]); - hashParamTable[316].hash = 0x5ab07032; - hashParamTable[316].ref = &device.sequencer.output.analog.state.enabled; - hashParamTable[316].size = sizeof(device.sequencer.output.analog.state.enabled); - hashParamTable[317].hash = 0x5b48bc99; - hashParamTable[317].ref = &device.plcs.reset.up.settings.environment.trigger[1]; - hashParamTable[317].size = sizeof(device.plcs.reset.up.settings.environment.trigger[1]); - hashParamTable[318].hash = 0x5b6ba5ac; - hashParamTable[318].ref = &device.isacs.input.settings.transfer.V[0]; - hashParamTable[318].size = sizeof(device.isacs.input.settings.transfer.V[0]); - hashParamTable[319].hash = 0x5b944d7b; - hashParamTable[319].ref = &device.dither.detector.settings.filter.factor[1]; - hashParamTable[319].size = sizeof(device.dither.detector.settings.filter.factor[1]); - hashParamTable[320].hash = 0x5ba1bf90; - hashParamTable[320].ref = &device.counters.dither.state.delta[14]; - hashParamTable[320].size = sizeof(device.counters.dither.state.delta[14]); - hashParamTable[321].hash = 0x5bb73eb8; - hashParamTable[321].ref = &device.dither.detector.state.sum; - hashParamTable[321].size = sizeof(device.dither.detector.state.sum); - hashParamTable[322].hash = 0x5bbe5132; - hashParamTable[322].ref = &device.counters.meander.state.amplitude; - hashParamTable[322].size = sizeof(device.counters.meander.state.amplitude); - hashParamTable[323].hash = 0x5bf09f67; - hashParamTable[323].ref = &device.plcs.reset.down.settings.environment.trigger[2]; - hashParamTable[323].size = sizeof(device.plcs.reset.down.settings.environment.trigger[2]); - hashParamTable[324].hash = 0x5c1786aa; - hashParamTable[324].ref = &device.plcs.reset.down.settings.environment.trigger[13]; - hashParamTable[324].size = sizeof(device.plcs.reset.down.settings.environment.trigger[13]); - hashParamTable[325].hash = 0x5c5bc75f; - hashParamTable[325].ref = &device.dither.detector.settings.transfer.raw[10]; - hashParamTable[325].size = sizeof(device.dither.detector.settings.transfer.raw[10]); - hashParamTable[326].hash = 0x5cdac43e; - hashParamTable[326].ref = &device.dither.detector.settings.transfer.restored[10]; - hashParamTable[326].size = sizeof(device.dither.detector.settings.transfer.restored[10]); - hashParamTable[327].hash = 0x5d3a1afb; - hashParamTable[327].ref = &device.plcs.feedback.settings.transfer.normalized[13]; - hashParamTable[327].size = sizeof(device.plcs.feedback.settings.transfer.normalized[13]); - hashParamTable[328].hash = 0x5d76bf57; - hashParamTable[328].ref = &device.plcs.reset.down.settings.environment.target[4]; - hashParamTable[328].size = sizeof(device.plcs.reset.down.settings.environment.target[4]); - hashParamTable[329].hash = 0x5da9c9f1; - hashParamTable[329].ref = &device.dither.amplitude.settings.transfer.error[13]; - hashParamTable[329].size = sizeof(device.dither.amplitude.settings.transfer.error[13]); - hashParamTable[330].hash = 0x5dd443ad; - hashParamTable[330].ref = &device.plcs.reset.up.settings.environment.temperature[12]; - hashParamTable[330].size = sizeof(device.plcs.reset.up.settings.environment.temperature[12]); - hashParamTable[331].hash = 0x5de953bb; - hashParamTable[331].ref = &device.isacs.input.settings.transfer.V[10]; - hashParamTable[331].size = sizeof(device.isacs.input.settings.transfer.V[10]); - hashParamTable[332].hash = 0x5e6a22d1; - hashParamTable[332].ref = &device.plcs.feedback.settings.transfer.normalized[7]; - hashParamTable[332].size = sizeof(device.plcs.feedback.settings.transfer.normalized[7]); - hashParamTable[333].hash = 0x5ee2a8eb; - hashParamTable[333].ref = &device.isacs.regulator.settings.transfer.correction[6]; - hashParamTable[333].size = sizeof(device.isacs.regulator.settings.transfer.correction[6]); - hashParamTable[334].hash = 0x5ef2fcb7; - hashParamTable[334].ref = &device.plcs.bias.settings.transfer.normalized[14]; - hashParamTable[334].size = sizeof(device.plcs.bias.settings.transfer.normalized[14]); - hashParamTable[335].hash = 0x5f9bfdd2; - hashParamTable[335].ref = &device.dither.noise.state.range; - hashParamTable[335].size = sizeof(device.dither.noise.state.range); - hashParamTable[336].hash = 0x60999818; - hashParamTable[336].ref = &device.isacs.input.settings.transfer.raw[2]; - hashParamTable[336].size = sizeof(device.isacs.input.settings.transfer.raw[2]); - hashParamTable[337].hash = 0x60a01bc; - hashParamTable[337].ref = &device.plcs.regulator.settings.transfer.error[10]; - hashParamTable[337].size = sizeof(device.plcs.regulator.settings.transfer.error[10]); - hashParamTable[338].hash = 0x60d2a50b; - hashParamTable[338].ref = &device.tss.gradient.settings.transfer.celsius[6]; - hashParamTable[338].size = sizeof(device.tss.gradient.settings.transfer.celsius[6]); - hashParamTable[339].hash = 0x611e152f; - hashParamTable[339].ref = &device.sequencer.output.analog.settings.transfer.code[15]; - hashParamTable[339].size = sizeof(device.sequencer.output.analog.settings.transfer.code[15]); - hashParamTable[340].hash = 0x617d53ad; - hashParamTable[340].ref = &device.dither.detector.settings.filter.factor[10]; - hashParamTable[340].size = sizeof(device.dither.detector.settings.filter.factor[10]); - hashParamTable[341].hash = 0x62190936; - hashParamTable[341].ref = &device.plcs.reset.up.settings.environment.temperature[4]; - hashParamTable[341].size = sizeof(device.plcs.reset.up.settings.environment.temperature[4]); - hashParamTable[342].hash = 0x624f9da4; - hashParamTable[342].ref = &device.dither.detector.settings.transfer.restored[9]; - hashParamTable[342].size = sizeof(device.dither.detector.settings.transfer.restored[9]); - hashParamTable[343].hash = 0x6266c4b8; - hashParamTable[343].ref = &device.plcs.regulator.settings.transfer.error[14]; - hashParamTable[343].size = sizeof(device.plcs.regulator.settings.transfer.error[14]); - hashParamTable[344].hash = 0x62a7cc86; - hashParamTable[344].ref = &device.controller.I2C.state.buffer[1]; - hashParamTable[344].size = sizeof(device.controller.I2C.state.buffer[1]); - hashParamTable[345].hash = 0x62d2c512; - hashParamTable[345].ref = &device.dither.amplitude.settings.transfer.correction[2]; - hashParamTable[345].size = sizeof(device.dither.amplitude.settings.transfer.correction[2]); - hashParamTable[346].hash = 0x62f987c3; - hashParamTable[346].ref = &device.dither.detector.settings.filter.factor[30]; - hashParamTable[346].size = sizeof(device.dither.detector.settings.filter.factor[30]); - hashParamTable[347].hash = 0x633ad754; - hashParamTable[347].ref = &device.tss.temperature.settings.transfer.raw[5]; - hashParamTable[347].size = sizeof(device.tss.temperature.settings.transfer.raw[5]); - hashParamTable[348].hash = 0x633bbaf1; - hashParamTable[348].ref = &device.dither.frequency.state.correction; - hashParamTable[348].size = sizeof(device.dither.frequency.state.correction); - hashParamTable[349].hash = 0x633bedf4; - hashParamTable[349].ref = &device.dither.detector.settings.filter.factor[20]; - hashParamTable[349].size = sizeof(device.dither.detector.settings.filter.factor[20]); - hashParamTable[350].hash = 0x633f2b2; - hashParamTable[350].ref = &device.dither.pulse.state.max; - hashParamTable[350].size = sizeof(device.dither.pulse.state.max); - hashParamTable[351].hash = 0x634b9e76; - hashParamTable[351].ref = &device.isacs.regulator.settings.start.scale; - hashParamTable[351].size = sizeof(device.isacs.regulator.settings.start.scale); - hashParamTable[352].hash = 0x635b8d69; - hashParamTable[352].ref = &device.controller.I2C.settings.trigger; - hashParamTable[352].size = sizeof(device.controller.I2C.settings.trigger); - hashParamTable[353].hash = 0x637bbdc7; - hashParamTable[353].ref = &device.ccs.current[0].settings.transfer.raw[0]; - hashParamTable[353].size = sizeof(device.ccs.current[0].settings.transfer.raw[0]); - hashParamTable[354].hash = 0x63a107e; - hashParamTable[354].ref = &device.tss.gradient.settings.transfer.celsius[12]; - hashParamTable[354].size = sizeof(device.tss.gradient.settings.transfer.celsius[12]); - hashParamTable[355].hash = 0x64bd94a8; - hashParamTable[355].ref = &device.dither.noise.state.disturbance; - hashParamTable[355].size = sizeof(device.dither.noise.state.disturbance); - hashParamTable[356].hash = 0x64bf4004; - hashParamTable[356].ref = &device.plcs.reset.up.settings.environment.duration[8]; - hashParamTable[356].size = sizeof(device.plcs.reset.up.settings.environment.duration[8]); - hashParamTable[357].hash = 0x64d4e06b; - hashParamTable[357].ref = &device.dither.detector.settings.transfer.raw[6]; - hashParamTable[357].size = sizeof(device.dither.detector.settings.transfer.raw[6]); - hashParamTable[358].hash = 0x64e94d33; - hashParamTable[358].ref = &device.counters.latch.settings.reset; - hashParamTable[358].size = sizeof(device.counters.latch.settings.reset); - hashParamTable[359].hash = 0x650187b9; - hashParamTable[359].ref = &device.isacs.output.settings.transfer.voltage[15]; - hashParamTable[359].size = sizeof(device.isacs.output.settings.transfer.voltage[15]); - hashParamTable[360].hash = 0x6528390c; - hashParamTable[360].ref = &device.dither.amplitude.settings.transfer.points; - hashParamTable[360].size = sizeof(device.dither.amplitude.settings.transfer.points); - hashParamTable[361].hash = 0x654721ac; - hashParamTable[361].ref = &device.plcs.reset.up.settings.environment.target[5]; - hashParamTable[361].size = sizeof(device.plcs.reset.up.settings.environment.target[5]); - hashParamTable[362].hash = 0x655a1002; - hashParamTable[362].ref = &device.dither.amplitude.settings.transfer.correction[12]; - hashParamTable[362].size = sizeof(device.dither.amplitude.settings.transfer.correction[12]); - hashParamTable[363].hash = 0x6588f9ab; - hashParamTable[363].ref = &device.plcs.bias.settings.transfer.raw[5]; - hashParamTable[363].size = sizeof(device.plcs.bias.settings.transfer.raw[5]); - hashParamTable[364].hash = 0x658afef1; - hashParamTable[364].ref = &device.plcs.feedback.settings.transfer.raw[5]; - hashParamTable[364].size = sizeof(device.plcs.feedback.settings.transfer.raw[5]); - hashParamTable[365].hash = 0x65e9109b; - hashParamTable[365].ref = &device.isacs.regulator.settings.transfer.error[0]; - hashParamTable[365].size = sizeof(device.isacs.regulator.settings.transfer.error[0]); - hashParamTable[366].hash = 0x65eb0e81; - hashParamTable[366].ref = &device.plcs.feedback.settings.transfer.raw[13]; - hashParamTable[366].size = sizeof(device.plcs.feedback.settings.transfer.raw[13]); - hashParamTable[367].hash = 0x664c6cbe; - hashParamTable[367].ref = &device.controller.timer[0].state.TCR; - hashParamTable[367].size = sizeof(device.controller.timer[0].state.TCR); - hashParamTable[368].hash = 0x664ca255; - hashParamTable[368].ref = &device.plcs.output.state.enabled; - hashParamTable[368].size = sizeof(device.plcs.output.state.enabled); - hashParamTable[369].hash = 0x665ae286; - hashParamTable[369].ref = &device.counters.dither.state.angle; - hashParamTable[369].size = sizeof(device.counters.dither.state.angle); - hashParamTable[370].hash = 0x666063c4; - hashParamTable[370].ref = &device.isacs.output.settings.transfer.voltage[5]; - hashParamTable[370].size = sizeof(device.isacs.output.settings.transfer.voltage[5]); - hashParamTable[371].hash = 0x674eeb85; - hashParamTable[371].ref = &device.controller.uart[0].state.DLL; - hashParamTable[371].size = sizeof(device.controller.uart[0].state.DLL); - hashParamTable[372].hash = 0x675cc32; - hashParamTable[372].ref = &device.plcs.reset.up.settings.environment.temperature[0]; - hashParamTable[372].size = sizeof(device.plcs.reset.up.settings.environment.temperature[0]); - hashParamTable[373].hash = 0x675e7dd5; - hashParamTable[373].ref = &device.plcs.reset.down.settings.environment.target[12]; - hashParamTable[373].size = sizeof(device.plcs.reset.down.settings.environment.target[12]); - hashParamTable[374].hash = 0x67623004; - hashParamTable[374].ref = &device.tss.temperature.state.raw; - hashParamTable[374].size = sizeof(device.tss.temperature.state.raw); - hashParamTable[375].hash = 0x6771d50; - hashParamTable[375].ref = &device.lightUp.settings.sequence; - hashParamTable[375].size = sizeof(device.lightUp.settings.sequence); - hashParamTable[376].hash = 0x67e65e2b; - hashParamTable[376].ref = &device.plcs.reset.up.settings.environment.target[11]; - hashParamTable[376].size = sizeof(device.plcs.reset.up.settings.environment.target[11]); - hashParamTable[377].hash = 0x688f56ab; - hashParamTable[377].ref = &device.isacs.regulator.state.scale; - hashParamTable[377].size = sizeof(device.isacs.regulator.state.scale); - hashParamTable[378].hash = 0x689465a0; - hashParamTable[378].ref = &device.dither.amplitude.settings.transfer.error[4]; - hashParamTable[378].size = sizeof(device.dither.amplitude.settings.transfer.error[4]); - hashParamTable[379].hash = 0x695dc72e; - hashParamTable[379].ref = &device.isacs.input.settings.transfer.V[2]; - hashParamTable[379].size = sizeof(device.isacs.input.settings.transfer.V[2]); - hashParamTable[380].hash = 0x697ede1b; - hashParamTable[380].ref = &device.plcs.reset.up.settings.environment.trigger[3]; - hashParamTable[380].size = sizeof(device.plcs.reset.up.settings.environment.trigger[3]); - hashParamTable[381].hash = 0x6997dd12; - hashParamTable[381].ref = &device.counters.dither.state.delta[16]; - hashParamTable[381].size = sizeof(device.counters.dither.state.delta[16]); - hashParamTable[382].hash = 0x69a22ff9; - hashParamTable[382].ref = &device.dither.detector.settings.filter.factor[3]; - hashParamTable[382].size = sizeof(device.dither.detector.settings.filter.factor[3]); - hashParamTable[383].hash = 0x69c6fde5; - hashParamTable[383].ref = &device.plcs.reset.down.settings.environment.trigger[0]; - hashParamTable[383].size = sizeof(device.plcs.reset.down.settings.environment.trigger[0]); - hashParamTable[384].hash = 0x6a1f9ca5; - hashParamTable[384].ref = &device.dither.frequency.settings.transfer.correction[8]; - hashParamTable[384].size = sizeof(device.dither.frequency.settings.transfer.correction[8]); - hashParamTable[385].hash = 0x6a86dff8; - hashParamTable[385].ref = &device.counters.dither.state.delta[8]; - hashParamTable[385].size = sizeof(device.counters.dither.state.delta[8]); - hashParamTable[386].hash = 0x6acb06fc; - hashParamTable[386].ref = &device.controller.SSP.in[1]; - hashParamTable[386].size = sizeof(device.controller.SSP.in[1]); - hashParamTable[387].hash = 0x6b1797f2; - hashParamTable[387].ref = &device.plcs.regulator.settings.transfer.correction[2]; - hashParamTable[387].size = sizeof(device.plcs.regulator.settings.transfer.correction[2]); - hashParamTable[388].hash = 0x6b586b6e; - hashParamTable[388].ref = &device.plcs.output.settings.transfer.code[5]; - hashParamTable[388].size = sizeof(device.plcs.output.settings.transfer.code[5]); - hashParamTable[389].hash = 0x6b65b310; - hashParamTable[389].ref = &device.ccs.current[0].state.mA; - hashParamTable[389].size = sizeof(device.ccs.current[0].state.mA); - hashParamTable[390].hash = 0x6b9ad924; - hashParamTable[390].ref = &device.dither.frequency.settings.transfer.correction[14]; - hashParamTable[390].size = sizeof(device.dither.frequency.settings.transfer.correction[14]); - hashParamTable[391].hash = 0x6bd1634b; - hashParamTable[391].ref = &device.counters.dither.state.delta[26]; - hashParamTable[391].size = sizeof(device.counters.dither.state.delta[26]); - hashParamTable[392].hash = 0x6be0016; - hashParamTable[392].ref = &device.dither.amplitude.settings.transfer.correction[6]; - hashParamTable[392].size = sizeof(device.dither.amplitude.settings.transfer.correction[6]); - hashParamTable[393].hash = 0x6c48cd09; - hashParamTable[393].ref = &device.plcs.reset.state.countdown; - hashParamTable[393].size = sizeof(device.plcs.reset.state.countdown); - hashParamTable[394].hash = 0x6c5c4053; - hashParamTable[394].ref = &device.plcs.feedback.settings.transfer.normalized[5]; - hashParamTable[394].size = sizeof(device.plcs.feedback.settings.transfer.normalized[5]); - hashParamTable[395].hash = 0x6cb0982; - hashParamTable[395].ref = &device.controller.I2C.state.buffer[5]; - hashParamTable[395].size = sizeof(device.controller.I2C.state.buffer[5]); - hashParamTable[396].hash = 0x6cd4ca69; - hashParamTable[396].ref = &device.isacs.regulator.settings.transfer.correction[4]; - hashParamTable[396].size = sizeof(device.isacs.regulator.settings.transfer.correction[4]); - hashParamTable[397].hash = 0x6ce82940; - hashParamTable[397].ref = &device.dither.amplitude.state.error; - hashParamTable[397].size = sizeof(device.dither.amplitude.state.error); - hashParamTable[398].hash = 0x6e21e428; - hashParamTable[398].ref = &device.plcs.reset.down.settings.environment.trigger[11]; - hashParamTable[398].size = sizeof(device.plcs.reset.down.settings.environment.trigger[11]); - hashParamTable[399].hash = 0x6e6da5dd; - hashParamTable[399].ref = &device.dither.detector.settings.transfer.raw[12]; - hashParamTable[399].size = sizeof(device.dither.detector.settings.transfer.raw[12]); - hashParamTable[400].hash = 0x6e881ccf; - hashParamTable[400].ref = &device.dither.frequency.state.error; - hashParamTable[400].size = sizeof(device.dither.frequency.state.error); - hashParamTable[401].hash = 0x6eeca6bc; - hashParamTable[401].ref = &device.dither.detector.settings.transfer.restored[12]; - hashParamTable[401].size = sizeof(device.dither.detector.settings.transfer.restored[12]); - hashParamTable[402].hash = 0x6f0c7879; - hashParamTable[402].ref = &device.plcs.feedback.settings.transfer.normalized[11]; - hashParamTable[402].size = sizeof(device.plcs.feedback.settings.transfer.normalized[11]); - hashParamTable[403].hash = 0x6f40ddd5; - hashParamTable[403].ref = &device.plcs.reset.down.settings.environment.target[6]; - hashParamTable[403].size = sizeof(device.plcs.reset.down.settings.environment.target[6]); - hashParamTable[404].hash = 0x6f9fab73; - hashParamTable[404].ref = &device.dither.amplitude.settings.transfer.error[11]; - hashParamTable[404].size = sizeof(device.dither.amplitude.settings.transfer.error[11]); - hashParamTable[405].hash = 0x6fdf3139; - hashParamTable[405].ref = &device.isacs.input.settings.transfer.V[12]; - hashParamTable[405].size = sizeof(device.isacs.input.settings.transfer.V[12]); - hashParamTable[406].hash = 0x6fe2212f; - hashParamTable[406].ref = &device.plcs.reset.up.settings.environment.temperature[10]; - hashParamTable[406].size = sizeof(device.plcs.reset.up.settings.environment.temperature[10]); - hashParamTable[407].hash = 0x7046f66f; - hashParamTable[407].ref = &device.isacs.input.settings.transfer.V[3]; - hashParamTable[407].size = sizeof(device.isacs.input.settings.transfer.V[3]); - hashParamTable[408].hash = 0x7065ef5a; - hashParamTable[408].ref = &device.plcs.reset.up.settings.environment.trigger[2]; - hashParamTable[408].size = sizeof(device.plcs.reset.up.settings.environment.trigger[2]); - hashParamTable[409].hash = 0x708cec53; - hashParamTable[409].ref = &device.counters.dither.state.delta[17]; - hashParamTable[409].size = sizeof(device.counters.dither.state.delta[17]); - hashParamTable[410].hash = 0x70b91eb8; - hashParamTable[410].ref = &device.dither.detector.settings.filter.factor[2]; - hashParamTable[410].size = sizeof(device.dither.detector.settings.filter.factor[2]); - hashParamTable[411].hash = 0x70c12b2; - hashParamTable[411].ref = &device.dither.pulse.settings.min; - hashParamTable[411].size = sizeof(device.dither.pulse.settings.min); - hashParamTable[412].hash = 0x70ddcca4; - hashParamTable[412].ref = &device.plcs.reset.down.settings.environment.trigger[1]; - hashParamTable[412].size = sizeof(device.plcs.reset.down.settings.environment.trigger[1]); - hashParamTable[413].hash = 0x7110b55a; - hashParamTable[413].ref = &device.plcs.bias.state.raw; - hashParamTable[413].size = sizeof(device.plcs.bias.state.raw); - hashParamTable[414].hash = 0x71778c3; - hashParamTable[414].ref = &device.ccs.current[0].settings.transfer.raw[4]; - hashParamTable[414].size = sizeof(device.ccs.current[0].settings.transfer.raw[4]); - hashParamTable[415].hash = 0x718f54e1; - hashParamTable[415].ref = &device.dither.amplitude.settings.transfer.error[5]; - hashParamTable[415].size = sizeof(device.dither.amplitude.settings.transfer.error[5]); - hashParamTable[416].hash = 0x720ca6b3; - hashParamTable[416].ref = &device.plcs.regulator.settings.transfer.correction[3]; - hashParamTable[416].size = sizeof(device.plcs.regulator.settings.transfer.correction[3]); - hashParamTable[417].hash = 0x72435a2f; - hashParamTable[417].ref = &device.plcs.output.settings.transfer.code[4]; - hashParamTable[417].size = sizeof(device.plcs.output.settings.transfer.code[4]); - hashParamTable[418].hash = 0x7281e865; - hashParamTable[418].ref = &device.dither.frequency.settings.transfer.correction[15]; - hashParamTable[418].size = sizeof(device.dither.frequency.settings.transfer.correction[15]); - hashParamTable[419].hash = 0x72ca520a; - hashParamTable[419].ref = &device.counters.dither.state.delta[27]; - hashParamTable[419].size = sizeof(device.counters.dither.state.delta[27]); - hashParamTable[420].hash = 0x7304ade4; - hashParamTable[420].ref = &device.dither.frequency.settings.transfer.correction[9]; - hashParamTable[420].size = sizeof(device.dither.frequency.settings.transfer.correction[9]); - hashParamTable[421].hash = 0x739deeb9; - hashParamTable[421].ref = &device.counters.dither.state.delta[9]; - hashParamTable[421].size = sizeof(device.counters.dither.state.delta[9]); - hashParamTable[422].hash = 0x73d037bd; - hashParamTable[422].ref = &device.controller.SSP.in[0]; - hashParamTable[422].size = sizeof(device.controller.SSP.in[0]); - hashParamTable[423].hash = 0x749c63a6; - hashParamTable[423].ref = &device.isacs.potentiometers.state.a; - hashParamTable[423].size = sizeof(device.isacs.potentiometers.state.a); - hashParamTable[424].hash = 0x74ee6c98; - hashParamTable[424].ref = &device.dither.frequency.state.enabled; - hashParamTable[424].size = sizeof(device.dither.frequency.state.enabled); - hashParamTable[425].hash = 0x75477112; - hashParamTable[425].ref = &device.plcs.feedback.settings.transfer.normalized[4]; - hashParamTable[425].size = sizeof(device.plcs.feedback.settings.transfer.normalized[4]); - hashParamTable[426].hash = 0x7561250; - hashParamTable[426].ref = &device.tss.temperature.settings.transfer.raw[1]; - hashParamTable[426].size = sizeof(device.tss.temperature.settings.transfer.raw[1]); - hashParamTable[427].hash = 0x756ec723; - hashParamTable[427].ref = &device.sequencer.output.logic.state.enabled; - hashParamTable[427].size = sizeof(device.sequencer.output.logic.state.enabled); - hashParamTable[428].hash = 0x75728f0; - hashParamTable[428].ref = &device.dither.detector.settings.filter.factor[24]; - hashParamTable[428].size = sizeof(device.dither.detector.settings.filter.factor[24]); - hashParamTable[429].hash = 0x75bbf441; - hashParamTable[429].ref = &device.controller.timer[0].state.MCR; - hashParamTable[429].size = sizeof(device.controller.timer[0].state.MCR); - hashParamTable[430].hash = 0x75cffb28; - hashParamTable[430].ref = &device.isacs.regulator.settings.transfer.correction[5]; - hashParamTable[430].size = sizeof(device.isacs.regulator.settings.transfer.correction[5]); - hashParamTable[431].hash = 0x76174938; - hashParamTable[431].ref = &device.plcs.feedback.settings.transfer.normalized[10]; - hashParamTable[431].size = sizeof(device.plcs.feedback.settings.transfer.normalized[10]); - hashParamTable[432].hash = 0x765bec94; - hashParamTable[432].ref = &device.plcs.reset.down.settings.environment.target[7]; - hashParamTable[432].size = sizeof(device.plcs.reset.down.settings.environment.target[7]); - hashParamTable[433].hash = 0x76849a32; - hashParamTable[433].ref = &device.dither.amplitude.settings.transfer.error[10]; - hashParamTable[433].size = sizeof(device.dither.amplitude.settings.transfer.error[10]); - hashParamTable[434].hash = 0x76c40078; - hashParamTable[434].ref = &device.isacs.input.settings.transfer.V[13]; - hashParamTable[434].size = sizeof(device.isacs.input.settings.transfer.V[13]); - hashParamTable[435].hash = 0x76f9106e; - hashParamTable[435].ref = &device.plcs.reset.up.settings.environment.temperature[11]; - hashParamTable[435].size = sizeof(device.plcs.reset.up.settings.environment.temperature[11]); - hashParamTable[436].hash = 0x773ad569; - hashParamTable[436].ref = &device.plcs.reset.down.settings.environment.trigger[10]; - hashParamTable[436].size = sizeof(device.plcs.reset.down.settings.environment.trigger[10]); - hashParamTable[437].hash = 0x7776949c; - hashParamTable[437].ref = &device.dither.detector.settings.transfer.raw[13]; - hashParamTable[437].size = sizeof(device.dither.detector.settings.transfer.raw[13]); - hashParamTable[438].hash = 0x77f797fd; - hashParamTable[438].ref = &device.dither.detector.settings.transfer.restored[13]; - hashParamTable[438].size = sizeof(device.dither.detector.settings.transfer.restored[13]); - hashParamTable[439].hash = 0x7805246e; - hashParamTable[439].ref = &device.sequencer.output.analog.settings.transfer.code[14]; - hashParamTable[439].size = sizeof(device.sequencer.output.analog.settings.transfer.code[14]); - hashParamTable[440].hash = 0x786662ec; - hashParamTable[440].ref = &device.dither.detector.settings.filter.factor[11]; - hashParamTable[440].size = sizeof(device.dither.detector.settings.filter.factor[11]); - hashParamTable[441].hash = 0x78bc99a7; - hashParamTable[441].ref = &device.dither.detector.state.phase; - hashParamTable[441].size = sizeof(device.dither.detector.state.phase); - hashParamTable[442].hash = 0x7982a959; - hashParamTable[442].ref = &device.isacs.input.settings.transfer.raw[3]; - hashParamTable[442].size = sizeof(device.isacs.input.settings.transfer.raw[3]); - hashParamTable[443].hash = 0x79c9944a; - hashParamTable[443].ref = &device.tss.gradient.settings.transfer.celsius[7]; - hashParamTable[443].size = sizeof(device.tss.gradient.settings.transfer.celsius[7]); - hashParamTable[444].hash = 0x7a20dcb5; - hashParamTable[444].ref = &device.dither.detector.settings.filter.factor[21]; - hashParamTable[444].size = sizeof(device.dither.detector.settings.filter.factor[21]); - hashParamTable[445].hash = 0x7a21e615; - hashParamTable[445].ref = &device.tss.temperature.settings.transfer.raw[4]; - hashParamTable[445].size = sizeof(device.tss.temperature.settings.transfer.raw[4]); - hashParamTable[446].hash = 0x7a3dbeb9; - hashParamTable[446].ref = &device.dither.amplitude.settings.enabled; - hashParamTable[446].size = sizeof(device.dither.amplitude.settings.enabled); - hashParamTable[447].hash = 0x7a608c86; - hashParamTable[447].ref = &device.ccs.current[0].settings.transfer.raw[1]; - hashParamTable[447].size = sizeof(device.ccs.current[0].settings.transfer.raw[1]); - hashParamTable[448].hash = 0x7ab9453b; - hashParamTable[448].ref = &device.plcs.output.state.sequencer; - hashParamTable[448].size = sizeof(device.plcs.output.state.sequencer); - hashParamTable[449].hash = 0x7af265e9; - hashParamTable[449].ref = &device.isacs.input.settings.transfer.points; - hashParamTable[449].size = sizeof(device.isacs.input.settings.transfer.points); - hashParamTable[450].hash = 0x7b023877; - hashParamTable[450].ref = &device.plcs.reset.up.settings.environment.temperature[5]; - hashParamTable[450].size = sizeof(device.plcs.reset.up.settings.environment.temperature[5]); - hashParamTable[451].hash = 0x7b54ace5; - hashParamTable[451].ref = &device.dither.detector.settings.transfer.restored[8]; - hashParamTable[451].size = sizeof(device.dither.detector.settings.transfer.restored[8]); - hashParamTable[452].hash = 0x7b7df5f9; - hashParamTable[452].ref = &device.plcs.regulator.settings.transfer.error[15]; - hashParamTable[452].size = sizeof(device.plcs.regulator.settings.transfer.error[15]); - hashParamTable[453].hash = 0x7b900e27; - hashParamTable[453].ref = &device.ccs.current[1].state.sum; - hashParamTable[453].size = sizeof(device.ccs.current[1].state.sum); - hashParamTable[454].hash = 0x7bbcfdc7; - hashParamTable[454].ref = &device.controller.I2C.state.buffer[0]; - hashParamTable[454].size = sizeof(device.controller.I2C.state.buffer[0]); - hashParamTable[455].hash = 0x7bc9f453; - hashParamTable[455].ref = &device.dither.amplitude.settings.transfer.correction[3]; - hashParamTable[455].size = sizeof(device.dither.amplitude.settings.transfer.correction[3]); - hashParamTable[456].hash = 0x7be2b682; - hashParamTable[456].ref = &device.dither.detector.settings.filter.factor[31]; - hashParamTable[456].size = sizeof(device.dither.detector.settings.filter.factor[31]); - hashParamTable[457].hash = 0x7c1ab6f8; - hashParamTable[457].ref = &device.isacs.output.settings.transfer.voltage[14]; - hashParamTable[457].size = sizeof(device.isacs.output.settings.transfer.voltage[14]); - hashParamTable[458].hash = 0x7c412143; - hashParamTable[458].ref = &device.dither.amplitude.settings.transfer.correction[13]; - hashParamTable[458].size = sizeof(device.dither.amplitude.settings.transfer.correction[13]); - hashParamTable[459].hash = 0x7c5c10ed; - hashParamTable[459].ref = &device.plcs.reset.up.settings.environment.target[4]; - hashParamTable[459].size = sizeof(device.plcs.reset.up.settings.environment.target[4]); - hashParamTable[460].hash = 0x7c91cfb0; - hashParamTable[460].ref = &device.plcs.feedback.settings.transfer.raw[4]; - hashParamTable[460].size = sizeof(device.plcs.feedback.settings.transfer.raw[4]); - hashParamTable[461].hash = 0x7c93c8ea; - hashParamTable[461].ref = &device.plcs.bias.settings.transfer.raw[4]; - hashParamTable[461].size = sizeof(device.plcs.bias.settings.transfer.raw[4]); - hashParamTable[462].hash = 0x7cf03fc0; - hashParamTable[462].ref = &device.plcs.feedback.settings.transfer.raw[12]; - hashParamTable[462].size = sizeof(device.plcs.feedback.settings.transfer.raw[12]); - hashParamTable[463].hash = 0x7cf221da; - hashParamTable[463].ref = &device.isacs.regulator.settings.transfer.error[1]; - hashParamTable[463].size = sizeof(device.isacs.regulator.settings.transfer.error[1]); - hashParamTable[464].hash = 0x7d95c657; - hashParamTable[464].ref = &device.isacs.potentiometers.settings.a; - hashParamTable[464].size = sizeof(device.isacs.potentiometers.settings.a); - hashParamTable[465].hash = 0x7da47145; - hashParamTable[465].ref = &device.plcs.reset.up.settings.environment.duration[9]; - hashParamTable[465].size = sizeof(device.plcs.reset.up.settings.environment.duration[9]); - hashParamTable[466].hash = 0x7da5766a; - hashParamTable[466].ref = &device.dither.noise.state.amplitude; - hashParamTable[466].size = sizeof(device.dither.noise.state.amplitude); - hashParamTable[467].hash = 0x7dcfd12a; - hashParamTable[467].ref = &device.dither.detector.settings.transfer.raw[7]; - hashParamTable[467].size = sizeof(device.dither.detector.settings.transfer.raw[7]); - hashParamTable[468].hash = 0x7e454c94; - hashParamTable[468].ref = &device.plcs.reset.down.settings.environment.target[13]; - hashParamTable[468].size = sizeof(device.plcs.reset.down.settings.environment.target[13]); - hashParamTable[469].hash = 0x7e58f1a4; - hashParamTable[469].ref = &device.user.port.state.baud; - hashParamTable[469].size = sizeof(device.user.port.state.baud); - hashParamTable[470].hash = 0x7efd6f6a; - hashParamTable[470].ref = &device.plcs.reset.up.settings.environment.target[10]; - hashParamTable[470].size = sizeof(device.plcs.reset.up.settings.environment.target[10]); - hashParamTable[471].hash = 0x7f4645bb; - hashParamTable[471].ref = &device.dither.cycle.state.pin2; - hashParamTable[471].size = sizeof(device.dither.cycle.state.pin2); - hashParamTable[472].hash = 0x7f7b5285; - hashParamTable[472].ref = &device.isacs.output.settings.transfer.voltage[4]; - hashParamTable[472].size = sizeof(device.isacs.output.settings.transfer.voltage[4]); - hashParamTable[473].hash = 0x80ede959; - hashParamTable[473].ref = &device.dither.noise.settings.amplitude; - hashParamTable[473].size = sizeof(device.dither.noise.settings.amplitude); - hashParamTable[474].hash = 0x8106b105; - hashParamTable[474].ref = &device.isacs.regulator.settings.transfer.error[14]; - hashParamTable[474].size = sizeof(device.isacs.regulator.settings.transfer.error[14]); - hashParamTable[475].hash = 0x81261cd9; - hashParamTable[475].ref = &device.dither.amplitude.settings.transfer.correction[9]; - hashParamTable[475].size = sizeof(device.dither.amplitude.settings.transfer.correction[9]); - hashParamTable[476].hash = 0x81bb446f; - hashParamTable[476].ref = &device.dither.detector.settings.transfer.restored[2]; - hashParamTable[476].size = sizeof(device.dither.detector.settings.transfer.restored[2]); - hashParamTable[477].hash = 0x8208e177; - hashParamTable[477].ref = &device.plcs.regulator.settings.enabled; - hashParamTable[477].size = sizeof(device.plcs.regulator.settings.enabled); - hashParamTable[478].hash = 0x82222d8a; - hashParamTable[478].ref = &device.plcs.output.settings.transfer.voltage[5]; - hashParamTable[478].size = sizeof(device.plcs.output.settings.transfer.voltage[5]); - hashParamTable[479].hash = 0x8249508a; - hashParamTable[479].ref = &device.sequencer.sampler.settings.sequence[44]; - hashParamTable[479].size = sizeof(device.sequencer.sampler.settings.sequence[44]); - hashParamTable[480].hash = 0x82bd8086; - hashParamTable[480].ref = &device.plcs.bias.state.average; - hashParamTable[480].size = sizeof(device.plcs.bias.state.average); - hashParamTable[481].hash = 0x82e988b8; - hashParamTable[481].ref = &device.ccs.current[0].settings.transfer.mA[15]; - hashParamTable[481].size = sizeof(device.ccs.current[0].settings.transfer.mA[15]); - hashParamTable[482].hash = 0x82f85228; - hashParamTable[482].ref = &device.controller.uart[1].state.FCR; - hashParamTable[482].size = sizeof(device.controller.uart[1].state.FCR); - hashParamTable[483].hash = 0x8308557; - hashParamTable[483].ref = &device.plcs.feedback.settings.transfer.normalized[1]; - hashParamTable[483].size = sizeof(device.plcs.feedback.settings.transfer.normalized[1]); - hashParamTable[484].hash = 0x83138da9; - hashParamTable[484].ref = &device.plcs.reset.down.settings.environment.duration[12]; - hashParamTable[484].size = sizeof(device.plcs.reset.down.settings.environment.duration[12]); - hashParamTable[485].hash = 0x836d41d3; - hashParamTable[485].ref = &device.isacs.input.settings.transfer.raw[9]; - hashParamTable[485].size = sizeof(device.isacs.input.settings.transfer.raw[9]); - hashParamTable[486].hash = 0x83843183; - hashParamTable[486].ref = &device.user.address; - hashParamTable[486].size = sizeof(device.user.address); - hashParamTable[487].hash = 0x838b3abd; - hashParamTable[487].ref = &device.sequencer.sampler.settings.sequence[54]; - hashParamTable[487].size = sizeof(device.sequencer.sampler.settings.sequence[54]); - hashParamTable[488].hash = 0x83ef10b5; - hashParamTable[488].ref = &device.isacs.regulator.settings.transfer.correction[12]; - hashParamTable[488].size = sizeof(device.isacs.regulator.settings.transfer.correction[12]); - hashParamTable[489].hash = 0x84829261; - hashParamTable[489].ref = &device.sequencer.sampler.settings.sequence[14]; - hashParamTable[489].size = sizeof(device.sequencer.sampler.settings.sequence[14]); - hashParamTable[490].hash = 0x856465c0; - hashParamTable[490].ref = &device.dither.noise.state.enabled; - hashParamTable[490].size = sizeof(device.dither.noise.state.enabled); - hashParamTable[491].hash = 0x85aa81dc; - hashParamTable[491].ref = &device.dither.frequency.settings.transfer.error[1]; - hashParamTable[491].size = sizeof(device.dither.frequency.settings.transfer.error[1]); - hashParamTable[492].hash = 0x85ded725; - hashParamTable[492].ref = &device.controller.timer[0].state.MR0; - hashParamTable[492].size = sizeof(device.controller.timer[0].state.MR0); - hashParamTable[493].hash = 0x85e836d8; - hashParamTable[493].ref = &device.tss.temperature.settings.transfer.celsius[10]; - hashParamTable[493].size = sizeof(device.tss.temperature.settings.transfer.celsius[10]); - hashParamTable[494].hash = 0x85f1a258; - hashParamTable[494].ref = &device.sequencer.sampler.settings.sequence[4]; - hashParamTable[494].size = sizeof(device.sequencer.sampler.settings.sequence[4]); - hashParamTable[495].hash = 0x865e7929; - hashParamTable[495].ref = &device.isacs.output.settings.transfer.code[5]; - hashParamTable[495].size = sizeof(device.isacs.output.settings.transfer.code[5]); - hashParamTable[496].hash = 0x868be0d4; - hashParamTable[496].ref = &device.sequencer.output.analog.settings.transfer.voltage[15]; - hashParamTable[496].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[15]); - hashParamTable[497].hash = 0x86c42c38; - hashParamTable[497].ref = &device.sequencer.sampler.settings.sequence[24]; - hashParamTable[497].size = sizeof(device.sequencer.sampler.settings.sequence[24]); - hashParamTable[498].hash = 0x8706460f; - hashParamTable[498].ref = &device.sequencer.sampler.settings.sequence[34]; - hashParamTable[498].size = sizeof(device.sequencer.sampler.settings.sequence[34]); - hashParamTable[499].hash = 0x874b99cf; - hashParamTable[499].ref = &device.plcs.reset.up.settings.environment.duration[3]; - hashParamTable[499].size = sizeof(device.plcs.reset.up.settings.environment.duration[3]); - hashParamTable[500].hash = 0x87501be1; - hashParamTable[500].ref = &device.sequencer.output.analog.state.voltage; - hashParamTable[500].size = sizeof(device.sequencer.output.analog.state.voltage); - hashParamTable[501].hash = 0x87fa4992; - hashParamTable[501].ref = &device.plcs.output.settings.start.voltage; - hashParamTable[501].size = sizeof(device.plcs.output.settings.start.voltage); - hashParamTable[502].hash = 0x88e34e39; - hashParamTable[502].ref = &device.plcs.regulator.settings.transfer.correction[9]; - hashParamTable[502].size = sizeof(device.plcs.regulator.settings.transfer.correction[9]); - hashParamTable[503].hash = 0x8952e728; - hashParamTable[503].ref = &device.plcs.reset.down.settings.environment.duration[5]; - hashParamTable[503].size = sizeof(device.plcs.reset.down.settings.environment.duration[5]); - hashParamTable[504].hash = 0x89720633; - hashParamTable[504].ref = &device.counters.dither.state.delta[3]; - hashParamTable[504].size = sizeof(device.counters.dither.state.delta[3]); - hashParamTable[505].hash = 0x897d7a0e; - hashParamTable[505].ref = &device.ccs.current[0].settings.transfer.raw[13]; - hashParamTable[505].size = sizeof(device.ccs.current[0].settings.transfer.raw[13]); - hashParamTable[506].hash = 0x89eb456e; - hashParamTable[506].ref = &device.dither.frequency.settings.transfer.correction[3]; - hashParamTable[506].size = sizeof(device.dither.frequency.settings.transfer.correction[3]); - hashParamTable[507].hash = 0x89ef30ef; - hashParamTable[507].ref = &device.tss.gradient.settings.transfer.raw[13]; - hashParamTable[507].size = sizeof(device.tss.gradient.settings.transfer.raw[13]); - hashParamTable[508].hash = 0x89f65d25; - hashParamTable[508].ref = &device.plcs.output.settings.transfer.voltage[10]; - hashParamTable[508].size = sizeof(device.plcs.output.settings.transfer.voltage[10]); - hashParamTable[509].hash = 0x89f9b381; - hashParamTable[509].ref = &device.sequencer.output.analog.settings.transfer.code[6]; - hashParamTable[509].size = sizeof(device.sequencer.output.analog.settings.transfer.code[6]); - hashParamTable[510].hash = 0x8a18a1ef; - hashParamTable[510].ref = &device.plcs.regulator.settings.transfer.correction[15]; - hashParamTable[510].size = sizeof(device.plcs.regulator.settings.transfer.correction[15]); - hashParamTable[511].hash = 0x8a56f632; - hashParamTable[511].ref = &device.dither.detector.settings.filter.factor[8]; - hashParamTable[511].size = sizeof(device.dither.detector.settings.filter.factor[8]); - hashParamTable[512].hash = 0x8a7419fa; - hashParamTable[512].ref = &device.ccs.current[0].settings.transfer.mA[7]; - hashParamTable[512].size = sizeof(device.ccs.current[0].settings.transfer.mA[7]); - hashParamTable[513].hash = 0x8a7802a2; - hashParamTable[513].ref = &device.counters.dither.state.displacement; - hashParamTable[513].size = sizeof(device.counters.dither.state.displacement); - hashParamTable[514].hash = 0x8a85b31; - hashParamTable[514].ref = &device.plcs.bias.settings.transfer.normalized[12]; - hashParamTable[514].size = sizeof(device.plcs.bias.settings.transfer.normalized[12]); - hashParamTable[515].hash = 0x8a8a07d0; - hashParamTable[515].ref = &device.plcs.reset.up.settings.environment.trigger[8]; - hashParamTable[515].size = sizeof(device.plcs.reset.up.settings.environment.trigger[8]); - hashParamTable[516].hash = 0x8aa91ee5; - hashParamTable[516].ref = &device.isacs.input.settings.transfer.V[9]; - hashParamTable[516].size = sizeof(device.isacs.input.settings.transfer.V[9]); - hashParamTable[517].hash = 0x8b41333c; - hashParamTable[517].ref = &device.isacs.input.settings.transfer.raw[11]; - hashParamTable[517].size = sizeof(device.isacs.input.settings.transfer.raw[11]); - hashParamTable[518].hash = 0x8b4e56e3; - hashParamTable[518].ref = &device.isacs.output.settings.transfer.points; - hashParamTable[518].size = sizeof(device.isacs.output.settings.transfer.points); - hashParamTable[519].hash = 0x8b80f6d; - hashParamTable[519].ref = &device.isacs.regulator.settings.transfer.correction[0]; - hashParamTable[519].size = sizeof(device.isacs.regulator.settings.transfer.correction[0]); - hashParamTable[520].hash = 0x8bc8fd3c; - hashParamTable[520].ref = &device.plcs.reset.up.settings.environment.duration[10]; - hashParamTable[520].size = sizeof(device.plcs.reset.up.settings.environment.duration[10]); - hashParamTable[521].hash = 0x8bec977c; - hashParamTable[521].ref = &device.controller.uart[1].state.DLM; - hashParamTable[521].size = sizeof(device.controller.uart[1].state.DLM); - hashParamTable[522].hash = 0x8c06eb3b; - hashParamTable[522].ref = &device.dither.noise.settings.enabled; - hashParamTable[522].size = sizeof(device.dither.noise.settings.enabled); - hashParamTable[523].hash = 0x8c3c9572; - hashParamTable[523].ref = &device.plcs.bias.settings.transfer.normalized[5]; - hashParamTable[523].size = sizeof(device.plcs.bias.settings.transfer.normalized[5]); - hashParamTable[524].hash = 0x8c46a882; - hashParamTable[524].ref = &device.tss.gradient.settings.transfer.raw[5]; - hashParamTable[524].size = sizeof(device.tss.gradient.settings.transfer.raw[5]); - hashParamTable[525].hash = 0x8cfb64a5; - hashParamTable[525].ref = &device.plcs.regulator.settings.transfer.error[4]; - hashParamTable[525].size = sizeof(device.plcs.regulator.settings.transfer.error[4]); - hashParamTable[526].hash = 0x8d38f744; - hashParamTable[526].ref = &device.plcs.reset.down.settings.environment.temperature[5]; - hashParamTable[526].size = sizeof(device.plcs.reset.down.settings.environment.temperature[5]); - hashParamTable[527].hash = 0x8e7b9ff; - hashParamTable[527].ref = &device.tss.temperature.settings.transfer.celsius[9]; - hashParamTable[527].size = sizeof(device.tss.temperature.settings.transfer.celsius[9]); - hashParamTable[528].hash = 0x8eeac83c; - hashParamTable[528].ref = &device.counters.zero.state.b; - hashParamTable[528].size = sizeof(device.counters.zero.state.b); - hashParamTable[529].hash = 0x8f0c1c4c; - hashParamTable[529].ref = &device.sequencer.output.analog.settings.transfer.voltage[5]; - hashParamTable[529].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[5]); - hashParamTable[530].hash = 0x8f6fd7fe; - hashParamTable[530].ref = &device.controller.uart[1].state.LCR; - hashParamTable[530].size = sizeof(device.controller.uart[1].state.LCR); - hashParamTable[531].hash = 0x8f7fa530; - hashParamTable[531].ref = &device.tss.temperature.settings.transfer.celsius[6]; - hashParamTable[531].size = sizeof(device.tss.temperature.settings.transfer.celsius[6]); - hashParamTable[532].hash = 0x9049d669; - hashParamTable[532].ref = &device.plcs.reset.down.settings.environment.duration[4]; - hashParamTable[532].size = sizeof(device.plcs.reset.down.settings.environment.duration[4]); - hashParamTable[533].hash = 0x90664b4f; - hashParamTable[533].ref = &device.ccs.current[0].settings.transfer.raw[12]; - hashParamTable[533].size = sizeof(device.ccs.current[0].settings.transfer.raw[12]); - hashParamTable[534].hash = 0x90693772; - hashParamTable[534].ref = &device.counters.dither.state.delta[2]; - hashParamTable[534].size = sizeof(device.counters.dither.state.delta[2]); - hashParamTable[535].hash = 0x90a6bcbd; - hashParamTable[535].ref = &device.isacs.regulator.settings.transfer.points; - hashParamTable[535].size = sizeof(device.isacs.regulator.settings.transfer.points); - hashParamTable[536].hash = 0x90e282c0; - hashParamTable[536].ref = &device.sequencer.output.analog.settings.transfer.code[7]; - hashParamTable[536].size = sizeof(device.sequencer.output.analog.settings.transfer.code[7]); - hashParamTable[537].hash = 0x90ed6c64; - hashParamTable[537].ref = &device.plcs.output.settings.transfer.voltage[11]; - hashParamTable[537].size = sizeof(device.plcs.output.settings.transfer.voltage[11]); - hashParamTable[538].hash = 0x90f0742f; - hashParamTable[538].ref = &device.dither.frequency.settings.transfer.correction[2]; - hashParamTable[538].size = sizeof(device.dither.frequency.settings.transfer.correction[2]); - hashParamTable[539].hash = 0x90f401ae; - hashParamTable[539].ref = &device.tss.gradient.settings.transfer.raw[12]; - hashParamTable[539].size = sizeof(device.tss.gradient.settings.transfer.raw[12]); - hashParamTable[540].hash = 0x91f87f78; - hashParamTable[540].ref = &device.plcs.regulator.settings.transfer.correction[8]; - hashParamTable[540].size = sizeof(device.plcs.regulator.settings.transfer.correction[8]); - hashParamTable[541].hash = 0x925a027d; - hashParamTable[541].ref = &device.isacs.input.settings.transfer.raw[10]; - hashParamTable[541].size = sizeof(device.isacs.input.settings.transfer.raw[10]); - hashParamTable[542].hash = 0x92b3ac84; - hashParamTable[542].ref = &device.plcs.reference.state.sequencer; - hashParamTable[542].size = sizeof(device.plcs.reference.state.sequencer); - hashParamTable[543].hash = 0x92d3cc7d; - hashParamTable[543].ref = &device.plcs.reset.up.settings.environment.duration[11]; - hashParamTable[543].size = sizeof(device.plcs.reset.up.settings.environment.duration[11]); - hashParamTable[544].hash = 0x930390ae; - hashParamTable[544].ref = &device.plcs.regulator.settings.transfer.correction[14]; - hashParamTable[544].size = sizeof(device.plcs.regulator.settings.transfer.correction[14]); - hashParamTable[545].hash = 0x930b3fec; - hashParamTable[545].ref = &device.plcs.feedback.state.voltage; - hashParamTable[545].size = sizeof(device.plcs.feedback.state.voltage); - hashParamTable[546].hash = 0x934dc773; - hashParamTable[546].ref = &device.dither.detector.settings.filter.factor[9]; - hashParamTable[546].size = sizeof(device.dither.detector.settings.filter.factor[9]); - hashParamTable[547].hash = 0x936f28bb; - hashParamTable[547].ref = &device.ccs.current[0].settings.transfer.mA[6]; - hashParamTable[547].size = sizeof(device.ccs.current[0].settings.transfer.mA[6]); - hashParamTable[548].hash = 0x93913691; - hashParamTable[548].ref = &device.plcs.reset.up.settings.environment.trigger[9]; - hashParamTable[548].size = sizeof(device.plcs.reset.up.settings.environment.trigger[9]); - hashParamTable[549].hash = 0x93b22fa4; - hashParamTable[549].ref = &device.isacs.input.settings.transfer.V[8]; - hashParamTable[549].size = sizeof(device.isacs.input.settings.transfer.V[8]); - hashParamTable[550].hash = 0x9423c605; - hashParamTable[550].ref = &device.plcs.reset.down.settings.environment.temperature[4]; - hashParamTable[550].size = sizeof(device.plcs.reset.down.settings.environment.temperature[4]); - hashParamTable[551].hash = 0x94360535; - hashParamTable[551].ref = &device.isacs.regulator.state.reference; - hashParamTable[551].size = sizeof(device.isacs.regulator.state.reference); - hashParamTable[552].hash = 0x9527a433; - hashParamTable[552].ref = &device.plcs.bias.settings.transfer.normalized[4]; - hashParamTable[552].size = sizeof(device.plcs.bias.settings.transfer.normalized[4]); - hashParamTable[553].hash = 0x955d99c3; - hashParamTable[553].ref = &device.tss.gradient.settings.transfer.raw[4]; - hashParamTable[553].size = sizeof(device.tss.gradient.settings.transfer.raw[4]); - hashParamTable[554].hash = 0x95e055e4; - hashParamTable[554].ref = &device.plcs.regulator.settings.transfer.error[5]; - hashParamTable[554].size = sizeof(device.plcs.regulator.settings.transfer.error[5]); - hashParamTable[555].hash = 0x96172d0d; - hashParamTable[555].ref = &device.sequencer.output.analog.settings.transfer.voltage[4]; - hashParamTable[555].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[4]); - hashParamTable[556].hash = 0x96649471; - hashParamTable[556].ref = &device.tss.temperature.settings.transfer.celsius[7]; - hashParamTable[556].size = sizeof(device.tss.temperature.settings.transfer.celsius[7]); - hashParamTable[557].hash = 0x96921cbb; - hashParamTable[557].ref = &device.counters.meander.state.a; - hashParamTable[557].size = sizeof(device.counters.meander.state.a); - hashParamTable[558].hash = 0x96d795b; - hashParamTable[558].ref = &device.isacs.regulator.settings.reset.reference; - hashParamTable[558].size = sizeof(device.isacs.regulator.settings.reset.reference); - hashParamTable[559].hash = 0x97dea178; - hashParamTable[559].ref = &device.controller.QEI.state.position; - hashParamTable[559].size = sizeof(device.controller.QEI.state.position); - hashParamTable[560].hash = 0x981d8044; - hashParamTable[560].ref = &device.isacs.regulator.settings.transfer.error[15]; - hashParamTable[560].size = sizeof(device.isacs.regulator.settings.transfer.error[15]); - hashParamTable[561].hash = 0x983d2d98; - hashParamTable[561].ref = &device.dither.amplitude.settings.transfer.correction[8]; - hashParamTable[561].size = sizeof(device.dither.amplitude.settings.transfer.correction[8]); - hashParamTable[562].hash = 0x98a0752e; - hashParamTable[562].ref = &device.dither.detector.settings.transfer.restored[3]; - hashParamTable[562].size = sizeof(device.dither.detector.settings.transfer.restored[3]); - hashParamTable[563].hash = 0x9a08bce8; - hashParamTable[563].ref = &device.plcs.reset.down.settings.environment.duration[13]; - hashParamTable[563].size = sizeof(device.plcs.reset.down.settings.environment.duration[13]); - hashParamTable[564].hash = 0x9a767092; - hashParamTable[564].ref = &device.isacs.input.settings.transfer.raw[8]; - hashParamTable[564].size = sizeof(device.isacs.input.settings.transfer.raw[8]); - hashParamTable[565].hash = 0x9a900bfc; - hashParamTable[565].ref = &device.sequencer.sampler.settings.sequence[55]; - hashParamTable[565].size = sizeof(device.sequencer.sampler.settings.sequence[55]); - hashParamTable[566].hash = 0x9ab04f57; - hashParamTable[566].ref = &device.sequencer.sampler.state.enabled; - hashParamTable[566].size = sizeof(device.sequencer.sampler.state.enabled); - hashParamTable[567].hash = 0x9af421f4; - hashParamTable[567].ref = &device.isacs.regulator.settings.transfer.correction[13]; - hashParamTable[567].size = sizeof(device.isacs.regulator.settings.transfer.correction[13]); - hashParamTable[568].hash = 0x9b391ccb; - hashParamTable[568].ref = &device.plcs.output.settings.transfer.voltage[4]; - hashParamTable[568].size = sizeof(device.plcs.output.settings.transfer.voltage[4]); - hashParamTable[569].hash = 0x9b5261cb; - hashParamTable[569].ref = &device.sequencer.sampler.settings.sequence[45]; - hashParamTable[569].size = sizeof(device.sequencer.sampler.settings.sequence[45]); - hashParamTable[570].hash = 0x9bf2b9f9; - hashParamTable[570].ref = &device.ccs.current[0].settings.transfer.mA[14]; - hashParamTable[570].size = sizeof(device.ccs.current[0].settings.transfer.mA[14]); - hashParamTable[571].hash = 0x9cb1b09d; - hashParamTable[571].ref = &device.dither.frequency.settings.transfer.error[0]; - hashParamTable[571].size = sizeof(device.dither.frequency.settings.transfer.error[0]); - hashParamTable[572].hash = 0x9cea9319; - hashParamTable[572].ref = &device.sequencer.sampler.settings.sequence[5]; - hashParamTable[572].size = sizeof(device.sequencer.sampler.settings.sequence[5]); - hashParamTable[573].hash = 0x9cf30799; - hashParamTable[573].ref = &device.tss.temperature.settings.transfer.celsius[11]; - hashParamTable[573].size = sizeof(device.tss.temperature.settings.transfer.celsius[11]); - hashParamTable[574].hash = 0x9d99a320; - hashParamTable[574].ref = &device.sequencer.sampler.settings.sequence[15]; - hashParamTable[574].size = sizeof(device.sequencer.sampler.settings.sequence[15]); - hashParamTable[575].hash = 0x9e1d774e; - hashParamTable[575].ref = &device.sequencer.sampler.settings.sequence[35]; - hashParamTable[575].size = sizeof(device.sequencer.sampler.settings.sequence[35]); - hashParamTable[576].hash = 0x9e50a88e; - hashParamTable[576].ref = &device.plcs.reset.up.settings.environment.duration[2]; - hashParamTable[576].size = sizeof(device.plcs.reset.up.settings.environment.duration[2]); - hashParamTable[577].hash = 0x9e54ecc8; - hashParamTable[577].ref = &device.dither.pulse.state.rise; - hashParamTable[577].size = sizeof(device.dither.pulse.state.rise); - hashParamTable[578].hash = 0x9ee1f9a5; - hashParamTable[578].ref = &device.isacs.regulator.settings.reset.scale; - hashParamTable[578].size = sizeof(device.isacs.regulator.settings.reset.scale); - hashParamTable[579].hash = 0x9ef65be2; - hashParamTable[579].ref = &device.controller.chip; - hashParamTable[579].size = sizeof(device.controller.chip); - hashParamTable[580].hash = 0x9f454868; - hashParamTable[580].ref = &device.isacs.output.settings.transfer.code[4]; - hashParamTable[580].size = sizeof(device.isacs.output.settings.transfer.code[4]); - hashParamTable[581].hash = 0x9f90d195; - hashParamTable[581].ref = &device.sequencer.output.analog.settings.transfer.voltage[14]; - hashParamTable[581].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[14]); - hashParamTable[582].hash = 0x9fdf1d79; - hashParamTable[582].ref = &device.sequencer.sampler.settings.sequence[25]; - hashParamTable[582].size = sizeof(device.sequencer.sampler.settings.sequence[25]); - hashParamTable[583].hash = 0xa023a359; - hashParamTable[583].ref = &device.counters.dither.state.amplitude; - hashParamTable[583].size = sizeof(device.counters.dither.state.amplitude); - hashParamTable[584].hash = 0xa06c60ff; - hashParamTable[584].ref = &device.isacs.input.settings.transfer.raw[12]; - hashParamTable[584].size = sizeof(device.isacs.input.settings.transfer.raw[12]); - hashParamTable[585].hash = 0xa0e5aeff; - hashParamTable[585].ref = &device.plcs.reset.up.settings.environment.duration[13]; - hashParamTable[585].size = sizeof(device.plcs.reset.up.settings.environment.duration[13]); - hashParamTable[586].hash = 0xa11422ab; - hashParamTable[586].ref = &device.plcs.bias.settings.transfer.raw[14]; - hashParamTable[586].size = sizeof(device.plcs.bias.settings.transfer.raw[14]); - hashParamTable[587].hash = 0xa11f77ed; - hashParamTable[587].ref = &device.plcs.reset.down.settings.environment.trigger[8]; - hashParamTable[587].size = sizeof(device.plcs.reset.down.settings.environment.trigger[8]); - hashParamTable[588].hash = 0xa1594a39; - hashParamTable[588].ref = &device.ccs.current[0].settings.transfer.mA[4]; - hashParamTable[588].size = sizeof(device.ccs.current[0].settings.transfer.mA[4]); - hashParamTable[589].hash = 0xa1dc592c; - hashParamTable[589].ref = &device.plcs.regulator.state.error; - hashParamTable[589].size = sizeof(device.plcs.regulator.state.error); - hashParamTable[590].hash = 0xa2411627; - hashParamTable[590].ref = &device.isacs.output.settings.transfer.code[14]; - hashParamTable[590].size = sizeof(device.isacs.output.settings.transfer.code[14]); - hashParamTable[591].hash = 0xa2471925; - hashParamTable[591].ref = &device.isacs.regulator.settings.start.enabled; - hashParamTable[591].size = sizeof(device.isacs.regulator.settings.start.enabled); - hashParamTable[592].hash = 0xa25029cd; - hashParamTable[592].ref = &device.ccs.current[0].settings.transfer.raw[10]; - hashParamTable[592].size = sizeof(device.ccs.current[0].settings.transfer.raw[10]); - hashParamTable[593].hash = 0xa25f55f0; - hashParamTable[593].ref = &device.counters.dither.state.delta[0]; - hashParamTable[593].size = sizeof(device.counters.dither.state.delta[0]); - hashParamTable[594].hash = 0xa27fb4eb; - hashParamTable[594].ref = &device.plcs.reset.down.settings.environment.duration[6]; - hashParamTable[594].size = sizeof(device.plcs.reset.down.settings.environment.duration[6]); - hashParamTable[595].hash = 0xa2c2632c; - hashParamTable[595].ref = &device.tss.gradient.settings.transfer.raw[10]; - hashParamTable[595].size = sizeof(device.tss.gradient.settings.transfer.raw[10]); - hashParamTable[596].hash = 0xa2c616ad; - hashParamTable[596].ref = &device.dither.frequency.settings.transfer.correction[0]; - hashParamTable[596].size = sizeof(device.dither.frequency.settings.transfer.correction[0]); - hashParamTable[597].hash = 0xa2d4e042; - hashParamTable[597].ref = &device.sequencer.output.analog.settings.transfer.code[5]; - hashParamTable[597].size = sizeof(device.sequencer.output.analog.settings.transfer.code[5]); - hashParamTable[598].hash = 0xa2db0ee6; - hashParamTable[598].ref = &device.plcs.output.settings.transfer.voltage[13]; - hashParamTable[598].size = sizeof(device.plcs.output.settings.transfer.voltage[13]); - hashParamTable[599].hash = 0xa31ef142; - hashParamTable[599].ref = &device.plcs.bias.state.sum; - hashParamTable[599].size = sizeof(device.plcs.bias.state.sum); - hashParamTable[600].hash = 0xa40a68a3; - hashParamTable[600].ref = &device.counters.meander.state.rate[0]; - hashParamTable[600].size = sizeof(device.counters.meander.state.rate[0]); - hashParamTable[601].hash = 0xa4214f8f; - hashParamTable[601].ref = &device.sequencer.output.analog.settings.transfer.voltage[6]; - hashParamTable[601].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[6]); - hashParamTable[602].hash = 0xa452f6f3; - hashParamTable[602].ref = &device.tss.temperature.settings.transfer.celsius[5]; - hashParamTable[602].size = sizeof(device.tss.temperature.settings.transfer.celsius[5]); - hashParamTable[603].hash = 0xa4cccaad; - hashParamTable[603].ref = &device.counters.latch.state.signal; - hashParamTable[603].size = sizeof(device.counters.latch.state.signal); - hashParamTable[604].hash = 0xa4d212c; - hashParamTable[604].ref = &device.plcs.reset.down.settings.environment.trigger[15]; - hashParamTable[604].size = sizeof(device.plcs.reset.down.settings.environment.trigger[15]); - hashParamTable[605].hash = 0xa4e250b4; - hashParamTable[605].ref = &device.sequencer.sampler.settings.position[0]; - hashParamTable[605].size = sizeof(device.sequencer.sampler.settings.position[0]); - hashParamTable[606].hash = 0xa50a94b2; - hashParamTable[606].ref = &device.counters.latch.settings.format; - hashParamTable[606].size = sizeof(device.counters.latch.settings.format); - hashParamTable[607].hash = 0xa615a487; - hashParamTable[607].ref = &device.plcs.reset.down.settings.environment.temperature[6]; - hashParamTable[607].size = sizeof(device.plcs.reset.down.settings.environment.temperature[6]); - hashParamTable[608].hash = 0xa711c6b1; - hashParamTable[608].ref = &device.plcs.bias.settings.transfer.normalized[6]; - hashParamTable[608].size = sizeof(device.plcs.bias.settings.transfer.normalized[6]); - hashParamTable[609].hash = 0xa76bfb41; - hashParamTable[609].ref = &device.tss.gradient.settings.transfer.raw[6]; - hashParamTable[609].size = sizeof(device.tss.gradient.settings.transfer.raw[6]); - hashParamTable[610].hash = 0xa7d63766; - hashParamTable[610].ref = &device.plcs.regulator.settings.transfer.error[7]; - hashParamTable[610].size = sizeof(device.plcs.regulator.settings.transfer.error[7]); - hashParamTable[611].hash = 0xa80ee333; - hashParamTable[611].ref = &device.lightUp.state.sequence; - hashParamTable[611].size = sizeof(device.lightUp.state.sequence); - hashParamTable[612].hash = 0xa83ede6a; - hashParamTable[612].ref = &device.plcs.reset.down.settings.environment.duration[11]; - hashParamTable[612].size = sizeof(device.plcs.reset.down.settings.environment.duration[11]); - hashParamTable[613].hash = 0xa8a6697e; - hashParamTable[613].ref = &device.sequencer.sampler.settings.sequence[57]; - hashParamTable[613].size = sizeof(device.sequencer.sampler.settings.sequence[57]); - hashParamTable[614].hash = 0xa8c24376; - hashParamTable[614].ref = &device.isacs.regulator.settings.transfer.correction[11]; - hashParamTable[614].size = sizeof(device.isacs.regulator.settings.transfer.correction[11]); - hashParamTable[615].hash = 0xa90f7e49; - hashParamTable[615].ref = &device.plcs.output.settings.transfer.voltage[6]; - hashParamTable[615].size = sizeof(device.plcs.output.settings.transfer.voltage[6]); - hashParamTable[616].hash = 0xa9640349; - hashParamTable[616].ref = &device.sequencer.sampler.settings.sequence[47]; - hashParamTable[616].size = sizeof(device.sequencer.sampler.settings.sequence[47]); - hashParamTable[617].hash = 0xa99e4a3f; - hashParamTable[617].ref = &device.ccs.current[1].state.raw; - hashParamTable[617].size = sizeof(device.ccs.current[1].state.raw); - hashParamTable[618].hash = 0xa9a4d9a5; - hashParamTable[618].ref = &device.dither.detector.settings.filter.factor[18]; - hashParamTable[618].size = sizeof(device.dither.detector.settings.filter.factor[18]); - hashParamTable[619].hash = 0xa9f1adb6; - hashParamTable[619].ref = &device.tss.temperature.settings.transfer.raw[14]; - hashParamTable[619].size = sizeof(device.tss.temperature.settings.transfer.raw[14]); - hashParamTable[620].hash = 0xaa1215fe; - hashParamTable[620].ref = &device.plcs.output.settings.sequencer; - hashParamTable[620].size = sizeof(device.plcs.output.settings.sequencer); - hashParamTable[621].hash = 0xaa9617ac; - hashParamTable[621].ref = &device.dither.detector.settings.transfer.restored[1]; - hashParamTable[621].size = sizeof(device.dither.detector.settings.transfer.restored[1]); - hashParamTable[622].hash = 0xaaeb6cd0; - hashParamTable[622].ref = &device.ccs.current[1].state.mA; - hashParamTable[622].size = sizeof(device.ccs.current[1].state.mA); - hashParamTable[623].hash = 0xaba237cf; - hashParamTable[623].ref = &device.ccs.current[0].settings.transfer.raw[8]; - hashParamTable[623].size = sizeof(device.ccs.current[0].settings.transfer.raw[8]); - hashParamTable[624].hash = 0xabe267fc; - hashParamTable[624].ref = &device.dither.detector.settings.filter.factor[28]; - hashParamTable[624].size = sizeof(device.dither.detector.settings.filter.factor[28]); - hashParamTable[625].hash = 0xac2b15cc; - hashParamTable[625].ref = &device.sequencer.sampler.settings.sequence[37]; - hashParamTable[625].size = sizeof(device.sequencer.sampler.settings.sequence[37]); - hashParamTable[626].hash = 0xac66ca0c; - hashParamTable[626].ref = &device.plcs.reset.up.settings.environment.duration[0]; - hashParamTable[626].size = sizeof(device.plcs.reset.up.settings.environment.duration[0]); - hashParamTable[627].hash = 0xad309a93; - hashParamTable[627].ref = &device.isacs.regulator.settings.transfer.error[8]; - hashParamTable[627].size = sizeof(device.isacs.regulator.settings.transfer.error[8]); - hashParamTable[628].hash = 0xad732aea; - hashParamTable[628].ref = &device.isacs.output.settings.transfer.code[6]; - hashParamTable[628].size = sizeof(device.isacs.output.settings.transfer.code[6]); - hashParamTable[629].hash = 0xadb38eb3; - hashParamTable[629].ref = &device.plcs.reset.down.settings.environment.temperature[15]; - hashParamTable[629].size = sizeof(device.plcs.reset.down.settings.environment.temperature[15]); - hashParamTable[630].hash = 0xade97ffb; - hashParamTable[630].ref = &device.sequencer.sampler.settings.sequence[27]; - hashParamTable[630].size = sizeof(device.sequencer.sampler.settings.sequence[27]); - hashParamTable[631].hash = 0xae87d21f; - hashParamTable[631].ref = &device.dither.frequency.settings.transfer.error[2]; - hashParamTable[631].size = sizeof(device.dither.frequency.settings.transfer.error[2]); - hashParamTable[632].hash = 0xaec5651b; - hashParamTable[632].ref = &device.tss.temperature.settings.transfer.celsius[13]; - hashParamTable[632].size = sizeof(device.tss.temperature.settings.transfer.celsius[13]); - hashParamTable[633].hash = 0xaedcf19b; - hashParamTable[633].ref = &device.sequencer.sampler.settings.sequence[7]; - hashParamTable[633].size = sizeof(device.sequencer.sampler.settings.sequence[7]); - hashParamTable[634].hash = 0xafafc1a2; - hashParamTable[634].ref = &device.sequencer.sampler.settings.sequence[17]; - hashParamTable[634].size = sizeof(device.sequencer.sampler.settings.sequence[17]); - hashParamTable[635].hash = 0xafb8d823; - hashParamTable[635].ref = &device.counters.latch.settings.enabled; - hashParamTable[635].size = sizeof(device.counters.latch.settings.enabled); - hashParamTable[636].hash = 0xb0144f08; - hashParamTable[636].ref = &device.plcs.output.settings.transfer.voltage[7]; - hashParamTable[636].size = sizeof(device.plcs.output.settings.transfer.voltage[7]); - hashParamTable[637].hash = 0xb07f3208; - hashParamTable[637].ref = &device.sequencer.sampler.settings.sequence[46]; - hashParamTable[637].size = sizeof(device.sequencer.sampler.settings.sequence[46]); - hashParamTable[638].hash = 0xb0bfe8e4; - hashParamTable[638].ref = &device.dither.detector.settings.filter.factor[19]; - hashParamTable[638].size = sizeof(device.dither.detector.settings.filter.factor[19]); - hashParamTable[639].hash = 0xb0ea9cf7; - hashParamTable[639].ref = &device.tss.temperature.settings.transfer.raw[15]; - hashParamTable[639].size = sizeof(device.tss.temperature.settings.transfer.raw[15]); - hashParamTable[640].hash = 0xb125ef2b; - hashParamTable[640].ref = &device.plcs.reset.down.settings.environment.duration[10]; - hashParamTable[640].size = sizeof(device.plcs.reset.down.settings.environment.duration[10]); - hashParamTable[641].hash = 0xb1bd583f; - hashParamTable[641].ref = &device.sequencer.sampler.settings.sequence[56]; - hashParamTable[641].size = sizeof(device.sequencer.sampler.settings.sequence[56]); - hashParamTable[642].hash = 0xb1d97237; - hashParamTable[642].ref = &device.isacs.regulator.settings.transfer.correction[10]; - hashParamTable[642].size = sizeof(device.isacs.regulator.settings.transfer.correction[10]); - hashParamTable[643].hash = 0xb2048fbd; - hashParamTable[643].ref = &device.dither.amplitude.state.frequency; - hashParamTable[643].size = sizeof(device.dither.amplitude.state.frequency); - hashParamTable[644].hash = 0xb2b9068e; - hashParamTable[644].ref = &device.ccs.current[0].settings.transfer.raw[9]; - hashParamTable[644].size = sizeof(device.ccs.current[0].settings.transfer.raw[9]); - hashParamTable[645].hash = 0xb2c18d1; - hashParamTable[645].ref = &device.plcs.reset.down.settings.environment.target[2]; - hashParamTable[645].size = sizeof(device.plcs.reset.down.settings.environment.target[2]); - hashParamTable[646].hash = 0xb2f956bd; - hashParamTable[646].ref = &device.dither.detector.settings.filter.factor[29]; - hashParamTable[646].size = sizeof(device.dither.detector.settings.filter.factor[29]); - hashParamTable[647].hash = 0xb38d26ed; - hashParamTable[647].ref = &device.dither.detector.settings.transfer.restored[0]; - hashParamTable[647].size = sizeof(device.dither.detector.settings.transfer.restored[0]); - hashParamTable[648].hash = 0xb42babd2; - hashParamTable[648].ref = &device.isacs.regulator.settings.transfer.error[9]; - hashParamTable[648].size = sizeof(device.isacs.regulator.settings.transfer.error[9]); - hashParamTable[649].hash = 0xb4681bab; - hashParamTable[649].ref = &device.isacs.output.settings.transfer.code[7]; - hashParamTable[649].size = sizeof(device.isacs.output.settings.transfer.code[7]); - hashParamTable[650].hash = 0xb4a8bff2; - hashParamTable[650].ref = &device.plcs.reset.down.settings.environment.temperature[14]; - hashParamTable[650].size = sizeof(device.plcs.reset.down.settings.environment.temperature[14]); - hashParamTable[651].hash = 0xb4f24eba; - hashParamTable[651].ref = &device.sequencer.sampler.settings.sequence[26]; - hashParamTable[651].size = sizeof(device.sequencer.sampler.settings.sequence[26]); - hashParamTable[652].hash = 0xb500fd6; - hashParamTable[652].ref = &device.sequencer.output.analog.settings.enabled; - hashParamTable[652].size = sizeof(device.sequencer.output.analog.settings.enabled); - hashParamTable[653].hash = 0xb530248d; - hashParamTable[653].ref = &device.sequencer.sampler.settings.sequence[36]; - hashParamTable[653].size = sizeof(device.sequencer.sampler.settings.sequence[36]); - hashParamTable[654].hash = 0xb56c741c; - hashParamTable[654].ref = &device.tss.temperature.state.sum; - hashParamTable[654].size = sizeof(device.tss.temperature.state.sum); - hashParamTable[655].hash = 0xb5749b10; - hashParamTable[655].ref = &device.sequencer.output.analog.settings.transfer.points; - hashParamTable[655].size = sizeof(device.sequencer.output.analog.settings.transfer.points); - hashParamTable[656].hash = 0xb57dcb8f; - hashParamTable[656].ref = &device.plcs.reset.up.state.duration; - hashParamTable[656].size = sizeof(device.plcs.reset.up.state.duration); - hashParamTable[657].hash = 0xb57dfb4d; - hashParamTable[657].ref = &device.plcs.reset.up.settings.environment.duration[1]; - hashParamTable[657].size = sizeof(device.plcs.reset.up.settings.environment.duration[1]); - hashParamTable[658].hash = 0xb60bd7d; - hashParamTable[658].ref = &device.plcs.feedback.settings.transfer.normalized[15]; - hashParamTable[658].size = sizeof(device.plcs.feedback.settings.transfer.normalized[15]); - hashParamTable[659].hash = 0xb6b4f0e3; - hashParamTable[659].ref = &device.sequencer.sampler.settings.sequence[16]; - hashParamTable[659].size = sizeof(device.sequencer.sampler.settings.sequence[16]); - hashParamTable[660].hash = 0xb79ce35e; - hashParamTable[660].ref = &device.dither.frequency.settings.transfer.error[3]; - hashParamTable[660].size = sizeof(device.dither.frequency.settings.transfer.error[3]); - hashParamTable[661].hash = 0xb7c7c0da; - hashParamTable[661].ref = &device.sequencer.sampler.settings.sequence[6]; - hashParamTable[661].size = sizeof(device.sequencer.sampler.settings.sequence[6]); - hashParamTable[662].hash = 0xb7de545a; - hashParamTable[662].ref = &device.tss.temperature.settings.transfer.celsius[12]; - hashParamTable[662].size = sizeof(device.tss.temperature.settings.transfer.celsius[12]); - hashParamTable[663].hash = 0xb80446ac; - hashParamTable[663].ref = &device.plcs.reset.down.settings.environment.trigger[9]; - hashParamTable[663].size = sizeof(device.plcs.reset.down.settings.environment.trigger[9]); - hashParamTable[664].hash = 0xb80f13ea; - hashParamTable[664].ref = &device.plcs.bias.settings.transfer.raw[15]; - hashParamTable[664].size = sizeof(device.plcs.bias.settings.transfer.raw[15]); - hashParamTable[665].hash = 0xb8256f; - hashParamTable[665].ref = &device.dither.detector.settings.transfer.raw[2]; - hashParamTable[665].size = sizeof(device.dither.detector.settings.transfer.raw[2]); - hashParamTable[666].hash = 0xb8427b78; - hashParamTable[666].ref = &device.ccs.current[0].settings.transfer.mA[5]; - hashParamTable[666].size = sizeof(device.ccs.current[0].settings.transfer.mA[5]); - hashParamTable[667].hash = 0xb8ee42b; - hashParamTable[667].ref = &device.plcs.reset.up.settings.environment.temperature[14]; - hashParamTable[667].size = sizeof(device.plcs.reset.up.settings.environment.temperature[14]); - hashParamTable[668].hash = 0xb97751be; - hashParamTable[668].ref = &device.isacs.input.settings.transfer.raw[13]; - hashParamTable[668].size = sizeof(device.isacs.input.settings.transfer.raw[13]); - hashParamTable[669].hash = 0xb9fe9fbe; - hashParamTable[669].ref = &device.plcs.reset.up.settings.environment.duration[12]; - hashParamTable[669].size = sizeof(device.plcs.reset.up.settings.environment.duration[12]); - hashParamTable[670].hash = 0xbb4464b1; - hashParamTable[670].ref = &device.counters.dither.state.delta[1]; - hashParamTable[670].size = sizeof(device.counters.dither.state.delta[1]); - hashParamTable[671].hash = 0xbb4b188c; - hashParamTable[671].ref = &device.ccs.current[0].settings.transfer.raw[11]; - hashParamTable[671].size = sizeof(device.ccs.current[0].settings.transfer.raw[11]); - hashParamTable[672].hash = 0xbb5a2766; - hashParamTable[672].ref = &device.isacs.output.settings.transfer.code[15]; - hashParamTable[672].size = sizeof(device.isacs.output.settings.transfer.code[15]); - hashParamTable[673].hash = 0xbb6485aa; - hashParamTable[673].ref = &device.plcs.reset.down.settings.environment.duration[7]; - hashParamTable[673].size = sizeof(device.plcs.reset.down.settings.environment.duration[7]); - hashParamTable[674].hash = 0xbbacc986; - hashParamTable[674].ref = &device.plcs.output.state.voltage; - hashParamTable[674].size = sizeof(device.plcs.output.state.voltage); - hashParamTable[675].hash = 0xbbc03fa7; - hashParamTable[675].ref = &device.plcs.output.settings.transfer.voltage[12]; - hashParamTable[675].size = sizeof(device.plcs.output.settings.transfer.voltage[12]); - hashParamTable[676].hash = 0xbbcfd103; - hashParamTable[676].ref = &device.sequencer.output.analog.settings.transfer.code[4]; - hashParamTable[676].size = sizeof(device.sequencer.output.analog.settings.transfer.code[4]); - hashParamTable[677].hash = 0xbbd9526d; - hashParamTable[677].ref = &device.tss.gradient.settings.transfer.raw[11]; - hashParamTable[677].size = sizeof(device.tss.gradient.settings.transfer.raw[11]); - hashParamTable[678].hash = 0xbbdd27ec; - hashParamTable[678].ref = &device.dither.frequency.settings.transfer.correction[1]; - hashParamTable[678].size = sizeof(device.dither.frequency.settings.transfer.correction[1]); - hashParamTable[679].hash = 0xbd1159e2; - hashParamTable[679].ref = &device.counters.meander.state.rate[1]; - hashParamTable[679].size = sizeof(device.counters.meander.state.rate[1]); - hashParamTable[680].hash = 0xbd3a7ece; - hashParamTable[680].ref = &device.sequencer.output.analog.settings.transfer.voltage[7]; - hashParamTable[680].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[7]); - hashParamTable[681].hash = 0xbd49c7b2; - hashParamTable[681].ref = &device.tss.temperature.settings.transfer.celsius[4]; - hashParamTable[681].size = sizeof(device.tss.temperature.settings.transfer.celsius[4]); - hashParamTable[682].hash = 0xbda3a53; - hashParamTable[682].ref = &device.isacs.input.state.raw; - hashParamTable[682].size = sizeof(device.isacs.input.state.raw); - hashParamTable[683].hash = 0xbdf961f5; - hashParamTable[683].ref = &device.sequencer.sampler.settings.position[1]; - hashParamTable[683].size = sizeof(device.sequencer.sampler.settings.position[1]); - hashParamTable[684].hash = 0xbdff6e0b; - hashParamTable[684].ref = &device.sequencer.sampler.state.amplitude; - hashParamTable[684].size = sizeof(device.sequencer.sampler.state.amplitude); - hashParamTable[685].hash = 0xbe0af7f0; - hashParamTable[685].ref = &device.plcs.bias.settings.transfer.normalized[7]; - hashParamTable[685].size = sizeof(device.plcs.bias.settings.transfer.normalized[7]); - hashParamTable[686].hash = 0xbe70ca00; - hashParamTable[686].ref = &device.tss.gradient.settings.transfer.raw[7]; - hashParamTable[686].size = sizeof(device.tss.gradient.settings.transfer.raw[7]); - hashParamTable[687].hash = 0xbecd0627; - hashParamTable[687].ref = &device.plcs.regulator.settings.transfer.error[6]; - hashParamTable[687].size = sizeof(device.plcs.regulator.settings.transfer.error[6]); - hashParamTable[688].hash = 0xbf0e95c6; - hashParamTable[688].ref = &device.plcs.reset.down.settings.environment.temperature[7]; - hashParamTable[688].size = sizeof(device.plcs.reset.down.settings.environment.temperature[7]); - hashParamTable[689].hash = 0xbf36e77; - hashParamTable[689].ref = &device.dither.amplitude.settings.transfer.error[15]; - hashParamTable[689].size = sizeof(device.dither.amplitude.settings.transfer.error[15]); - hashParamTable[690].hash = 0xc03e33f7; - hashParamTable[690].ref = &device.tss.temperature.settings.transfer.celsius[1]; - hashParamTable[690].size = sizeof(device.tss.temperature.settings.transfer.celsius[1]); - hashParamTable[691].hash = 0xc04d8a8b; - hashParamTable[691].ref = &device.sequencer.output.analog.settings.transfer.voltage[2]; - hashParamTable[691].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[2]); - hashParamTable[692].hash = 0xc0618565; - hashParamTable[692].ref = &device.isacs.regulator.settings.transfer.correction[8]; - hashParamTable[692].size = sizeof(device.isacs.regulator.settings.transfer.correction[8]); - hashParamTable[693].hash = 0xc0e90f5f; - hashParamTable[693].ref = &device.plcs.feedback.settings.transfer.normalized[9]; - hashParamTable[693].size = sizeof(device.plcs.feedback.settings.transfer.normalized[9]); - hashParamTable[694].hash = 0xc177fc3b; - hashParamTable[694].ref = &device.dither.noise.state.trigger; - hashParamTable[694].size = sizeof(device.dither.noise.state.trigger); - hashParamTable[695].hash = 0xc2796183; - hashParamTable[695].ref = &device.plcs.reset.down.settings.environment.temperature[2]; - hashParamTable[695].size = sizeof(device.plcs.reset.down.settings.environment.temperature[2]); - hashParamTable[696].hash = 0xc3073e45; - hashParamTable[696].ref = &device.tss.gradient.settings.transfer.raw[2]; - hashParamTable[696].size = sizeof(device.tss.gradient.settings.transfer.raw[2]); - hashParamTable[697].hash = 0xc37d03b5; - hashParamTable[697].ref = &device.plcs.bias.settings.transfer.normalized[2]; - hashParamTable[697].size = sizeof(device.plcs.bias.settings.transfer.normalized[2]); - hashParamTable[698].hash = 0xc38048cc; - hashParamTable[698].ref = &device.controller.I2C.state.counter; - hashParamTable[698].size = sizeof(device.controller.I2C.state.counter); - hashParamTable[699].hash = 0xc3baf262; - hashParamTable[699].ref = &device.plcs.regulator.settings.transfer.error[3]; - hashParamTable[699].size = sizeof(device.plcs.regulator.settings.transfer.error[3]); - hashParamTable[700].hash = 0xc4212aac; - hashParamTable[700].ref = &device.dither.amplitude.settings.transfer.error[8]; - hashParamTable[700].size = sizeof(device.dither.amplitude.settings.transfer.error[8]); - hashParamTable[701].hash = 0xc4c6dc10; - hashParamTable[701].ref = &device.plcs.feedback.state.output; - hashParamTable[701].size = sizeof(device.plcs.feedback.state.output); - hashParamTable[702].hash = 0xc4dd202b; - hashParamTable[702].ref = &device.dither.cycle.settings.enabled; - hashParamTable[702].size = sizeof(device.dither.cycle.settings.enabled); - hashParamTable[703].hash = 0xc5139b41; - hashParamTable[703].ref = &device.plcs.reset.down.state.duration; - hashParamTable[703].size = sizeof(device.plcs.reset.down.state.duration); - hashParamTable[704].hash = 0xc5358f3d; - hashParamTable[704].ref = &device.ccs.current[0].settings.transfer.mA[0]; - hashParamTable[704].size = sizeof(device.ccs.current[0].settings.transfer.mA[0]); - hashParamTable[705].hash = 0xc5593728; - hashParamTable[705].ref = &device.plcs.regulator.settings.transfer.correction[12]; - hashParamTable[705].size = sizeof(device.plcs.regulator.settings.transfer.correction[12]); - hashParamTable[706].hash = 0xc56d211c; - hashParamTable[706].ref = &device.counters.latch.state.reset; - hashParamTable[706].size = sizeof(device.counters.latch.state.reset); - hashParamTable[707].hash = 0xc578e7af; - hashParamTable[707].ref = &device.plcs.bias.settings.transfer.raw[10]; - hashParamTable[707].size = sizeof(device.plcs.bias.settings.transfer.raw[10]); - hashParamTable[708].hash = 0xc61371ef; - hashParamTable[708].ref = &device.plcs.reset.down.settings.environment.duration[2]; - hashParamTable[708].size = sizeof(device.plcs.reset.down.settings.environment.duration[2]); - hashParamTable[709].hash = 0xc62dd323; - hashParamTable[709].ref = &device.isacs.output.settings.transfer.code[10]; - hashParamTable[709].size = sizeof(device.isacs.output.settings.transfer.code[10]); - hashParamTable[710].hash = 0xc63390f4; - hashParamTable[710].ref = &device.counters.dither.state.delta[4]; - hashParamTable[710].size = sizeof(device.counters.dither.state.delta[4]); - hashParamTable[711].hash = 0xc63cecc9; - hashParamTable[711].ref = &device.ccs.current[0].settings.transfer.raw[14]; - hashParamTable[711].size = sizeof(device.ccs.current[0].settings.transfer.raw[14]); - hashParamTable[712].hash = 0xc69881ce; - hashParamTable[712].ref = &device.isacs.input.state.V; - hashParamTable[712].size = sizeof(device.isacs.input.state.V); - hashParamTable[713].hash = 0xc6aad3a9; - hashParamTable[713].ref = &device.dither.frequency.settings.transfer.correction[4]; - hashParamTable[713].size = sizeof(device.dither.frequency.settings.transfer.correction[4]); - hashParamTable[714].hash = 0xc6aea628; - hashParamTable[714].ref = &device.tss.gradient.settings.transfer.raw[14]; - hashParamTable[714].size = sizeof(device.tss.gradient.settings.transfer.raw[14]); - hashParamTable[715].hash = 0xc6b82546; - hashParamTable[715].ref = &device.sequencer.output.analog.settings.transfer.code[1]; - hashParamTable[715].size = sizeof(device.sequencer.output.analog.settings.transfer.code[1]); - hashParamTable[716].hash = 0xc6d70a1e; - hashParamTable[716].ref = &device.isacs.regulator.settings.regular.reference; - hashParamTable[716].size = sizeof(device.isacs.regulator.settings.regular.reference); - hashParamTable[717].hash = 0xc71120d3; - hashParamTable[717].ref = &device.dither.noise.settings.period; - hashParamTable[717].size = sizeof(device.dither.noise.settings.period); - hashParamTable[718].hash = 0xc7ed2462; - hashParamTable[718].ref = &device.plcs.output.settings.transfer.code[9]; - hashParamTable[718].size = sizeof(device.plcs.output.settings.transfer.code[9]); - hashParamTable[719].hash = 0xc80a0f08; - hashParamTable[719].ref = &device.plcs.reset.up.settings.environment.duration[4]; - hashParamTable[719].size = sizeof(device.plcs.reset.up.settings.environment.duration[4]); - hashParamTable[720].hash = 0xc847d0c8; - hashParamTable[720].ref = &device.sequencer.sampler.settings.sequence[33]; - hashParamTable[720].size = sizeof(device.sequencer.sampler.settings.sequence[33]); - hashParamTable[721].hash = 0xc871939f; - hashParamTable[721].ref = &device.dither.cycle.state.enabled; - hashParamTable[721].size = sizeof(device.dither.cycle.state.enabled); - hashParamTable[722].hash = 0xc91fefee; - hashParamTable[722].ref = &device.isacs.output.settings.transfer.code[2]; - hashParamTable[722].size = sizeof(device.isacs.output.settings.transfer.code[2]); - hashParamTable[723].hash = 0xc93db6a7; - hashParamTable[723].ref = &device.plcs.bias.settings.transfer.raw[9]; - hashParamTable[723].size = sizeof(device.plcs.bias.settings.transfer.raw[9]); - hashParamTable[724].hash = 0xc93fb1fd; - hashParamTable[724].ref = &device.plcs.feedback.settings.transfer.raw[9]; - hashParamTable[724].size = sizeof(device.plcs.feedback.settings.transfer.raw[9]); - hashParamTable[725].hash = 0xc985baff; - hashParamTable[725].ref = &device.sequencer.sampler.settings.sequence[23]; - hashParamTable[725].size = sizeof(device.sequencer.sampler.settings.sequence[23]); - hashParamTable[726].hash = 0xc9ca7613; - hashParamTable[726].ref = &device.sequencer.output.analog.settings.transfer.voltage[12]; - hashParamTable[726].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[12]); - hashParamTable[727].hash = 0xc9df4bb7; - hashParamTable[727].ref = &device.plcs.reset.down.settings.environment.temperature[11]; - hashParamTable[727].size = sizeof(device.plcs.reset.down.settings.environment.temperature[11]); - hashParamTable[728].hash = 0xc9f26ea0; - hashParamTable[728].ref = &device.plcs.reset.up.settings.environment.target[9]; - hashParamTable[728].size = sizeof(device.plcs.reset.up.settings.environment.target[9]); - hashParamTable[729].hash = 0xcab0349f; - hashParamTable[729].ref = &device.sequencer.sampler.settings.sequence[3]; - hashParamTable[729].size = sizeof(device.sequencer.sampler.settings.sequence[3]); - hashParamTable[730].hash = 0xcad52cc8; - hashParamTable[730].ref = &device.isacs.output.settings.transfer.voltage[9]; - hashParamTable[730].size = sizeof(device.isacs.output.settings.transfer.voltage[9]); - hashParamTable[731].hash = 0xcaeb171b; - hashParamTable[731].ref = &device.dither.frequency.settings.transfer.error[6]; - hashParamTable[731].size = sizeof(device.dither.frequency.settings.transfer.error[6]); - hashParamTable[732].hash = 0xcbc304a6; - hashParamTable[732].ref = &device.sequencer.sampler.settings.sequence[13]; - hashParamTable[732].size = sizeof(device.sequencer.sampler.settings.sequence[13]); - hashParamTable[733].hash = 0xcc521b6e; - hashParamTable[733].ref = &device.plcs.reset.down.settings.environment.duration[15]; - hashParamTable[733].size = sizeof(device.plcs.reset.down.settings.environment.duration[15]); - hashParamTable[734].hash = 0xccae8672; - hashParamTable[734].ref = &device.isacs.regulator.settings.transfer.correction[15]; - hashParamTable[734].size = sizeof(device.isacs.regulator.settings.transfer.correction[15]); - hashParamTable[735].hash = 0xcccaac7a; - hashParamTable[735].ref = &device.sequencer.sampler.settings.sequence[53]; - hashParamTable[735].size = sizeof(device.sequencer.sampler.settings.sequence[53]); - hashParamTable[736].hash = 0xcd08c64d; - hashParamTable[736].ref = &device.sequencer.sampler.settings.sequence[43]; - hashParamTable[736].size = sizeof(device.sequencer.sampler.settings.sequence[43]); - hashParamTable[737].hash = 0xcd55a6bd; - hashParamTable[737].ref = &device.plcs.reference.state.delta; - hashParamTable[737].size = sizeof(device.plcs.reference.state.delta); - hashParamTable[738].hash = 0xcd63bb4d; - hashParamTable[738].ref = &device.plcs.output.settings.transfer.voltage[2]; - hashParamTable[738].size = sizeof(device.plcs.output.settings.transfer.voltage[2]); - hashParamTable[739].hash = 0xcd9d68b2; - hashParamTable[739].ref = &device.tss.temperature.settings.transfer.raw[10]; - hashParamTable[739].size = sizeof(device.tss.temperature.settings.transfer.raw[10]); - hashParamTable[740].hash = 0xcda81e7f; - hashParamTable[740].ref = &device.ccs.current[0].settings.transfer.mA[12]; - hashParamTable[740].size = sizeof(device.ccs.current[0].settings.transfer.mA[12]); - hashParamTable[741].hash = 0xce004abf; - hashParamTable[741].ref = &device.tss.gradient.state.raw; - hashParamTable[741].size = sizeof(device.tss.gradient.state.raw); - hashParamTable[742].hash = 0xce4727c2; - hashParamTable[742].ref = &device.isacs.regulator.settings.transfer.error[13]; - hashParamTable[742].size = sizeof(device.isacs.regulator.settings.transfer.error[13]); - hashParamTable[743].hash = 0xce8c1223; - hashParamTable[743].ref = &device.sequencer.sampler.settings.sequence[63]; - hashParamTable[743].size = sizeof(device.sequencer.sampler.settings.sequence[63]); - hashParamTable[744].hash = 0xceac463a; - hashParamTable[744].ref = &device.plcs.reset.up.settings.environment.temperature[8]; - hashParamTable[744].size = sizeof(device.plcs.reset.up.settings.environment.temperature[8]); - hashParamTable[745].hash = 0xcefad2a8; - hashParamTable[745].ref = &device.dither.detector.settings.transfer.restored[5]; - hashParamTable[745].size = sizeof(device.dither.detector.settings.transfer.restored[5]); - hashParamTable[746].hash = 0xcf8a0a4; - hashParamTable[746].ref = &device.dither.amplitude.settings.transfer.error[0]; - hashParamTable[746].size = sizeof(device.dither.amplitude.settings.transfer.error[0]); - hashParamTable[747].hash = 0xcf8f9858; - hashParamTable[747].ref = &device.tss.temperature.settings.transfer.raw[9]; - hashParamTable[747].size = sizeof(device.tss.temperature.settings.transfer.raw[9]); - hashParamTable[748].hash = 0xcfc8a2e9; - hashParamTable[748].ref = &device.lightUp.state.enabled; - hashParamTable[748].size = sizeof(device.lightUp.state.enabled); - hashParamTable[749].hash = 0xd004deaf; - hashParamTable[749].ref = &device.isacs.output.settings.transfer.code[3]; - hashParamTable[749].size = sizeof(device.isacs.output.settings.transfer.code[3]); - hashParamTable[750].hash = 0xd02480bc; - hashParamTable[750].ref = &device.plcs.feedback.settings.transfer.raw[8]; - hashParamTable[750].size = sizeof(device.plcs.feedback.settings.transfer.raw[8]); - hashParamTable[751].hash = 0xd02687e6; - hashParamTable[751].ref = &device.plcs.bias.settings.transfer.raw[8]; - hashParamTable[751].size = sizeof(device.plcs.bias.settings.transfer.raw[8]); - hashParamTable[752].hash = 0xd09e8bbe; - hashParamTable[752].ref = &device.sequencer.sampler.settings.sequence[22]; - hashParamTable[752].size = sizeof(device.sequencer.sampler.settings.sequence[22]); - hashParamTable[753].hash = 0xd0c47af6; - hashParamTable[753].ref = &device.plcs.reset.down.settings.environment.temperature[10]; - hashParamTable[753].size = sizeof(device.plcs.reset.down.settings.environment.temperature[10]); - hashParamTable[754].hash = 0xd0d14752; - hashParamTable[754].ref = &device.sequencer.output.analog.settings.transfer.voltage[13]; - hashParamTable[754].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[13]); - hashParamTable[755].hash = 0xd0e95fe1; - hashParamTable[755].ref = &device.plcs.reset.up.settings.environment.target[8]; - hashParamTable[755].size = sizeof(device.plcs.reset.up.settings.environment.target[8]); - hashParamTable[756].hash = 0xd1113e49; - hashParamTable[756].ref = &device.plcs.reset.up.settings.environment.duration[5]; - hashParamTable[756].size = sizeof(device.plcs.reset.up.settings.environment.duration[5]); - hashParamTable[757].hash = 0xd121b1f; - hashParamTable[757].ref = &device.plcs.reset.up.settings.environment.trigger[7]; - hashParamTable[757].size = sizeof(device.plcs.reset.up.settings.environment.trigger[7]); - hashParamTable[758].hash = 0xd14fa026; - hashParamTable[758].ref = &device.controller.flash.settings.dataSector; - hashParamTable[758].size = sizeof(device.controller.flash.settings.dataSector); - hashParamTable[759].hash = 0xd15ce189; - hashParamTable[759].ref = &device.sequencer.sampler.settings.sequence[32]; - hashParamTable[759].size = sizeof(device.sequencer.sampler.settings.sequence[32]); - hashParamTable[760].hash = 0xd1a66dd9; - hashParamTable[760].ref = &device.dither.frequency.settings.transfer.points; - hashParamTable[760].size = sizeof(device.dither.frequency.settings.transfer.points); - hashParamTable[761].hash = 0xd288ba7; - hashParamTable[761].ref = &device.counters.meander.state.angle[1]; - hashParamTable[761].size = sizeof(device.counters.meander.state.angle[1]); - hashParamTable[762].hash = 0xd2d835e7; - hashParamTable[762].ref = &device.sequencer.sampler.settings.sequence[12]; - hashParamTable[762].size = sizeof(device.sequencer.sampler.settings.sequence[12]); - hashParamTable[763].hash = 0xd31022a; - hashParamTable[763].ref = &device.isacs.input.settings.transfer.V[6]; - hashParamTable[763].size = sizeof(device.isacs.input.settings.transfer.V[6]); - hashParamTable[764].hash = 0xd3ab05de; - hashParamTable[764].ref = &device.sequencer.sampler.settings.sequence[2]; - hashParamTable[764].size = sizeof(device.sequencer.sampler.settings.sequence[2]); - hashParamTable[765].hash = 0xd3ce1d89; - hashParamTable[765].ref = &device.isacs.output.settings.transfer.voltage[8]; - hashParamTable[765].size = sizeof(device.isacs.output.settings.transfer.voltage[8]); - hashParamTable[766].hash = 0xd3f0265a; - hashParamTable[766].ref = &device.dither.frequency.settings.transfer.error[7]; - hashParamTable[766].size = sizeof(device.dither.frequency.settings.transfer.error[7]); - hashParamTable[767].hash = 0xd413f70c; - hashParamTable[767].ref = &device.sequencer.sampler.settings.sequence[42]; - hashParamTable[767].size = sizeof(device.sequencer.sampler.settings.sequence[42]); - hashParamTable[768].hash = 0xd4788a0c; - hashParamTable[768].ref = &device.plcs.output.settings.transfer.voltage[3]; - hashParamTable[768].size = sizeof(device.plcs.output.settings.transfer.voltage[3]); - hashParamTable[769].hash = 0xd48659f3; - hashParamTable[769].ref = &device.tss.temperature.settings.transfer.raw[11]; - hashParamTable[769].size = sizeof(device.tss.temperature.settings.transfer.raw[11]); - hashParamTable[770].hash = 0xd4b32f3e; - hashParamTable[770].ref = &device.ccs.current[0].settings.transfer.mA[13]; - hashParamTable[770].size = sizeof(device.ccs.current[0].settings.transfer.mA[13]); - hashParamTable[771].hash = 0xd5492a2f; - hashParamTable[771].ref = &device.plcs.reset.down.settings.environment.duration[14]; - hashParamTable[771].size = sizeof(device.plcs.reset.down.settings.environment.duration[14]); - hashParamTable[772].hash = 0xd5b5b733; - hashParamTable[772].ref = &device.isacs.regulator.settings.transfer.correction[14]; - hashParamTable[772].size = sizeof(device.isacs.regulator.settings.transfer.correction[14]); - hashParamTable[773].hash = 0xd5d19d3b; - hashParamTable[773].ref = &device.sequencer.sampler.settings.sequence[52]; - hashParamTable[773].size = sizeof(device.sequencer.sampler.settings.sequence[52]); - hashParamTable[774].hash = 0xd694a919; - hashParamTable[774].ref = &device.tss.temperature.settings.transfer.raw[8]; - hashParamTable[774].size = sizeof(device.tss.temperature.settings.transfer.raw[8]); - hashParamTable[775].hash = 0xd75c1683; - hashParamTable[775].ref = &device.isacs.regulator.settings.transfer.error[12]; - hashParamTable[775].size = sizeof(device.isacs.regulator.settings.transfer.error[12]); - hashParamTable[776].hash = 0xd7972362; - hashParamTable[776].ref = &device.sequencer.sampler.settings.sequence[62]; - hashParamTable[776].size = sizeof(device.sequencer.sampler.settings.sequence[62]); - hashParamTable[777].hash = 0xd7b7777b; - hashParamTable[777].ref = &device.plcs.reset.up.settings.environment.temperature[9]; - hashParamTable[777].size = sizeof(device.plcs.reset.up.settings.environment.temperature[9]); - hashParamTable[778].hash = 0xd7e1e3e9; - hashParamTable[778].ref = &device.dither.detector.settings.transfer.restored[4]; - hashParamTable[778].size = sizeof(device.dither.detector.settings.transfer.restored[4]); - hashParamTable[779].hash = 0xd914cf5e; - hashParamTable[779].ref = &device.isacs.regulator.state.error; - hashParamTable[779].size = sizeof(device.isacs.regulator.state.error); - hashParamTable[780].hash = 0xd92502b6; - hashParamTable[780].ref = &device.tss.temperature.settings.transfer.celsius[0]; - hashParamTable[780].size = sizeof(device.tss.temperature.settings.transfer.celsius[0]); - hashParamTable[781].hash = 0xd956bbca; - hashParamTable[781].ref = &device.sequencer.output.analog.settings.transfer.voltage[3]; - hashParamTable[781].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[3]); - hashParamTable[782].hash = 0xd96cc3b4; - hashParamTable[782].ref = &device.tss.gradient.settings.transfer.points; - hashParamTable[782].size = sizeof(device.tss.gradient.settings.transfer.points); - hashParamTable[783].hash = 0xd97ab424; - hashParamTable[783].ref = &device.isacs.regulator.settings.transfer.correction[9]; - hashParamTable[783].size = sizeof(device.isacs.regulator.settings.transfer.correction[9]); - hashParamTable[784].hash = 0xd9d47e4b; - hashParamTable[784].ref = &device.isacs.input.state.sum; - hashParamTable[784].size = sizeof(device.isacs.input.state.sum); - hashParamTable[785].hash = 0xd9f23e1e; - hashParamTable[785].ref = &device.plcs.feedback.settings.transfer.normalized[8]; - hashParamTable[785].size = sizeof(device.plcs.feedback.settings.transfer.normalized[8]); - hashParamTable[786].hash = 0xda1c0f04; - hashParamTable[786].ref = &device.tss.gradient.settings.transfer.raw[3]; - hashParamTable[786].size = sizeof(device.tss.gradient.settings.transfer.raw[3]); - hashParamTable[787].hash = 0xda6632f4; - hashParamTable[787].ref = &device.plcs.bias.settings.transfer.normalized[3]; - hashParamTable[787].size = sizeof(device.plcs.bias.settings.transfer.normalized[3]); - hashParamTable[788].hash = 0xdaa1c323; - hashParamTable[788].ref = &device.plcs.regulator.settings.transfer.error[2]; - hashParamTable[788].size = sizeof(device.plcs.regulator.settings.transfer.error[2]); - hashParamTable[789].hash = 0xdaa38e1; - hashParamTable[789].ref = &device.plcs.reset.down.settings.environment.trigger[4]; - hashParamTable[789].size = sizeof(device.plcs.reset.down.settings.environment.trigger[4]); - hashParamTable[790].hash = 0xdb6250c2; - hashParamTable[790].ref = &device.plcs.reset.down.settings.environment.temperature[3]; - hashParamTable[790].size = sizeof(device.plcs.reset.down.settings.environment.temperature[3]); - hashParamTable[791].hash = 0xdb8486a8; - hashParamTable[791].ref = &device.isacs.regulator.settings.reset.enabled; - hashParamTable[791].size = sizeof(device.isacs.regulator.settings.reset.enabled); - hashParamTable[792].hash = 0xdbdbd0f5; - hashParamTable[792].ref = &device.sequencer.sampler.settings.amplitude; - hashParamTable[792].size = sizeof(device.sequencer.sampler.settings.amplitude); - hashParamTable[793].hash = 0xdc1b0dfc; - hashParamTable[793].ref = &device.plcs.regulator.settings.reference; - hashParamTable[793].size = sizeof(device.plcs.regulator.settings.reference); - hashParamTable[794].hash = 0xdc27f931; - hashParamTable[794].ref = &device.plcs.regulator.settings.transfer.points; - hashParamTable[794].size = sizeof(device.plcs.regulator.settings.transfer.points); - hashParamTable[795].hash = 0xdc2ebe7c; - hashParamTable[795].ref = &device.ccs.current[0].settings.transfer.mA[1]; - hashParamTable[795].size = sizeof(device.ccs.current[0].settings.transfer.mA[1]); - hashParamTable[796].hash = 0xdc420669; - hashParamTable[796].ref = &device.plcs.regulator.settings.transfer.correction[13]; - hashParamTable[796].size = sizeof(device.plcs.regulator.settings.transfer.correction[13]); - hashParamTable[797].hash = 0xdc5b0112; - hashParamTable[797].ref = &device.sequencer.output.logic.settings.enabled; - hashParamTable[797].size = sizeof(device.sequencer.output.logic.settings.enabled); - hashParamTable[798].hash = 0xdc63d6ee; - hashParamTable[798].ref = &device.plcs.bias.settings.transfer.raw[11]; - hashParamTable[798].size = sizeof(device.plcs.bias.settings.transfer.raw[11]); - hashParamTable[799].hash = 0xdceeafd; - hashParamTable[799].ref = &device.dither.detector.settings.filter.factor[7]; - hashParamTable[799].size = sizeof(device.dither.detector.settings.filter.factor[7]); - hashParamTable[800].hash = 0xdd3a1bed; - hashParamTable[800].ref = &device.dither.amplitude.settings.transfer.error[9]; - hashParamTable[800].size = sizeof(device.dither.amplitude.settings.transfer.error[9]); - hashParamTable[801].hash = 0xdd73b0b5; - hashParamTable[801].ref = &device.dither.amplitude.state.scale; - hashParamTable[801].size = sizeof(device.dither.amplitude.state.scale); - hashParamTable[802].hash = 0xdec0535; - hashParamTable[802].ref = &device.ccs.current[0].settings.transfer.mA[8]; - hashParamTable[802].size = sizeof(device.ccs.current[0].settings.transfer.mA[8]); - hashParamTable[803].hash = 0xdef61523; - hashParamTable[803].ref = &device.plcs.output.settings.transfer.code[8]; - hashParamTable[803].size = sizeof(device.plcs.output.settings.transfer.code[8]); - hashParamTable[804].hash = 0xdf0840ae; - hashParamTable[804].ref = &device.plcs.reset.down.settings.environment.duration[3]; - hashParamTable[804].size = sizeof(device.plcs.reset.down.settings.environment.duration[3]); - hashParamTable[805].hash = 0xdf13853a; - hashParamTable[805].ref = &device.dither.frequency.state.scale; - hashParamTable[805].size = sizeof(device.dither.frequency.state.scale); - hashParamTable[806].hash = 0xdf27dd88; - hashParamTable[806].ref = &device.ccs.current[0].settings.transfer.raw[15]; - hashParamTable[806].size = sizeof(device.ccs.current[0].settings.transfer.raw[15]); - hashParamTable[807].hash = 0xdf28a1b5; - hashParamTable[807].ref = &device.counters.dither.state.delta[5]; - hashParamTable[807].size = sizeof(device.counters.dither.state.delta[5]); - hashParamTable[808].hash = 0xdf36e262; - hashParamTable[808].ref = &device.isacs.output.settings.transfer.code[11]; - hashParamTable[808].size = sizeof(device.isacs.output.settings.transfer.code[11]); - hashParamTable[809].hash = 0xdfa31407; - hashParamTable[809].ref = &device.sequencer.output.analog.settings.transfer.code[0]; - hashParamTable[809].size = sizeof(device.sequencer.output.analog.settings.transfer.code[0]); - hashParamTable[810].hash = 0xdfb1816; - hashParamTable[810].ref = &device.counters.dither.state.delta[12]; - hashParamTable[810].size = sizeof(device.counters.dither.state.delta[12]); - hashParamTable[811].hash = 0xdfb1e2e8; - hashParamTable[811].ref = &device.dither.frequency.settings.transfer.correction[5]; - hashParamTable[811].size = sizeof(device.dither.frequency.settings.transfer.correction[5]); - hashParamTable[812].hash = 0xdfb59769; - hashParamTable[812].ref = &device.tss.gradient.settings.transfer.raw[15]; - hashParamTable[812].size = sizeof(device.tss.gradient.settings.transfer.raw[15]); - hashParamTable[813].hash = 0xe0354248; - hashParamTable[813].ref = &device.ccs.current[0].state.sum; - hashParamTable[813].size = sizeof(device.ccs.current[0].state.sum); - hashParamTable[814].hash = 0xe0dc3b87; - hashParamTable[814].ref = &device.plcs.bias.state.counter; - hashParamTable[814].size = sizeof(device.plcs.bias.state.counter); - hashParamTable[815].hash = 0xe0ee5765; - hashParamTable[815].ref = &device.sequencer.sampler.settings.sequence[10]; - hashParamTable[815].size = sizeof(device.sequencer.sampler.settings.sequence[10]); - hashParamTable[816].hash = 0xe184f3dc; - hashParamTable[816].ref = &device.tss.temperature.settings.transfer.celsius[14]; - hashParamTable[816].size = sizeof(device.tss.temperature.settings.transfer.celsius[14]); - hashParamTable[817].hash = 0xe19d675c; - hashParamTable[817].ref = &device.sequencer.sampler.settings.sequence[0]; - hashParamTable[817].size = sizeof(device.sequencer.sampler.settings.sequence[0]); - hashParamTable[818].hash = 0xe1c644d8; - hashParamTable[818].ref = &device.dither.frequency.settings.transfer.error[5]; - hashParamTable[818].size = sizeof(device.dither.frequency.settings.transfer.error[5]); - hashParamTable[819].hash = 0xe232bc2d; - hashParamTable[819].ref = &device.isacs.output.settings.transfer.code[1]; - hashParamTable[819].size = sizeof(device.isacs.output.settings.transfer.code[1]); - hashParamTable[820].hash = 0xe2a8e93c; - hashParamTable[820].ref = &device.sequencer.sampler.settings.sequence[20]; - hashParamTable[820].size = sizeof(device.sequencer.sampler.settings.sequence[20]); - hashParamTable[821].hash = 0xe2e725d0; - hashParamTable[821].ref = &device.sequencer.output.analog.settings.transfer.voltage[11]; - hashParamTable[821].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[11]); - hashParamTable[822].hash = 0xe2f21874; - hashParamTable[822].ref = &device.plcs.reset.down.settings.environment.temperature[12]; - hashParamTable[822].size = sizeof(device.plcs.reset.down.settings.environment.temperature[12]); - hashParamTable[823].hash = 0xe3275ccb; - hashParamTable[823].ref = &device.plcs.reset.up.settings.environment.duration[7]; - hashParamTable[823].size = sizeof(device.plcs.reset.up.settings.environment.duration[7]); - hashParamTable[824].hash = 0xe34cfca4; - hashParamTable[824].ref = &device.dither.detector.settings.transfer.raw[9]; - hashParamTable[824].size = sizeof(device.dither.detector.settings.transfer.raw[9]); - hashParamTable[825].hash = 0xe369804d; - hashParamTable[825].ref = &device.user.port.settings.baud; - hashParamTable[825].size = sizeof(device.user.port.settings.baud); - hashParamTable[826].hash = 0xe36a830b; - hashParamTable[826].ref = &device.sequencer.sampler.settings.sequence[30]; - hashParamTable[826].size = sizeof(device.sequencer.sampler.settings.sequence[30]); - hashParamTable[827].hash = 0xe431dbcd; - hashParamTable[827].ref = &device.isacs.regulator.state.correction; - hashParamTable[827].size = sizeof(device.isacs.regulator.state.correction); - hashParamTable[828].hash = 0xe49c97ed; - hashParamTable[828].ref = &device.isacs.potentiometers.settings.b; - hashParamTable[828].size = sizeof(device.isacs.potentiometers.settings.b); - hashParamTable[829].hash = 0xe55b8142; - hashParamTable[829].ref = &device.plcs.detector.state.in[0]; - hashParamTable[829].size = sizeof(device.plcs.detector.state.in[0]); - hashParamTable[830].hash = 0xe56a7401; - hashParamTable[830].ref = &device.isacs.regulator.settings.transfer.error[10]; - hashParamTable[830].size = sizeof(device.isacs.regulator.settings.transfer.error[10]); - hashParamTable[831].hash = 0xe5d7816b; - hashParamTable[831].ref = &device.dither.detector.settings.transfer.restored[6]; - hashParamTable[831].size = sizeof(device.dither.detector.settings.transfer.restored[6]); - hashParamTable[832].hash = 0xe60d989f; - hashParamTable[832].ref = &device.isacs.output.state.voltage; - hashParamTable[832].size = sizeof(device.isacs.output.state.voltage); - hashParamTable[833].hash = 0xe61af4e; - hashParamTable[833].ref = &device.sequencer.output.analog.settings.transfer.code[9]; - hashParamTable[833].size = sizeof(device.sequencer.output.analog.settings.transfer.code[9]); - hashParamTable[834].hash = 0xe625958e; - hashParamTable[834].ref = &device.sequencer.sampler.settings.sequence[40]; - hashParamTable[834].size = sizeof(device.sequencer.sampler.settings.sequence[40]); - hashParamTable[835].hash = 0xe64ee88e; - hashParamTable[835].ref = &device.plcs.output.settings.transfer.voltage[1]; - hashParamTable[835].size = sizeof(device.plcs.output.settings.transfer.voltage[1]); - hashParamTable[836].hash = 0xe64f1401; - hashParamTable[836].ref = &device.dither.cycle.state.pin1; - hashParamTable[836].size = sizeof(device.dither.cycle.state.pin1); - hashParamTable[837].hash = 0xe6854dbc; - hashParamTable[837].ref = &device.ccs.current[0].settings.transfer.mA[11]; - hashParamTable[837].size = sizeof(device.ccs.current[0].settings.transfer.mA[11]); - hashParamTable[838].hash = 0xe6b03b71; - hashParamTable[838].ref = &device.tss.temperature.settings.transfer.raw[13]; - hashParamTable[838].size = sizeof(device.tss.temperature.settings.transfer.raw[13]); - hashParamTable[839].hash = 0xe723ebb2; - hashParamTable[839].ref = &device.sequencer.sampler.state.sample[1]; - hashParamTable[839].size = sizeof(device.sequencer.sampler.state.sample[1]); - hashParamTable[840].hash = 0xe74ab9c4; - hashParamTable[840].ref = &device.tss.gradient.settings.transfer.celsius[9]; - hashParamTable[840].size = sizeof(device.tss.gradient.settings.transfer.celsius[9]); - hashParamTable[841].hash = 0xe7a2d87; - hashParamTable[841].ref = &device.counters.latch.state.format; - hashParamTable[841].size = sizeof(device.counters.latch.state.format); - hashParamTable[842].hash = 0xe7e7ffb9; - hashParamTable[842].ref = &device.sequencer.sampler.settings.sequence[50]; - hashParamTable[842].size = sizeof(device.sequencer.sampler.settings.sequence[50]); - hashParamTable[843].hash = 0xe7f0684b; - hashParamTable[843].ref = &device.isacs.regulator.settings.start.reference; - hashParamTable[843].size = sizeof(device.isacs.regulator.settings.start.reference); - hashParamTable[844].hash = 0xe82a6d86; - hashParamTable[844].ref = &device.tss.gradient.settings.transfer.raw[1]; - hashParamTable[844].size = sizeof(device.tss.gradient.settings.transfer.raw[1]); - hashParamTable[845].hash = 0xe8505076; - hashParamTable[845].ref = &device.plcs.bias.settings.transfer.normalized[1]; - hashParamTable[845].size = sizeof(device.plcs.bias.settings.transfer.normalized[1]); - hashParamTable[846].hash = 0xe897a1a1; - hashParamTable[846].ref = &device.plcs.regulator.settings.transfer.error[0]; - hashParamTable[846].size = sizeof(device.plcs.regulator.settings.transfer.error[0]); - hashParamTable[847].hash = 0xe8d8c11a; - hashParamTable[847].ref = &device.plcs.reset.down.settings.environment.target[9]; - hashParamTable[847].size = sizeof(device.plcs.reset.down.settings.environment.target[9]); - hashParamTable[848].hash = 0xe9543240; - hashParamTable[848].ref = &device.plcs.reset.down.settings.environment.temperature[1]; - hashParamTable[848].size = sizeof(device.plcs.reset.down.settings.environment.temperature[1]); - hashParamTable[849].hash = 0xe9c143c; - hashParamTable[849].ref = &device.service.port.settings.baud; - hashParamTable[849].size = sizeof(device.service.port.settings.baud); - hashParamTable[850].hash = 0xe9feab5; - hashParamTable[850].ref = &device.dither.frequency.state.min; - hashParamTable[850].size = sizeof(device.dither.frequency.state.min); - hashParamTable[851].hash = 0xeae5bf6a; - hashParamTable[851].ref = &device.controller.I2C.state.CON0; - hashParamTable[851].size = sizeof(device.controller.I2C.state.CON0); - hashParamTable[852].hash = 0xeb136034; - hashParamTable[852].ref = &device.tss.temperature.settings.transfer.celsius[2]; - hashParamTable[852].size = sizeof(device.tss.temperature.settings.transfer.celsius[2]); - hashParamTable[853].hash = 0xeb60d948; - hashParamTable[853].ref = &device.sequencer.output.analog.settings.transfer.voltage[1]; - hashParamTable[853].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[1]); - hashParamTable[854].hash = 0xec497f84; - hashParamTable[854].ref = &device.counters.dither.state.delta[29]; - hashParamTable[854].size = sizeof(device.counters.dither.state.delta[29]); - hashParamTable[855].hash = 0xed0080e0; - hashParamTable[855].ref = &device.isacs.output.settings.transfer.code[13]; - hashParamTable[855].size = sizeof(device.isacs.output.settings.transfer.code[13]); - hashParamTable[856].hash = 0xed1ec337; - hashParamTable[856].ref = &device.counters.dither.state.delta[7]; - hashParamTable[856].size = sizeof(device.counters.dither.state.delta[7]); - hashParamTable[857].hash = 0xed3e222c; - hashParamTable[857].ref = &device.plcs.reset.down.settings.environment.duration[1]; - hashParamTable[857].size = sizeof(device.plcs.reset.down.settings.environment.duration[1]); - hashParamTable[858].hash = 0xed87806a; - hashParamTable[858].ref = &device.dither.frequency.settings.transfer.correction[7]; - hashParamTable[858].size = sizeof(device.dither.frequency.settings.transfer.correction[7]); - hashParamTable[859].hash = 0xed95321c; - hashParamTable[859].ref = &device.isacs.potentiometers.state.b; - hashParamTable[859].size = sizeof(device.isacs.potentiometers.state.b); - hashParamTable[860].hash = 0xed957685; - hashParamTable[860].ref = &device.sequencer.output.analog.settings.transfer.code[2]; - hashParamTable[860].size = sizeof(device.sequencer.output.analog.settings.transfer.code[2]); - hashParamTable[861].hash = 0xed9a9821; - hashParamTable[861].ref = &device.plcs.output.settings.transfer.voltage[14]; - hashParamTable[861].size = sizeof(device.plcs.output.settings.transfer.voltage[14]); - hashParamTable[862].hash = 0xee0fc1dd; - hashParamTable[862].ref = &device.counters.dither.state.delta[19]; - hashParamTable[862].size = sizeof(device.counters.dither.state.delta[19]); - hashParamTable[863].hash = 0xee18dcfe; - hashParamTable[863].ref = &device.ccs.current[0].settings.transfer.mA[3]; - hashParamTable[863].size = sizeof(device.ccs.current[0].settings.transfer.mA[3]); - hashParamTable[864].hash = 0xee55b46c; - hashParamTable[864].ref = &device.plcs.bias.settings.transfer.raw[13]; - hashParamTable[864].size = sizeof(device.plcs.bias.settings.transfer.raw[13]); - hashParamTable[865].hash = 0xee7464eb; - hashParamTable[865].ref = &device.plcs.regulator.settings.transfer.correction[11]; - hashParamTable[865].size = sizeof(device.plcs.regulator.settings.transfer.correction[11]); - hashParamTable[866].hash = 0xef2df638; - hashParamTable[866].ref = &device.isacs.input.settings.transfer.raw[15]; - hashParamTable[866].size = sizeof(device.isacs.input.settings.transfer.raw[15]); - hashParamTable[867].hash = 0xefa43838; - hashParamTable[867].ref = &device.plcs.reset.up.settings.environment.duration[14]; - hashParamTable[867].size = sizeof(device.plcs.reset.up.settings.environment.duration[14]); - hashParamTable[868].hash = 0xf04f0301; - hashParamTable[868].ref = &device.plcs.reset.down.settings.environment.temperature[0]; - hashParamTable[868].size = sizeof(device.plcs.reset.down.settings.environment.temperature[0]); - hashParamTable[869].hash = 0xf1315cc7; - hashParamTable[869].ref = &device.tss.gradient.settings.transfer.raw[0]; - hashParamTable[869].size = sizeof(device.tss.gradient.settings.transfer.raw[0]); - hashParamTable[870].hash = 0xf14b6137; - hashParamTable[870].ref = &device.plcs.bias.settings.transfer.normalized[0]; - hashParamTable[870].size = sizeof(device.plcs.bias.settings.transfer.normalized[0]); - hashParamTable[871].hash = 0xf18c90e0; - hashParamTable[871].ref = &device.plcs.regulator.settings.transfer.error[1]; - hashParamTable[871].size = sizeof(device.plcs.regulator.settings.transfer.error[1]); - hashParamTable[872].hash = 0xf1c3f05b; - hashParamTable[872].ref = &device.plcs.reset.down.settings.environment.target[8]; - hashParamTable[872].size = sizeof(device.plcs.reset.down.settings.environment.target[8]); - hashParamTable[873].hash = 0xf2085175; - hashParamTable[873].ref = &device.tss.temperature.settings.transfer.celsius[3]; - hashParamTable[873].size = sizeof(device.tss.temperature.settings.transfer.celsius[3]); - hashParamTable[874].hash = 0xf27be809; - hashParamTable[874].ref = &device.sequencer.output.analog.settings.transfer.voltage[0]; - hashParamTable[874].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[0]); - hashParamTable[875].hash = 0xf34ae6a; - hashParamTable[875].ref = &device.plcs.output.settings.transfer.code[1]; - hashParamTable[875].size = sizeof(device.plcs.output.settings.transfer.code[1]); - hashParamTable[876].hash = 0xf405f276; - hashParamTable[876].ref = &device.counters.dither.state.delta[6]; - hashParamTable[876].size = sizeof(device.counters.dither.state.delta[6]); - hashParamTable[877].hash = 0xf41bb1a1; - hashParamTable[877].ref = &device.isacs.output.settings.transfer.code[12]; - hashParamTable[877].size = sizeof(device.isacs.output.settings.transfer.code[12]); - hashParamTable[878].hash = 0xf425136d; - hashParamTable[878].ref = &device.plcs.reset.down.settings.environment.duration[0]; - hashParamTable[878].size = sizeof(device.plcs.reset.down.settings.environment.duration[0]); - hashParamTable[879].hash = 0xf481a960; - hashParamTable[879].ref = &device.plcs.output.settings.transfer.voltage[15]; - hashParamTable[879].size = sizeof(device.plcs.output.settings.transfer.voltage[15]); - hashParamTable[880].hash = 0xf48e47c4; - hashParamTable[880].ref = &device.sequencer.output.analog.settings.transfer.code[3]; - hashParamTable[880].size = sizeof(device.sequencer.output.analog.settings.transfer.code[3]); - hashParamTable[881].hash = 0xf49cb12b; - hashParamTable[881].ref = &device.dither.frequency.settings.transfer.correction[6]; - hashParamTable[881].size = sizeof(device.dither.frequency.settings.transfer.correction[6]); - hashParamTable[882].hash = 0xf5502fff; - hashParamTable[882].ref = &device.plcs.reference.settings.delta; - hashParamTable[882].size = sizeof(device.plcs.reference.settings.delta); - hashParamTable[883].hash = 0xf5524ec5; - hashParamTable[883].ref = &device.counters.dither.state.delta[28]; - hashParamTable[883].size = sizeof(device.counters.dither.state.delta[28]); - hashParamTable[884].hash = 0xf636c779; - hashParamTable[884].ref = &device.isacs.input.settings.transfer.raw[14]; - hashParamTable[884].size = sizeof(device.isacs.input.settings.transfer.raw[14]); - hashParamTable[885].hash = 0xf6bf0979; - hashParamTable[885].ref = &device.plcs.reset.up.settings.environment.duration[15]; - hashParamTable[885].size = sizeof(device.plcs.reset.up.settings.environment.duration[15]); - hashParamTable[886].hash = 0xf703edbf; - hashParamTable[886].ref = &device.ccs.current[0].settings.transfer.mA[2]; - hashParamTable[886].size = sizeof(device.ccs.current[0].settings.transfer.mA[2]); - hashParamTable[887].hash = 0xf714f09c; - hashParamTable[887].ref = &device.counters.dither.state.delta[18]; - hashParamTable[887].size = sizeof(device.counters.dither.state.delta[18]); - hashParamTable[888].hash = 0xf74e852d; - hashParamTable[888].ref = &device.plcs.bias.settings.transfer.raw[12]; - hashParamTable[888].size = sizeof(device.plcs.bias.settings.transfer.raw[12]); - hashParamTable[889].hash = 0xf76f55aa; - hashParamTable[889].ref = &device.plcs.regulator.settings.transfer.correction[10]; - hashParamTable[889].size = sizeof(device.plcs.regulator.settings.transfer.correction[10]); - hashParamTable[890].hash = 0xf7b52f6; - hashParamTable[890].ref = &device.plcs.regulator.settings.transfer.correction[6]; - hashParamTable[890].size = sizeof(device.plcs.regulator.settings.transfer.correction[6]); - hashParamTable[891].hash = 0xf886561d; - hashParamTable[891].ref = &device.sequencer.sampler.settings.sequence[1]; - hashParamTable[891].size = sizeof(device.sequencer.sampler.settings.sequence[1]); - hashParamTable[892].hash = 0xf89fc29d; - hashParamTable[892].ref = &device.tss.temperature.settings.transfer.celsius[15]; - hashParamTable[892].size = sizeof(device.tss.temperature.settings.transfer.celsius[15]); - hashParamTable[893].hash = 0xf8dd7599; - hashParamTable[893].ref = &device.dither.frequency.settings.transfer.error[4]; - hashParamTable[893].size = sizeof(device.dither.frequency.settings.transfer.error[4]); - hashParamTable[894].hash = 0xf9a06cb9; - hashParamTable[894].ref = &device.counters.latch.state.enabled; - hashParamTable[894].size = sizeof(device.counters.latch.state.enabled); - hashParamTable[895].hash = 0xf9b4d01; - hashParamTable[895].ref = &device.counters.meander.state.b; - hashParamTable[895].size = sizeof(device.counters.meander.state.b); - hashParamTable[896].hash = 0xf9f56624; - hashParamTable[896].ref = &device.sequencer.sampler.settings.sequence[11]; - hashParamTable[896].size = sizeof(device.sequencer.sampler.settings.sequence[11]); - hashParamTable[897].hash = 0xfa3c6d8a; - hashParamTable[897].ref = &device.plcs.reset.up.settings.environment.duration[6]; - hashParamTable[897].size = sizeof(device.plcs.reset.up.settings.environment.duration[6]); - hashParamTable[898].hash = 0xfa57cde5; - hashParamTable[898].ref = &device.dither.detector.settings.transfer.raw[8]; - hashParamTable[898].size = sizeof(device.dither.detector.settings.transfer.raw[8]); - hashParamTable[899].hash = 0xfa71b24a; - hashParamTable[899].ref = &device.sequencer.sampler.settings.sequence[31]; - hashParamTable[899].size = sizeof(device.sequencer.sampler.settings.sequence[31]); - hashParamTable[900].hash = 0xfb298d6c; - hashParamTable[900].ref = &device.isacs.output.settings.transfer.code[0]; - hashParamTable[900].size = sizeof(device.isacs.output.settings.transfer.code[0]); - hashParamTable[901].hash = 0xfbb3d87d; - hashParamTable[901].ref = &device.sequencer.sampler.settings.sequence[21]; - hashParamTable[901].size = sizeof(device.sequencer.sampler.settings.sequence[21]); - hashParamTable[902].hash = 0xfbbacb82; - hashParamTable[902].ref = &device.dither.pulse.state.fall; - hashParamTable[902].size = sizeof(device.dither.pulse.state.fall); - hashParamTable[903].hash = 0xfbc7398; - hashParamTable[903].ref = &device.counters.latch.settings.signal; - hashParamTable[903].size = sizeof(device.counters.latch.settings.signal); - hashParamTable[904].hash = 0xfbda64f; - hashParamTable[904].ref = &device.counters.dither.state.delta[22]; - hashParamTable[904].size = sizeof(device.counters.dither.state.delta[22]); - hashParamTable[905].hash = 0xfbe92935; - hashParamTable[905].ref = &device.plcs.reset.down.settings.environment.temperature[13]; - hashParamTable[905].size = sizeof(device.plcs.reset.down.settings.environment.temperature[13]); - hashParamTable[906].hash = 0xfbfc1491; - hashParamTable[906].ref = &device.sequencer.output.analog.settings.transfer.voltage[10]; - hashParamTable[906].size = sizeof(device.sequencer.output.analog.settings.transfer.voltage[10]); - hashParamTable[907].hash = 0xfc0531d4; - hashParamTable[907].ref = &device.controller.QEI.state.delta; - hashParamTable[907].size = sizeof(device.controller.QEI.state.delta); - hashParamTable[908].hash = 0xfc40b003; - hashParamTable[908].ref = &device.plcs.detector.state.in[1]; - hashParamTable[908].size = sizeof(device.plcs.detector.state.in[1]); - hashParamTable[909].hash = 0xfc714540; - hashParamTable[909].ref = &device.isacs.regulator.settings.transfer.error[11]; - hashParamTable[909].size = sizeof(device.isacs.regulator.settings.transfer.error[11]); - hashParamTable[910].hash = 0xfcba70a1; - hashParamTable[910].ref = &device.sequencer.sampler.settings.sequence[61]; - hashParamTable[910].size = sizeof(device.sequencer.sampler.settings.sequence[61]); - hashParamTable[911].hash = 0xfcccb02a; - hashParamTable[911].ref = &device.dither.detector.settings.transfer.restored[7]; - hashParamTable[911].size = sizeof(device.dither.detector.settings.transfer.restored[7]); - hashParamTable[912].hash = 0xfceba7ea; - hashParamTable[912].ref = &device.controller.uart[1].state.DLL; - hashParamTable[912].size = sizeof(device.controller.uart[1].state.DLL); - hashParamTable[913].hash = 0xfd213a6a; - hashParamTable[913].ref = &device.counters.dither.state.rate; - hashParamTable[913].size = sizeof(device.counters.dither.state.rate); - hashParamTable[914].hash = 0xfe38daf3; - hashParamTable[914].ref = &device.sequencer.sampler.state.sample[0]; - hashParamTable[914].size = sizeof(device.sequencer.sampler.state.sample[0]); - hashParamTable[915].hash = 0xfe518885; - hashParamTable[915].ref = &device.tss.gradient.settings.transfer.celsius[8]; - hashParamTable[915].size = sizeof(device.tss.gradient.settings.transfer.celsius[8]); - hashParamTable[916].hash = 0xfefccef8; - hashParamTable[916].ref = &device.sequencer.sampler.settings.sequence[51]; - hashParamTable[916].size = sizeof(device.sequencer.sampler.settings.sequence[51]); - hashParamTable[917].hash = 0xff3ea4cf; - hashParamTable[917].ref = &device.sequencer.sampler.settings.sequence[41]; - hashParamTable[917].size = sizeof(device.sequencer.sampler.settings.sequence[41]); - hashParamTable[918].hash = 0xff55d9cf; - hashParamTable[918].ref = &device.plcs.output.settings.transfer.voltage[0]; - hashParamTable[918].size = sizeof(device.plcs.output.settings.transfer.voltage[0]); - hashParamTable[919].hash = 0xff61c20; - hashParamTable[919].ref = &device.dither.frequency.settings.transfer.correction[10]; - hashParamTable[919].size = sizeof(device.dither.frequency.settings.transfer.correction[10]); - hashParamTable[920].hash = 0xff9e7cfd; - hashParamTable[920].ref = &device.ccs.current[0].settings.transfer.mA[10]; - hashParamTable[920].size = sizeof(device.ccs.current[0].settings.transfer.mA[10]); - hashParamTable[921].hash = 0xffab0a30; - hashParamTable[921].ref = &device.tss.temperature.settings.transfer.raw[12]; - hashParamTable[921].size = sizeof(device.tss.temperature.settings.transfer.raw[12]); -} - -void InitHashFuncTable(void) { - hashFuncTable[0].hash = 0x71f16e12; - hashFuncTable[0].ref = DeviceFlashWriteAll; - hashFuncTable[0].resultSize = sizeof(void); - hashFuncTable[0].paramCount = 0; - hashFuncTable[1].hash = 0xd84a94cf; - hashFuncTable[1].ref = DeviceFlashReadAll; - hashFuncTable[1].resultSize = sizeof(void); - hashFuncTable[1].paramCount = 0; - hashFuncTable[2].hash = 0xd93b80f4; - hashFuncTable[2].ref = DeviceStartLightUp; - hashFuncTable[2].resultSize = sizeof(void); - hashFuncTable[2].paramCount = 0; -} -/* -int main (void) -{ - //Device initialization - DeviceInit(); - - //Service port communication - sprintf(device.service.buffer,"...GL start...\r\n"); WriteConcole(); - sprintf(device.service.buffer,"Compiled: %s %s\r\n",__DATE__, __TIME__ ); WriteConcole(); - sprintf(device.service.buffer,"SystemCoreClock: %d\r\n",SystemCoreClock1); WriteConcole(); - sprintf(device.service.buffer,"Service port: %03d %03d\r\n",device.controller.uart[0].state.DLM, device.controller.uart[0].state.DLL); WriteConcole(); - sprintf(device.service.buffer,"Host port: %03d %03d\r\n",device.controller.uart[1].state.DLM, device.controller.uart[1].state.DLL); WriteConcole(); - - //Start device operation - DeviceStart(); - //Main cycle - while ( 1 ) { - deviceCycle(); - } -} -*/ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 Device.h --- a/Device.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -#ifndef __DEVICE_H__ -#define __DEVICE_H__ - -#include "LPC17xx.h" -//#include "system_LPC17xx.h" -#include "DeviceController.h" -//#include "DeviceDAC.h" -#include "DeviceUser.h" -#include "DeviceCounters.h" -#include "DeviceDither.h" -#include "DeviceLightUp.h" -#include "DeviceISACS.h" -#include "DeviceSequencer.h" -#include "DevicePLCS.h" -#include "DeviceTSS.h" -#include "DeviceCCS.h" -#include "DeviceErrorModel.h" -//#include "DeviceDebug.h" - -//Device service communication interface typedefs -typedef struct _DeviceService { - char buffer[512]; - uint16_t position; //Transmission position - DeviceServicePort port; -} DeviceService; - -//Device measurement cycle typedefs -typedef struct _DeviceMeasurementCycle { - uint32_t length; //Measurement cycle length - uint32_t counter; //Measurement cycle counter -} DeviceMeasurementCycle; - -//Device regular cycle typedefs -typedef struct _DeviceRegularCycle { - volatile uint32_t event1Hz; - volatile uint32_t event500Hz; - volatile uint32_t event1K; - volatile uint32_t event10K; - volatile uint32_t event100K; - - volatile uint32_t time100K; - volatile uint32_t time10K; - volatile uint32_t time1K; - volatile uint32_t time500Hz; - volatile uint32_t time1Hz; -} DeviceRegularCycle; - -//Device sensor typedefs -typedef struct _DeviceSensorSettings { - //Device ID - uint16_t id; - //Block ID - uint16_t block; -} DeviceSensorSettings; - -typedef struct _DeviceSensorState { -} DeviceSensorState; - -typedef struct _DeviceSensor { - DeviceSensorSettings settings; - DeviceSensorState state; -} DeviceSensor; - -//Device typedefs -typedef struct _Device { - //Measurement cycle - DeviceMeasurementCycle measurement; - //Control cycle - DeviceRegularCycle regular; - //Counters - DeviceCounters counters; - //Controller - DeviceController controller; - //Interfaces - DeviceService service; //Service communication interface - asynchronous serial port 0 - DeviceUser user; //User communication interface - asynchronous serial port 1 - //Units - DeviceSensor sensor; //Sensor info - DeviceLightUp lightUp; //Light-up system - DeviceDither dither; //Dither system - DeviceISACS isacs; //Information signal amplitude stabilizer - DeviceSequencer sequencer; //Sequencer - DevicePathLengthControlSystem plcs; //Path length control system - DeviceTSS tss; //Temperature sense system - DeviceCCS ccs; //Current control system - DeviceEM em; //Error model - #ifdef __DEVICE_DEBUG_H__ - DeviceDebug debug; - #endif -} Device; - -typedef struct _HashParam { - uint32_t hash; - void * ref; - uint32_t size; -} HashParam; - -#define HASH_PARAM_COUNT 922 - -typedef struct _HashFunc { - uint32_t hash; - void * ref; - uint32_t resultSize; - uint32_t paramCount; -} HashFunc; - -#define HASH_FUNC_COUNT 3 - -void DeviceInitDefaultSettings(void); -void DeviceInitState(void); - -void DeviceInit(void); -void DeviceStart(void); - -void InitHashParamTable(void); -void InitHashFuncTable(void); - -void DeviceRegularEvent1Hz(void); -void DeviceRegularEvent500Hz(void); -void DeviceRegularEvent1KHz(void); -void DeviceRegularEvent10KHz(void); -void DeviceRegularEvent100KHz(void); -void DeviceMeasurementInterruptHandler(void); -void DeviceRegularInterruptHandler(void); - -#endif /* __DEVICE_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceCCS.c --- a/DeviceCCS.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitCCSDefaultSettings(void){ - //TODO: real values - device.ccs.current[0].settings.transfer.points = 16; - device.ccs.current[0].settings.transfer.raw[0] = 0x0; //0.0 - device.ccs.current[0].settings.transfer.mA[0] = 0x0; //0.0 - device.ccs.current[0].settings.transfer.raw[1] = 0x1111111; //273.06666666666666 - device.ccs.current[0].settings.transfer.mA[1] = 0x6aaaa; //6.666666666666667 - device.ccs.current[0].settings.transfer.raw[2] = 0x2222222; //546.1333333333333 - device.ccs.current[0].settings.transfer.mA[2] = 0xd5555; //13.333333333333334 - device.ccs.current[0].settings.transfer.raw[3] = 0x3333333; //819.2 - device.ccs.current[0].settings.transfer.mA[3] = 0x140000; //20.0 - device.ccs.current[0].settings.transfer.raw[4] = 0x4444444; //1092.2666666666667 - device.ccs.current[0].settings.transfer.mA[4] = 0x1aaaaa; //26.666666666666668 - device.ccs.current[0].settings.transfer.raw[5] = 0x5555555; //1365.3333333333333 - device.ccs.current[0].settings.transfer.mA[5] = 0x215555; //33.333333333333336 - device.ccs.current[0].settings.transfer.raw[6] = 0x6666666; //1638.4 - device.ccs.current[0].settings.transfer.mA[6] = 0x280000; //40.0 - device.ccs.current[0].settings.transfer.raw[7] = 0x7777777; //1911.4666666666667 - device.ccs.current[0].settings.transfer.mA[7] = 0x2eaaaa; //46.66666666666667 - device.ccs.current[0].settings.transfer.raw[8] = 0x8888888; //2184.5333333333333 - device.ccs.current[0].settings.transfer.mA[8] = 0x355555; //53.333333333333336 - device.ccs.current[0].settings.transfer.raw[9] = 0x9999999; //2457.6 - device.ccs.current[0].settings.transfer.mA[9] = 0x3c0000; //60.0 - device.ccs.current[0].settings.transfer.raw[10] = 0xaaaaaaa; //2730.6666666666665 - device.ccs.current[0].settings.transfer.mA[10] = 0x42aaaa; //66.66666666666667 - device.ccs.current[0].settings.transfer.raw[11] = 0xbbbbbbb; //3003.733333333333 - device.ccs.current[0].settings.transfer.mA[11] = 0x495555; //73.33333333333334 - device.ccs.current[0].settings.transfer.raw[12] = 0xccccccc; //3276.8 - device.ccs.current[0].settings.transfer.mA[12] = 0x500000; //80.0 - device.ccs.current[0].settings.transfer.raw[13] = 0xddddddd; //3549.866666666667 - device.ccs.current[0].settings.transfer.mA[13] = 0x56aaaa; //86.66666666666667 - device.ccs.current[0].settings.transfer.raw[14] = 0xeeeeeee; //3822.9333333333334 - device.ccs.current[0].settings.transfer.mA[14] = 0x5d5555; //93.33333333333334 - device.ccs.current[0].settings.transfer.raw[15] = 0x10000000; //4096.0 - device.ccs.current[0].settings.transfer.mA[15] = 0x640000; //100.0 - - //TODO: real values - device.ccs.current[1].settings.transfer.points = 16; - device.ccs.current[1].settings.transfer.raw[0] = 0x0; //0.0 - device.ccs.current[1].settings.transfer.mA[0] = 0x0; //0.0 - device.ccs.current[1].settings.transfer.raw[1] = 0x1111111; //273.06666666666666 - device.ccs.current[1].settings.transfer.mA[1] = 0x6aaaa; //6.666666666666667 - device.ccs.current[1].settings.transfer.raw[2] = 0x2222222; //546.1333333333333 - device.ccs.current[1].settings.transfer.mA[2] = 0xd5555; //13.333333333333334 - device.ccs.current[1].settings.transfer.raw[3] = 0x3333333; //819.2 - device.ccs.current[1].settings.transfer.mA[3] = 0x140000; //20.0 - device.ccs.current[1].settings.transfer.raw[4] = 0x4444444; //1092.2666666666667 - device.ccs.current[1].settings.transfer.mA[4] = 0x1aaaaa; //26.666666666666668 - device.ccs.current[1].settings.transfer.raw[5] = 0x5555555; //1365.3333333333333 - device.ccs.current[1].settings.transfer.mA[5] = 0x215555; //33.333333333333336 - device.ccs.current[1].settings.transfer.raw[6] = 0x6666666; //1638.4 - device.ccs.current[1].settings.transfer.mA[6] = 0x280000; //40.0 - device.ccs.current[1].settings.transfer.raw[7] = 0x7777777; //1911.4666666666667 - device.ccs.current[1].settings.transfer.mA[7] = 0x2eaaaa; //46.66666666666667 - device.ccs.current[1].settings.transfer.raw[8] = 0x8888888; //2184.5333333333333 - device.ccs.current[1].settings.transfer.mA[8] = 0x355555; //53.333333333333336 - device.ccs.current[1].settings.transfer.raw[9] = 0x9999999; //2457.6 - device.ccs.current[1].settings.transfer.mA[9] = 0x3c0000; //60.0 - device.ccs.current[1].settings.transfer.raw[10] = 0xaaaaaaa; //2730.6666666666665 - device.ccs.current[1].settings.transfer.mA[10] = 0x42aaaa; //66.66666666666667 - device.ccs.current[1].settings.transfer.raw[11] = 0xbbbbbbb; //3003.733333333333 - device.ccs.current[1].settings.transfer.mA[11] = 0x495555; //73.33333333333334 - device.ccs.current[1].settings.transfer.raw[12] = 0xccccccc; //3276.8 - device.ccs.current[1].settings.transfer.mA[12] = 0x500000; //80.0 - device.ccs.current[1].settings.transfer.raw[13] = 0xddddddd; //3549.866666666667 - device.ccs.current[1].settings.transfer.mA[13] = 0x56aaaa; //86.66666666666667 - device.ccs.current[1].settings.transfer.raw[14] = 0xeeeeeee; //3822.9333333333334 - device.ccs.current[1].settings.transfer.mA[14] = 0x5d5555; //93.33333333333334 - device.ccs.current[1].settings.transfer.raw[15] = 0x10000000; //4096.0 - device.ccs.current[1].settings.transfer.mA[15] = 0x640000; //100.0 -} - -void InitCCSState(void) { - device.ccs.current[0].state.sum = 0; - device.ccs.current[0].state.raw = 0; - device.ccs.current[0].state.mA = ccsCurrent(0, device.ccs.current[0].state.raw); - - device.ccs.current[1].state.sum = 0; - device.ccs.current[1].state.raw = 0; - device.ccs.current[1].state.mA = ccsCurrent(1, device.ccs.current[0].state.raw); -} - -void DeviceStartCCS(void) { -} - -int32_t ccsInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t ccsCurrent(uint32_t channel, uint32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.ccs.current[channel].settings.transfer.points; i++) { - r1 = device.ccs.current[channel].settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.ccs.current[channel].settings.transfer.mA[i - 1]; - } - - r2 = device.ccs.current[channel].settings.transfer.raw[i]; - if (raw < r2) { - int32_t c1 = device.ccs.current[channel].settings.transfer.mA[i - 1]; - int32_t c2 = device.ccs.current[channel].settings.transfer.mA[i]; - return ccsInterpolate(raw, r1, r2, c1, c2); - } - } - return device.ccs.current[channel].settings.transfer.mA[device.ccs.current[channel].settings.transfer.points - 1]; -} - -void ccsProcess(void) { - device.ccs.current[0].state.sum += device.controller.SSP.in[1]; - device.ccs.current[1].state.sum += device.controller.SSP.in[2]; - - if (device.measurement.counter == 31) { - device.ccs.current[0].state.raw = device.ccs.current[0].state.sum >> 5; - device.ccs.current[0].state.mA = ccsCurrent(0, device.ccs.current[0].state.raw); - device.ccs.current[0].state.sum = 0; - device.ccs.current[1].state.raw = device.ccs.current[1].state.sum >> 5; - device.ccs.current[1].state.mA = ccsCurrent(1, device.ccs.current[1].state.raw); - device.ccs.current[1].state.sum = 0; - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceCCS.h --- a/DeviceCCS.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -#ifndef __DEVICE_CCS_H__ -#define __DEVICE_CCS_H__ - -typedef struct _DeviceCCSTransferFunction { - int32_t points; //Used points count - int32_t raw[16]; //Current - ADC code - int32_t mA[16]; //Current - mA in 16.16 format -} DeviceCCSTransferFunction; - -typedef struct _DeviceCCSCurrentSettings { - DeviceCCSTransferFunction transfer; -} DeviceCCSCurrentSettings; - -typedef struct _DeviceCCSCurrentState { - int32_t sum; //Sum of last 32 current measurements - ADC code - int32_t raw; //Average current - ADC code - int32_t mA; //Average current - degrees in 16.16 format -} DeviceCCSCurrentState; - -typedef struct _DeviceCCSCurrent { - DeviceCCSCurrentSettings settings; - DeviceCCSCurrentState state; -} DeviceCCSCurrent; - -typedef struct _DeviceCCS { - DeviceCCSCurrent current[2]; -} DeviceCCS; - -void InitCCSDefaultSettings(void); -void InitCCSState(void); -void DeviceStartCCS(void); - -void ccsProcess(void); - -#endif /* __DEVICE_CCS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceController.c --- a/DeviceController.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitControllerDefaultSettings(void){ - //Init chip - device.controller.chip = (1768 << 16) | 100; //(LPC) 1768 (FBD) 100 - //Init flash memory - InitFlashDefaultSettings(); - //Init timer 1 - measurement timer - InitMeasurementTimerDefaultSettings(); - //Init timer 2 - regular timer - InitRegularTimerDefaultSettings(); - //Init UART0 - service port - InitServicePortDefaultSettings(); - //Init UART1 - user commununication port - InitUserPortDefaultSettings(); - //Init SSP - InitSSPDefaultSettings(); - //Init I2C - InitI2CDefaultSettings(); - //Init QEI - InitQEIDefaultSettings(); -} - -void InitControllerState(void){ - //Init flash memory - InitFlashState(); - //Init timer 1 - measurement timer - InitMeasurementTimerState(); //Init in dither module - //Init timer 2 - regular timer - InitRegularTimerState(); - //Init UART0 - service port - InitServicePortState(); - //Init UART1 - user commununication port - InitUserPortState(); - //Init SSP - InitSSPState(); - //InitI2C - InitI2CState(); - //InitQEI - InitQEIState(); -} - -void DeviceStartController(void){ - DeviceStartServicePort(); - DeviceStartUserPort(); - DeviceStartSSP(); - DeviceStartI2C(); - //DeviceStartQEI(); - //DeviceStartMeasurementTimer(); - //DeviceStartRegularTimer(); -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceController.h --- a/DeviceController.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -#ifndef __DEVICE_CONTROLLER_H__ -#define __DEVICE_CONTROLLER_H__ - -#include "DeviceFlash.h" -#include "DeviceSSP.h" -#include "DeviceI2C.h" -#include "DeviceQEI.h" -#include "DeviceServicePort.h" -#include "DeviceUserPort.h" -#include "DeviceTimers.h" - -typedef struct _DeviceUARTSettings { -} DeviceUARTSettings; - -typedef struct _DeviceUARTState { - //Line Control Register. Contains controls for frame formatting and break generation. - uint8_t LCR; - - //Divisor Latch MSB. Most significant byte of the baud rate divisor value. - //The full divisor is used to generate a baud rate from the fractional rate divider. - //When DLAB = 1 - uint8_t DLM; - - //Divisor Latch LSB. Least significant byte of the baud rate divisor value. - //The full divisor is used to generate a baud rate from the fractional rate divider. - //When DLAB = 1 - uint8_t DLL; - - //FIFO Control Register. Controls FIFO usage and modes. - uint8_t FCR; -} DeviceUARTState; - -typedef struct _DeviceUART { - DeviceUARTSettings settings; - DeviceUARTState state; -} DeviceUART; - -typedef struct _DeviceController { - uint32_t chip; - DeviceFlash flash; - DeviceSSP SSP; - DeviceI2C I2C; - DeviceQEI QEI; - DeviceTimer timer[2]; - DeviceUART uart[2]; -} DeviceController; - -void SystemInit1(void); -void SystemCoreClockUpdate1(void); - -void InitControllerDefaultSettings(void); -void InitControllerState(void); -void DeviceStartController(void); - -#endif /* __DEVICE_CONTROLLER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceCounters.c --- a/DeviceCounters.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitCountersDefaultSettings(void){ - device.counters.latch.settings.enabled = 0; //External latch disabled - device.counters.latch.settings.signal = 0; //External latch signal 0/1 - RS422/Wire - device.counters.latch.settings.format = 0; //DeltaPS - device.counters.latch.settings.reset = 1; //Reset device.counters.dither.state.angle on latch - - device.counters.rate.settings.source = 0; //Dither counters -} - -void InitCountersState(void){ - device.counters.latch.state.enabled = device.counters.latch.settings.enabled; - device.counters.latch.state.signal = device.counters.latch.settings.signal; - device.counters.latch.state.format = device.counters.latch.settings.format; - device.counters.latch.state.reset = device.counters.latch.settings.reset; - device.counters.latch.state.clock = 0; - device.counters.latch.state.angle = 0; - - //Dither latched counters - for (uint8_t i = 0; i < 32; i++) device.counters.dither.state.delta[i] = 0; - device.counters.dither.state.rate = 0; - device.counters.dither.state.angle = 0; - device.counters.dither.state.amplitude = 0; - device.counters.dither.state.displacement = 0; - //device.counters.dither.state.frequency = 0; - //Meander latched counters - device.counters.meander.state.a = 0; - device.counters.meander.state.b = 0; - device.counters.meander.state.c = 0; - device.counters.meander.state.rate[0] = 0; - device.counters.meander.state.rate[1] = 0; - device.counters.meander.state.angle[0] = 0; - device.counters.meander.state.angle[1] = 0; - device.counters.meander.state.amplitude = 0; - - device.counters.rate.state.source = device.counters.rate.settings.source; -} - -void DeviceStartCounters(void){ - DeviceStartQEI(); -} - -void countersProcess(void){ - // - //Process dither latched counters - // - int32_t income = device.controller.QEI.state.delta; - int32_t outcome = device.counters.dither.state.delta[device.measurement.counter]; - device.counters.dither.state.delta[device.measurement.counter] = income; - - //Angle, accumulated for measurement cycle - // Subtract outcoming pulses - device.counters.dither.state.rate -= outcome; - // Add incoming pulses - device.counters.dither.state.rate += income; - //Accumulated angle - device.counters.dither.state.angle += device.counters.dither.state.rate; - - //Displacement (restored sine angle) - // Subtract outcoming half wave - // Add outcoming half wave end - device.counters.dither.state.displacement += outcome; - // Subtract outcoming half wave start - device.counters.dither.state.displacement -= device.counters.dither.state.delta[(device.measurement.counter-16) & 0x1f]; - // Add incoming half wave - // Subtract incoming half wave end - device.counters.dither.state.displacement -= device.counters.dither.state.delta[(device.measurement.counter-15) & 0x1f]; - // Add incoming half wave start - device.counters.dither.state.displacement += income; - - //Amplitude - //if (device.counters.dither.state.displacement > 0) device.counters.dither.state.amp += device.counters.dither.state.displacement; - //if (device.counters.dither.state.displacement < 0) device.counters.dither.state.amp -= device.counters.dither.state.displacement; - - //Dither amplitude/Output frequency - // Subtract outcoming pulses - if (outcome > 0) device.counters.dither.state.amplitude -= outcome; - if (outcome < 0) device.counters.dither.state.amplitude += outcome; - // Add incoming pulses - if (income > 0) device.counters.dither.state.amplitude += income; - if (income < 0) device.counters.dither.state.amplitude -= income; - - // - //Process restored meander counters - low accuracy. TODO: use QEI reverse interrupt for correct counting in meander mode - // - //if (income > 0) a += income - //if (income < 0) b += income - if (income > 0) device.counters.meander.state.a += income; - if (income < 0) device.counters.meander.state.b -= income; - if (device.measurement.counter == 31) { - device.counters.meander.state.rate[0] = device.counters.meander.state.a - device.counters.meander.state.b; - device.counters.meander.state.rate[1] = device.counters.meander.state.a - device.counters.meander.state.c; - device.counters.meander.state.amplitude = device.counters.meander.state.a + device.counters.meander.state.b; - device.counters.meander.state.angle[0] += device.counters.meander.state.rate[0]; - device.counters.meander.state.angle[1] += device.counters.meander.state.rate[1]; - - //Process MRate data - //device.counters.rate.state.a = device.counters.meander.state.a; - //device.counters.rate.state.b = device.counters.meander.state.b; - //device.counters.rate.state.angle = device.counters.meander.state.angle[0] + device.counters.meander.state.angle[1] >> 1; - - //Reset meander latched counters - device.counters.meander.state.c = device.counters.meander.state.a; - device.counters.meander.state.a = 0; - device.counters.meander.state.b = 0; - } - - //Virtual zero sensor - low accuracy - //if (device.counters.state.displacement > 0) a += income - //if (device.counters.state.displacement < 0) b += income -} - -// -//Compatibility functions section -// -int16_t var_Cnt_Dif(void) { - int32_t angle = device.counters.meander.state.angle[0] + device.counters.meander.state.angle[1] >> 1; - device.counters.meander.state.angle[0] = 0; - device.counters.meander.state.angle[1] -= device.counters.meander.state.angle[1] >> 1;//? - - if (angle > 32767) { - device.counters.meander.state.angle[0] = angle - 32767; - angle = 32767; - } else if (angle < -32768) { - device.counters.meander.state.angle[0] = angle + 32768; - angle = -32768; - } - - return (int16_t)angle; -} - -int16_t var_PSdiff(void) { - int32_t angle = device.counters.dither.state.angle; - device.counters.dither.state.angle = 0; - int32_t correction = device.em.error.state.correction >> 16; - device.em.error.state.correction -= correction; - - int32_t res = angle + correction; - if (res > 32767) { - device.counters.dither.state.angle = res - 32767; - res = 32767; - } else if (res < -32768) { - device.counters.dither.state.angle = res + 32768; - res = -32768; - } - - return (int16_t)res; -} - -int16_t var_Device_Mode(void) { - if (device.counters.latch.state.enabled) { - //External latch mode - if ((device.counters.latch.state.signal == 0) && (device.counters.latch.state.format == 0)) - //DM_EXT_LATCH_DELTA_PS_LINE - return 3; - else if ((device.counters.latch.state.signal == 1) && (device.counters.latch.state.format == 0)) - //DM_EXT_LATCH_DELTA_PS_PULSE - return 4; - else if ((device.counters.latch.state.signal == 0) && (device.counters.latch.state.format == 1)) - //DM_EXT_LATCH_DELTA_BINS_LINE - return 5; - else if ((device.counters.latch.state.signal == 1) && (device.counters.latch.state.format == 1)) - //DM_EXT_LATCH_DELTA_BINS_PULSE - return 6; - } else { - //Internal latch mode - if (device.counters.rate.state.source == 0) { - //DM_INT_SIGN_MEANDER_LATCH - return 2; - } else { - //DM_INT_10KHZ_LATCH - return 1; - } - } - return 0; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceCounters.h --- a/DeviceCounters.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -#ifndef __DEVICE_COUNTERS_H__ -#define __DEVICE_COUNTERS_H__ - -//Dither latched counters typedefs -typedef struct _DeviceCountersDitherLatchedSettings { -} DeviceCountersDitherLatchedSettings; - -//Updates 32 times each measurement cycle -typedef struct _DeviceCountersDitherLatchedState { - int32_t delta[32]; //Cyclic buffer of QEI counts with (32 * oscillation frequency) update frequency - int32_t rate; //Sum of last 32 deltas from delta[] - angle accumulated for 1 vibro cycle till now - angular rate - int32_t angle; //Angle accumulated between user angle requests, or between periodic answers - int32_t amplitude; //Positive deltas minus negative deltas from last 32 deltas - dither amplitude - "output frequency" - int32_t displacement; //Sum of last 16 deltas minus sum of previous 16 deltas from delta buffer - displacement - //int32_t amp; //Positive displacements minus negative displacements from last 32 displacements - dither "amplitude" -} DeviceCountersDitherLatchedState; - -typedef struct _DeviceCountersDitherLatched { - DeviceCountersDitherLatchedSettings settings; - DeviceCountersDitherLatchedState state; -} DeviceCountersDitherLatched; - -//Reconstructed (virtual) meander latched counters typedefs -typedef struct _DeviceCountersMeanderLatchedSettings { -} DeviceCountersMeanderLatchedSettings; - -//Updates once each measurement cycle -typedef struct _DeviceCountersMeanderLatchedState { - int32_t a; //Positive counts - int32_t b; //Negative counts - int32_t c; //Positive counts of previous cycle - int32_t rate[2]; //Angle accumulated for full vibro cycle - angular rate: a - b + (a - c)/2 - int32_t angle[2]; //Accumulated angle: angle[0] += a - b; angle[1] += a - c; angle = angle[0] - angle[1]/2 - int32_t amplitude; //Dither amplitude (output frequency): amplitude = a + b; -} DeviceCountersMeanderLatchedState; - -typedef struct _DeviceCountersMeanderLatched { - DeviceCountersMeanderLatchedSettings settings; - DeviceCountersMeanderLatchedState state; -} DeviceCountersMeanderLatched; - -//Virtual zero sensor latched counters typedefs -typedef struct _DeviceCountersZeroLatchedSettings { -} DeviceCountersZeroLatchedSettings; - -typedef struct _DeviceCountersZeroLatchedState { - int32_t a; //Positive counts - int32_t b; //Negative counts -} DeviceCountersZeroLatchedState; - -typedef struct _DeviceCountersZeroLatched { - DeviceCountersZeroLatchedSettings settings; - DeviceCountersZeroLatchedState state; -} DeviceCountersZeroLatched; - -//External latch typedefs -typedef struct _DeviceCountersExternalLatchSettings { - uint16_t enabled;//Latch mode 0/1 - internal/external - uint16_t signal; //External latch signal 0/1 - RS422/Wire - uint16_t format; //Angle format: 0/1/2 - (Delta_PS 16.0)/(Delta_BINS 14.18)/(Delta_SF ?.?) - uint16_t reset; //Reset mode 0/1 - keep/reset device.counters.dither.state.angle on latch -} DeviceCountersExternalLatchSettings; - -typedef struct _DeviceCountersExternalLatchState { - uint16_t enabled;//Latch mode 0/1 - internal/external - uint16_t signal; //External latch signal 0/1 - RS422/Wire - uint16_t format; //Angle format: 0/1/2 - (Delta_PS 16.0)/(Delta_BINS 14.18)/(Delta_SF ?.?) - uint16_t reset; //Reset mode 0/1 - keep/reset device.counters.dither.state.angle on latch - uint16_t clock; //Interpolator ratio - uint32_t angle; //Latched angle = device.counters.dither.state.angle + clock/period * device.counters.dither.state.delta[device.measurement.counter] -} DeviceCountersExternalLatchState; - -typedef struct _DeviceCountersExternalLatch { - DeviceCountersExternalLatchSettings settings; - DeviceCountersExternalLatchState state; -} DeviceCountersExternalLatch; - -//Maintenance rate output typedefs -typedef struct _DeviceCountersRateSettings { - uint16_t source; //0/1 - output meander/dither latched counters in rate commands -} DeviceCountersRateSettings; - -typedef struct _DeviceCountersRateState { - uint16_t source; //0/1 - output meander/dither latched counters in rate commands -} DeviceCountersRateState; - -typedef struct _DeviceCountersRate { - DeviceCountersRateSettings settings; - DeviceCountersRateState state; -} DeviceCountersRate; - -//Counters typedefs -typedef struct _DeviceCounters { - DeviceCountersDitherLatched dither; //Counters latched by dither (measurement) cycle - DeviceCountersMeanderLatched meander; //Counters latched by restored meander (angular velocity reverse latched) - DeviceCountersZeroLatched zero; //Counters latched by virtual zero position sensor - DeviceCountersExternalLatch latch; //External latch mode variables - DeviceCountersRate rate; //Rate mode variables -} DeviceCounters; - -void InitCountersDefaultSettings(void); -void InitCountersState(void); -void DeviceStartCounters(void); - -void countersProcess(void); - -//Compatibility functions section -//Cnt_Dif -int16_t var_Cnt_Dif(void); -//PSdiff -int16_t var_PSdiff(void); -int16_t var_Device_Mode(void); -//void set_var_Device_Mode(int16_t); - -#endif /* __DEVICE_COUNTERS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceDebug.c --- a/DeviceDebug.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitDebugDefaultSettings(void){ -} - -void InitDebugState(void) { -} - -void DeviceStartDebug(void) { -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceDebug.h --- a/DeviceDebug.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#ifndef __DEVICE_DEBUG_H__ -#define __DEVICE_DEBUG_H__ - -#warning "Program config: debug unit enabled!!!" - -#define DEBUG_QEI -#define DEBUG_DECODER_INPUT -#define DEBUG_ENCODER_OUTPUT -#define DEBUG_USER_BAUD - -#define DEV_BOARD_HAOYU -#ifdef DEV_BOARD_HAOYU -#warning "Program config: development board!!!" -#endif - -typedef struct _DeviceDebugSettings { -} DeviceDebugSettings; - -typedef struct _DeviceDebugState { -} DeviceDebugState; - -typedef struct _DeviceDebug { - DeviceDebugSettings settings; - DeviceDebugState state; -} DeviceDebug; - -void InitDebugDefaultSettings(void); -void InitDebugState(void); -void DeviceStartDebug(void); - -#endif /* __DEVICE_DEBUG_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceDither.c --- a/DeviceDither.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,682 +0,0 @@ -#include "Device.h" -extern Device device; -extern unsigned int SystemCoreClock1; - -void InitDitherDefaultSettings(void){ - //Init pulse default settings - device.dither.pulse.settings.width = 0x00002000; //0.125 - device.dither.pulse.settings.min = 0x00000400; //0.031 - device.dither.pulse.settings.max = 0x00004000; //0.5 - - //Init noise default settings - device.dither.noise.settings.period = 20; - device.dither.noise.settings.range = 20; - device.dither.noise.settings.amplitude = 0x00000400; //0.031 - - //Init dither cycle default settings - device.dither.cycle.settings.enabled = 1; - - //Init phase detector default settings - device.dither.detector.settings.filter.factor[0] = -0x00010000; - device.dither.detector.settings.filter.factor[1] = -0x00010000; - device.dither.detector.settings.filter.factor[2] = -0x00010000; - device.dither.detector.settings.filter.factor[3] = -0x00010000; - device.dither.detector.settings.filter.factor[4] = -0x00010000; - device.dither.detector.settings.filter.factor[5] = -0x00010000; - device.dither.detector.settings.filter.factor[6] = -0x00010000; - device.dither.detector.settings.filter.factor[7] = -0x00010000; - - device.dither.detector.settings.filter.factor[8] = -0x00010000; - device.dither.detector.settings.filter.factor[9] = -0x00010000; - device.dither.detector.settings.filter.factor[10] = -0x00010000; - device.dither.detector.settings.filter.factor[11] = -0x00010000; - device.dither.detector.settings.filter.factor[12] = -0x00010000; - device.dither.detector.settings.filter.factor[13] = -0x00010000; - device.dither.detector.settings.filter.factor[14] = -0x00010000; - device.dither.detector.settings.filter.factor[15] = -0x00010000; - - device.dither.detector.settings.filter.factor[16] = 0x00010000; - device.dither.detector.settings.filter.factor[17] = 0x00010000; - device.dither.detector.settings.filter.factor[18] = 0x00010000; - device.dither.detector.settings.filter.factor[19] = 0x00010000; - device.dither.detector.settings.filter.factor[20] = 0x00010000; - device.dither.detector.settings.filter.factor[21] = 0x00010000; - device.dither.detector.settings.filter.factor[22] = 0x00010000; - device.dither.detector.settings.filter.factor[23] = 0x00010000; - - device.dither.detector.settings.filter.factor[24] = 0x00010000; - device.dither.detector.settings.filter.factor[25] = 0x00010000; - device.dither.detector.settings.filter.factor[26] = 0x00010000; - device.dither.detector.settings.filter.factor[27] = 0x00010000; - device.dither.detector.settings.filter.factor[28] = 0x00010000; - device.dither.detector.settings.filter.factor[29] = 0x00010000; - device.dither.detector.settings.filter.factor[30] = 0x00010000; - device.dither.detector.settings.filter.factor[31] = 0x00010000; - - device.dither.detector.settings.transfer.points = 16; - device.dither.detector.settings.transfer.raw[0] = -0x10000; //-1.0 - device.dither.detector.settings.transfer.restored[0] = -0x1921f; //-1.5707963267948966 - device.dither.detector.settings.transfer.raw[1] = -0xfa67; //-0.9781476007338056 - device.dither.detector.settings.transfer.restored[1] = -0x15c81; //-1.361356816555577 - device.dither.detector.settings.transfer.raw[2] = -0xe9de; //-0.9135454576426009 - device.dither.detector.settings.transfer.restored[2] = -0x126e4; //-1.1519173063162575 - device.dither.detector.settings.transfer.raw[3] = -0xcf1b; //-0.8090169943749475 - device.dither.detector.settings.transfer.restored[3] = -0xf146; //-0.9424777960769379 - device.dither.detector.settings.transfer.raw[4] = -0xab4c; //-0.6691306063588582 - device.dither.detector.settings.transfer.restored[4] = -0xbba8; //-0.7330382858376184 - device.dither.detector.settings.transfer.raw[5] = -0x8000; //-0.5 - device.dither.detector.settings.transfer.restored[5] = -0x860a; //-0.5235987755982989 - device.dither.detector.settings.transfer.raw[6] = -0x4f1b; //-0.3090169943749474 - device.dither.detector.settings.transfer.restored[6] = -0x506c; //-0.3141592653589793 - device.dither.detector.settings.transfer.raw[7] = -0x1ac2; //-0.10452846326765361 - device.dither.detector.settings.transfer.restored[7] = -0x1ace; //-0.10471975511965992 - device.dither.detector.settings.transfer.raw[8] = 0x1ac2; //0.10452846326765339 - device.dither.detector.settings.transfer.restored[8] = 0x1ace; //0.1047197551196597 - device.dither.detector.settings.transfer.raw[9] = 0x4f1b; //0.3090169943749474 - device.dither.detector.settings.transfer.restored[9] = 0x506c; //0.3141592653589793 - device.dither.detector.settings.transfer.raw[10] = 0x7fff; //0.49999999999999983 - device.dither.detector.settings.transfer.restored[10] = 0x860a; //0.5235987755982987 - device.dither.detector.settings.transfer.raw[11] = 0xab4c; //0.669130606358858 - device.dither.detector.settings.transfer.restored[11] = 0xbba8; //0.7330382858376181 - device.dither.detector.settings.transfer.raw[12] = 0xcf1b; //0.8090169943749475 - device.dither.detector.settings.transfer.restored[12] = 0xf146; //0.9424777960769379 - device.dither.detector.settings.transfer.raw[13] = 0xe9de; //0.9135454576426009 - device.dither.detector.settings.transfer.restored[13] = 0x126e4; //1.1519173063162573 - device.dither.detector.settings.transfer.raw[14] = 0xfa67; //0.9781476007338056 - device.dither.detector.settings.transfer.restored[14] = 0x15c81; //1.3613568165555767 - device.dither.detector.settings.transfer.raw[15] = 0x10000; //1.0 - device.dither.detector.settings.transfer.restored[15] = 0x1921f; //1.5707963267948966 - - //Init frequency regulator default settings - device.dither.frequency.settings.enabled = 1; - device.dither.frequency.settings.min = 0x01630000;//355Hz 0x01860000; //390 Hz in 16.16 format - device.dither.frequency.settings.max = 0x01680000;//365 0x019A0000; //410 Hz in 16.16 format - device.dither.frequency.settings.scale = 0x00010000; //0.0625Hz - device.dither.frequency.settings.transfer.points = 16; - device.dither.frequency.settings.transfer.error[0] = -0x140000; //-20.0Hz - device.dither.frequency.settings.transfer.correction[0] = 0x10000; //1.0 - device.dither.frequency.settings.transfer.error[1] = -0x115555; //-17.333333333333332Hz - device.dither.frequency.settings.transfer.correction[1] = 0xb473; //0.7048888888888889 - device.dither.frequency.settings.transfer.error[2] = -0xeaaaa; //-14.666666666666668Hz - device.dither.frequency.settings.transfer.correction[2] = 0x7aa7; //0.47911111111111115 - device.dither.frequency.settings.transfer.error[3] = -0xc0000; //-12.0Hz - device.dither.frequency.settings.transfer.correction[3] = 0x4fdf; //0.31199999999999994 - device.dither.frequency.settings.transfer.error[4] = -0x95555; //-9.333333333333334Hz - device.dither.frequency.settings.transfer.correction[4] = 0x3161; //0.1928888888888889 - device.dither.frequency.settings.transfer.error[5] = -0x6aaaa; //-6.666666666666668Hz - device.dither.frequency.settings.transfer.correction[5] = 0x1c71; //0.11111111111111113 - device.dither.frequency.settings.transfer.error[6] = -0x40000; //-4.0Hz - device.dither.frequency.settings.transfer.correction[6] = 0xe56; //0.05599999999999999 - device.dither.frequency.settings.transfer.error[7] = -0x15555; //-1.3333333333333357Hz - device.dither.frequency.settings.transfer.correction[7] = 0x452; //0.016888888888888884 - device.dither.frequency.settings.transfer.error[8] = 0x15555; //1.3333333333333321Hz - device.dither.frequency.settings.transfer.correction[8] = -0x452; //-0.016888888888888884 - device.dither.frequency.settings.transfer.error[9] = 0x40000; //4.0Hz - device.dither.frequency.settings.transfer.correction[9] = -0xe56; //-0.05599999999999999 - device.dither.frequency.settings.transfer.error[10] = 0x6aaaa; //6.666666666666664Hz - device.dither.frequency.settings.transfer.correction[10] = -0x1c71; //-0.11111111111111108 - device.dither.frequency.settings.transfer.error[11] = 0x95555; //9.333333333333332Hz - device.dither.frequency.settings.transfer.correction[11] = -0x3161; //-0.1928888888888888 - device.dither.frequency.settings.transfer.error[12] = 0xc0000; //12.0kHz - device.dither.frequency.settings.transfer.correction[12] = -0x4fdf; //-0.31200000000000006 - device.dither.frequency.settings.transfer.error[13] = 0xeaaaa; //14.666666666666664Hz - device.dither.frequency.settings.transfer.correction[13] = -0x7aa7; //-0.47911111111111115 - device.dither.frequency.settings.transfer.error[14] = 0x115555; //17.33333333333333Hz - device.dither.frequency.settings.transfer.correction[14] = -0xb473; //-0.7048888888888889 - device.dither.frequency.settings.transfer.error[15] = 0x140000; //20.0Hz - device.dither.frequency.settings.transfer.correction[15] = -0x10000; //-1.0 - - //Init amplitude regulator default settings - device.dither.amplitude.settings.enabled = 1; - device.dither.amplitude.settings.scale = 0x00001000; //0.0625 (6.25%) of period - device.dither.amplitude.settings.transfer.points = 16; - device.dither.amplitude.settings.transfer.error[0] = -0x140000; //-20.0kHz - device.dither.amplitude.settings.transfer.correction[0] = 0x10000; //1.0 - device.dither.amplitude.settings.transfer.error[1] = -0x115555; //-17.333333333333332kHz - device.dither.amplitude.settings.transfer.correction[1] = 0xb473; //0.7048888888888889 - device.dither.amplitude.settings.transfer.error[2] = -0xeaaaa; //-14.666666666666668kHz - device.dither.amplitude.settings.transfer.correction[2] = 0x7aa7; //0.47911111111111115 - device.dither.amplitude.settings.transfer.error[3] = -0xc0000; //-12.0kHz - device.dither.amplitude.settings.transfer.correction[3] = 0x4fdf; //0.31199999999999994 - device.dither.amplitude.settings.transfer.error[4] = -0x95555; //-9.333333333333334kHz - device.dither.amplitude.settings.transfer.correction[4] = 0x3161; //0.1928888888888889 - device.dither.amplitude.settings.transfer.error[5] = -0x6aaaa; //-6.666666666666668kHz - device.dither.amplitude.settings.transfer.correction[5] = 0x1c71; //0.11111111111111113 - device.dither.amplitude.settings.transfer.error[6] = -0x40000; //-4.0kHz - device.dither.amplitude.settings.transfer.correction[6] = 0xe56; //0.05599999999999999 - device.dither.amplitude.settings.transfer.error[7] = -0x15555; //-1.3333333333333357kHz - device.dither.amplitude.settings.transfer.correction[7] = 0x452; //0.016888888888888884 - device.dither.amplitude.settings.transfer.error[8] = 0x15555; //1.3333333333333321kHz - device.dither.amplitude.settings.transfer.correction[8] = -0x452; //-0.016888888888888884 - device.dither.amplitude.settings.transfer.error[9] = 0x40000; //4.0kHz - device.dither.amplitude.settings.transfer.correction[9] = -0xe56; //-0.05599999999999999 - device.dither.amplitude.settings.transfer.error[10] = 0x6aaaa; //6.666666666666664kHz - device.dither.amplitude.settings.transfer.correction[10] = -0x1c71; //-0.11111111111111108 - device.dither.amplitude.settings.transfer.error[11] = 0x95555; //9.333333333333332kHz - device.dither.amplitude.settings.transfer.correction[11] = -0x3161; //-0.1928888888888888 - device.dither.amplitude.settings.transfer.error[12] = 0xc0000; //12.0kHz - device.dither.amplitude.settings.transfer.correction[12] = -0x4fdf; //-0.31200000000000006 - device.dither.amplitude.settings.transfer.error[13] = 0xeaaaa; //14.666666666666664kHz - device.dither.amplitude.settings.transfer.correction[13] = -0x7aa7; //-0.47911111111111115 - device.dither.amplitude.settings.transfer.error[14] = 0x115555; //17.33333333333333kHz - device.dither.amplitude.settings.transfer.correction[14] = -0xb473; //-0.7048888888888889 - device.dither.amplitude.settings.transfer.error[15] = 0x140000; //20.0kHz - device.dither.amplitude.settings.transfer.correction[15] = -0x10000; //-1.0 -} - -void InitDitherState(void){ - //Init pulse state - device.dither.pulse.state.width = device.dither.pulse.settings.width; - device.dither.pulse.state.min = device.dither.pulse.settings.min; - device.dither.pulse.state.max = device.dither.pulse.settings.max; - device.dither.pulse.state.rise = 0; - device.dither.pulse.state.fall = 0; - device.dither.pulse.state.counter = 0; - - //Init noise state - device.dither.noise.state.enabled = device.dither.noise.settings.enabled; - device.dither.noise.state.period = device.dither.noise.settings.period; - device.dither.noise.state.range = device.dither.noise.settings.range; - device.dither.noise.state.amplitude = device.dither.noise.settings.amplitude; - device.dither.noise.state.counter = 0; - device.dither.noise.state.trigger = 0; - device.dither.noise.state.disturbance = 0; - - //Init dither cycle state - device.dither.cycle.state.enabled = device.dither.cycle.settings.enabled; - device.dither.cycle.state.pin1 = 0; - device.dither.cycle.state.pin2 = 0; - - //Init phase detector state - device.dither.detector.state.sum = 0; - device.dither.detector.state.raw = 0; - device.dither.detector.state.phase = 0; - - //Init frequency regulator state - //TODO: min(temperature), max(temperature) - device.dither.frequency.state.enabled = device.dither.frequency.settings.enabled; - device.dither.frequency.state.min = device.dither.frequency.settings.min; - device.dither.frequency.state.max = device.dither.frequency.settings.max; - device.dither.frequency.state.scale = device.dither.frequency.settings.scale; - device.dither.frequency.state.frequency = (device.dither.frequency.state.max + device.dither.frequency.state.min) / 2; - device.dither.frequency.state.error = 0; - device.dither.frequency.state.correction = 0; - //Set measurement timer - timersSetMeasurementPeriod((unsigned int)(SystemCoreClock1/(device.dither.frequency.state.frequency >> 11))); - - //Init amplitude regulator state - device.dither.amplitude.state.enabled = device.dither.amplitude.settings.enabled; - device.dither.amplitude.state.reference = device.dither.amplitude.settings.reference; - device.dither.amplitude.state.scale = device.dither.amplitude.settings.scale; - device.dither.amplitude.state.frequency = 0; - device.dither.amplitude.state.error = 0; - device.dither.amplitude.state.correction = 0; -} - -void DeviceStartDither(void){ - LPC_PINCON->PINSEL3 &= ~(0x00<<18); //e. P1.25 is GPIO pin - LPC_PINCON->PINSEL3 |= (0x00<<18); //e. P1.25 is GPIO pin - LPC_PINCON->PINMODE3 |= (3<<18); //e. P1.25 (включениe подтягивающего резистора") - LPC_GPIO1->FIODIR |= (1<<25); //e. P0.5 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.5 как выход) - LPC_GPIO1->FIOCLR |= (1<<25); - - LPC_PINCON->PINSEL3 &= ~(0x00<<24); //e. P1.28 is GPIO pin - LPC_PINCON->PINSEL3 |= (0x00<<24); //e. P1.28 is GPIO pin - LPC_PINCON->PINMODE3 |= (3<<24); //e. P1.28 is GPIO pin (запись ( 11 ) в бит PINMODE0 "для включения подтягивающего резистора") - LPC_GPIO1->FIODIR |= (1<<28); //e. P1.28 is output (запись ( 1 ) в 5 бит FIODIR выбор P0.5 как выход) - LPC_GPIO1->FIOCLR |= (1<<28); - - DeviceStartMeasurementTimer(); -} - -//Call from regular cycle interrupt (or from main cycle?) -void ditherCycle(void){ - int8_t pin1, pin2; - //Use LPC_TIM1->TC instead of device.dither.pulse.state.counter? - // device.measurement.state.counter + (LPC_TIM1->TC << 16)/LPC_TIM1->MR0 - cycle phase 0...32 in 16.16 format - // "+": 100kHz timer will be just 10kHz timer if call DeviceDitherDoCycle() in main cycle - if ((device.dither.pulse.state.counter > device.dither.pulse.state.rise) && (device.dither.pulse.state.counter < device.dither.pulse.state.fall)){ - pin1 = 1; pin2 = 1; - } else { - pin1 = 0; pin2 = 0; - } - - if (device.measurement.counter < 16){ - pin2 = 0; - } else { - pin1 = 0; - } - if (!device.dither.cycle.state.enabled) { - pin1 = 0; pin2 = 0; - } - if (pin1 > device.dither.cycle.state.pin1) LPC_GPIO1->FIOCLR = 1<<25; - if (pin1 < device.dither.cycle.state.pin1) LPC_GPIO1->FIOSET = 1<<25; - if (pin2 > device.dither.cycle.state.pin2) LPC_GPIO1->FIOCLR = 1<<28; - if (pin2 < device.dither.cycle.state.pin2) LPC_GPIO1->FIOSET = 1<<28; - device.dither.cycle.state.pin1 = pin1; - device.dither.cycle.state.pin2 = pin2; -} - -int32_t ditherInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t ditherRestorePhase(int32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.dither.detector.settings.transfer.points; i++) { - r1 = device.dither.detector.settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.dither.detector.settings.transfer.restored[i - 1]; - } - - r2 = device.dither.detector.settings.transfer.raw[i]; - if (raw < r2) { - int32_t p1 = device.dither.detector.settings.transfer.restored[i - 1]; - int32_t p2 = device.dither.detector.settings.transfer.restored[i]; - return ditherInterpolate(raw, r1, r2, p1, p2); - } - } - return device.dither.detector.settings.transfer.restored[device.dither.detector.settings.transfer.points - 1]; -} - -int32_t ditherFrequencyCorrection(int32_t error) { - int32_t e1, e2; - for (uint8_t i = 1; i < device.dither.frequency.settings.transfer.points; i++) { - e1 = device.dither.frequency.settings.transfer.error[i - 1]; - if (error < e1) { - return device.dither.frequency.settings.transfer.correction[i - 1]; - } - - e2 = device.dither.frequency.settings.transfer.error[i]; - if (error < e2) { - int32_t c1 = device.dither.frequency.settings.transfer.correction[i - 1]; - int32_t c2 = device.dither.frequency.settings.transfer.correction[i]; - return ditherInterpolate(error, e1, e2, c1, c2); - } - } - return device.dither.frequency.settings.transfer.correction[device.dither.frequency.settings.transfer.points - 1]; -} - -int32_t ditherPulseCorrection(int32_t error) { - int32_t e1, e2; - for (uint8_t i = 1; i < device.dither.amplitude.settings.transfer.points; i++) { - e1 = device.dither.amplitude.settings.transfer.error[i - 1]; - if (error < e1) { - return device.dither.amplitude.settings.transfer.correction[i - 1]; - } - - e2 = device.dither.amplitude.settings.transfer.error[i]; - if (error < e2) { - int32_t c1 = device.dither.amplitude.settings.transfer.correction[i - 1]; - int32_t c2 = device.dither.amplitude.settings.transfer.correction[i]; - return ditherInterpolate(error, e1, e2, c1, c2); - } - } - return device.dither.amplitude.settings.transfer.correction[device.dither.amplitude.settings.transfer.points - 1]; -} - -void ditherProcessDetector(void) { - //f(t) = f0 * cos(w * t) - //x(t) = x0 * cos(w * t - fi) - //fi = - arctan(const / (w0^2 - w^2)) - int32_t delta = device.counters.dither.state.delta[device.measurement.counter]; - int32_t factor = device.dither.detector.settings.filter.factor[(device.measurement.counter + 14) % 32]; //-1...+1 in 16.16 format - device.dither.detector.state.sum += delta * factor; //-500...+500 in 16.16 format -} - -void ditherProcessPhase(void) { - //Raw phase -1...+1 in 16.16 format - if (device.counters.dither.state.amplitude > 0) {//0...+2500 in 32.0 format (1MHz/400Hz) - device.dither.detector.state.raw = device.dither.detector.state.sum / device.counters.dither.state.amplitude; //-1...+1 in 16.16 format - device.dither.detector.state.sum = 0; - } else { - device.dither.detector.state.raw = 0; - } - //TODO: Transform required to actual phase in range -1...+1 or -Pi/2...+Pi/2 or -90...+90 degrees - device.dither.detector.state.phase = ditherRestorePhase(device.dither.detector.state.raw); - //sprintf(device.service.buffer,"- %d\r\n", device.dither.detector.state.phase); WriteConcole(); //Development message -} - -void ditherProcessFrequency(void) { - device.dither.frequency.state.error = -device.dither.detector.state.phase; - device.dither.frequency.state.correction = (device.dither.frequency.state.scale * ditherFrequencyCorrection(device.dither.frequency.state.error)) >> 16; - - if (device.dither.frequency.state.enabled){ - device.dither.frequency.state.frequency += device.dither.frequency.state.correction; - - if (device.dither.frequency.state.frequency > device.dither.frequency.state.max) { - device.dither.frequency.state.frequency = device.dither.frequency.state.max; - } else if (device.dither.frequency.state.frequency < device.dither.frequency.state.min) { - device.dither.frequency.state.frequency = device.dither.frequency.state.min; - } - - timersSetMeasurementPeriod((unsigned int)(SystemCoreClock1/(device.dither.frequency.state.frequency >> 11))); - } -} - -void ditherProcessAmplitude(void) { - //Frequency = device.counters.state.frequency * device.dither.frequency.state.frequency / 2; - // 500 * 400Hz (0x01900000) / 2 / 1000 = 100kHz (0x00640000) - // 500 * 0x19000000 / 2000 / 16 = 100kHz = 0x00640000 - device.dither.amplitude.state.frequency = (device.counters.dither.state.amplitude * ((device.dither.frequency.state.frequency << 4) / 2000)) >> 4; - device.dither.amplitude.state.error = device.dither.amplitude.state.frequency - device.dither.amplitude.state.reference; //0...200kHz 16.16 format - device.dither.amplitude.state.correction = (device.dither.amplitude.state.scale * ditherPulseCorrection(device.dither.amplitude.state.error)) >> 16; - - if (device.dither.amplitude.state.enabled){ - //Debug!! - device.dither.pulse.state.width += device.dither.amplitude.state.correction; - if (device.dither.pulse.state.width < device.dither.pulse.state.min) device.dither.pulse.state.width = device.dither.pulse.state.min; - if (device.dither.pulse.state.width > device.dither.pulse.state.max) device.dither.pulse.state.width = device.dither.pulse.state.max; - } -} - -void ditherProcessNoise(void) { - if (device.dither.noise.state.counter == device.dither.noise.state.trigger) { - //Set noise update state parameters - device.dither.noise.state.counter = 0; - device.dither.noise.state.trigger = device.dither.noise.state.period + rand() % device.dither.noise.state.range; - - //Set pulse width disturbance - if (device.dither.noise.state.enabled) { - device.dither.noise.state.disturbance = (device.dither.noise.state.amplitude * (-0x00010000 + 2 * rand())) >> 16; //-1...1 - } else { - device.dither.noise.state.disturbance = 0; - } - } -} - -void ditherProcessPulse(void) { - //Dither period: device.controller.timer[0].state.MR0 * 32 / CCLK - //Timer #1 period: device.controller.timer[1].state.MR0 / CCLK - //Timer #1 ticks in dither period: device.controller.timer[0].state.MR0 * 32 / device.controller.timer[1].state.MR0 - - //int32_t max = device.controller.timer[0].state.MR0 / 2; - int32_t max = device.controller.timer[0].state.MR0 * 16 / device.controller.timer[1].state.MR0; - int32_t mid = max / 2; - //int32_t half = (max * (device.dither.pulse.state.width + device.dither.noise.state.disturbance)) >> 17; //pulse half width in 10 mks ticks - //int32_t half = (max * device.dither.pulse.state.width) >> 16; - int32_t half = max/3; //Debug!!! - - int32_t rise = mid - half; if (rise < 0) rise = 0; - int32_t fall = mid + half; if (fall > max) fall = max; - device.dither.pulse.state.rise = rise; - device.dither.pulse.state.fall = fall; - - /* - int32_t delta = (max * (device.dither.amplitude.state.correction + device.dither.noise.state.disturbance)) >> 17; - - device.dither.pulse.state.rise += delta; - if (device.dither.pulse.state.rise < 0) device.dither.pulse.state.rise = 0; - if (device.dither.pulse.state.rise > mid) device.dither.pulse.state.rise = mid; - - device.dither.pulse.state.fall -= delta; - if (device.dither.pulse.state.fall > max) device.dither.pulse.state.fall = max; - if (device.dither.pulse.state.fall < mid) device.dither.pulse.state.fall = mid; - */ -} - -//Call from measurement timer interrupt -void ditherProcess(void) { - ditherProcessDetector(); - if (device.measurement.counter == 31) { - ditherProcessPhase(); - ditherProcessFrequency(); - ditherProcessAmplitude(); - ditherProcessNoise(); - ditherProcessPulse(); - } -} - -// -// Compatibility functions section -// -uint32_t ditherGetRawAmplitudeSetting(void) { - //Value: dither output frequency F - Hz - //Internal format: device.dither.amplitude.settings.reference - kHz in 16.16 format - //Output format: 2 * 1000 * F - dimensionless units in 32.0 format - - //Frequency: device.dither.amplitude.settings.reference / 65536 - //Output: 1000 * device.dither.amplitude.settings.reference / 32768 - - int32_t r = device.dither.amplitude.state.reference * 1000 / 32768; - if (r < 0) r = 0; - return (uint32_t)r; -} - -uint16_t ditherGetRawAmplitudeState(void) { - //Value: dither output frequency F - Hz - //Internal format: device.dither.amplitude.settings.frequency - kHz in 16.16 format - //Output format: F/16 - dimensionless units in 16.0 format - - //Result: device.dither.amplitude.settings.frequency / 16 * 1000 / 65536 - int32_t r = ((device.dither.amplitude.state.frequency >> 5) * 1000) >> 16; - if (r < 0) r = 0; - if (r > 32767) r = 32767; - return (uint16_t)r; -} - -uint16_t ditherGetRawDividerSetting(void) { - //Value: dither oscillation frequency F - Hz - //Internal format: device.dither.frequency.settings.frequency - Hz in 16.16 format - //Output format: frequency divider 7680000/F - dimensionless units in 16.0 format - - //Numerator: 7680000 * 256 = 7680000 << 8 = 0x75300000 < maxint32 - //Denominator: F * 256 = device.dither.frequency.settings.frequency >> 8 = 0x15e00 ... 0x1c200 - //Result: numerator/denominator = (7680000 * 256)/(F * 256) = 0x55b6 ... 0x42aa = 21942 ... 17066 < maxint16 - int32_t d = 0x75300000 / ((device.dither.frequency.settings.max + device.dither.frequency.settings.min) >> 9); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawDividerMaxSetting(void) { - //Value: dither oscillation min frequency F - Hz - //Internal format: device.dither.frequency.settings.min - Hz in 16.16 format - //Output format: frequency max divider 7680000/F - dimensionless units in 16.0 format - - //Numerator: 7680000 * 256 = 7680000 << 8 = 0x75300000 < maxint32 - //Denominator: F * 256 = device.dither.frequency.settings.max >> 8 = 0x15e00 ... 0x1c200 - //Result: numerator/denominator = (7680000 * 256)/(F * 256) = 0x55b6 ... 0x42aa = 21942 ... 17066 < maxint16 - int32_t d = 0x75300000 / (device.dither.frequency.settings.min >> 8); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawDividerMinSetting(void) { - //Value: dither oscillation max frequency F - Hz - //Internal format: device.dither.frequency.settings.max - Hz in 16.16 format - //Output format: frequency min divider 7680000/F - dimensionless units in 16.0 format - - //Numerator: 7680000 * 256 = 7680000 << 8 = 0x75300000 < maxint32 - //Denominator: F * 256 = device.dither.frequency.settings.frequency >> 8 = 0x15e00 ... 0x1c200 - //Result: numerator/denominator = (7680000 * 256)/(F * 256) = 0x55b6 ... 0x42aa = 21942 ... 17066 < maxint16 - int32_t d = 0x75300000 / (device.dither.frequency.settings.max >> 8); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawDividerState(void) { - //Value: dither oscillation frequency F - Hz - //Internal format: device.dither.frequency.state.frequency - Hz in 16.16 format - //Output format: frequency divider 7680000/F - dimensionless units in 16.0 format - - //Numerator: 7680000 * 256 = 7680000 << 8 = 0x75300000 < maxint32 - //Denominator: F * 256 = device.dither.frequency.state.frequency >> 8 = 0x15e00 ... 0x1c200 - //Result: numerator/denominator = (7680000 * 256)/(F * 256) = 0x55b6 ... 0x42aa = 21942 ... 17066 < maxint16 - int32_t d = 0x75300000 / (device.dither.frequency.state.frequency >> 8); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -int16_t ditherGetRawPhaseState(void) { - //Value: dither raw phase - Ph - -1,0,+1 - //Internal format: device.dither.detector.state.phase - -1...1 in 16.16 format - //Output format: sum(Ph, 1 sec) - dimensionless units in 16.0 format - - //Now: Multiply 512 instead of sum for 1 sec and right shift 16 to transform in format 16.0 (shift 16 - 9 = 7) - //Signed right shift implementation-defined!!! Required to replace right shift 7 to division on 128 for implementation independence? - int32_t phase = device.dither.detector.state.phase / 128; - //TODO: make summation for 1 sec as in DSP-based program and tranform 16.0 - - return (int16_t)phase; -} - -uint16_t ditherGetRawPulseSetting(void) { - //Value: dither pulse width W - s - //Internal format: device.dither.pulse.settings.width - 0...1 of dither half-period in 16.16 format - //Output format: 15360000 * W - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.settings.frequency / 65536 - //Half-period: 1/(2 * F) = 0.0011 ... 0.0014 s - //Percentage: P = device.dither.pulse.settings.width / 65536 - //Pulse width: W = P/(2 * F) - //Output: O = W * 1536000 = 768000 * device.dither.pulse.settings.width / device.dither.frequency.settings.frequency - - //Numerator: (768000 >> 5) * device.dither.pulse.settings.width = 0 ... 0x5dc00000 < maxint - //Denominator: device.dither.frequency.settings.frequency >> 5 = 0xaf000 ... 0xe1000 - //Result: numerator/denominator = 0 ... 0x892 < maxint16 - int32_t d = 0x5dc0 * device.dither.pulse.settings.width / ((device.dither.frequency.settings.max + device.dither.frequency.settings.min) >> 6); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawPulseMaxSetting(void) { - //Value: dither pulse max width W - s - //Internal format: device.dither.pulse.settings.max - 0...1 of dither half-period in 16.16 format - //Output format: 15360000 * W - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.settings.min / 65536 - //Half-period: 1/(2 * F) = 0.0011 ... 0.0014 s - //Percentage: P = device.dither.pulse.settings.max / 65536 - //Pulse width: W = P/(2 * F) - //Output: O = W * 1536000 = 768000 * device.dither.pulse.settings.max / device.dither.frequency.settings.min - - //Numerator: (768000 >> 5) * device.dither.pulse.settings.max = 0 ... 0x5dc00000 < maxint - //Denominator: device.dither.frequency.settings.frequency >> 5 = 0xaf000 ... 0xe1000 - //Result: numerator/denominator = 0 ... 0x892 < maxint16 - int32_t d = 0x5dc0 * device.dither.pulse.settings.max / (device.dither.frequency.settings.min >> 5); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawPulseMinSetting(void) { - //Value: dither pulse min width W - s - //Internal format: device.dither.pulse.settings.min - 0...1 of dither half-period in 16.16 format - //Output format: 15360000 * W - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.settings.max / 65536 - //Half-period: 1/(2 * F) = 0.0011 ... 0.0014 s - //Percentage: P = device.dither.pulse.settings.min / 65536 - //Pulse width: W = P/(2 * F) - //Output: O = W * 1536000 = 768000 * device.dither.pulse.settings.min / device.dither.frequency.settings.max - - //Numerator: (768000 >> 5) * device.dither.pulse.settings.min = 0 ... 0x5dc00000 < maxint - //Denominator: device.dither.frequency.settings.max >> 5 = 0xaf000 ... 0xe1000 - //Result: numerator/denominator = 0 ... 0x892 < maxint16 - int32_t d = 0x5dc0 * device.dither.pulse.settings.min / (device.dither.frequency.settings.max >> 5); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -uint16_t ditherGetRawPulseState(void) { - //Value: dither pulse width W - s - //Internal format: device.dither.pulse.state.width - 0...1 of dither half-period in 16.16 format - //Output format: 15360000 * W - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.state.frequency / 65536 - //Half-period: 1/(2 * F) = 0.0011 ... 0.0014 s - //Percentage: P = device.dither.pulse.state.width / 65536 - //Pulse width: W = P/(2 * F) - //Output: O = W * 1536000 = 768000 * device.dither.pulse.state.width / device.dither.frequency.state.frequency - - //Numerator: (768000 >> 5) * device.dither.pulse.state.width = 0 ... 0x5dc00000 < maxint - //Denominator: device.dither.frequency.state.frequency >> 5 = 0xaf000 ... 0xe1000 - //Result: numerator/denominator = 0 ... 0x892 < maxint16 - int32_t d = 0x5dc0 * device.dither.pulse.state.width / (device.dither.frequency.state.frequency >> 5); - if (d < 0) d = 0; - if (d > 32767) d = 32767; - return (uint16_t)d; -} - -//VBN_Tzd s16 adjusted noise period -//int32_t device.dither.noise.settings.period -uint16_t param_VBN_Tzd(void) { - //Value: dither noise period (fixed part) - T [s] - //Internal format: device.dither.noise.state.period - 0...100 of measurement cycles in 16.16 format - //Output format: T [s] * 10000 (in 10000 Hz periods) - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.state.frequency / 65536 - //Period: 1/F = 0.0022 ... 0.0028 s - //Output: O = device.dither.noise.state.period * 1/F * 10000 = - // = device.dither.noise.state.period * 10000 * 65536 / device.dither.frequency.state.frequency = - // = 65536 * 20000 / device.dither.frequency.state.frequency * device.dither.noise.state.period / 2 - - int32_t tzd = 0x4e200000 / device.dither.frequency.state.frequency * device.dither.noise.state.period / 2; - if (tzd < 0) tzd = 0; - if (tzd > 32767) tzd = 32767; - return (uint16_t)tzd; -} - -//VBN_Ran s16 range of the random component of noise -//int32_t device.dither.noise.settings.range -uint16_t param_VBN_Ran(void) { - //Value: dither noise period (random part) - T [s] - //Internal format: device.dither.noise.state.range - 0...100 of measurement cycles in 16.16 format - //Output format: T [s] * 10000 (in 10000 Hz periods) - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.state.frequency / 65536 - //Period: 1/F = 0.0022 ... 0.0028 s - //Output: O = device.dither.noise.state.range * 1/F * 10000 = - // = device.dither.noise.state.range * 10000 * 65536 / device.dither.frequency.state.frequency = - // = 65536 * 20000 / device.dither.frequency.state.frequency * device.dither.noise.state.range / 2 - - int32_t ran = 0x4e200000 / device.dither.frequency.state.frequency * device.dither.noise.state.range / 2; - if (ran < 0) ran = 0; - if (ran > 32767) ran = 32767; - return (uint16_t)ran; -} - -//VBN_k s16 adjusted noise constant: pulse width = VB_tau +/- VBN_k -//int32_t device.dither.noise.settings.amplitude -uint16_t param_VBN_k(void) { - //Value: dither pulse width variation (pulse noise) W - s - //Internal format: device.dither.noise.settings.amplitude - 0...1 of dither half-period in 16.16 format - //Output format: 15360000 * W - dimensionless units in 16.0 format - - //Frequency: F = device.dither.frequency.settings.frequency / 65536 - //Half-period: 1/(2 * F) = 0.0011 ... 0.0014 s - //Percentage: P = device.dither.noise.settings.amplitude / 65536 - //Pulse variation: W = P/(2 * F) - //Output: O = W * 1536000 = 768000 * device.dither.noise.settings.amplitude / device.dither.frequency.settings.frequency - - //Numerator: (768000 >> 5) * device.dither.noise.settings.amplitude = 0 ... 0x5dc00000 < maxint - //Denominator: device.dither.frequency.settings.frequency >> 5 = 0xaf000 ... 0xe1000 - //Result: numerator/denominator = 0 ... 0x892 < maxint16 - int32_t k = 0x5dc0 * device.dither.noise.settings.amplitude / ((device.dither.frequency.settings.max + device.dither.frequency.settings.min) >> 6); - if (k < 0) k = 0; - if (k > 32767) k = 32767; - return (uint16_t)k; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceDither.h --- a/DeviceDither.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -#ifndef __DEVICE_DITHER_H__ -#define __DEVICE_DITHER_H__ - -//Dither drive pulse typedefs -typedef struct _DeviceDitherPulseSettings { - int32_t width; //start pulse width - 0...1 in 16.16 format - int32_t min; //min pulse width - 0...1 in 16.16 format - int32_t max; //max pulse width - 0...1 in 16.16 format -} DeviceDitherPulseSettings; - -typedef struct _DeviceDitherPulseState { - int32_t width; //pulse width - 0...1 in 16.16 format - int32_t min; //min pulse width - 0...1 in 16.16 format - int32_t max; //max pulse width - 0...1 in 16.16 format - int32_t rise; //rising edge position in 10 mks resolution ticks - int32_t fall; //falling edge position in 10 mks resolution ticks - int32_t counter; //10 mks resolution counter, zeroed at each dither half period -} DeviceDitherPulseState; - -typedef struct _DeviceDitherPulse { - DeviceDitherPulseSettings settings; - DeviceDitherPulseState state; -} DeviceDitherPulse; - -//Dither noise typedefs -typedef struct _DeviceDitherNoiseSettings { - int8_t enabled; - int32_t period; //base (fixed) part of noise period - 0...100 measurement cycles - int32_t range; //variable (random) part of noise period - 0...50 measurement cycles - int32_t amplitude; //pulse width variation amplitude -} DeviceDitherNoiseSettings; - -typedef struct _DeviceDitherNoiseState { - int8_t enabled; - int32_t period; //base (fixed) part of noise state update period - 0...100 measurement cycles - int32_t range; //variable (random) part of noise state update period - 0...50 measurement cycles - int32_t amplitude; //pulse width variation amplitude - int32_t counter; //noise state update counter - 0 ... (period + range - 1) in measurement cycles - int32_t trigger; //noise state update trigger - 0 ... (period + range - 1) in measurement cycles - int32_t disturbance; //pulse width disturbance - -1...1 (-100...100% of maximum pulse width) in 16.16 format -} DeviceDitherNoiseState; - -typedef struct _DeviceDitherNoise { - DeviceDitherNoiseSettings settings; - DeviceDitherNoiseState state; -} DeviceDitherNoise; - -//Dither cycle typedefs -typedef struct _DeviceDitherCycleSettings { - int8_t enabled; -} DeviceDitherCycleSettings; - -typedef struct _DeviceDitherCycleState { - int8_t enabled; //dither on/off - int8_t pin1; //pin 1 state - int8_t pin2; //pin 2 state -} DeviceDitherCycleState; - -typedef struct _DeviceDitherCycle { - DeviceDitherCycleSettings settings; - DeviceDitherCycleState state; -} DeviceDitherCycle; - -//Dither phase detector typedefs -typedef struct _DeviceDitherPhaseDetectorFilterFunction { - int32_t factor[32]; //-1...+1 weight factors in 16.16 format -} DeviceDitherPhaseDetectorFilterFunction; - -typedef struct _DeviceDitherPhaseTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t raw[16]; //Raw phase (distorted) - -1...+1 in signed 16.16 fixed point format - int32_t restored[16]; //Restored phase - -1...+1 in 16.16 fixed point format -} DeviceDitherPhaseTransferFunction; - -//error = sum(weight[i + offset] * device.counters.state.delta[i]) -typedef struct _DeviceDitherPhaseDetectorSettings { - //int32_t factor[32]; //-1...+1 weight factors in 16.16 format - DeviceDitherPhaseDetectorFilterFunction filter; - DeviceDitherPhaseTransferFunction transfer; -} DeviceDitherPhaseDetectorSettings; - -typedef struct _DeviceDitherPhaseDetectorState { - int32_t sum; //Raw phase accumulator - int32_t raw; //Raw (distorted) phase - int32_t phase; //Restored phase -} DeviceDitherPhaseDetectorState; - -typedef struct _DeviceDitherPhaseDetector { - DeviceDitherPhaseDetectorSettings settings; - DeviceDitherPhaseDetectorState state; -} DeviceDitherPhaseDetector; - -//Dither oscillation frequency regulator typedefs -typedef struct _DeviceDitherFrequencyRegulatorTransferSettings { - int32_t points; //actual control points 1...16 set - int32_t error[16]; //regulator error - 0..150 Hz, signed 16.16 format - int32_t correction[16]; //regulator oscillation frequency correction - -1...1 (-100%...100%), 16.16 format -} DeviceDitherFrequencyRegulatorTransferSettings; - -typedef struct _DeviceDitherFrequencyRegulatorSettings { - int8_t enabled; - int32_t max; //signed 16.16 format maximum oscillation frequency. TODO: max(temperature) - int32_t min; //signed 16.16 format minimum oscillation frequency. TODO: min(temperature) - int32_t scale; //signed 16.16 format regulator scale factor. TODO: correction(phase) - DeviceDitherFrequencyRegulatorTransferSettings transfer; -} DeviceDitherFrequencyRegulatorSettings; - -typedef struct _DeviceDitherFrequencyRegulatorState { - int8_t enabled; - int32_t max; //maximum oscillation frequency - Hz in signed 16.16 format - int32_t min; //minimum oscillation frequency - Hz in signed 16.16 format - int32_t frequency; //oscillation frequency - Hz in signed 16.16 format - int32_t scale; //regulator scale factor - in signed 16.16 format - int32_t error; //regulator error - Hz in signed 16.16 format - int32_t correction; //regulator correction - Hz in signed 16.16 format -} DeviceDitherFrequencyRegulatorState; - -typedef struct _DeviceDitherFrequencyRegulator { - DeviceDitherFrequencyRegulatorSettings settings; - DeviceDitherFrequencyRegulatorState state; -} DeviceDitherFrequencyRegulator; - -//Dither information signal carrier frequency regulator typedefs -typedef struct _DeviceDitherAmplitudeRegulatorTransferSettings { - int32_t points; //actual control points 1...16 set - int32_t error[16]; //regulator error - 0..200 kHz, signed 16.16 format - int32_t correction[16]; //regulator pulse width correction - -1...1 (-100%...100%), 16.16 format -} DeviceDitherAmplitudeRegulatorTransferSettings; - -typedef struct _DeviceDitherAmplitudeRegulatorSettings { - int8_t enabled; - int32_t reference; //signed 16.16 format reference information signal carrier frequency - int32_t scale; //signed 16.16 format regulator scale factor - DeviceDitherAmplitudeRegulatorTransferSettings transfer; -} DeviceDitherAmplitudeRegulatorSettings; - -typedef struct _DeviceDitherAmplitudeRegulatorState { - int8_t enabled; - int32_t reference; //0...200 (kHz) signed 16.16 format reference information signal carrier frequency - int32_t scale; //regulator scale factor in signed 16.16 format - int32_t frequency; //carrier frequency in signed 16.16 format - int32_t error; //signed 16.16 format regulator error - int32_t correction; //regulator pulse width correction - -1...1 in signed 16.16 format -} DeviceDitherAmplitudeRegulatorState; - -typedef struct _DeviceDitherAmplitudeRegulator { - DeviceDitherAmplitudeRegulatorSettings settings; - DeviceDitherAmplitudeRegulatorState state; -} DeviceDitherAmplitudeRegulator; - -//Dither drive typedefs -typedef struct _DeviceDither { - DeviceDitherPulse pulse; - DeviceDitherNoise noise; - DeviceDitherCycle cycle; - DeviceDitherPhaseDetector detector; - DeviceDitherFrequencyRegulator frequency; - DeviceDitherAmplitudeRegulator amplitude; -} DeviceDither; - -void InitDitherDefaultSettings(void); -void InitDitherState(void); -void DeviceStartDither(void); - -void ditherCycle(void); -void ditherProcess(void); - -// -//Compatibility functions section -// - -//VB_Fdf s32 double output frequency (Hi) -uint32_t ditherGetRawAmplitudeSetting(void); //VB_Fdf s32 double output frequency (Hi) -#define param_VB_Fdf() ditherGetRawAmplitudeSetting() - -//F_ras int16 code: output frequency, divided by 16 (for transmission); value: output frequency -uint16_t ditherGetRawAmplitudeState(void); -#define var_F_ras() ditherGetRawAmplitudeState() - -//VB_N vbd ttf:dither drive oscillation central frequency divider 7680000/F; value:dither drive central oscillation frequency -uint16_t ditherGetRawDividerSetting(void); -#define param_VB_N() ditherGetRawDividerSetting() - -//VB_Nmax vbd ttf:maximum dither drive oscillation frequency divider 7680000/F; value:minimum dither drive oscillation frequency -uint16_t ditherGetRawDividerMaxSetting(void); -#define param_VB_Nmax() ditherGetRawDividerMaxSetting() - -//VB_Nmin vbd ttf:minimum dither drive oscillation frequency divider 7680000/F; value:maximum dither drive oscillation frequency -uint16_t ditherGetRawDividerMinSetting(void); -#define param_VB_Nmin() ditherGetRawDividerMinSetting() - -//T_Vibro code: dither drive oscillation frequency divider 7680000/F value: dither oscillation period Tva = T_Vibro * 4/Fin, Fin = 16MHz -uint16_t ditherGetRawDividerState(void); -#define var_T_Vibro() ditherGetRawDividerState() - -//T_VB_pll -int16_t ditherGetRawPhaseState(void); -#define var_T_VB_pll() ditherGetRawPhaseState() - -//VB_tau tau pulse width of the dither drive without noise or current pulse width of the dither drive with noise; value=ttf/15360000 in seconds -uint16_t ditherGetRawPulseSetting(void); -#define param_VB_tau() ditherGetRawPulseSetting() - -//VB_Tmax tau maximum pulse width of the dither drive; value=ttf/15360000 in seconds -uint16_t ditherGetRawPulseMaxSetting(void); -#define param_VB_Tmax() ditherGetRawPulseMaxSetting() - -//VB_Tmin tau minimum pulse width of the dither drive; value=ttf/15360000 in seconds -uint16_t ditherGetRawPulseMinSetting(void); -#define param_VB_Tmin() ditherGetRawPulseMinSetting() - -//L_Vibro pulse width of the dither drive without noise or current pulse width of the dither drive with noise; value=ttf/15360000 in seconds -uint16_t ditherGetRawPulseState(void); -#define var_L_Vibro() ditherGetRawPulseState() - -//VBN_Tzd s16 adjusted noise period -//int32_t device.dither.noise.settings.period -uint16_t param_VBN_Tzd(void); - -//VBN_Ran s16 range of the random component of noise -//int32_t device.dither.noise.settings.range -uint16_t param_VBN_Ran(void); - -#endif /* __DEVICE_DITHER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceErrorModel.c --- a/DeviceErrorModel.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitEMDefaultSettings(void){ - device.em.bias1.settings.enabled = 0; - device.em.bias1.settings.m[0] = 0; - device.em.bias1.settings.m[1] = 0; - device.em.bias1.settings.m[2] = 0; -} - -void InitEMState(void) { - device.em.bias1.state.enabled = device.em.bias1.settings.enabled; - device.em.bias1.state.ppm = 0; - device.em.bias1.state.error = 0; -} - -void DeviceStartEM(void) { -} - -void emProcessBias1(void) { -} - -void emProcessBias2(void) { -} - -void emProcess(void) { - if (device.em.bias1.state.enabled) { - emProcessBias1(); - } - if (device.em.bias2.state.enabled) { - emProcessBias2(); - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceErrorModel.h --- a/DeviceErrorModel.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -#ifndef __DEVICE_EM_H__ -#define __DEVICE_EM_H__ - -//Bias model #1 typedefs -// Error = m[0] + m[1] * T + m[2] * dT -typedef struct _DeviceEMBias1Settings { - int32_t enabled; - int32_t m[3]; -} DeviceEMBias1Settings; - -typedef struct _DeviceEMBias1State { - int32_t enabled; - int32_t ppm; //Accumulated angle error - millionth part in signed 16.16 format - int32_t error; //Accumulated angle error - pulses in signed 16.16 format -} DeviceEMBias1State; - -typedef struct _DeviceEMBias1 { - DeviceEMBias1Settings settings; - DeviceEMBias1State state; -} DeviceEMBias1; - -//Bias model #2 typedefs -// Error = f(T), f(T) - piecewise linear interpolation -typedef struct _DeviceEMBias2Function { - int32_t points; - int32_t celsius[16]; //Temperature - celsius in signed 16.16 format - int32_t ppm[16]; //Accumulated angle correction per dither cycle interval - ppm in signed 16.16 format -} DeviceEMBias2Function; - -typedef struct _DeviceEMBias2Settings { - int32_t enabled; - DeviceEMBias2Function tc; -} DeviceEMBias2Settings; - -typedef struct _DeviceEMBias2State { - int32_t enabled; - int32_t ppm; //Accumulated angle error - millionth part in signed 16.16 format - int32_t error; //Accumulated angle error - pulses in signed 16.16 format -} DeviceEMBias2State; - -typedef struct _DeviceEMBias2 { - DeviceEMBias2Settings settings; - DeviceEMBias2State state; -} DeviceEMBias2; - -//Scale error model typedefs -//typedef struct _DeviceEMScale1 { -// DeviceEMScale1Settings settings; -// DeviceEMScale1State state; -//} DeviceEMScale1; - -//Total error model typedefs -typedef struct _DeviceEMErrorSettings { -} DeviceEMErrorSettings; - -typedef struct _DeviceEMErrorState { - int32_t ppm; //Accumulated angle error - millionth part in signed 16.16 format - int32_t correction; //Accumulated angle error - pulses in signed 16.16 format -} DeviceEMErrorState; - -typedef struct _DeviceEMError { - DeviceEMErrorSettings settings; - DeviceEMErrorState state; -} DeviceEMError; - -typedef struct _DeviceEM { - DeviceEMBias1 bias1; //Bias error model #1 - DeviceEMBias2 bias2; //Bias error model #2 - //DeviceEMScale1 scale1; //Scale factor error model #1 - DeviceEMError error; //Total error -} DeviceEM; - -void InitEMDefaultSettings(void); -void InitEMState(void); -void DeviceStartEM(void); - -void emProcess(void); - -#endif /* __DEVICE_EM_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceFlash.c --- a/DeviceFlash.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,377 +0,0 @@ -#include "Device.h" -#include <stdio.h> - -extern Device device; -extern HashParam hashParamTable[HASH_PARAM_COUNT]; - -//Flash memory sectors -#define FLASH_SECTOR0_SIZE 0x1000 -#define FLASH_SECTOR0_START 0x00000000 -#define FLASH_SECTOR0_END 0x00000FFF - -#define FLASH_SECTOR1_SIZE 0x1000 -#define FLASH_SECTOR1_START 0X00001000 -#define FLASH_SECTOR1_END 0X00001FFF - -#define FLASH_SECTOR2_SIZE 0x1000 -#define FLASH_SECTOR2_START 0X00002000 -#define FLASH_SECTOR2_END 0X00002FFF - -#define FLASH_SECTOR3_SIZE 0x1000 -#define FLASH_SECTOR3_START 0X00003000 -#define FLASH_SECTOR3_END 0X00003FFF - -#define FLASH_SECTOR4_SIZE 0x1000 -#define FLASH_SECTOR4_START 0X00004000 -#define FLASH_SECTOR4_END 0X00004FFF - -#define FLASH_SECTOR5_SIZE 0x1000 -#define FLASH_SECTOR5_START 0X00005000 -#define FLASH_SECTOR5_END 0X00005FFF - -#define FLASH_SECTOR6_SIZE 0x1000 -#define FLASH_SECTOR6_START 0X00006000 -#define FLASH_SECTOR6_END 0X00006FFF - -#define FLASH_SECTOR7_SIZE 0x1000 -#define FLASH_SECTOR7_START 0X00007000 -#define FLASH_SECTOR7_END 0X00007FFF - -#define FLASH_SECTOR8_SIZE 0x1000 -#define FLASH_SECTOR8_START 0x00008000 -#define FLASH_SECTOR8_END 0X00008FFF - -#define FLASH_SECTOR9_SIZE 0x1000 -#define FLASH_SECTOR9_START 0x00009000 -#define FLASH_SECTOR9_END 0X00009FFF - -#define FLASH_SECTOR10_SIZE 0x1000 -#define FLASH_SECTOR10_START 0x0000A000 -#define FLASH_SECTOR10_END 0X0000AFFF - -#define FLASH_SECTOR11_SIZE 0x1000 -#define FLASH_SECTOR11_START 0x0000B000 -#define FLASH_SECTOR11_END 0X0000BFFF - -#define FLASH_SECTOR12_SIZE 0x1000 -#define FLASH_SECTOR12_START 0x0000C000 -#define FLASH_SECTOR12_END 0X0000CFFF - -#define FLASH_SECTOR13_SIZE 0x1000 -#define FLASH_SECTOR13_START 0x0000D000 -#define FLASH_SECTOR13_END 0X0000DFFF - -#define FLASH_SECTOR14_SIZE 0x1000 -#define FLASH_SECTOR14_START 0x0000E000 -#define FLASH_SECTOR14_END 0X0000EFFF - -#define FLASH_SECTOR15_SIZE 0x1000 -#define FLASH_SECTOR15_START 0x0000F000 -#define FLASH_SECTOR15_END 0X0000FFFF - -#define FLASH_SECTOR16_SIZE 0x8000 -#define FLASH_SECTOR16_START 0x00010000 -#define FLASH_SECTOR16_END 0x00017FFF - -#define FLASH_SECTOR17_SIZE 0x8000 -#define FLASH_SECTOR17_START 0x00018000 -#define FLASH_SECTOR17_END 0x0001FFFF - -#define FLASH_SECTOR18_SIZE 0x8000 -#define FLASH_SECTOR18_START 0x00020000 -#define FLASH_SECTOR18_END 0x00027FFF - -#define FLASH_SECTOR19_SIZE 0x8000 -#define FLASH_SECTOR19_START 0x00028000 -#define FLASH_SECTOR19_END 0x0002FFFF - -#define FLASH_SECTOR20_SIZE 0x8000 -#define FLASH_SECTOR20_START 0x00030000 -#define FLASH_SECTOR20_END 0x00037FFF - -#define FLASH_SECTOR21_SIZE 0x8000 -#define FLASH_SECTOR21_START 0x00038000 -#define FLASH_SECTOR21_END 0x0003FFFF - -#define FLASH_SECTOR22_SIZE 0x8000 -#define FLASH_SECTOR22_START 0x00040000 -#define FLASH_SECTOR22_END 0x00047FFF - -#define FLASH_SECTOR23_SIZE 0x8000 -#define FLASH_SECTOR23_START 0x00048000 -#define FLASH_SECTOR23_END 0x0004FFFF - -#define FLASH_SECTOR24_SIZE 0x8000 -#define FLASH_SECTOR24_START 0x00050000 -#define FLASH_SECTOR24_END 0x00057FFF - -#define FLASH_SECTOR25_SIZE 0x8000 -#define FLASH_SECTOR25_START 0x00058000 -#define FLASH_SECTOR25_END 0x0005FFFF - -#define FLASH_SECTOR26_SIZE 0x8000 -#define FLASH_SECTOR26_START 0x00060000 -#define FLASH_SECTOR26_END 0x00067FFF - -#define FLASH_SECTOR27_SIZE 0x8000 -#define FLASH_SECTOR27_START 0x00068000 -#define FLASH_SECTOR27_END 0x0006FFFF - -#define FLASH_SECTOR28_SIZE 0x8000 -#define FLASH_SECTOR28_START 0x00070000 -#define FLASH_SECTOR28_END 0x00077FFF - -#define FLASH_SECTOR29_SIZE 0x8000 -#define FLASH_SECTOR29_START 0x00078000 -#define FLASH_SECTOR29_END 0x0007FFFF - -void InitFlashDefaultSettings(void){ - device.controller.flash.settings.hashSector = 22; - device.controller.flash.settings.dataSector = 23; -} - -void InitFlashState(void){ -} - -uint32_t AddressFromSector(uint8_t sector){ - switch (sector){ - case 0: return FLASH_SECTOR0_START; - case 1: return FLASH_SECTOR1_START; - case 2: return FLASH_SECTOR2_START; - case 3: return FLASH_SECTOR3_START; - case 4: return FLASH_SECTOR4_START; - case 5: return FLASH_SECTOR5_START; - case 6: return FLASH_SECTOR6_START; - case 7: return FLASH_SECTOR7_START; - case 8: return FLASH_SECTOR8_START; - case 9: return FLASH_SECTOR9_START; - case 10: return FLASH_SECTOR10_START; - case 11: return FLASH_SECTOR11_START; - case 12: return FLASH_SECTOR12_START; - case 13: return FLASH_SECTOR13_START; - case 14: return FLASH_SECTOR14_START; - case 15: return FLASH_SECTOR15_START; - case 16: return FLASH_SECTOR16_START; - case 17: return FLASH_SECTOR17_START; - case 18: return FLASH_SECTOR18_START; - case 19: return FLASH_SECTOR19_START; - case 20: return FLASH_SECTOR20_START; - case 21: return FLASH_SECTOR21_START; - case 22: return FLASH_SECTOR22_START; - case 23: return FLASH_SECTOR23_START; - case 24: return FLASH_SECTOR24_START; - case 25: return FLASH_SECTOR25_START; - case 26: return FLASH_SECTOR26_START; - case 27: return FLASH_SECTOR27_START; - case 28: return FLASH_SECTOR28_START; - case 29: return FLASH_SECTOR29_START; - default: return 0; - } -} - -uint16_t LengthFromSector(uint8_t sector){ - switch (sector){ - case 0: return FLASH_SECTOR0_SIZE; - case 1: return FLASH_SECTOR1_SIZE; - case 2: return FLASH_SECTOR2_SIZE; - case 3: return FLASH_SECTOR3_SIZE; - case 4: return FLASH_SECTOR4_SIZE; - case 5: return FLASH_SECTOR5_SIZE; - case 6: return FLASH_SECTOR6_SIZE; - case 7: return FLASH_SECTOR7_SIZE; - case 8: return FLASH_SECTOR8_SIZE; - case 9: return FLASH_SECTOR9_SIZE; - case 10: return FLASH_SECTOR10_SIZE; - case 11: return FLASH_SECTOR11_SIZE; - case 12: return FLASH_SECTOR12_SIZE; - case 13: return FLASH_SECTOR13_SIZE; - case 14: return FLASH_SECTOR14_SIZE; - case 15: return FLASH_SECTOR15_SIZE; - case 16: return FLASH_SECTOR16_SIZE; - case 17: return FLASH_SECTOR17_SIZE; - case 18: return FLASH_SECTOR18_SIZE; - case 19: return FLASH_SECTOR19_SIZE; - case 20: return FLASH_SECTOR20_SIZE; - case 21: return FLASH_SECTOR21_SIZE; - case 22: return FLASH_SECTOR22_SIZE; - case 23: return FLASH_SECTOR23_SIZE; - case 24: return FLASH_SECTOR24_SIZE; - case 25: return FLASH_SECTOR25_SIZE; - case 26: return FLASH_SECTOR26_SIZE; - case 27: return FLASH_SECTOR27_SIZE; - case 28: return FLASH_SECTOR28_SIZE; - case 29: return FLASH_SECTOR29_SIZE; - default: return 0; - } -} -/* -uint8_t sectorFromAddress(uint32_t address){ - if (address >= FLASH_SECTOR29_START) return 29; - else if (address >= FLASH_SECTOR28_START) return 28; - else if (address >= FLASH_SECTOR27_START) return 27; - else if (address >= FLASH_SECTOR26_START) return 26; - else if (address >= FLASH_SECTOR25_START) return 25; - else if (address >= FLASH_SECTOR24_START) return 24; - else if (address >= FLASH_SECTOR23_START) return 23; - else if (address >= FLASH_SECTOR22_START) return 22; - else if (address >= FLASH_SECTOR21_START) return 21; - else if (address >= FLASH_SECTOR20_START) return 20; - else if (address >= FLASH_SECTOR19_START) return 19; - else if (address >= FLASH_SECTOR18_START) return 18; - else if (address >= FLASH_SECTOR17_START) return 17; - else if (address >= FLASH_SECTOR16_START) return 16; - else if (address >= FLASH_SECTOR15_START) return 15; - else if (address >= FLASH_SECTOR14_START) return 14; - else if (address >= FLASH_SECTOR13_START) return 13; - else if (address >= FLASH_SECTOR12_START) return 12; - else if (address >= FLASH_SECTOR11_START) return 11; - else if (address >= FLASH_SECTOR10_START) return 10; - else if (address >= FLASH_SECTOR9_START) return 9; - else if (address >= FLASH_SECTOR8_START) return 8; - else if (address >= FLASH_SECTOR7_START) return 7; - else if (address >= FLASH_SECTOR6_START) return 6; - else if (address >= FLASH_SECTOR5_START) return 5; - else if (address >= FLASH_SECTOR4_START) return 4; - else if (address >= FLASH_SECTOR3_START) return 3; - else if (address >= FLASH_SECTOR2_START) return 2; - else if (address >= FLASH_SECTOR1_START) return 1; - else return 0; -} -*/ - -DeviceFlashHash * FlashFindByHash(uint32_t hash){ - uint16_t sectorLength = LengthFromSector(device.controller.flash.settings.hashSector); - uint16_t hashCapacity = sectorLength / sizeof(DeviceFlashHash); - uint32_t sectorAddress = AddressFromSector(device.controller.flash.settings.hashSector); - DeviceFlashHash * item = (DeviceFlashHash *)sectorAddress; - for (uint16_t i = 0; i < hashCapacity; i++){ - if (item->hash == 0) break; - if (item->hash == hash) return item; - item++; - } - return 0; -} - -void DeviceFlashReadAll(void){ - uint16_t count = 0; - uint16_t sectorLength = LengthFromSector(device.controller.flash.settings.hashSector); - uint16_t hashCapacity = sectorLength / sizeof(DeviceFlashHash); - uint32_t sectorAddress = AddressFromSector(device.controller.flash.settings.hashSector); - DeviceFlashHash * item = (DeviceFlashHash *)sectorAddress; - for (uint16_t i = 0; i < hashCapacity; i++){ - if (item->hash == 0) break; //Cleared - if (item->hash == 0xffffffff) break; //Erased - for (uint32_t j = 0; j < HASH_PARAM_COUNT; j++){ - if (item->hash == hashParamTable[j].hash){ - //if (item->size == hashParamTable[j].size){ - uint8_t * src = (uint8_t *)item->address; - uint8_t * dst = hashParamTable[j].ref; - for (uint16_t k = 0; k < hashParamTable[j].size; k++){ - *dst = *src; src++; dst++; - } - //} - } - } - item++; - count++; - } - sprintf(device.service.buffer,"FlashReadAll(): %d\r\n",count); WriteConcole(); -} - -void FlashOperationWritePage(DeviceFlashWriteOperation * op){ - uint32_t res; - if (op->sectorPosition == 0){ - //Prepare new sector for write operation - res = u32IAP_PrepareSectors(op->sector, op->sector); - sprintf(device.service.buffer,"PrepareSectors(): %02d %08x\r\n",op->sector, res); WriteConcole(); - //Erase new sector - res = u32IAP_EraseSectors(op->sector, op->sector); - sprintf(device.service.buffer,"EraseSectors(): %02d %08x\r\n",op->sector, res); WriteConcole(); - } - if (op->bytes < op->maxBytes){ - //Prepare sector for write operation - res = u32IAP_PrepareSectors(op->sector, op->sector); - sprintf(device.service.buffer,"PrepareSectors(): %02d %08x\r\n",op->sector, res); WriteConcole(); - //Copy page buffer to flash - res = u32IAP_CopyRAMToFlash(op->sectorAddress + op->sectorPosition, (uint32_t)&op->pageBuffer[0], FLASH_PAGE_SIZE); - sprintf(device.service.buffer,"CopyRAMToFlash(): %8x %08x\r\n", op->sectorAddress + op->sectorPosition, res); WriteConcole(); - //Update bytes count - op->bytes += FLASH_PAGE_SIZE; - //Update sector position - op->sectorPosition += FLASH_PAGE_SIZE; - if (op->sectorPosition == op->sectorLength){ - //Update sector address - op->sectorAddress += op->sectorLength; - //Clear sector position - op->sectorPosition = 0; - //Update sector - op->sector += 1; - } - //Update page position - op->pagePosition = 0; - } -} - -void FlashOperationAppend(DeviceFlashWriteOperation * op, void * src, uint16_t count){ - uint8_t * ptr = (uint8_t*) src; - for (uint16_t i = 0; i < count; i++){ - op->pageBuffer[op->pagePosition] = *ptr; - op->pagePosition++; - ptr++; - //Write page buffer - if (op->pagePosition == FLASH_PAGE_SIZE){ - FlashOperationWritePage(op); - } - } -} - -void FlashOperationComplete(DeviceFlashWriteOperation * op){ - for (uint16_t i = op->pagePosition; i < FLASH_PAGE_SIZE; i++){ - op->pageBuffer[op->pagePosition] = 0xff; - op->pagePosition++; - } - FlashOperationWritePage(op); -} - -void DeviceFlashWriteAll(void){ - //#pragma pack(push) /* push current alignment to stack */ - //#pragma pack(4) /* set alignment to 4 byte boundary */ - DeviceFlashWriteOperation hash; - //#pragma pack(pop) /* restore original alignment from stack */ - hash.sector = device.controller.flash.settings.hashSector; - hash.sectorAddress = AddressFromSector(hash.sector); - hash.sectorLength = LengthFromSector(hash.sector); - hash.sectorPosition = 0; - hash.pagePosition = 0; - //hash.pageLength = device.flash.settings.hashPageLength; - hash.bytes = 0; - hash.maxBytes = hash.sectorLength; - - DeviceFlashWriteOperation data; - data.sector = device.controller.flash.settings.dataSector; - data.sectorAddress = AddressFromSector(data.sector); - data.sectorLength = LengthFromSector(data.sector); - data.sectorPosition = 0; - data.pagePosition = 0; - //data.pageLength = device.flash.settings.dataPageLength; - data.bytes = 0; - data.maxBytes = FLASH_SECTOR29_END - data.sectorAddress; - - NVIC_DisableIRQ(TIMER1_IRQn); - NVIC_DisableIRQ(TIMER2_IRQn); - NVIC_DisableIRQ(EINT3_IRQn); - //SystemInitDef(); - - for (uint32_t i = 0; i < HASH_PARAM_COUNT; i++){ - FlashOperationAppend(&hash, &hashParamTable[i].hash, 4); - uint32_t address = data.sectorAddress + data.sectorPosition + data.pagePosition; - FlashOperationAppend(&hash, &address, 4); - FlashOperationAppend(&data, hashParamTable[i].ref, hashParamTable[i].size); - } - FlashOperationComplete(&hash); - FlashOperationComplete(&data); - - NVIC_EnableIRQ(TIMER1_IRQn); - NVIC_EnableIRQ(TIMER2_IRQn); - NVIC_EnableIRQ(EINT3_IRQn); -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceFlash.h --- a/DeviceFlash.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -#ifndef __DEVICE_FLASH_H__ -#define __DEVICE_FLASH_H__ - -#include "IAP.h" - -//Flash memory page size: 256|512|1024|4096 allowed -#define FLASH_PAGE_SIZE 256 - -//Hash sector - 8 bytes per hash -typedef struct _DeviceFlashHash { - uint32_t hash; //Hash - uint32_t address; //Address of data located in data sector - //uint16_t size; //Size of data -} DeviceFlashHash; - -typedef struct _DeviceFlashSettings { - uint16_t hashSector; //Sector of "hash - data address" pairs - //uint16_t hashPageLength; - uint16_t dataSector; //Sector of data, referenced from hash sector - //uint16_t dataPageLength; -} DeviceFlashSettings; - -typedef struct _DeviceFlashWriteOperation { - uint8_t pageBuffer[FLASH_PAGE_SIZE]; //Page buffer - //uint16_t pageLength; - uint16_t pagePosition; //Position in page buffer to write in - - uint16_t sector; //Current sector to write data in - uint32_t sectorAddress; //Starting address of sector to write data from page buffer - uint16_t sectorPosition; //Position in sector to write data from page buffer relative to sector start address - uint16_t sectorLength; //Length of current sector - - uint32_t bytes; //Count of bytes written - uint32_t maxBytes; //Maximum allowed bytes to write -} DeviceFlashWriteOperation; - -typedef struct _DeviceFlashState { -} DeviceFlashState; - -typedef struct _DeviceFlash { - DeviceFlashSettings settings; - DeviceFlashState state; -} DeviceFlash; - -void InitFlashDefaultSettings(void); -void InitFlashState(void); - -uint32_t AddressFromSector(uint8_t sector); -uint16_t LengthFromSector(uint8_t sector); -//uint8_t sectorFromAddress(uint32_t address); - -void DeviceFlashReadAll(void); -void DeviceFlashWriteAll(void); - -#endif /* __DEVICE_FLASH_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceI2C.c --- a/DeviceI2C.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -#include "Device.h" - -//I2C Control Set Register -#define I2CONSET_I2EN 0x0000040 -#define I2CONSET_AA 0x0000004 -#define I2CONSET_SI 0x0000008 -#define I2CONSET_STO 0x0000010 -#define I2CONSET_STA 0x0000020 -//I2C Control clear Register -#define I2CONCLR_AAC 0x0000004 -#define I2CONCLR_SIC 0x0000008 -#define I2CONCLR_STAC 0x0000020 -#define I2CONCLR_I2ENC 0x0000040 -//I2C SCL Duty Cycle Register -#define I2SCLH_SCLH 0x00000080 //High -#define I2SCLL_SCLL 0x00000080 //Low -//Address -#define I2C_A_ADDRESS 0x0000005E //address of slave potentiometer A (table 6-2 of pot's manual) -#define I2C_B_ADDRESS 0x0000005C //address of slave potentiometer B (table 6-2 of pot's manual) -#define I2C_WRITE_CMD 0x00000000 //address of wiper0 register in memory map -//Timeout -#define I2C_TIMEOUT 1000 - -extern Device device; - -// -//Attention!!! -// Different LPC17xx.h versions declare different I2C registers names: -// LPC_I2C0->CONCLR (Keil?)/ LPC_I2C0->I2CONCLR (mbed) -// ... -// - -void InitI2CDefaultSettings(void){ - device.controller.I2C.settings.trigger = 1000; -} - -void InitI2CState(void) { - device.controller.I2C.state.buffer[0] = I2C_A_ADDRESS; - device.controller.I2C.state.buffer[1] = I2C_WRITE_CMD; - device.controller.I2C.state.buffer[2] = 255 - device.isacs.potentiometers.settings.a; - device.controller.I2C.state.buffer[3] = I2C_B_ADDRESS; - device.controller.I2C.state.buffer[4] = I2C_WRITE_CMD; - device.controller.I2C.state.buffer[5] = 255 - device.isacs.potentiometers.settings.b; - device.controller.I2C.state.position = 0; - device.controller.I2C.state.counter = 0; - device.controller.I2C.state.trigger = device.controller.I2C.settings.trigger; - device.controller.I2C.state.enabled = 0; -} - -void DeviceStartI2C(void) { - LPC_SC->PCONP |= (1 << 7);//I2C0 power on - - LPC_PINCON->PINSEL1 &= ~0x03C00000; //P0.27 - SDA - LPC_PINCON->PINSEL1 |= 0x01400000; //P0.28 - SCK - - LPC_I2C0->CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC; //Master mode - //LPC_I2C0->I2CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC; //Master mode - - LPC_I2C0->SCLL = I2SCLL_SCLL; // - счетчик scl low time period - //LPC_I2C0->I2SCLL = I2SCLL_SCLL; // - счетчик scl low time period - LPC_I2C0->SCLH = I2SCLH_SCLH; // - счетчик scl high time period - //LPC_I2C0->I2SCLH = I2SCLH_SCLH; // - счетчик scl high time period - - LPC_I2C0->CONSET = I2CONSET_I2EN; //включение интерфейса I2C - //LPC_I2C0->I2CONSET = I2CONSET_I2EN; //включение интерфейса I2C - - device.controller.I2C.state.CON0 = LPC_I2C0->CONSET & (~LPC_I2C0->CONCLR); - - i2cEnableTransmission(); -} - -void i2cProcess(void) { - if (!device.controller.I2C.state.enabled) return; //Transmission disabled, go away - - device.controller.I2C.state.counter++; - if (device.controller.I2C.state.counter > device.controller.I2C.state.trigger){//Time out, go away - device.controller.I2C.state.counter = 0; - device.controller.I2C.state.enabled = 0; - LPC_I2C0->CONSET = I2CONSET_STO; //Set Stop flag - //LPC_I2C0->I2CONSET = I2CONSET_STO; //Set Stop flag - LPC_I2C0->CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC; - //LPC_I2C0->I2CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC; - return; - } - - if (!(LPC_I2C0->CONSET & I2CONSET_SI)) return; //State of I2C bus has not been changed - //if (!(LPC_I2C0->I2CONSET & I2CONSET_SI)) return; //State of I2C bus has not been changed - - uint32_t StatValue = LPC_I2C0->STAT; - //uint32_t StatValue = LPC_I2C0->I2STAT; - switch ( StatValue ) { - //Start condition issued (write data for the first potentiometer) - case 0x08: - device.controller.I2C.state.position = 0; //Init buffer position - device.controller.I2C.state.counter = 0; //Init countdown - LPC_I2C0->DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send address - //LPC_I2C0->I2DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send address - LPC_I2C0->CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); //Clear interrupt bit and start bit - //LPC_I2C0->I2CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); //Clear interrupt bit and start bit - break; - - //Repeated started is issued (write data for the second potentiometer) - case 0x10: - LPC_I2C0->DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send address - //LPC_I2C0->I2DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send address - LPC_I2C0->CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); //Clear interrupt bit and start bit - //LPC_I2C0->I2CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); //Clear interrupt bit and start bit - break; - - //ACK after slave address reading - case 0x18: - LPC_I2C0->DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send another byte - //LPC_I2C0->I2DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++]; //Send another byte - LPC_I2C0->CONCLR = I2CONCLR_SIC; //Clear interrupt bit - //LPC_I2C0->I2CONCLR = I2CONCLR_SIC; //Clear interrupt bit - break; - - //ACK after data byte - case 0x28: - if (device.controller.I2C.state.position == I2C_BUFFER_LENGTH) { //Data transmission finished - device.controller.I2C.state.enabled = 0; - LPC_I2C0->CONSET = I2CONSET_STO; //Set Stop flag - //LPC_I2C0->I2CONSET = I2CONSET_STO; //Set Stop flag - } else if (device.controller.I2C.state.position == 3) { - LPC_I2C0->CONSET = I2CONSET_STA; - //LPC_I2C0->I2CONSET = I2CONSET_STA; - //sprintf(device.service.buffer, "I2C 0x28 mid\r\n"); WriteConcole(); //Development message - } else { - LPC_I2C0->DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++];//Send another byte - //LPC_I2C0->I2DAT = device.controller.I2C.state.buffer[device.controller.I2C.state.position++];//Send another byte - } - LPC_I2C0->CONCLR = I2CONCLR_SIC; //Clear interrupt bit - //LPC_I2C0->I2CONCLR = I2CONCLR_SIC; //Clear interrupt bit - break; - - //No acknoledgement after address transmitting - case 0x20: - //No acknoledgement after data block transmitting - case 0x30: - LPC_I2C0->CONSET = I2CONSET_STO; //Set Stop flag - //LPC_I2C0->I2CONSET = I2CONSET_STO; //Set Stop flag - LPC_I2C0->CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); - //LPC_I2C0->I2CONCLR = (I2CONCLR_SIC | I2CONCLR_STAC); - device.controller.I2C.state.enabled = 0; //Disable transmission - break; - } -} - -void i2cEnableTransmission(void){ - device.controller.I2C.state.position = 0; - device.controller.I2C.state.counter = 0; - LPC_I2C0->CONSET = I2CONSET_STA; //Set start flag - //LPC_I2C0->I2CONSET = I2CONSET_STA; //Set start flag - device.controller.I2C.state.enabled = 1; //Enable transmission -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceI2C.h --- a/DeviceI2C.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -#ifndef __DEVICE_I2C_H__ -#define __DEVICE_I2C_H__ - -typedef struct _DeviceI2CSettings { - uint32_t trigger; -} DeviceI2CSettings; - -#define I2C_BUFFER_LENGTH 6 -typedef struct _DeviceI2CState { - uint32_t CON0; //Control register - uint32_t buffer[I2C_BUFFER_LENGTH]; //Transmission buffer - uint32_t position; //Buffer position - uint32_t counter; //Time out counter - uint32_t trigger; //Time out trigger - uint32_t enabled; //Transmission enabled -} DeviceI2CState; - -typedef struct _DeviceI2C { - DeviceI2CState state; - DeviceI2CSettings settings; -} DeviceI2C; - -void InitI2CDefaultSettings(void); -void InitI2CState(void); -void DeviceStartI2C(void); - -void i2cEnableTransmission(void); -void i2cProcess(void); -#endif /* __DEVICE_I2C_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceISACS.c --- a/DeviceISACS.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +0,0 @@ -#include "Device.h" - -extern Device device; - -void InitISACSOutputDefaultSettings(void){ - device.isacs.regulator.settings.start.enabled = 1; - device.isacs.regulator.settings.regular.enabled = 1; - device.isacs.regulator.settings.reset.enabled = 1; - - device.isacs.regulator.settings.transfer.points = 16; - device.isacs.regulator.settings.transfer.error[0] = -0x20000; //-2.0V - device.isacs.regulator.settings.transfer.correction[0] = 0x10000; //1.0 - device.isacs.regulator.settings.transfer.error[1] = -0x1bbbb; //-1.7333333333333334V - device.isacs.regulator.settings.transfer.correction[1] = 0xb473; //0.7048888888888889 - device.isacs.regulator.settings.transfer.error[2] = -0x17777; //-1.4666666666666668V - device.isacs.regulator.settings.transfer.correction[2] = 0x7aa7; //0.47911111111111115 - device.isacs.regulator.settings.transfer.error[3] = -0x13333; //-1.2V - device.isacs.regulator.settings.transfer.correction[3] = 0x4fdf; //0.31199999999999994 - device.isacs.regulator.settings.transfer.error[4] = -0xeeee; //-0.9333333333333333V - device.isacs.regulator.settings.transfer.correction[4] = 0x3161; //0.1928888888888889 - device.isacs.regulator.settings.transfer.error[5] = -0xaaaa; //-0.6666666666666667V - device.isacs.regulator.settings.transfer.correction[5] = 0x1c71; //0.11111111111111113 - device.isacs.regulator.settings.transfer.error[6] = -0x6666; //-0.3999999999999999V - device.isacs.regulator.settings.transfer.correction[6] = 0xe56; //0.05599999999999999 - device.isacs.regulator.settings.transfer.error[7] = -0x2222; //-0.1333333333333333V - device.isacs.regulator.settings.transfer.correction[7] = 0x452; //0.016888888888888884 - device.isacs.regulator.settings.transfer.error[8] = 0x2222; //0.1333333333333333V - device.isacs.regulator.settings.transfer.correction[8] = -0x452; //-0.016888888888888884 - device.isacs.regulator.settings.transfer.error[9] = 0x6666; //0.3999999999999999V - device.isacs.regulator.settings.transfer.correction[9] = -0xe56; //-0.05599999999999999 - device.isacs.regulator.settings.transfer.error[10] = 0xaaaa; //0.6666666666666665V - device.isacs.regulator.settings.transfer.correction[10] = -0x1c71; //-0.11111111111111108 - device.isacs.regulator.settings.transfer.error[11] = 0xeeee; //0.9333333333333331V - device.isacs.regulator.settings.transfer.correction[11] = -0x3161; //-0.1928888888888888 - device.isacs.regulator.settings.transfer.error[12] = 0x13333; //1.2000000000000002V - device.isacs.regulator.settings.transfer.correction[12] = -0x4fdf; //-0.31200000000000006 - device.isacs.regulator.settings.transfer.error[13] = 0x17777; //1.4666666666666668V - device.isacs.regulator.settings.transfer.correction[13] = -0x7aa7; //-0.47911111111111115 - device.isacs.regulator.settings.transfer.error[14] = 0x1bbbb; //1.7333333333333334V - device.isacs.regulator.settings.transfer.correction[14] = -0xb473; //-0.7048888888888889 - device.isacs.regulator.settings.transfer.error[15] = 0x20000; //2.0V - device.isacs.regulator.settings.transfer.correction[15] = -0x10000; //-1.0 - - device.isacs.output.settings.transfer.points = 2; - //Control point 1.5 volt - low output limit - device.isacs.output.settings.transfer.voltage[0] = 0x00017fff; - device.isacs.output.settings.transfer.code[0] = 800; - //Control point 12.5 volt - high output limit - device.isacs.output.settings.transfer.voltage[1] = 0x000c7fff; - device.isacs.output.settings.transfer.code[1] = 2048; - device.isacs.output.settings.start.voltage = 0x000c7fff; //+12.5V start - device.isacs.output.settings.reset.voltage = 0x00077fff; //+7.5V if regulator disabled at reset time - device.isacs.output.state.min = 0x00077fff; //+7.5V - device.isacs.output.state.max = 0x000c7fff; //+12.5V -} - -void InitISACSOutputState(void){ -} - -void DeviceStartISACSOutput(void){ -} - -void InitISACSRegulatorDefaultSettings(void){ - //Startup settings - device.isacs.regulator.settings.start.enabled = 1; - device.isacs.regulator.settings.start.reference = 0x00020000; //Reference voltage 2V in 16.16 signed fixed point format - device.isacs.regulator.settings.start.scale = 1; //Scale factor - //Regular operation settings - device.isacs.regulator.settings.regular.enabled = 1; - device.isacs.regulator.settings.regular.reference = 0x00020000; //Reference voltage 2V in 16.16 signed fixed point format - device.isacs.regulator.settings.regular.scale = 1; //Scale factor - //Reset operation settings - device.isacs.regulator.settings.reset.enabled = 1; - device.isacs.regulator.settings.reset.reference = 0x00020000; //Reference voltage 2V in 16.16 signed fixed point format - device.isacs.regulator.settings.reset.scale = 1; //Scale factor -} - -void InitISACSRegulatorState(void){ - device.isacs.regulator.state.enabled = device.isacs.regulator.settings.start.enabled; - device.isacs.regulator.state.reference = device.isacs.regulator.settings.start.reference; - device.isacs.regulator.state.scale = device.isacs.regulator.settings.start.scale; - device.isacs.regulator.state.error = 0; - device.isacs.regulator.state.correction = 0; -} - -void DeviceStartISACSRegulator(void){ -} - -void InitISACSDefaultSettings(void){ - InitISACSPotentiometersDefaultSettings(); - InitISACSRegulatorDefaultSettings(); - InitISACSOutputDefaultSettings(); -} - -void InitISACSState(void){ - InitISACSPotentiometersState(); - InitISACSRegulatorState(); - InitISACSOutputState(); -} - -void DeviceStartISACS(void){ - DeviceStartISACSPotentiometers(); - DeviceStartISACSRegulator(); - DeviceStartISACSOutput(); -} - -/* -//Count leading zeroes -static uint8_t clz(uint32_t x) { - uint8_t result = 0; - if (x == 0) return 32; - while (!(x & 0xF0000000)) { result += 4; x <<= 4; } - while (!(x & 0x80000000)) { result += 1; x <<= 1; } - return result; -} -//Count trailing zeroes -static uint8_t ctz(uint32_t x) { - uint8_t result = 0; - if (x == 0) return 32; - while (!(x & 0xF0000000)) { result += 4; x <<= 4; } - while (!(x & 0x80000000)) { result += 1; x <<= 1; } - return result; -} -*/ - -int32_t isacsInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t isacsInput(uint32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.isacs.input.settings.transfer.points; i++) { - r1 = device.isacs.input.settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.isacs.input.settings.transfer.V[i - 1]; - } - - r2 = device.isacs.input.settings.transfer.raw[i]; - if (raw < r2) { - int32_t v1 = device.isacs.input.settings.transfer.V[i - 1]; - int32_t v2 = device.isacs.input.settings.transfer.V[i]; - return isacsInterpolate(raw, r1, r2, v1, v2); - } - } - return device.isacs.input.settings.transfer.V[device.isacs.input.settings.transfer.points - 1]; -} - -int32_t isacsCorrection(int32_t error) { - int32_t e1, e2; - for (uint8_t i = 1; i < device.isacs.regulator.settings.transfer.points; i++) { - e1 = device.isacs.regulator.settings.transfer.error[i - 1]; - if (error < e1) { - return device.isacs.regulator.settings.transfer.correction[i - 1]; - } - - e2 = device.isacs.regulator.settings.transfer.error[i]; - if (error < e2) { - int32_t c1 = device.isacs.regulator.settings.transfer.correction[i - 1]; - int32_t c2 = device.isacs.regulator.settings.transfer.correction[i]; - return isacsInterpolate(error, e1, e2, c1, c2); - } - } - return device.isacs.regulator.settings.transfer.correction[device.isacs.regulator.settings.transfer.points - 1]; -} - -uint32_t isacsOutput(int32_t voltage) { - int32_t v1, v2; - for (uint8_t i = 1; i < device.isacs.output.settings.transfer.points; i++) { - v1 = device.isacs.output.settings.transfer.voltage[i - 1]; - if (voltage < v1) { - return device.isacs.output.settings.transfer.code[i - 1]; - } - - v2 = device.isacs.output.settings.transfer.voltage[i]; - if (voltage < v2) { - int32_t c1 = device.isacs.output.settings.transfer.code[i - 1]; - int32_t c2 = device.isacs.output.settings.transfer.code[i]; - return isacsInterpolate(voltage, v1, v2, c1, c2); - } - } - return device.isacs.output.settings.transfer.code[device.isacs.output.settings.transfer.points - 1]; -} - -void isacsProcess(void) { - device.isacs.input.state.sum += device.controller.SSP.in[4]; - if (device.measurement.counter == 31) { - device.isacs.input.state.raw = device.isacs.input.state.sum >> 5; - device.isacs.input.state.sum = 0; - device.isacs.input.state.V = isacsInput(device.isacs.input.state.raw); - - if (device.isacs.regulator.state.enabled) { - device.isacs.regulator.state.error = device.isacs.regulator.state.reference - device.isacs.input.state.V; - device.isacs.regulator.state.correction = (device.isacs.regulator.state.scale * isacsCorrection(device.isacs.regulator.state.error)) >> 16; - device.isacs.output.state.voltage += device.isacs.regulator.state.correction; - device.controller.SSP.out[0] = isacsOutput(device.isacs.output.state.voltage); - } - } -} - -int16_t var_HF_reg(void) { - //Value: HFO voltage - V - -13.2V...10.7V - //Internal format: device.isacs.output.state.voltage - device.isacs.output.state.min...device.isacs.output.state.max [V] in 16.16 format - //Output format: -8192 * (V + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: V + 1.3 = (device.isacs.output.state.voltage + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.isacs.output.state.voltage + 0x00014ccd) / 24 - - int32_t V = -(device.isacs.output.state.voltage + 0x00014ccd) / 24; - if (V > 32767) V = 32767; - if (V < -32768) V = -32768; - - return (int16_t)V; -} - -int16_t var_HF_dif(void) { - //Value: HFO regulator input signal error - [V] - //Internal format: device.isacs.regulator.state.error - [V] in 16.16 format - //Output format: (V / 2.0) * 15000 - dimensionless units in 16.0 format - - //Voltage: V = device.isacs.regulator.state.error / 65536 - //Output: (V / 2.0) * 15000 = device.isacs.regulator.state.error * 1875 / 16384 - - int32_t V = device.isacs.regulator.state.error * 1875 / 16384; - if (V > 32767) V = 32767; - if (V < 0) V = 0; - - return (int16_t)V; -} - -uint16_t param_HF_ref(void) { - //Value: HFO regulator input signal reference voltage - V - 2V - //Internal format: device.isacs.regulator.state.reference - [V] in 16.16 format - //Output format: (V / 2.0) * 15000 - dimensionless units in 16.0 format - - //Voltage: V = device.isacs.regulator.state.reference / 65536 - //Output: V = device.isacs.regulator.state.reference * 1875 / 16384 - - //TODO: state/settings - - int32_t V = device.isacs.regulator.state.reference * 1875 / 16384; - if (V > 32767) V = 32767; - if (V < 0) V = 0; - - return (uint16_t)V; -} - -//HF_scl s16 HFO gain factor -uint16_t param_HF_scl(void) { - //Value: ISACS output regulator scale - S - -13.2V...10.7V - //Internal format: device.isacs.regulator.state.scale - dimensionless units in 16.16 format - //Output format: S / 65536 - dimensionless units in 16.0 format - - int32_t scl = device.isacs.regulator.state.scale / 65536; - if (scl > 32767) scl = 32767; - if (scl < 0) scl = 0; - - return (uint16_t)scl; -} - -uint16_t param_HF_min(void) { - //Value: HFO maximum voltage - V - -13.2V...10.7V - //Internal format: device.isacs.output.state.max - [V] in 16.16 format - //Output format: -8192 * (V + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: V + 1.3 = (device.isacs.output.state.max + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.isacs.output.state.max + 0x00014ccd) / 24 - - //TODO: state/settings - - int32_t V = -(device.isacs.output.state.max + 0x00014ccd) / 24; - if (V > 32767) V = 32767; - if (V < -32768) V = -32768; - - return (uint16_t)V; -} - -uint16_t param_HF_max(void) { - //Value: HFO minimum voltage - V - -13.2V...10.7V - //Internal format: device.isacs.output.state.min - [V] in 16.16 format - //Output format: -8192 * (V + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: V + 1.3 = (device.isacs.output.state.min + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.isacs.output.state.min + 0x00014ccd) / 24 - - //TODO: state/settings - - int32_t V = -(device.isacs.output.state.min + 0x00014ccd) / 24; - if (V > 32767) V = 32767; - if (V < -32768) V = -32768; - - return (uint16_t)V; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceISACS.h --- a/DeviceISACS.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -#ifndef __DEVICE_ISACS_H__ -#define __DEVICE_ISACS_H__ - -#include "DeviceISACSPotentiometers.h" - -//Information signal amplitude control system -// input(photodetector - amplifier - potentiometers - amplitude detector - ADC - low pass filter - code - voltage) -// regulator -// output(voltage - code - DAC - Amplifier - control unit - hfo) - -//Information signal amplitude control system input ( = ADC - low pass filter - code - voltage) typedefs -typedef struct _DeviceISACSInputTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t V[16]; //Input voltage control points - V in signed 16.16 fixed point format - int32_t raw[16]; //Input voltage control points - DAC code -} DeviceISACSInputTransferFunction; - -typedef struct _DeviceISACSInputSettings { - DeviceISACSInputTransferFunction transfer; -} DeviceISACSInputSettings; - -typedef struct _DeviceISACSInputState { - int32_t sum; //Sum of cycle current measurements - ADC code - updates 32 times per cycle - int32_t raw; //Average input - ADC code - updates 1 time per cycle - int32_t V; //Average input - volts in 16.16 format - updates 1 time per cycle -} DeviceISACSInputState; - -typedef struct _DeviceISACSInput { - DeviceISACSInputSettings settings; - DeviceISACSInputState state; -} DeviceISACSInput; - -//Information signal amplitude control system output ( = DAC + amplifier + control unit + hfo) typedefs -typedef struct _DeviceISACSOutputTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t voltage[16]; //Output voltage control points - V in signed 16.16 fixed point format - int32_t code[16]; //DAC code control points -} DeviceISACSOutputTransferFunction; - -typedef struct _DeviceISACSOutputStart { - int32_t voltage; //Output - volts in 16.16 format -} DeviceISACSOutputStart; - -typedef struct _DeviceISACSOutputReset { - int32_t voltage; //Output - volts in 16.16 format -} DeviceISACSOutputReset; - -typedef struct _DeviceISACSOutputSettings { - uint32_t max; //Maximum output voltage in 16.16 format. TODO: max(temperature - uint32_t min; //Minimum output voltage in 16.16 format. TODO: max(temperature - DeviceISACSOutputTransferFunction transfer; - DeviceISACSOutputStart start; - DeviceISACSOutputReset reset; -} DeviceISACSOutputSettings; - -typedef struct _DeviceISACSOutputState { - uint32_t max; //Maximum output voltage in 16.16 format - uint32_t min; //Minimum output voltage in 16.16 format - int32_t voltage; //Output - volts in 16.16 format - updates 1 time per cycle -} DeviceISACSOutputState; - -typedef struct _DeviceISACSOutput { - DeviceISACSOutputSettings settings; - DeviceISACSOutputState state; -} DeviceISACSOutput; - -//Information signal amplitude control system regulator typedefs -typedef struct _DeviceISACSCorrectionTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t error[16]; //Regulator error - V in signed 16.16 fixed point format - int32_t correction[16]; //Output correction - -1...+1 in signed 16.16 fixed point format -} DeviceISACSCorrectionTransferFunction; - -typedef struct _DeviceISACSRegulatorConditionSettings { - uint8_t enabled; - int32_t reference; //Reference input - volts in 16.16 format - int32_t scale; //Regulator scale factor - dimensionless units in signed 16.16 format -} DeviceISACSRegulatorConditionSettings; - -typedef struct _DeviceISACSRegulatorSettings { - DeviceISACSRegulatorConditionSettings start; //Regulator settings for ISACS system in start condition - DeviceISACSRegulatorConditionSettings regular; //Regulator settings for ISACS system in normal condition - DeviceISACSRegulatorConditionSettings reset; //Regulator settings for ISACS system in reset condition - DeviceISACSCorrectionTransferFunction transfer; //Regulator correction function -} DeviceISACSRegulatorSettings; - -typedef struct _DeviceISACSRegulatorState { - uint8_t enabled; - int32_t reference; //Reference input - volts in 16.16 format - int32_t error; //Regulator error - volts in signed 16.16 format - int32_t scale; //Regulator scale factor - dimensionless units in signed 16.16 format - int32_t correction; //Output correction - V in signed 16.16 fixed point format -} DeviceISACSRegulatorState; - -typedef struct _DeviceISACSRegulator { - DeviceISACSRegulatorSettings settings; - DeviceISACSRegulatorState state; -} DeviceISACSRegulator; - -//Information signal amplitude control system typedefs -// Information signal amplitude ADC: device.controller.SSP.ADC[4] -// Information signal amplitude control system DAC: device.controller.SSP.DAC[0] -typedef struct _DeviceISACS { - DeviceISACSPotentiometers potentiometers; - DeviceISACSInput input; - DeviceISACSRegulator regulator; - DeviceISACSOutput output; -} DeviceISACS; - -//Information signal amplitude stabilizer functions -void InitISACSOutputDefaultSettings(void); -void InitISACSOutputState(void); -void DeviceStartISACSOutput(void); - -void InitISACSRegulatorDefaultSettings(void); -void InitISACSRegulatorState(void); -void DeviceStartISACSRegulator(void); - -void InitISACSDefaultSettings(void); -void InitISACSState(void); -void DeviceStartISACS(void); - -void isacsProcess(void); - -//Compatibility functions section -//HF_reg dac ttf: DAC code in HFO channel; value: voltage of HFO; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -int16_t var_HF_reg(void); - -//HF_dif = HF_ref - HF_out -int16_t var_HF_dif(void); - -//HF_ref s16 value of the reference -uint16_t param_HF_ref(void); - -//HF_scl s16 HFO gain factor -uint16_t param_HF_scl(void); - -//HF_min dac ttf:minimum DAC code in HFO channel; value:maximal voltage of HFO; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_HF_min(void); - -//HF_max dac ttf:maximum DAC code in HFO channel; value:minimal voltage of HFO; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_HF_max(void); - -#endif /* __DEVICE_ISACS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceISACSPotentiometers.c --- a/DeviceISACSPotentiometers.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitISACSPotentiometersDefaultSettings(void){ - device.isacs.potentiometers.settings.a = 255; - device.isacs.potentiometers.settings.b = 255; -} - -void InitISACSPotentiometersState(void) { - device.isacs.potentiometers.state.a = device.isacs.potentiometers.settings.a; - device.isacs.potentiometers.state.b = device.isacs.potentiometers.settings.b; -} - -void DeviceStartISACSPotentiometers(void) { - DeviceISACSSetPotentiometers(); -} - -void DeviceISACSSetPotentiometers(void) { - device.controller.I2C.state.buffer[2] = 255 - device.isacs.potentiometers.state.a; - device.controller.I2C.state.buffer[5] = 255 - device.isacs.potentiometers.state.b; - i2cEnableTransmission(); -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceISACSPotentiometers.h --- a/DeviceISACSPotentiometers.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#ifndef __DEVICE_ISACS_POTENTIOMETERS_H__ -#define __DEVICE_ISACS_POTENTIOMETERS_H__ - -typedef struct _DeviceISACSPotentiometersSettings { - uint32_t a; - uint32_t b; -} DeviceISACSPotentiometersSettings; - -typedef struct _DeviceISACSPotentiometersState { - uint32_t a; - uint32_t b; -} DeviceISACSPotentiometersState; - -typedef struct _DeviceISACSPotentiometers { - DeviceISACSPotentiometersSettings settings; - DeviceISACSPotentiometersState state; -} DeviceISACSPotentiometers; - -void InitISACSPotentiometersDefaultSettings(void); -void InitISACSPotentiometersState(void); -void DeviceStartISACSPotentiometers(void); - -void DeviceISACSSetPotentiometers(void); - -#endif /* __DEVICE_ISACS_POTENTIOMETERS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceLightUp.c --- a/DeviceLightUp.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -#include "Device.h" - -#ifdef DEV_BOARD_HAOYU -#warning "DeviceLightUp.c debug: development board LED1, LED2 in use instead light-up and backlight!!!" -#endif - -extern Device device; - -void InitLightUpDefaultSettings(void){ - device.lightUp.settings.sequence = 0x0155; - device.lightUp.state.sequence = 0x0000; - device.lightUp.state.enabled = 0; -} - -void InitLightUpState(void) { - device.lightUp.state.sequence = device.lightUp.settings.sequence; - device.lightUp.state.enabled = 1; -} - -void DeviceStartLightUp(void) { - #ifdef DEV_BOARD_HAOYU - //Development board - P3.25: LED1 - LPC_PINCON->PINSEL7 &= ~(3<<18); //P3.25 is GPIO pin (write ( 00 ) in bits 19:18 of PISEL7) - LPC_PINCON->PINMODE7 |= (3<<18); //P3.25 pull-down resistor on (write ( 11 ) in bits 19:18 of PINMODE7) - LPC_GPIO3->FIODIR |= (1<<25); //P3.25 is output (write ( 1 ) in bit 25 of FIODIR) - LPC_GPIO3->FIOSET |= (1<<25); //off - - //Development board - P3.26: LED2 - LPC_PINCON->PINSEL7 &= ~(3<<20); //P3.26 is GPIO pin (write ( 00 ) in bits 21:20 of PISEL7) - LPC_PINCON->PINMODE7 |= (3<<20); //P3.26 pull-down resistor on (write ( 11 ) in bits 21:20 of PINMODE7) - LPC_GPIO3->FIODIR |= (1<<26); //P3.26 is output (write ( 1 ) in bit 26 of FIODIR) - LPC_GPIO3->FIOSET |= (1<<26); //off - #else - //Device - P0.4: Light-up - LPC_PINCON->PINSEL0 &= ~(3<<8); //P0.4 is GPIO pin (write ( 00 ) in bits 9:8 of PISEL0) - LPC_PINCON->PINMODE0 |= (3<<8); //P0.4 pull-down resistor on (write ( 11 ) in bits 9:8 of PINMODE0) - LPC_GPIO0->FIODIR |= (1<<4); //P0.4 is output (write ( 1 ) in bit 4 of FIODIR) - LPC_GPIO0->FIOSET |= (1<<4); //off - - //Device - P2.12: Back light - LPC_PINCON->PINSEL3 &= ~(0x00<<24); - LPC_PINCON->PINSEL3 |= (0x00<<24); //P2.12 is GPIO pin (write ( 00 ) in bits 13:12 of PISEL3) - LPC_PINCON->PINMODE3 |= (3<<24); //P2.12 pull-down resistor on (write ( 11 ) in bits 13:12 of PINMODE3) - LPC_GPIO2->FIODIR |= (1<<12); //P2.12 is output (write ( 1 ) in bit 12 of FIODIR) - LPC_GPIO2->FIOSET |= (1<<12); //off - #endif -} - -void DeviceLightUpDoCycle(void) -{ - if (device.lightUp.state.enabled){ - if (device.lightUp.state.sequence & 0x01){ - #ifdef DEV_BOARD_HAOYU - //Development board - P3.25: LED 1 on - LPC_GPIO3->FIOCLR = (1<<25); - //Development board - P3.26: LED 2 on - LPC_GPIO3->FIOCLR = (1<<26); - #else - //Device - P0.4: Light-up on - LPC_GPIO0->FIOCLR = (1<<4); - //Device - P2.12: Back light on - LPC_GPIO2->FIOCLR = (1<<12); - #endif - } else { - #ifdef DEV_BOARD_HAOYU - //Development board - P3.25: LED 1 off - LPC_GPIO3->FIOSET = (1<<25); - //Development board - P3.26: LED 2 off - LPC_GPIO3->FIOSET = (1<<26); - #else - //Device - P0.4: Light-up off - LPC_GPIO0->FIOSET = (1<<4); - //Device - P2.12: Back light off - LPC_GPIO2->FIOSET = (1<<12); - #endif - } - - if (device.lightUp.state.sequence) - device.lightUp.state.sequence = device.lightUp.state.sequence >> 1; - else - device.lightUp.state.enabled = 0; - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceLightUp.h --- a/DeviceLightUp.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -#ifndef __DEVICE_LIGHT_UP_H__ -#define __DEVICE_LIGHT_UP_H__ - -typedef struct _DeviceLightUpSettings { - uint32_t sequence; -} DeviceLightUpSettings; - -typedef struct _DeviceLightUpState { - uint32_t sequence; - uint8_t enabled; -} DeviceLightUpState; - -typedef struct _DeviceLightUp { - DeviceLightUpSettings settings; - DeviceLightUpState state; -} DeviceLightUp; - -void InitLightUpDefaultSettings(void); -void InitLightUpState(void); -void DeviceStartLightUp(void); - -void DeviceLightUpDoCycle(void); - -#endif /* __DEVICE_LIGHT_UP_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DevicePLCS.c --- a/DevicePLCS.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,736 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitPathLengthControlSystemDefaultSettings(void){ - device.plcs.feedback.settings.input = 1; - device.plcs.feedback.settings.output = 0; - device.plcs.feedback.settings.transfer.points = 16; - device.plcs.feedback.settings.transfer.raw[0] = -0x20000; //-2.0 - device.plcs.feedback.settings.transfer.normalized[0] = -0x10000; //-1.0 - device.plcs.feedback.settings.transfer.raw[1] = -0x1bbbb; //-1.7333333333333334 - device.plcs.feedback.settings.transfer.normalized[1] = -0xdddd; //-0.8666666666666667 - device.plcs.feedback.settings.transfer.raw[2] = -0x17777; //-1.4666666666666668 - device.plcs.feedback.settings.transfer.normalized[2] = -0xbbbb; //-0.7333333333333334 - device.plcs.feedback.settings.transfer.raw[3] = -0x13333; //-1.2 - device.plcs.feedback.settings.transfer.normalized[3] = -0x9999; //-0.6 - device.plcs.feedback.settings.transfer.raw[4] = -0xeeee; //-0.9333333333333333 - device.plcs.feedback.settings.transfer.normalized[4] = -0x7777; //-0.4666666666666667 - device.plcs.feedback.settings.transfer.raw[5] = -0xaaaa; //-0.6666666666666667 - device.plcs.feedback.settings.transfer.normalized[5] = -0x5555; //-0.33333333333333337 - device.plcs.feedback.settings.transfer.raw[6] = -0x6666; //-0.3999999999999999 - device.plcs.feedback.settings.transfer.normalized[6] = -0x3333; //-0.19999999999999996 - device.plcs.feedback.settings.transfer.raw[7] = -0x2222; //-0.1333333333333333 - device.plcs.feedback.settings.transfer.normalized[7] = -0x1111; //-0.06666666666666665 - device.plcs.feedback.settings.transfer.raw[8] = 0x2222; //0.1333333333333333 - device.plcs.feedback.settings.transfer.normalized[8] = 0x1111; //0.06666666666666665 - device.plcs.feedback.settings.transfer.raw[9] = 0x6666; //0.3999999999999999 - device.plcs.feedback.settings.transfer.normalized[9] = 0x3333; //0.19999999999999996 - device.plcs.feedback.settings.transfer.raw[10] = 0xaaaa; //0.6666666666666665 - device.plcs.feedback.settings.transfer.normalized[10] = 0x5555; //0.33333333333333326 - device.plcs.feedback.settings.transfer.raw[11] = 0xeeee; //0.9333333333333331 - device.plcs.feedback.settings.transfer.normalized[11] = 0x7777; //0.46666666666666656 - device.plcs.feedback.settings.transfer.raw[12] = 0x13333; //1.2000000000000002 - device.plcs.feedback.settings.transfer.normalized[12] = 0x9999; //0.6000000000000001 - device.plcs.feedback.settings.transfer.raw[13] = 0x17777; //1.4666666666666668 - device.plcs.feedback.settings.transfer.normalized[13] = 0xbbbb; //0.7333333333333334 - device.plcs.feedback.settings.transfer.raw[14] = 0x1bbbb; //1.7333333333333334 - device.plcs.feedback.settings.transfer.normalized[14] = 0xdddd; //0.8666666666666667 - device.plcs.feedback.settings.transfer.raw[15] = 0x20000; //2.0 - device.plcs.feedback.settings.transfer.normalized[15] = 0x10000; //1.0 - - device.plcs.reference.settings.sequencer = 1; - device.plcs.reference.settings.delta = 0; - - device.plcs.regulator.settings.enabled = 1; - device.plcs.regulator.settings.reference = 0; - device.plcs.regulator.settings.scale = 0x00050000; - device.plcs.regulator.settings.transfer.points = 16; - device.plcs.regulator.settings.transfer.error[0] = -0x8000; //-0.5 - device.plcs.regulator.settings.transfer.correction[0] = 0x10000; //1.0 - device.plcs.regulator.settings.transfer.error[1] = -0x6eee; //-0.43333333333333335 - device.plcs.regulator.settings.transfer.correction[1] = 0xb473; //0.7048888888888889 - device.plcs.regulator.settings.transfer.error[2] = -0x5ddd; //-0.3666666666666667 - device.plcs.regulator.settings.transfer.correction[2] = 0x7aa7; //0.47911111111111115 - device.plcs.regulator.settings.transfer.error[3] = -0x4ccc; //-0.3 - device.plcs.regulator.settings.transfer.correction[3] = 0x4fdf; //0.31199999999999994 - device.plcs.regulator.settings.transfer.error[4] = -0x3bbb; //-0.23333333333333334 - device.plcs.regulator.settings.transfer.correction[4] = 0x3161; //0.1928888888888889 - device.plcs.regulator.settings.transfer.error[5] = -0x2aaa; //-0.16666666666666669 - device.plcs.regulator.settings.transfer.correction[5] = 0x1c71; //0.11111111111111113 - device.plcs.regulator.settings.transfer.error[6] = -0x1999; //-0.09999999999999998 - device.plcs.regulator.settings.transfer.correction[6] = 0xe56; //0.05599999999999999 - device.plcs.regulator.settings.transfer.error[7] = -0x888; //-0.033333333333333326 - device.plcs.regulator.settings.transfer.correction[7] = 0x452; //0.016888888888888884 - device.plcs.regulator.settings.transfer.error[8] = 0x888; //0.033333333333333326 - device.plcs.regulator.settings.transfer.correction[8] = -0x452; //-0.016888888888888884 - device.plcs.regulator.settings.transfer.error[9] = 0x1999; //0.09999999999999998 - device.plcs.regulator.settings.transfer.correction[9] = -0xe56; //-0.05599999999999999 - device.plcs.regulator.settings.transfer.error[10] = 0x2aaa; //0.16666666666666663 - device.plcs.regulator.settings.transfer.correction[10] = -0x1c71; //-0.11111111111111108 - device.plcs.regulator.settings.transfer.error[11] = 0x3bbb; //0.23333333333333328 - device.plcs.regulator.settings.transfer.correction[11] = -0x3161; //-0.1928888888888888 - device.plcs.regulator.settings.transfer.error[12] = 0x4ccc; //0.30000000000000004 - device.plcs.regulator.settings.transfer.correction[12] = -0x4fdf; //-0.31200000000000006 - device.plcs.regulator.settings.transfer.error[13] = 0x5ddd; //0.3666666666666667 - device.plcs.regulator.settings.transfer.correction[13] = -0x7aa7; //-0.47911111111111115 - device.plcs.regulator.settings.transfer.error[14] = 0x6eee; //0.43333333333333335 - device.plcs.regulator.settings.transfer.correction[14] = -0xb473; //-0.7048888888888889 - device.plcs.regulator.settings.transfer.error[15] = 0x8000; //0.5 - device.plcs.regulator.settings.transfer.correction[15] = -0x10000; //-1.0 - - //device.plcs.reset.levels.upper = 0xc8000; //12.5V - //device.plcs.reset.levels.lower = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.points = 16; - device.plcs.reset.up.settings.environment.temperature[0] = -0x3c0000; //-60C - device.plcs.reset.up.settings.environment.trigger[0] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[0] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[0] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[1] = -0x320000; //-50C - device.plcs.reset.up.settings.environment.trigger[1] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[1] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[1] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[2] = -0x280000; //-40C - device.plcs.reset.up.settings.environment.trigger[2] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[2] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[2] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[3] = -0x1e0000; //-30C - device.plcs.reset.up.settings.environment.trigger[3] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[3] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[3] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[4] = -0x140000; //-20C - device.plcs.reset.up.settings.environment.trigger[4] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[4] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[4] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[5] = -0xa0000; //-10C - device.plcs.reset.up.settings.environment.trigger[5] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[5] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[5] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[6] = 0x0; //0C - device.plcs.reset.up.settings.environment.trigger[6] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[6] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[6] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[7] = 0xa0000; //10C - device.plcs.reset.up.settings.environment.trigger[7] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[7] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[7] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[8] = 0x140000; //20C - device.plcs.reset.up.settings.environment.trigger[8] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[8] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[8] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[9] = 0x1e0000; //30C - device.plcs.reset.up.settings.environment.trigger[9] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[9] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[9] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[10] = 0x280000; //40C - device.plcs.reset.up.settings.environment.trigger[10] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[10] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[10] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[11] = 0x320000; //50C - device.plcs.reset.up.settings.environment.trigger[11] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[11] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[11] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[12] = 0x3c0000; //60C - device.plcs.reset.up.settings.environment.trigger[12] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[12] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[12] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[13] = 0x460000; //70C - device.plcs.reset.up.settings.environment.trigger[13] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[13] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[13] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[14] = 0x500000; //80C - device.plcs.reset.up.settings.environment.trigger[14] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[14] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[14] = 0x30000; //3s - device.plcs.reset.up.settings.environment.temperature[15] = 0x5a0000; //90C - device.plcs.reset.up.settings.environment.trigger[15] = 0x18000; //1.5V - device.plcs.reset.up.settings.environment.target[15] = 0xc8000; //12.5V - device.plcs.reset.up.settings.environment.duration[15] = 0x30000; //3s - - device.plcs.reset.down.settings.environment.points = 16; - device.plcs.reset.down.settings.environment.temperature[0] = -0x3c0000; //-60C - device.plcs.reset.down.settings.environment.trigger[0] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[0] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[0] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[1] = -0x320000; //-50C - device.plcs.reset.down.settings.environment.trigger[1] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[1] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[1] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[2] = -0x280000; //-40C - device.plcs.reset.down.settings.environment.trigger[2] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[2] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[2] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[3] = -0x1e0000; //-30C - device.plcs.reset.down.settings.environment.trigger[3] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[3] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[3] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[4] = -0x140000; //-20C - device.plcs.reset.down.settings.environment.trigger[4] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[4] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[4] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[5] = -0xa0000; //-10C - device.plcs.reset.down.settings.environment.trigger[5] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[5] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[5] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[6] = 0x0; //0C - device.plcs.reset.down.settings.environment.trigger[6] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[6] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[6] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[7] = 0xa0000; //10C - device.plcs.reset.down.settings.environment.trigger[7] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[7] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[7] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[8] = 0x140000; //20C - device.plcs.reset.down.settings.environment.trigger[8] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[8] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[8] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[9] = 0x1e0000; //30C - device.plcs.reset.down.settings.environment.trigger[9] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[9] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[9] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[10] = 0x280000; //40C - device.plcs.reset.down.settings.environment.trigger[10] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[10] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[10] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[11] = 0x320000; //50C - device.plcs.reset.down.settings.environment.trigger[11] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[11] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[11] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[12] = 0x3c0000; //60C - device.plcs.reset.down.settings.environment.trigger[12] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[12] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[12] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[13] = 0x460000; //70C - device.plcs.reset.down.settings.environment.trigger[13] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[13] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[13] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[14] = 0x500000; //80C - device.plcs.reset.down.settings.environment.trigger[14] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[14] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[14] = 0x30000; //3s - device.plcs.reset.down.settings.environment.temperature[15] = 0x5a0000; //90C - device.plcs.reset.down.settings.environment.trigger[15] = 0xc8000; //12.5V - device.plcs.reset.down.settings.environment.target[15] = 0x18000; //1.5V - device.plcs.reset.down.settings.environment.duration[15] = 0x30000; //3s - - device.plcs.output.settings.sequencer = 1; -} - -void InitPathLengthControlSystemState(void){ - device.plcs.feedback.state.input = device.plcs.feedback.settings.input; - device.plcs.feedback.state.output = device.plcs.feedback.settings.output; - - device.plcs.reference.state.sequencer = device.plcs.reference.settings.sequencer; - device.plcs.reference.state.delta = device.plcs.reference.settings.delta; - - device.plcs.detector.state.out = 1; - - device.plcs.regulator.state.enabled = device.plcs.regulator.settings.enabled; - device.plcs.regulator.state.reference = device.plcs.regulator.settings.reference; - device.plcs.regulator.state.scale = device.plcs.regulator.settings.scale; - - device.plcs.reset.state.countdown = 0; - - device.plcs.output.settings.sequencer = device.plcs.output.state.sequencer; -} - -void DeviceStartPLCS(void){ -} - -/* - //Move to DevicePLCS regulator - uint32_t value; - switch(device.plcs.state.modulation) { - case 1://малое воздействие - value = device.SSP.DAC[1] + Gyro.StrayPLC_Pls; - break; - - case 3://малое воздействие - value = device.SSP.DAC[1] + Gyro.StrayPLC_Mns; - break; - - case 2://большое воздействие - value = device.SSP.DAC[1] + Gyro.StrayPLC_2Mode; - break; - - default://режим без воздействия - value = device.SSP.DAC[1]; - break; - } - LPC_SSP0->DR = device.SSP.DAC[1]; - */ - -int32_t plcsInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t plcsFeedback(int32_t voltage) { - int32_t v1, v2; - for (uint8_t i = 1; i < device.plcs.feedback.settings.transfer.points; i++) { - v1 = device.plcs.feedback.settings.transfer.raw[i - 1]; - if (voltage < v1) { - return device.plcs.feedback.settings.transfer.normalized[i - 1]; - } - - v2 = device.plcs.feedback.settings.transfer.raw[i]; - if (voltage < v2) { - int32_t r1 = device.plcs.feedback.settings.transfer.normalized[i - 1]; - int32_t r2 = device.plcs.feedback.settings.transfer.normalized[i]; - return plcsInterpolate(voltage, v1, v2, r1, r2); - } - } - return device.plcs.feedback.settings.transfer.normalized[device.plcs.feedback.settings.transfer.points - 1]; -} - -int32_t plcsBias(int32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.plcs.bias.settings.transfer.points; i++) { - r1 = device.plcs.bias.settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.plcs.bias.settings.transfer.normalized[i - 1]; - } - - r2 = device.plcs.bias.settings.transfer.raw[i]; - if (raw < r2) { - int32_t l1 = device.plcs.bias.settings.transfer.normalized[i - 1]; - int32_t l2 = device.plcs.bias.settings.transfer.normalized[i]; - return plcsInterpolate(raw, r1, r2, l1, l2); - } - } - return device.plcs.bias.settings.transfer.normalized[device.plcs.bias.settings.transfer.points - 1]; -} - -int32_t plcsCorrection(int32_t error) { - int32_t e1, e2; - for (uint8_t i = 1; i < device.plcs.regulator.settings.transfer.points; i++) { - e1 = device.plcs.regulator.settings.transfer.error[i - 1]; - if (error < e1) { - return device.plcs.regulator.settings.transfer.correction[i - 1]; - } - - e2 = device.plcs.regulator.settings.transfer.error[i]; - if (error < e2) { - int32_t c1 = device.plcs.regulator.settings.transfer.correction[i - 1]; - int32_t c2 = device.plcs.regulator.settings.transfer.correction[i]; - return plcsInterpolate(error, e1, e2, c1, c2); - } - } - return device.plcs.regulator.settings.transfer.correction[device.plcs.regulator.settings.transfer.points - 1]; -} - -uint32_t plcsCode(int32_t voltage) { - int32_t v1, v2; - for (uint8_t i = 1; i < device.plcs.output.settings.transfer.points; i++) { - v1 = device.plcs.output.settings.transfer.voltage[i - 1]; - if (voltage < v1) { - return device.plcs.output.settings.transfer.code[i - 1]; - } - - v2 = device.plcs.output.settings.transfer.voltage[i]; - if (voltage < v2) { - int32_t c1 = device.plcs.output.settings.transfer.code[i - 1]; - int32_t c2 = device.plcs.output.settings.transfer.code[i]; - return plcsInterpolate(voltage, v1, v2, c1, c2); //TODO: signed/unsigned - } - } - return device.plcs.output.settings.transfer.code[device.plcs.output.settings.transfer.points - 1]; -} - -void plcsProcessDelta(void) { - //Process detector - int32_t feedback = plcsFeedback(device.plcs.feedback.state.voltage); //-1...+1 in 16.16 format - int32_t delta = feedback - device.plcs.detector.state.in[0]; //-2...+2 in 16.16 format - //if (delta > 0) delta = 1; - //if (delta < 0) delta = -1; - device.plcs.detector.state.in[0] = feedback; - device.plcs.detector.state.out = ((delta >> 2) * (device.plcs.detector.state.in[1] >> 1)) >> 14; //-1...+1 in 16.16 format - - //Process bias -0.5...+0.5 in 16.16 format - device.plcs.bias.state.raw = plcsBias(device.plcs.detector.state.out); - device.plcs.bias.state.sum += device.plcs.bias.state.raw; - device.plcs.bias.state.counter++; - if (device.plcs.bias.state.counter == 256) { - device.plcs.bias.state.average = device.plcs.bias.state.sum >> 8; - device.plcs.bias.state.sum = 0; - device.plcs.bias.state.counter = 0; - - if (device.plcs.bias.state.average > 0) - device.plcs.detector.state.in[1] = -1; - else - device.plcs.detector.state.in[1] = 1; - } -} - -void plcsProcessSequencer(void) { - //Process detector - device.plcs.detector.state.in[0] = plcsFeedback(device.plcs.feedback.state.voltage) >> 1; //-1...+1 in 17.15 format - device.plcs.detector.state.in[1] = device.sequencer.sampler.state.sample[1] >> 1; //-1...+1 in 17.15 format - device.plcs.detector.state.out = device.plcs.detector.state.in[0] * device.plcs.detector.state.in[1] >> 14;//-1...+1 in 16.16 format - - //Process bias -0.5...+0.5 in 16.16 format - device.plcs.bias.state.raw = plcsBias(device.plcs.detector.state.out); - device.plcs.bias.state.sum += device.plcs.bias.state.raw; - device.plcs.bias.state.counter++; - if (device.plcs.bias.state.counter == 64) { - device.plcs.bias.state.average = device.plcs.bias.state.sum >> 6; - device.plcs.bias.state.sum = 0; - device.plcs.bias.state.counter = 0; - } -} - -void plcsRegulate(void) { - device.plcs.regulator.state.error = device.plcs.regulator.state.reference - device.plcs.bias.state.average; - device.plcs.regulator.state.correction = (device.plcs.regulator.state.scale * plcsCorrection(device.plcs.regulator.state.error)) >> 16; - - if (device.plcs.output.state.enabled) { - if (device.plcs.reset.state.countdown == 0){ - if (device.plcs.regulator.state.enabled) { - device.plcs.output.state.voltage += device.plcs.regulator.state.correction; - } - } - } -} - -void plcsPreprocessJumpUp(void) { - int32_t t1, t2; - for (uint8_t i = 1; i < device.plcs.reset.up.settings.environment.points; i++) { - t1 = device.plcs.reset.up.settings.environment.temperature[i - 1]; - if (device.tss.temperature.state.celsius < t1) { - device.plcs.reset.up.state.trigger = device.plcs.reset.up.settings.environment.trigger[i - 1]; - device.plcs.reset.up.state.target = device.plcs.reset.up.settings.environment.target[i - 1]; - device.plcs.reset.up.state.duration = device.plcs.reset.up.settings.environment.duration[i - 1]; - return; - } - - t2 = device.plcs.reset.up.settings.environment.temperature[i]; - if (device.tss.temperature.state.celsius < t2) { - int32_t v1 = device.plcs.reset.up.settings.environment.trigger[i - 1]; - int32_t v2 = device.plcs.reset.up.settings.environment.trigger[i]; - device.plcs.reset.up.state.trigger = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - v1 = device.plcs.reset.up.settings.environment.target[i - 1]; - v2 = device.plcs.reset.up.settings.environment.target[i]; - device.plcs.reset.up.state.target = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - int32_t d1 = device.plcs.reset.up.settings.environment.duration[i - 1]; - int32_t d2 = device.plcs.reset.up.settings.environment.duration[i]; - device.plcs.reset.up.state.duration = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, d1, d2); - return; - } - } - device.plcs.reset.up.state.trigger = device.plcs.reset.up.settings.environment.trigger[device.plcs.reset.up.settings.environment.points - 1]; - device.plcs.reset.up.state.target = device.plcs.reset.up.settings.environment.target[device.plcs.reset.up.settings.environment.points - 1]; - device.plcs.reset.up.state.duration = device.plcs.reset.up.settings.environment.duration[device.plcs.reset.up.settings.environment.points - 1]; -} - -void plcsPreprocessJumpDown(void) { - int32_t t1, t2; - for (uint8_t i = 1; i < device.plcs.reset.down.settings.environment.points; i++) { - t1 = device.plcs.reset.down.settings.environment.temperature[i - 1]; - if (device.tss.temperature.state.celsius < t1) { - device.plcs.reset.down.state.trigger = device.plcs.reset.down.settings.environment.trigger[i - 1]; - device.plcs.reset.down.state.target = device.plcs.reset.down.settings.environment.target[i - 1]; - device.plcs.reset.down.state.duration = device.plcs.reset.down.settings.environment.duration[i - 1]; - return; - } - - t2 = device.plcs.reset.down.settings.environment.temperature[i]; - if (device.tss.temperature.state.celsius < t2) { - int32_t v1 = device.plcs.reset.down.settings.environment.trigger[i - 1]; - int32_t v2 = device.plcs.reset.down.settings.environment.trigger[i]; - device.plcs.reset.down.state.trigger = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - v1 = device.plcs.reset.down.settings.environment.target[i - 1]; - v2 = device.plcs.reset.down.settings.environment.target[i]; - device.plcs.reset.down.state.target = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - int32_t d1 = device.plcs.reset.down.settings.environment.duration[i - 1]; - int32_t d2 = device.plcs.reset.down.settings.environment.duration[i]; - device.plcs.reset.down.state.duration = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, d1, d2); - return; - } - } - device.plcs.reset.down.state.trigger = device.plcs.reset.down.settings.environment.trigger[device.plcs.reset.down.settings.environment.points - 1]; - device.plcs.reset.down.state.target = device.plcs.reset.down.settings.environment.target[device.plcs.reset.down.settings.environment.points - 1]; - device.plcs.reset.down.state.duration = device.plcs.reset.down.settings.environment.duration[device.plcs.reset.down.settings.environment.points - 1]; -} - -//Delete this!!! -/*void plcsUp(void) { - int32_t t1, t2; - for (uint8_t i = 1; i < device.plcs.reset.up.points; i++) { - t1 = device.plcs.reset.up.temperature[i - 1]; - if (device.tss.temperature.state.celsius < t1) { - device.plcs.reset.state.voltage = device.plcs.reset.up.settings.environment.voltage[i - 1]; //Delete this!!! - device.plcs.reset.state.countdown = device.plcs.reset.up.settings.environment.duration[i - 1]; - } - - t2 = device.plcs.reset.up.temperature[i]; - if (device.tss.temperature.state.celsius < t2) { - int32_t v1 = device.plcs.reset.up.settings.environment.voltage[i - 1]; - int32_t v2 = device.plcs.reset.up.settings.environment.voltage[i]; - device.plcs.reset.state.voltage = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - int32_t d1 = device.plcs.reset.up.settings.environment.duration[i - 1]; - int32_t d2 = device.plcs.reset.up.settings.environment.duration[i]; - device.plcs.reset.state.countdown = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, d1, d2); - } - } - device.plcs.output.state.voltage = device.plcs.reset.up.settings.environment.voltage[device.plcs.reset.up.settings.environment.points - 1]; - device.plcs.reset.state.countdown = device.plcs.reset.up.settings.environment.duration[device.plcs.reset.up.settings.environment.points - 1]; -}*/ - -//Delete this!!! -/*void plcsDown(void) { - int32_t t1, t2; - for (uint8_t i = 1; i < device.plcs.reset.down.points; i++) { - t1 = device.plcs.reset.down.temperature[i - 1]; - if (device.tss.temperature.state.celsius < t1) { - device.plcs.reset.state.voltage = device.plcs.reset.down.settings.environment.voltage[i - 1]; - device.plcs.reset.state.countdown = device.plcs.reset.down.settings.environment.duration[i - 1]; - } - - t2 = device.plcs.reset.down.settings.environment.temperature[i]; - if (device.tss.temperature.state.celsius < t2) { - int32_t v1 = device.plcs.reset.down.settings.environment.voltage[i - 1]; - int32_t v2 = device.plcs.reset.down.settings.environment.voltage[i]; - device.plcs.reset.state.voltage = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, v1, v2); - int32_t d1 = device.plcs.reset.down.settings.environment.duration[i - 1]; - int32_t d2 = device.plcs.reset.down.settings.environment.duration[i]; - device.plcs.reset.state.countdown = plcsInterpolate(device.tss.temperature.state.celsius, t1, t2, d1, d2); - } - } - device.plcs.reset.state.voltage = device.plcs.reset.down.settings.environment.voltage[device.plcs.reset.down.settings.environment.points - 1]; - device.plcs.reset.state.countdown = device.plcs.reset.down.settings.environment.duration[device.plcs.reset.down.settings.environment.points - 1]; -}*/ - -void plcsReset(void) { - if (device.plcs.reset.state.countdown > 0){ - //Process jump - int32_t period = 0x00000005; //5/65536sec = 75 mks - //TODO: Set processing period from measurement cycle - - device.plcs.reset.state.countdown -= period; - if (device.plcs.reset.state.countdown < 0) device.plcs.reset.state.countdown = 0; - } else { - //Update jump parameters - plcsPreprocessJumpDown(); - plcsPreprocessJumpUp(); - //Detect reset condition - if (device.plcs.output.state.voltage > device.plcs.reset.up.state.trigger) { - //Process reset down - //plcsDown(); - device.plcs.reset.state.countdown = device.plcs.reset.down.state.duration; - device.plcs.output.state.voltage = device.plcs.reset.down.state.target; - } else if (device.plcs.output.state.voltage < device.plcs.reset.down.state.trigger) { - //Process reset up - //plcsUp(); - device.plcs.reset.state.countdown = device.plcs.reset.up.state.duration; - device.plcs.output.state.voltage = device.plcs.reset.down.state.target; - }; - } -} - -void plcsOutput(void) { - if (device.plcs.output.state.enabled) { - //Add sequencer output - if (device.plcs.output.state.sequencer) { - if (device.sequencer.output.analog.state.enabled) { - device.plcs.output.state.voltage += device.sequencer.output.analog.state.voltage; - } - } - - device.plcs.output.state.code = plcsCode(device.plcs.output.state.voltage); - device.controller.SSP.out[1] = device.plcs.output.state.code; - } -} - -//Main PLCS processing function -void plcsProcess(void) { - //Process reset state output voltage - if (device.plcs.output.state.enabled) { - if (device.plcs.reset.state.countdown > 0){ - device.plcs.output.state.voltage = device.plcs.reset.state.voltage; - } - } - //Process input - if (device.plcs.reference.state.delta) { - //Process delta state - if (device.plcs.feedback.state.input) { - device.plcs.feedback.state.voltage = device.isacs.input.state.V; - } else if (device.plcs.feedback.state.output) { - device.plcs.feedback.state.voltage = device.isacs.output.state.voltage; - } - - plcsProcessDelta(); - - } else if (device.plcs.reference.state.sequencer) { - //Process sequencer state - if (device.plcs.feedback.state.input) { - device.plcs.feedback.state.voltage = device.isacs.input.state.V; - } else if (device.plcs.feedback.state.output) { - device.plcs.feedback.state.voltage = device.isacs.output.state.voltage; - } - plcsProcessSequencer(); - - } - //Process regulator - plcsRegulate(); - //Process reset - plcsReset(); - //Process output - plcsOutput(); -} - -int16_t var_WP_reg(void) { - //Value: PLCS output voltage - V - -13.2V...10.7V - //Internal format: device.plcs.output.state.voltage - [V] in 16.16 format - //Output format: -8192 * (V + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: V + 1.3 = (device.plcs.output.state.voltage + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.plcs.output.state.voltage + 0x00014ccd) / 24 - - int32_t V = -(device.plcs.output.state.voltage + 0x00014ccd) / 24; - if (V > 32767) V = 32767; - if (V < -32768) V = -32768; - - return (int16_t)V; -} - -int16_t var_WP_pll(void) { - //Value: PLCS error - err - //Internal format: device.plcs.regulator.state.error - -1...1 in 16.16 format - //Output format: sum(err, 1 sec) - dimensionless units in 16.0 format - - //Now: Multiply 512 instead of sum for 1 sec and right shift 16 to transform in format 16.0 (shift 16 - 9 = 7) - //Signed right shift implementation-defined!!! Required to replace right shift 7 to division on 128 for implementation independence? - int32_t err = device.plcs.regulator.state.error / 128; - //TODO: make summation for 1 sec as in DSP-based program and tranform 16.0 - - return (int16_t)err; -} - -uint16_t param_WP_ref(void) { - //Value: PLCS regulator input signal reference voltage - V - //Internal format: device.plcs.regulator.state.reference - [V] in 16.16 format - //Output format: (V / v) * 15000 - dimensionless units in 16.0 format - //TODO: v = ??? Now v = 2.0 - - //Voltage: V = device.isacs.regulator.state.reference / 65536 - //Output: V = device.isacs.regulator.state.reference * 1875 / 16384 - - //TODO: state/settings - - int32_t V = device.plcs.regulator.state.reference * 1875 / 16384; - if (V > 32767) V = 32767; - if (V < 0) V = 0; - - return (uint16_t)V; -} - -//WP_scl s16 PLCS gain factor (1.15) 5..20 -uint16_t param_WP_scl(void) { - //Value: PLCS output regulator scale - S - -13.2V...10.7V - //Internal format: device.plcs.regulator.state.scale - dimensionless units in 16.16 format - //Output format: S / 65536 - dimensionless units in 16.0 format - - int32_t scl = device.plcs.regulator.state.scale / 65536; - if (scl > 32767) scl = 32767; - if (scl < 0) scl = 0; - - return (uint16_t)scl; -} - -//WP_mdy s16 PLCS reset delay in 10kHz cycles -uint16_t param_WP_mdy(void) { - //Value: PLCS reset delay - D [s] - //Internal format: device.plcs.reset.up/down.state.duration - [s] in 16.16 format - //Output format: (D / 65536) * 10000 - dimensionless units in 16.0 format - - //Delay: D = device.plcs.reset.up/down.state.duration / 65536 - //Output: mdy = device.plcs.reset.up/down.state.duration * 625 / 4096 - - //TODO: up/down??? - //Now: average for up and down - - int32_t mdy = (device.plcs.reset.up.state.duration + device.plcs.reset.down.state.duration) * 625 / 8192; - if (mdy > 32767) mdy = 32767; - if (mdy < 0) mdy = 0; - - return (uint16_t)mdy; -} - -//WP_rup dac ttf:PLCS maximum DAC code in heater channel; value:minimal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_rup(void) { - //Value: PLCS reset up trigger voltage - T [V] - //Internal format: device.plcs.reset.up.state.trigger - [V] in 16.16 format - //Output format: -8192 * (T + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: T + 1.3 = (device.plcs.reset.up.state.trigger + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.plcs.reset.up.state.trigger + 0x00014ccd) / 24 - - int32_t rup = -(device.plcs.reset.up.state.trigger + 0x00014ccd) / 24; - if (rup > 32767) rup = 32767; - if (rup < -32768) rup = -32768; - - return (int16_t)rup; -} - -//WP_rdw dac ttf:PLCS minimum DAC code in heater channel; value:maximal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_rdw(void) { - //Value: PLCS reset down trigger voltage - T [V] - //Internal format: device.plcs.reset.down.state.trigger - [V] in 16.16 format - //Output format: -8192 * (T + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: T + 1.3 = (device.plcs.reset.down.state.trigger + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.plcs.reset.down.state.trigger + 0x00014ccd) / 24 - - int32_t rdw = -(device.plcs.reset.down.state.trigger + 0x00014ccd) / 24; - if (rdw > 32767) rdw = 32767; - if (rdw < -32768) rdw = -32768; - - return (int16_t)rdw; -} - -//WP_reset dac ttf:PLCS DAC code after reset at heating; value:heater voltage after reset at heating; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_reset(void) { - //Value: PLCS reset up target voltage - T [V] - //Internal format: device.plcs.reset.up.state.target - [V] in 16.16 format - //Output format: -8192 * (T + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: T + 1.3 = (device.plcs.reset.up.state.target + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.plcs.reset.up.state.target + 0x00014ccd) / 24 - - int32_t reset = -(device.plcs.reset.up.state.target + 0x00014ccd) / 24; - if (reset > 32767) reset = 32767; - if (reset < -32768) reset = -32768; - - return (int16_t)reset; -} - -//WP_reset2 dac ttf:PLCS DAC code after reset at cooling; value:heater voltage after reset at cooling; value=(ttf>>4)/2048*(-12)-1.3 -uint16_t param_WP_reset2(void) { - //Value: PLCS reset down target voltage - T [V] - //Internal format: device.plcs.reset.down.state.target - [V] in 16.16 format - //Output format: -8192 * (T + 1.3) / 3 - dimensionless units in 16.0 format - - //Voltage: T + 1.3 = (device.plcs.reset.down.state.target + 0x00014ccd) / 65536 - //Output: -8192 * (V + 1.3) / 3 = -(device.plcs.reset.down.state.target + 0x00014ccd) / 24 - - int32_t reset2 = -(device.plcs.reset.down.state.target + 0x00014ccd) / 24; - if (reset2 > 32767) reset2 = 32767; - if (reset2 < -32768) reset2 = -32768; - - return (int16_t)reset2; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DevicePLCS.h --- a/DevicePLCS.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,219 +0,0 @@ -#ifndef __DEVICE_PLCS_H__ -#define __DEVICE_PLCS_H__ - -//Path length control system phase feedback typedefs -typedef struct _DevicePLCSFeedbackTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t raw[16]; //Feedback raw value - volts in 16.16 format - int32_t normalized[16];//Feedback normalized value - -1...+1 in 16.16 format -} DevicePLCSFeedbackTransferFunction; - -typedef struct _DevicePLCSFeedbackSettings { - uint8_t input; //Take ISACS input as feedback - uint8_t output; //Take ISACS output as feedback - DevicePLCSFeedbackTransferFunction transfer; -} DevicePLCSFeedbackSettings; - -typedef struct _DevicePLCSFeedbackState { - uint8_t input; //Take ISACS input as feedback - uint8_t output; //Take ISACS output as feedback - int32_t voltage; //Feedback - volts in 16.16 format -} DevicePLCSFeedbackState; - -typedef struct _DevicePLCSFeedback { - DevicePLCSFeedbackSettings settings; - DevicePLCSFeedbackState state; -} DevicePLCSFeedback; - -//Path length control system reference typedefs -typedef struct _DevicePLCSReferenceSettings { - uint8_t sequencer; //Take sequencer as reference (and ISACS amplitude/output as feedback) - uint8_t delta; //Take delta as reference (and ISACS amplitude/output delta as feedback) -} DevicePLCSReferenceSettings; - -typedef struct _DevicePLCSReferenceState { - uint8_t sequencer; //Take sequencer as reference (and ISACS amplitude/output as feedback) - uint8_t delta; //Take delta as reference (and ISACS amplitude/output delta as feedback) -} DevicePLCSReferenceState; - -typedef struct _DevicePLCSReference { - DevicePLCSReferenceSettings settings; - DevicePLCSReferenceState state; -} DevicePLCSReference; - -//Path length control system detector typedefs -typedef struct _DevicePLCSDetectorState { - int32_t in[2]; //Detector inputs: reference, feedback -1...+1 in 16.16 format - int32_t out; //Detector output: -1...+1 in 16.16 format -} DevicePLCSDetectorState; - -typedef struct _DevicePLCSDetector { - DevicePLCSDetectorState state; -} DevicePLCSDetector; - -//Path length control system bias typedefs -typedef struct _DevicePLCSBiasTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t raw[16]; //Raw bias value - dimensionless units - int32_t normalized[16]; //Normalized bias value - -0.5...+0.5 of lambda in 16.16 format -} DevicePLCSBiasTransferFunction; - -typedef struct _DevicePLCSBiasSettings { - DevicePLCSBiasTransferFunction transfer; -} DevicePLCSBiasSettings; - -typedef struct _DevicePLCSBiasState { - uint32_t raw; //Raw bias value - -0.5...+0.5 in 16.16 format - int32_t sum; - int32_t counter; - int32_t average; //Average bias value - -0.5...+0.5 in 16.16 format -} DevicePLCSBiasState; - -typedef struct _DevicePLCSBias { - DevicePLCSBiasSettings settings; - DevicePLCSBiasState state; -} DevicePLCSBias; - -//Path length control system regulator typedefs -typedef struct _DevicePLCSCorrectionTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t error[16]; //Regulator error value - degrees in 16.16 format - int32_t correction[16]; //Regulator correction value - -1...+1 in 16.16 format -} DevicePLCSCorrectionTransferFunction; - -typedef struct _DevicePLCSRegulatorSettings { - uint8_t enabled; - int32_t reference; //Reference bias - signed 16.16 format - int32_t scale; //Regulator scale factor - signed 16.16 format - DevicePLCSCorrectionTransferFunction transfer; -} DevicePLCSRegulatorSettings; - -typedef struct _DevicePLCSRegulatorState { - uint8_t enabled; - int32_t reference; //Reference bias - signed 16.16 format - int32_t scale; //Regulator scale factor - signed 16.16 format - int32_t error; //Regulator error - signed 16.16 format - int32_t correction;//Output correction - signed 16.16 format -} DevicePLCSRegulatorState; - -typedef struct _DevicePLCSRegulator { - DevicePLCSRegulatorSettings settings; - DevicePLCSRegulatorState state; -} DevicePLCSRegulator; - -//Path length control reset typedefs -typedef struct _DevicePLCSResetTemperatureFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t temperature[16]; //Output reset temperature value - centigrade, 16.16 format - int32_t trigger[16]; //Output reset trigger level value - volts, 16.16 format - int32_t voltage[16]; //Output reset target level value - volts, 16.16 format - Delete this!!! - int32_t target[16]; //Output reset target level value - volts, 16.16 format - Use this!!! - int32_t duration[16]; //Output reset duration value - seconds, 16.16 format -} DevicePLCSResetTemperatureFunction; - -typedef struct _DevicePLCSResetDirectionSettings { - DevicePLCSResetTemperatureFunction environment; -} DevicePLCSResetDirectionSettings; - -typedef struct _DevicePLCSResetDirectionState { - int32_t trigger; //Output reset trigger level value - volts, 16.16 format - int32_t target; //Output reset target level value - volts, 16.16 format - int32_t duration; //Output reset duration value - seconds, 16.16 format -} DevicePLCSResetDirectionState; - -typedef struct _DevicePLCSResetDirection { - DevicePLCSResetDirectionSettings settings; - DevicePLCSResetDirectionState state; -} DevicePLCSResetDirection; - -typedef struct _DevicePLCSResetState { - int32_t countdown; //Output reset countdown - seconds, 16.16 format - int32_t voltage; //Output reset target level value - volts, 16.16 format -} DevicePLCSResetState; - -typedef struct _DevicePLCSReset { - //DevicePLCSResetSettings settings; //Delete this!!! - DevicePLCSResetDirection up; - DevicePLCSResetDirection down; - DevicePLCSResetState state; -} DevicePLCSReset; - -//Path length control system output ( = DAC + amplifier + control unit + heater/piezo) typedefs -typedef struct _DevicePLCSOutputStart { - int32_t voltage; //Output voltage in signed 16.16 fixed point format -} DevicePLCSOutputStart; - -typedef struct _DevicePLCSOutputTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format - int32_t code[16]; //DAC code control points -} DevicePLCSOutputTransferFunction; - -typedef struct _DevicePLCSOutputSettings { - uint8_t enabled; //Enable DAC output - uint8_t sequencer; //Enable sequencer output summation - DevicePLCSOutputStart start; - DevicePLCSOutputTransferFunction transfer; -} DevicePLCSOutputSettings; - -typedef struct _DevicePLCSOutputState { - uint8_t enabled; //Enable DAC output - uint8_t sequencer; //Enable sequencer output summation - int32_t voltage; //Voltage output - uint32_t code; //Code output -} DevicePLCSOutputState; - -typedef struct _DevicePLCSOutput { - DevicePLCSOutputSettings settings; - DevicePLCSOutputState state; -} DevicePLCSOutput; - -//Path length control system typedefs -// Information signal amplitude ADC: device.controller.SSP.ADC[4] -// Path length control system DAC: device.controller.SSP.DAC[1] -typedef struct _DevicePathLengthControlSystem { - DevicePLCSFeedback feedback; - DevicePLCSReference reference; - DevicePLCSDetector detector; - DevicePLCSBias bias; - DevicePLCSRegulator regulator; - DevicePLCSReset reset; - DevicePLCSOutput output; -} DevicePathLengthControlSystem; - -//Path length control system functions -void InitPathLengthControlSystemDefaultSettings(void); -void InitPathLengthControlSystemState(void); -void DeviceStartPLCS(void); - -void plcsProcess(void); - -//Compatibility functions section -//WP_reg dac ttf: DAC code in PLCS channel; value: voltage of PLCS; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -int16_t var_WP_reg(void); - -//WP_pll = WP_PhaseDetectorRate( WP_Phase_Det, time_1_Sec) -int16_t var_WP_pll(void); - -//WP_ref s16 PLCS reference -uint16_t param_WP_ref(void); - -//WP_scl s16 PLCS gain factor (1.15) 5..20 -uint16_t param_WP_scl(void); - -//WP_mdy s16 PLCS reset delay in 10kHz cycles -uint16_t param_WP_mdy(void); - -//WP_rup dac ttf:PLCS maximum DAC code in heater channel; value:minimal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_rup(void); - -//WP_rdw dac ttf:PLCS minimum DAC code in heater channel; value:maximal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_rdw(void); - -//WP_reset dac ttf:PLCS DAC code after reset at heating; value:heater voltage after reset at heating; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V -uint16_t param_WP_reset(void); - -//WP_reset2 dac ttf:PLCS DAC code after reset at cooling; value:heater voltage after reset at cooling; value=(ttf>>4)/2048*(-12)-1.3 -uint16_t param_WP_reset2(void); - -#endif /* __DEVICE_PLCS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceQEI.c --- a/DeviceQEI.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -#include "Device.h" -extern Device device; - -//#define MAX_QEI_CNT 2147483646 - -void InitQEIDefaultSettings(void){ -} - -void InitQEIState(void){ -} - -void DeviceStartQEI(void){ - //Power on - LPC_SC->PCONP |= (1<<18); - //Clock - LPC_SC->PCLKSEL1 |= 0x00000001; // выбор частоты для кв.э. CLK=100MHz - //Pin function select - LPC_PINCON->PINSEL3 &= ~0x4100; - LPC_PINCON->PINSEL3 |= 0x4100; //P1.20, p1.23 установить как входы кв.э - //Pin mode select - LPC_PINCON->PINMODE3 |= 0x3C300; //P1.20, p1.23 - - //LPC_QEI->QEIMAXPOS = MAX_QEI_CNT; //LPC_QEI->"регистор максимального положения" = 2147483646 - LPC_QEI->MAXPOS = 0xffffffff; // - LPC_QEI->FILTER = 2; // фильтр( ?? ) - LPC_QEI->CON = 0xF; //сбросить в ноль все счетчики кв.э. (скорость, направление, позицию и тд) - LPC_QEI->CONF = (0<<2) |(0<<1); //Quadrature inputs, no inverting,only A pulses are counted - - LPC_QEI->CLR = 0x1fff; //r. сбросить все прерывания - LPC_QEI->IEC = 0x1fff; //r. запретить прерывание при изменении направления. TODO: meander mode!!! -} - -#ifdef DEBUG_QEI -void qeiProcess(void) { - static uint16_t idx = 0; - static int16_t deltas[] = {0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25, 0x27, 0x27, 0x25, 0x22, 0x1e, 0x18, 0x12, 0xb, 0x3, -0x3, -0xb, -0x12, -0x18, -0x1e, -0x22, -0x25, -0x27, -0x27, -0x25, -0x22, -0x1e, -0x18, -0x12, -0xb, -0x3, 0x3, 0xb, 0x12, 0x18, 0x1e, 0x22, 0x25}; - device.controller.QEI.state.delta = deltas[idx]; - idx++; if (idx == 1536) idx = 0; //48 cycles -} -#else -void qeiProcess(void) -{ - //TODO: zero QEI position instead of difference??? - // "+": no QEI position overflow - //device.controller.QEI.state.delta = LPC_QEI->QEIPOS; //Get delta directly - //LPC_QEI->QEICON = 0xF; //Zero QEI counters - - int32_t position = LPC_QEI->POS; - device.controller.QEI.state.delta = position - device.controller.QEI.state.position; - device.controller.QEI.state.position = position; - - //???????? - //if (device.controller.QEI.state.delta < -0xfff) device.controller.QEI.state.delta += 0x10000; // обработка прохода значения через ноль - //if (device.controller.QEI.state.delta > 0xfff) device.controller.QEI.state.delta -= 0x10000; // обработка прохода значения через ноль - //???????? -} -#endif \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceQEI.h --- a/DeviceQEI.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#ifndef __DEVICE_QEI_H__ -#define __DEVICE_QEI_H__ - -#ifdef DEBUG_QEI -#warning "Program config: QEI debug simulation enabled!!!" -#endif - -typedef struct _DeviceQEISettings { -} DeviceQEISettings; - -typedef struct _DeviceQEIState { - int32_t position; - int32_t delta; -} DeviceQEIState; - -typedef struct _DeviceQEI { - DeviceQEISettings settings; - DeviceQEIState state; -} DeviceQEI; - -void InitQEIDefaultSettings(void); -void InitQEIState(void); -void DeviceStartQEI(void); - -void qeiProcess(void); - -#endif /* __DEVICE_QEI_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceSSP.c --- a/DeviceSSP.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -#include "Device.h" - -#define SSPCR1_SSE 0x00000002 - -#define TX_SSP_EMPT 0x00000001 -#define RX_SSP_notEMPT 0x00000004 -#define TX_SSP_notFULL 0x00000002 -#define RX_SSP_FULL 0x00000008 -#define SSP_BUSY 0x00000010 - -#define ADC_ERR_MSK 0x00000001 -#define DAC_ERR_MSK 0x00000002 - -extern Device device; - -void InitSSPDefaultSettings(void){ -} - -void InitSSPState(void){ -} - -void DeviceStartSSP(void){ - uint32_t Dummy; - - LPC_SC->PCONP |= (1<<21); //Power on SSP0 - - /* выбор частоты для переферии используем по умолчания с делителем основной на 4 */ - LPC_SC->PCLKSEL1 &= ~(0x3<<10); //00 CLK/4; 1 CLK; 2 CLK/2; 3 CLK/8 - LPC_SC->PCLKSEL1 |= (0x0<<10); //00 CLK/4; 1 CLK; 2 CLK/2; 3 CLK/ - - // P0.15~0.18 as SSP0 - LPC_PINCON->PINSEL0 &= ~(0x3UL<<30); //установит Р 0.15 - LPC_PINCON->PINSEL0 |= (0x2UL<<30); //частота для синхронизациии Master - slave - - LPC_PINCON->PINSEL1 &= ~((0x3<<0)|(0x3<<2)|(0x3<<4)); // устанивоить Р 0.17 и Р 0.18 - LPC_PINCON->PINSEL1 |= ((0x2<<2)|(0x2<<4)); // как MISO0 и MOSI0 - - LPC_PINCON->PINMODE0 &= ~(0x3UL<<30);// ? установление на Р 0.15 режима On-Chip pull-down resistor enabled - LPC_PINCON->PINMODE0 |= (0x3UL<<30);// ? установление на Р 0.15 режима On-Chip pull-down resistor enabled - - LPC_PINCON->PINMODE1 &= ~((0x3<<2)|(0x3<<4));// ? установление на Р 0.17 и Р 0.18 режима On-Chip pull-down resistor enabled - LPC_PINCON->PINMODE1 |= ((0x3<<2)|(0x3<<4));// ? установление на Р 0.17 и Р 0.18 режима On-Chip pull-down resistor enabled - - LPC_SSP0->CR0 = ((3<<8)|(0<<7)|(0<<4) |0xF); // (0xF)-установление DSS(Data sise select) в 16-битный формат, (3<<8 scr - выбор частоты), - // низкий уровень линии тактирования между кадрами, прикрепление передачи к первому нарастанию тактового мигнала - // формат кадра TI. - - /* SSPCPSR clock prescale register, master mode, minimum divisor is 0x02 */ - LPC_SSP0->CPSR = 0x2; // freq = CLK/(cpsdvr*(scr+1)) = 1.6 MHz - - /*SSP enable, master mode */ - LPC_SSP0->CR1 = SSPCR1_SSE; - while (LPC_SSP0->SR & SSP_BUSY); //wait until busy - while (LPC_SSP0->SR & RX_SSP_notEMPT) /* clear the RxFIFO */ - Dummy = LPC_SSP0->DR; - //all pins after reset is in GPIO mode, so CS pins needn't to configure - LPC_GPIO0->FIODIR |= (1<<16); // P0.16 defined as CS for ADC - LPC_GPIO0->FIOSET |= (1<<16); // set CS for ADC - - LPC_GPIO0->FIODIR |= (1<<23); // P defined as CS for DAC - LPC_GPIO0->FIOCLR |= (1<<23); // set CS for DAC - while (LPC_SSP1->SR & RX_SSP_notEMPT) - Dummy = LPC_SSP1->DR; /* clear the RxFIFO */ -} - -void sspReceive(void){ - //Prepare ADCs for sampling - LPC_GPIO0->FIOCLR = 1<<16; //reset SSEL signal for ADCs - //Start ADCs sampling - LPC_GPIO0->FIOSET = 1<<16; //set SSEL signal for ADCs - //Get samples - - device.controller.SSP.in[4] += LPC_SSP0->DR; - device.controller.SSP.in[3] += LPC_SSP0->DR; - device.controller.SSP.in[2] += LPC_SSP0->DR; - device.controller.SSP.in[1] += LPC_SSP0->DR; - device.controller.SSP.in[0] += LPC_SSP0->DR; - - /* - device.controller.SSP.accumulator[4] += LPC_SSP0->DR; - device.controller.SSP.accumulator[3] += LPC_SSP0->DR; - device.controller.SSP.accumulator[2] += LPC_SSP0->DR; - device.controller.SSP.accumulator[1] += LPC_SSP0->DR; - device.controller.SSP.accumulator[0] += LPC_SSP0->DR; - */ - - //Clear input queue - uint32_t value; - while (LPC_SSP0->SR & 0x00000004) value = LPC_SSP0->DR; - /* - //Average samples for dither period - if (device.measurement.counter == 31) { - for (uint8_t i = 0; i < 5; i++){ - device.controller.SSP.in[i] = device.controller.SSP.accumulator[i] >> 5; - device.controller.SSP.accumulator[i] = 0; - } - } - */ -} - -void sspTransmit(uint8_t index){ - LPC_GPIO0->FIOSET = 1<<23; //set SSEL signal for DACs - LPC_GPIO0->FIOCLR = 1<<23; //reset SSEL signal for DACs - - LPC_SSP0->DR=0x5555; - LPC_SSP0->DR=0x5555; - LPC_SSP0->DR=0x5555; - - if (index){ - LPC_SSP0->DR = 0x00000030; //Write DAC0 - LPC_SSP0->DR = device.controller.SSP.out[0]; - } else { - LPC_SSP0->DR = 0x00000031; //Write DAC1 - LPC_SSP0->DR = device.controller.SSP.out[1]; - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceSSP.h --- a/DeviceSSP.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#ifndef __DEVICE_SSP_H__ -#define __DEVICE_SSP_H__ - -typedef struct _DeviceSSP { - uint32_t in[5]; - //uint32_t accumulator[5]; - uint32_t out[2]; -} DeviceSSP; - -void InitSSPDefaultSettings(void); -void InitSSPState(void); -void DeviceStartSSP(void); - -void sspReceive(void); -void sspTransmit(uint8_t index); - -#endif /* __DEVICE_SSP_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceSequencer.c --- a/DeviceSequencer.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitSequencerDefaultSettings(void){ - device.sequencer.sampler.settings.enabled = 1; - device.sequencer.sampler.settings.amplitude = 0x1e0000; //30V - device.sequencer.sampler.settings.position[0] = 0; //starting output sample position - device.sequencer.sampler.settings.position[1] = 16; //starting reference (delayed) sample position - device.sequencer.sampler.settings.sequence[0] = 0; - device.sequencer.sampler.settings.sequence[1] = 6424; - device.sequencer.sampler.settings.sequence[2] = 12785; - device.sequencer.sampler.settings.sequence[3] = 19024; - device.sequencer.sampler.settings.sequence[4] = 25080; - device.sequencer.sampler.settings.sequence[5] = 30893; - device.sequencer.sampler.settings.sequence[6] = 36410; - device.sequencer.sampler.settings.sequence[7] = 41576; - device.sequencer.sampler.settings.sequence[8] = 46341; - device.sequencer.sampler.settings.sequence[9] = 50660; - device.sequencer.sampler.settings.sequence[10] = 54491; - device.sequencer.sampler.settings.sequence[11] = 57798; - device.sequencer.sampler.settings.sequence[12] = 60547; - device.sequencer.sampler.settings.sequence[13] = 62714; - device.sequencer.sampler.settings.sequence[14] = 64277; - device.sequencer.sampler.settings.sequence[15] = 65220; - device.sequencer.sampler.settings.sequence[16] = 65536; - device.sequencer.sampler.settings.sequence[17] = 65220; - device.sequencer.sampler.settings.sequence[18] = 64277; - device.sequencer.sampler.settings.sequence[19] = 62714; - device.sequencer.sampler.settings.sequence[20] = 60547; - device.sequencer.sampler.settings.sequence[21] = 57798; - device.sequencer.sampler.settings.sequence[22] = 54491; - device.sequencer.sampler.settings.sequence[23] = 50660; - device.sequencer.sampler.settings.sequence[24] = 46341; - device.sequencer.sampler.settings.sequence[25] = 41576; - device.sequencer.sampler.settings.sequence[26] = 36410; - device.sequencer.sampler.settings.sequence[27] = 30893; - device.sequencer.sampler.settings.sequence[28] = 25080; - device.sequencer.sampler.settings.sequence[29] = 19024; - device.sequencer.sampler.settings.sequence[30] = 12785; - device.sequencer.sampler.settings.sequence[31] = 6424; - device.sequencer.sampler.settings.sequence[32] = 0; - device.sequencer.sampler.settings.sequence[33] = -6424; - device.sequencer.sampler.settings.sequence[34] = -12785; - device.sequencer.sampler.settings.sequence[35] = -19024; - device.sequencer.sampler.settings.sequence[36] = -25080; - device.sequencer.sampler.settings.sequence[37] = -30893; - device.sequencer.sampler.settings.sequence[38] = -36410; - device.sequencer.sampler.settings.sequence[39] = -41576; - device.sequencer.sampler.settings.sequence[40] = -46341; - device.sequencer.sampler.settings.sequence[41] = -50660; - device.sequencer.sampler.settings.sequence[42] = -54491; - device.sequencer.sampler.settings.sequence[43] = -57798; - device.sequencer.sampler.settings.sequence[44] = -60547; - device.sequencer.sampler.settings.sequence[45] = -62714; - device.sequencer.sampler.settings.sequence[46] = -64277; - device.sequencer.sampler.settings.sequence[47] = -65220; - device.sequencer.sampler.settings.sequence[48] = -65536; - device.sequencer.sampler.settings.sequence[49] = -65220; - device.sequencer.sampler.settings.sequence[50] = -64277; - device.sequencer.sampler.settings.sequence[51] = -62714; - device.sequencer.sampler.settings.sequence[52] = -60547; - device.sequencer.sampler.settings.sequence[53] = -57798; - device.sequencer.sampler.settings.sequence[54] = -54491; - device.sequencer.sampler.settings.sequence[55] = -50660; - device.sequencer.sampler.settings.sequence[56] = -46341; - device.sequencer.sampler.settings.sequence[57] = -41576; - device.sequencer.sampler.settings.sequence[58] = -36410; - device.sequencer.sampler.settings.sequence[59] = -30893; - device.sequencer.sampler.settings.sequence[60] = -25080; - device.sequencer.sampler.settings.sequence[61] = -19024; - device.sequencer.sampler.settings.sequence[62] = -12785; - device.sequencer.sampler.settings.sequence[63] = -6424; - - device.sequencer.output.analog.settings.enabled = 1; - device.sequencer.output.logic.settings.enabled = 0; - device.sequencer.output.analog.settings.transfer.points = 16; - device.sequencer.output.analog.settings.transfer.code[0] = 0x0; - device.sequencer.output.analog.settings.transfer.voltage[0] = -0x1e0000; //-30.0V - device.sequencer.output.analog.settings.transfer.code[1] = 0x1100; - device.sequencer.output.analog.settings.transfer.voltage[1] = -0x1a0000; //-26.0V - device.sequencer.output.analog.settings.transfer.code[2] = 0x2200; - device.sequencer.output.analog.settings.transfer.voltage[2] = -0x160000; //-22.0V - device.sequencer.output.analog.settings.transfer.code[3] = 0x3300; - device.sequencer.output.analog.settings.transfer.voltage[3] = -0x120000; //-18.0V - device.sequencer.output.analog.settings.transfer.code[4] = 0x4440; - device.sequencer.output.analog.settings.transfer.voltage[4] = -0xe0000; //-14.0V - device.sequencer.output.analog.settings.transfer.code[5] = 0x5540; - device.sequencer.output.analog.settings.transfer.voltage[5] = -0xa0000; //-10.0V - device.sequencer.output.analog.settings.transfer.code[6] = 0x6640; - device.sequencer.output.analog.settings.transfer.voltage[6] = -0x60000; //-6.0V - device.sequencer.output.analog.settings.transfer.code[7] = 0x7740; - device.sequencer.output.analog.settings.transfer.voltage[7] = -0x20000; //-2.0V - device.sequencer.output.analog.settings.transfer.code[8] = 0x8880; - device.sequencer.output.analog.settings.transfer.voltage[8] = 0x20000; //2.0V - device.sequencer.output.analog.settings.transfer.code[9] = 0x9980; - device.sequencer.output.analog.settings.transfer.voltage[9] = 0x60000; //6.0V - device.sequencer.output.analog.settings.transfer.code[10] = 0xaa80; - device.sequencer.output.analog.settings.transfer.voltage[10] = 0xa0000; //10.0V - device.sequencer.output.analog.settings.transfer.code[11] = 0xbb80; - device.sequencer.output.analog.settings.transfer.voltage[11] = 0xe0000; //14.0V - device.sequencer.output.analog.settings.transfer.code[12] = 0xccc0; - device.sequencer.output.analog.settings.transfer.voltage[12] = 0x120000; //18.0V - device.sequencer.output.analog.settings.transfer.code[13] = 0xddc0; - device.sequencer.output.analog.settings.transfer.voltage[13] = 0x160000; //22.0V - device.sequencer.output.analog.settings.transfer.code[14] = 0xeec0; - device.sequencer.output.analog.settings.transfer.voltage[14] = 0x1a0000; //26.0V - device.sequencer.output.analog.settings.transfer.code[15] = 0xffc0; - device.sequencer.output.analog.settings.transfer.voltage[15] = 0x1e0000; //30.0V -} - -void InitSequencerState(void){ - device.sequencer.sampler.state.enabled = device.sequencer.sampler.settings.enabled; - device.sequencer.sampler.state.amplitude = device.sequencer.sampler.settings.amplitude; - device.sequencer.sampler.state.position[0] = device.sequencer.sampler.settings.position[0]; //starting output sample position - device.sequencer.sampler.state.position[1] = device.sequencer.sampler.settings.position[1]; //starting reference (delayed) sample position - device.sequencer.sampler.state.sample[0] = device.sequencer.sampler.settings.sequence[device.sequencer.sampler.state.position[0]]; - device.sequencer.sampler.state.sample[1] = device.sequencer.sampler.settings.sequence[device.sequencer.sampler.state.position[1]]; - device.sequencer.sampler.state.voltage = device.sequencer.sampler.state.amplitude * device.sequencer.sampler.state.sample[0]; - - device.sequencer.output.analog.state.enabled = device.sequencer.output.analog.settings.enabled; - device.sequencer.output.logic.state.enabled = device.sequencer.output.logic.settings.enabled; -} - -void DeviceStartSequencer(void){ - if (device.sequencer.output.logic.state.enabled) { - //Setup P0.26: GPIO output - LPC_PINCON->PINSEL1 &= ~(3<<20); //P0.26 is GPIO pin (write 00b in bits 21:20 of PINSEL1) - LPC_PINCON->PINMODE1 |= (3<<20); //P0.26 pull-down resistor on (write 11b in bits 21:20 of PINMODE0) - LPC_GPIO0->FIODIR |= (1<<26); //P0.26 is output (write 1b in bit 4 of FIODIR) - LPC_GPIO0->FIOSET |= (1<<26); //off - } else if (device.sequencer.output.analog.state.enabled) { - LPC_SC->PCLKSEL0 &= ~(0x3<<22); //00b CLK/4; 01b CLK; 10b CLK/2; 11b CLK/8 - //Pin 0.26 function select AOUT (10b) - LPC_PINCON->PINSEL1 &= ~(3<<20); - LPC_PINCON->PINSEL1 |= 0x2 << 20; //P0.26 is AOUT pin (write 10b in bits 21:20 of PINSEL1) - } -} - -int32_t sequencerInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t sequencerOutput(uint32_t voltage) { - int32_t v1, v2; - for (uint8_t i = 1; i < device.sequencer.output.analog.settings.transfer.points; i++) { - v1 = device.sequencer.output.analog.settings.transfer.voltage[i - 1]; - if (voltage < v1) { - return device.sequencer.output.analog.settings.transfer.code[i - 1]; - } - - v2 = device.sequencer.output.analog.settings.transfer.voltage[i]; - if (voltage < v2) { - int32_t c1 = device.sequencer.output.analog.settings.transfer.code[i - 1]; - int32_t c2 = device.sequencer.output.analog.settings.transfer.code[i]; - return sequencerInterpolate(voltage, v1, v2, c1, c2); - } - } - return device.sequencer.output.analog.settings.transfer.code[device.sequencer.output.analog.settings.transfer.points - 1]; -} - -void sequencerProcess(void){ - //Sample - device.sequencer.sampler.state.sample[0] = device.sequencer.sampler.settings.sequence[device.sequencer.sampler.state.position[0]]; - device.sequencer.sampler.state.sample[1] = device.sequencer.sampler.settings.sequence[device.sequencer.sampler.state.position[1]]; - device.sequencer.sampler.state.voltage = device.sequencer.sampler.state.amplitude * device.sequencer.sampler.state.sample[0]; - //Set output - if (device.sequencer.output.logic.state.enabled) { - if (device.sequencer.sampler.state.sample[0] > 0) { - LPC_GPIO0->FIOCLR |= (1<<26); //1 - } else { - LPC_GPIO0->FIOSET |= (1<<26); //0 - } - } else if (device.sequencer.output.analog.state.enabled) { - device.sequencer.output.analog.state.voltage = device.sequencer.sampler.state.voltage; - //Warning! bit 16 - 0/1: Update rate 1MHz/400kHz; bits 15...6 - code; bits 5...0 - reserved, write 000000 - LPC_DAC->DACR = sequencerOutput(device.sequencer.output.analog.state.voltage); - //LPC_DAC->CR = sequencerOutput(device.sequencer.output.analog.state.voltage); - } - //Process sequencer state - device.sequencer.sampler.state.position[0]++; - if (device.sequencer.sampler.state.position[0] == 64) device.sequencer.sampler.state.position[0] = 0; - device.sequencer.sampler.state.position[1]++; - if (device.sequencer.sampler.state.position[1] == 64) device.sequencer.sampler.state.position[1] = 0; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceSequencer.h --- a/DeviceSequencer.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -#ifndef __DEVICE_SEQUENCER_H__ -#define __DEVICE_SEQUENCER_H__ - -//Sampler typedefs -typedef struct _DeviceSequencerSamplerSettings { - uint8_t enabled; //Enable sequence generation - uint32_t amplitude; //Generator analog output amplitude - volts in 16.16 format - int32_t sequence[64]; //Generator sequence - dimensionless units -1...+1 in 16.16 format - uint8_t position[2]; //Sequence position -} DeviceSequencerSamplerSettings; - -typedef struct _DeviceSequencerSamplerState { - uint8_t enabled; //Enable sequence generation - uint32_t amplitude; //Generator analog output amplitude - volts in 16.16 format - uint8_t position[2]; //Sequence position - uint32_t sample[2]; //Sequencer analog output = sequence[]: current/delayed - dimensionless units -1...+1 in 16.16 format - uint32_t voltage; //Sequencer analog output = sequence[] * amplitude - volts in 16.16 format -} DeviceSequencerSamplerState; - -typedef struct _DeviceSequencerSampler { - DeviceSequencerSamplerSettings settings; - DeviceSequencerSamplerState state; -} DeviceSequencerSampler; - -//Analog output typedefs -typedef struct _DeviceSequencerAnalogOutputTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format - int32_t code[16]; //DAC code control points -} DeviceSequencerAnalogOutputTransferFunction; - -typedef struct _DeviceSequencerAnalogOutputSettings { - uint8_t enabled; //Enable analog output - DeviceSequencerAnalogOutputTransferFunction transfer; -} DeviceSequencerAnalogOutputSettings; - -typedef struct _DeviceSequencerAnalogOutputState { - uint8_t enabled; //Enable analog output - uint32_t voltage; //Sequencer analog output = sequence[] * amplitude - volts in 16.16 format -} DeviceSequencerAnalogOutputState; - -typedef struct _DeviceSequencerAnalogOutput { - DeviceSequencerAnalogOutputSettings settings; - DeviceSequencerAnalogOutputState state; -} DeviceSequencerAnalogOutput; - -//Logic output typedefs -typedef struct _DeviceSequencerLogicOutputSettings { - uint8_t enabled; //Enable logic (GPIO pin) output -} DeviceSequencerLogicOutputSettings; - -typedef struct _DeviceSequencerLogicOutputState { - uint8_t enabled; //Enable logic (GPIO pin) output - uint32_t level; //Sequencer logic output - 0/1 -} DeviceSequencerLogicOutputState; - -typedef struct _DeviceSequencerLogicOutput { - DeviceSequencerLogicOutputSettings settings; - DeviceSequencerLogicOutputState state; -} DeviceSequencerLogicOutput; - -typedef struct _DeviceSequencerOutput { - DeviceSequencerLogicOutput logic; - DeviceSequencerAnalogOutput analog; -} DeviceSequencerOutput; - -//Sequencer typedefs -typedef struct _DeviceSequencerOutputTransferFunction { - uint32_t points; //Number of actual control points (up to 16) - int32_t voltage[16]; //Output voltage control points in signed 16.16 fixed point format - int32_t code[16]; //DAC code control points -} DeviceSequencerOutputTransferFunction; - -typedef struct _DeviceSequencerSettings { - uint8_t enabled; //Enable sequence generation - uint8_t analog; //Modulate analog (voltage) output - uint8_t logic; //Modulate logic (GPIO pin) output - int32_t amplitude; //Generator analog output amplitude - volts in 16.16 format - int32_t sequence[64]; //Generator sequence - dimensionless units -1...+1 in 16.16 format - uint8_t position[2]; //Sequence position - DeviceSequencerOutputTransferFunction transfer; -} DeviceSequencerSettings; - -typedef struct _DeviceSequencerState { - uint8_t enabled; //Enable sequence generation - uint8_t analog; //Modulate analog (voltage) output - uint8_t logic; //Modulate logic (GPIO pin) output - uint32_t amplitude; //Generator analog output amplitude - volts in 16.16 format - uint8_t position[2]; //Sequence position - uint32_t sample[2]; //Sequencer analog output = sequence[]: current/delayed - dimensionless units -1...+1 in 16.16 format - uint32_t voltage; //Sequencer analog output = sequence[] * amplitude - volts in 16.16 format -} DeviceSequencerState; - -typedef struct _DeviceSequencer { - //DeviceSequencerSettings settings; - //DeviceSequencerState state; - - DeviceSequencerSampler sampler; - DeviceSequencerOutput output; -} DeviceSequencer; - -void InitSequencerDefaultSettings(void); -void InitSequencerState(void); -void DeviceStartSequencer(void); - -void sequencerProcess(void); - -#endif /* __DEVICE_SEQUENCER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceServicePort.c --- a/DeviceServicePort.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -#include "Device.h" -extern Device device; -extern unsigned int SystemCoreClock1; - -extern char InCon[1024]; -extern char OutCon[1024]; - -extern unsigned int ConInPnt; -extern unsigned int ConInCur; -extern unsigned int ConOutPnt; -extern unsigned int ConOutCur; - -void InitServicePortDefaultSettings(void) { - device.service.port.settings.baud = 921600; -} - -void InitServicePortState(void){ - device.service.port.state.baud = device.service.port.settings.baud; -} - -void DeviceStartServicePort(void){ - uint32_t Fdiv; - uint32_t pclkdiv, pclk; - - LPC_PINCON->PINSEL0 |= (1 << 4); /* Pin P0.2 used as TXD0 (Com0) */ - LPC_PINCON->PINSEL0 |= (1 << 6); /* Pin P0.3 used as RXD0 (Com0) */ - - /* By default, the PCLKSELx value is zero, thus, the PCLK for all the peripherals is 1/4 of the SystemFrequency. */ - /* Bit 6,7 are for UART0 */ - pclkdiv = (LPC_SC->PCLKSEL0 >> 6) & 0x03; - switch ( pclkdiv ) { - case 0x00: - default: - pclk = SystemCoreClock1/4; - break; - case 0x01: - pclk = SystemCoreClock1; - break; - case 0x02: - pclk = SystemCoreClock1/2; - break; - case 0x03: - pclk = SystemCoreClock1/8; - break; - } - - device.controller.uart[0].state.LCR = 0x83; - LPC_UART0->LCR = device.controller.uart[0].state.LCR; - - Fdiv = ((pclk / 16) / device.service.port.state.baud) + 1; - - device.controller.uart[0].state.DLM = Fdiv / 256; - LPC_UART0->DLM = device.controller.uart[0].state.DLM; - device.controller.uart[0].state.DLL = Fdiv % 256; - LPC_UART0->DLL = device.controller.uart[0].state.DLL; - - device.controller.uart[0].state.LCR = 0x03; - LPC_UART0->LCR = device.controller.uart[0].state.LCR; - device.controller.uart[0].state.FCR = 0x07; - LPC_UART0->FCR = device.controller.uart[0].state.FCR; -} - -void Concole(void) -{ - if (ConOutPnt != ConOutCur) - if (LPC_UART0->LSR & 0x20){ - LPC_UART0->THR = OutCon[ConOutCur]; - ConOutCur++; - ConOutCur = ConOutCur & 0x3ff; - } - if (LPC_UART0->LSR & 0x01){ - InCon[ConInCur] = (LPC_UART0->RBR); - ConInCur++; - ConInCur = ConInCur & 0x3ff; - } -} - -int ReadConcole(void) -{ - uint16_t i = 0; - while (ConInPnt != ConInCur){ - device.service.buffer[i] = InCon[ConInPnt]; - ConInPnt++; ConInPnt = ConInPnt & 0x3ff; - i++; - } - device.service.buffer[i] = 0; - return i; -} - -void WriteConcole(void) { - uint16_t i = 0; - while (device.service.buffer[i] != 0){ - OutCon[ConOutPnt] = device.service.buffer[i]; - ConOutPnt++; ConOutPnt = ConOutPnt & 0x3ff; - i++; - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceServicePort.h --- a/DeviceServicePort.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#ifndef __DEVICE_SERVICE_PORT_H__ -#define __DEVICE_SERVICE_PORT_H__ - -//User port typedefs -typedef struct _DeviceServicePortSettings { - uint32_t baud; //Baud rate -} DeviceServicePortSettings; - -typedef struct _DeviceServicePortState { - uint32_t baud; //Baud rate -} DeviceServicePortState; - -typedef struct _DeviceServicePort { - DeviceServicePortSettings settings; - DeviceServicePortState state; -} DeviceServicePort; - -void InitServicePortDefaultSettings(void); -void InitServicePortState(void); -void DeviceStartServicePort(void); - -void Concole(void); -int ReadConcole(void); -void WriteConcole(void); -#endif /* __DEVICE_SERVICE_PORT_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceTSS.c --- a/DeviceTSS.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -#include "Device.h" -extern Device device; - -void InitTSSDefaultSettings(void){ - device.tss.temperature.settings.transfer.points = 16; - device.tss.temperature.settings.transfer.raw[0] = -0x8e0ba2e; //-2272.727272727273 - device.tss.temperature.settings.transfer.celsius[0] = -0x3c0000; //-60.0 - device.tss.temperature.settings.transfer.raw[1] = -0x6645d17; //-1636.3636363636365 - device.tss.temperature.settings.transfer.celsius[1] = -0x320000; //-50.0 - device.tss.temperature.settings.transfer.raw[2] = -0x3e80000; //-1000.0000000000002 - device.tss.temperature.settings.transfer.celsius[2] = -0x280000; //-40.0 - device.tss.temperature.settings.transfer.raw[3] = -0x16ba2e8; //-363.63636363636397 - device.tss.temperature.settings.transfer.celsius[3] = -0x1e0000; //-30.0 - device.tss.temperature.settings.transfer.raw[4] = 0x110ba2e; //272.7272727272725 - device.tss.temperature.settings.transfer.celsius[4] = -0x140000; //-20.0 - device.tss.temperature.settings.transfer.raw[5] = 0x38d1745; //909.090909090909 - device.tss.temperature.settings.transfer.celsius[5] = -0xa0000; //-10.0 - device.tss.temperature.settings.transfer.raw[6] = 0x609745d; //1545.454545454545 - device.tss.temperature.settings.transfer.celsius[6] = 0x0; //0.0 - device.tss.temperature.settings.transfer.raw[7] = 0x885d174; //2181.818181818182 - device.tss.temperature.settings.transfer.celsius[7] = 0xa0000; //10.0 - device.tss.temperature.settings.transfer.raw[8] = 0xb022e8b; //2818.181818181818 - device.tss.temperature.settings.transfer.celsius[8] = 0x140000; //20.0 - device.tss.temperature.settings.transfer.raw[9] = 0xd7e8ba2; //3454.545454545454 - device.tss.temperature.settings.transfer.celsius[9] = 0x1e0000; //30.0 - device.tss.temperature.settings.transfer.raw[10] = 0xffae8ba; //4090.909090909091 - device.tss.temperature.settings.transfer.celsius[10] = 0x280000; //40.0 - device.tss.temperature.settings.transfer.raw[11] = 0x127745d1; //4727.272727272727 - device.tss.temperature.settings.transfer.celsius[11] = 0x320000; //50.0 - device.tss.temperature.settings.transfer.raw[12] = 0x14f3a2e8; //5363.636363636363 - device.tss.temperature.settings.transfer.celsius[12] = 0x3c0000; //60.0 - device.tss.temperature.settings.transfer.raw[13] = 0x176fffff; //5999.999999999999 - device.tss.temperature.settings.transfer.celsius[13] = 0x460000; //70.0 - device.tss.temperature.settings.transfer.raw[14] = 0x19ec5d17; //6636.363636363637 - device.tss.temperature.settings.transfer.celsius[14] = 0x500000; //80.0 - device.tss.temperature.settings.transfer.raw[15] = 0x1c68ba2e; //7272.727272727273 - device.tss.temperature.settings.transfer.celsius[15] = 0x5a0000; //90.0 - - //TODO: actual values - device.tss.gradient.settings.transfer.points = 16; - device.tss.gradient.settings.transfer.raw[0] = -0x640000; //-100.0 - device.tss.gradient.settings.transfer.celsius[0] = -0xa0000; //-10.0 - device.tss.gradient.settings.transfer.raw[1] = -0x56aaaa; //-86.66666666666667 - device.tss.gradient.settings.transfer.celsius[1] = -0x8aaaa; //-8.666666666666666 - device.tss.gradient.settings.transfer.raw[2] = -0x495555; //-73.33333333333333 - device.tss.gradient.settings.transfer.celsius[2] = -0x75555; //-7.333333333333334 - device.tss.gradient.settings.transfer.raw[3] = -0x3c0000; //-60.0 - device.tss.gradient.settings.transfer.celsius[3] = -0x60000; //-6.0 - device.tss.gradient.settings.transfer.raw[4] = -0x2eaaaa; //-46.666666666666664 - device.tss.gradient.settings.transfer.celsius[4] = -0x4aaaa; //-4.666666666666667 - device.tss.gradient.settings.transfer.raw[5] = -0x215555; //-33.33333333333333 - device.tss.gradient.settings.transfer.celsius[5] = -0x35555; //-3.333333333333334 - device.tss.gradient.settings.transfer.raw[6] = -0x140000; //-20.0 - device.tss.gradient.settings.transfer.celsius[6] = -0x20000; //-2.0 - device.tss.gradient.settings.transfer.raw[7] = -0x6aaaa; //-6.666666666666657 - device.tss.gradient.settings.transfer.celsius[7] = -0xaaaa; //-0.6666666666666679 - device.tss.gradient.settings.transfer.raw[8] = 0x6aaaa; //6.666666666666671 - device.tss.gradient.settings.transfer.celsius[8] = 0xaaaa; //0.6666666666666661 - device.tss.gradient.settings.transfer.raw[9] = 0x140000; //20.0 - device.tss.gradient.settings.transfer.celsius[9] = 0x20000; //2.0 - device.tss.gradient.settings.transfer.raw[10] = 0x215555; //33.33333333333334 - device.tss.gradient.settings.transfer.celsius[10] = 0x35555; //3.333333333333332 - device.tss.gradient.settings.transfer.raw[11] = 0x2eaaaa; //46.666666666666686 - device.tss.gradient.settings.transfer.celsius[11] = 0x4aaaa; //4.666666666666666 - device.tss.gradient.settings.transfer.raw[12] = 0x3c0000; //60.0 - device.tss.gradient.settings.transfer.celsius[12] = 0x60000; //6.0 - device.tss.gradient.settings.transfer.raw[13] = 0x495555; //73.33333333333334 - device.tss.gradient.settings.transfer.celsius[13] = 0x75555; //7.333333333333332 - device.tss.gradient.settings.transfer.raw[14] = 0x56aaaa; //86.66666666666669 - device.tss.gradient.settings.transfer.celsius[14] = 0x8aaaa; //8.666666666666664 - device.tss.gradient.settings.transfer.raw[15] = 0x640000; //100.0 - device.tss.gradient.settings.transfer.celsius[15] = 0xa0000; //10.0 -} - -void InitTSSState(void) { - device.tss.temperature.state.sum = 0; - device.tss.gradient.state.sum = 0; - device.tss.temperature.state.raw = 0; - device.tss.temperature.state.celsius = tssTemperature(device.tss.temperature.state.raw); - device.tss.gradient.state.raw = 0; - device.tss.gradient.state.celsius = tssGradient(device.tss.gradient.state.raw); -} - -void DeviceStartTSS(void) { -} - -int32_t tssInterpolate(int32_t a,int32_t a1,int32_t a2,int32_t b1,int32_t b2) { - int32_t ma, mb; - while (1) { - if (a1 == a) return b1; - if (a2 == a) return b2; - - ma = (a1 + a2) >> 1; - mb = (b1 + b2) >> 1; - - if (a < ma) { - if (a2 == ma) return mb; - if (b1 == mb) return mb; - a2 = ma; b2 = mb; - } else if (a > ma) { - if (a1 == ma) return mb; - if (b2 == mb) return mb; - a1 = ma; b1 = mb; - } else return mb; - } -} - -int32_t tssTemperature(uint32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.tss.temperature.settings.transfer.points; i++) { - r1 = device.tss.temperature.settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.tss.temperature.settings.transfer.celsius[i - 1]; - } - - r2 = device.tss.temperature.settings.transfer.raw[i]; - if (raw < r2) { - int32_t c1 = device.tss.temperature.settings.transfer.celsius[i - 1]; - int32_t c2 = device.tss.temperature.settings.transfer.celsius[i]; - return tssInterpolate(raw, r1, r2, c1, c2); - } - } - return device.tss.temperature.settings.transfer.celsius[device.tss.temperature.settings.transfer.points - 1]; -} - -int32_t tssGradient(uint32_t raw) { - int32_t r1, r2; - for (uint8_t i = 1; i < device.tss.gradient.settings.transfer.points; i++) { - r1 = device.tss.gradient.settings.transfer.raw[i - 1]; - if (raw < r1) { - return device.tss.gradient.settings.transfer.celsius[i - 1]; - } - - r2 = device.tss.gradient.settings.transfer.raw[i]; - if (raw < r2) { - int32_t c1 = device.tss.gradient.settings.transfer.celsius[i - 1]; - int32_t c2 = device.tss.gradient.settings.transfer.celsius[i]; - return tssInterpolate(raw, r1, r2, c1, c2); - } - } - return device.tss.gradient.settings.transfer.celsius[device.tss.gradient.settings.transfer.points - 1]; -} - -void tssProcess(void) { - device.tss.temperature.state.sum += device.controller.SSP.in[3]; - device.tss.gradient.state.sum += device.controller.SSP.in[0]; - - if (device.measurement.counter == 31) { - device.tss.temperature.state.raw = device.tss.temperature.state.sum >> 5; - device.tss.temperature.state.celsius = tssTemperature(device.tss.temperature.state.raw); - device.tss.temperature.state.sum = 0; - device.tss.gradient.state.raw = device.tss.gradient.state.sum >> 5; - device.tss.gradient.state.celsius = tssGradient(device.tss.gradient.state.raw); - device.tss.gradient.state.sum = 0; - } -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceTSS.h --- a/DeviceTSS.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -#ifndef __DEVICE_TSS_H__ -#define __DEVICE_TSS_H__ - -typedef struct _DeviceTSSTransferFunction { - int32_t points; //Used points count - int32_t raw[16]; //ADC code - int32_t celsius[16]; //Temperature - degrees in 16.16 format -} DeviceTSSTransferFunction; - -typedef struct _DeviceTSSTemperatureSettings { - DeviceTSSTransferFunction transfer; -} DeviceTSSTemperatureSettings; - -typedef struct _DeviceTSSTemperatureState { - int32_t sum; //Sum of last 32 temperature measurements - ADC code - int32_t raw; //Average temperature - ADC code - int32_t celsius; //Average temperature - degrees in 16.16 format -} DeviceTSSTemperatureState; - -typedef struct _DeviceTSSTemperature { - DeviceTSSTemperatureSettings settings; - DeviceTSSTemperatureState state; -} DeviceTSSTemperature; - -typedef struct _DeviceTSSGradientSettings { - DeviceTSSTransferFunction transfer; -} DeviceTSSGradientSettings; - -typedef struct _DeviceTSSGradientState { - int32_t sum; //Sum of last 32 gradient measurements - ADC code - int32_t raw; //Average gradient - ADC code - int32_t celsius; //Average gradient - degrees in 16.16 format -} DeviceTSSGradientState; - -typedef struct _DeviceTSSGradient { - DeviceTSSGradientSettings settings; - DeviceTSSGradientState state; -} DeviceTSSGradient; - -typedef struct _DeviceTSS { - DeviceTSSTemperature temperature; - DeviceTSSGradient gradient; -} DeviceTSS; - -void InitTSSDefaultSettings(void); -void InitTSSState(void); -void DeviceStartTSS(void); - -void tssProcess(void); - -#endif /* __DEVICE_TSS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceTimers.c --- a/DeviceTimers.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -#include "Device.h" - -extern Device device; -extern unsigned int SystemCoreClock1; - -void InitMeasurementTimerDefaultSettings(void){ - //device.controller.timer[0].settings.match = 8064; //CCLK / 8064 = 12800.0Hz; Vibro: Timer1/32 = 400.0Hz; -} - -void InitMeasurementTimerState(void) { - //TODO: - //SystemCoreClock1 - 27 bit - //device.dither.oscillation.state.frequency - 25 bit - //device.controller.timer[0].state.MR0 - 13 bit - device.controller.timer[0].state.MR0 = 0; - device.controller.timer[0].state.MCR = 0; - device.controller.timer[0].state.TCR = 0; -} - -void DeviceStartMeasurementTimer(void) { - LPC_SC->PCONP |= (1<<2); //Power on timer 1 - - LPC_TIM1->MR0 = device.controller.timer[0].state.MR0; - - device.controller.timer[0].state.MCR = 3; - LPC_TIM1->MCR = device.controller.timer[0].state.MCR; //Interrupt and Reset on MR1 - - NVIC_EnableIRQ(TIMER1_IRQn); - - device.controller.timer[0].state.TCR = 1; //Bit 0: Counter Enable - LPC_TIM1->TCR = device.controller.timer[0].state.TCR; - return; -} - -void timersSetMeasurementPeriod(uint32_t period) { - device.controller.timer[0].state.MR0 = period; - LPC_TIM1->MR0 = device.controller.timer[0].state.MR0; -} - -void InitRegularTimerDefaultSettings(void){ -} - -void InitRegularTimerState(void) { - device.controller.timer[1].state.MR0 = 0; - device.controller.timer[1].state.MCR = 0; - device.controller.timer[1].state.TCR = 0; -} - -void DeviceStartRegularTimer(void) { - LPC_SC->PCONP |= (1<<22);//Power on timer 2 - - LPC_TIM2->MR0 = device.controller.timer[1].state.MR0; - - device.controller.timer[1].state.MCR = 3; - LPC_TIM2->MCR = device.controller.timer[1].state.MCR; //Interrupt and Reset on MR0 - - NVIC_EnableIRQ(TIMER2_IRQn); - - device.controller.timer[1].state.TCR = 1; //Bit 0: Counter Enable - LPC_TIM2->TCR = device.controller.timer[1].state.TCR; -} - -void timersSetRegularPeriod(uint32_t period) { - device.controller.timer[1].state.MR0 = period; - LPC_TIM2->MR0 = device.controller.timer[1].state.MR0; -} -/* -//Measurement floating cycle timer interrupt -__irq void TIMER1_IRQHandler(void) { - DeviceMeasurementInterruptHandler(); - - LPC_TIM1->IR = 1; -} - -//Regular cycle 100kHz timer interrupt -__irq void TIMER2_IRQHandler(void) { - DeviceRegularInterruptHandler(); - - LPC_TIM2->IR = 1; -} -*/ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceTimers.h --- a/DeviceTimers.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#ifndef __DEVICE_TIMERS_H__ -#define __DEVICE_TIMERS_H__ - -typedef struct _DeviceTimerSettings { -} DeviceTimerSettings; - -typedef struct _DeviceTimerState { - //Match Register 0. MR0 can be enabled through the MCR to reset the TC, stop both the TC and PC, and/or generate an interrupt every time MR0 matches the TC. - uint32_t MR0; - //Match Control Register. The MCR is used to control if an interrupt is generated and if the TC is reset when a Match occurs. - uint32_t MCR; - //Timer Control Register. The TCR is used to control the Timer Counter functions. The Timer Counter can be disabled or reset through the TCR. - uint32_t TCR; -} DeviceTimerState; - -typedef struct _DeviceTimer { - DeviceTimerSettings settings; - DeviceTimerState state; -} DeviceTimer; - -void InitMeasurementTimerDefaultSettings(void); -void InitMeasurementTimerState(void); -void DeviceStartMeasurementTimer(void); - -void timersSetMeasurementPeriod(uint32_t period); - -void InitRegularTimerDefaultSettings(void); -void InitRegularTimerState(void); -void DeviceStartRegularTimer(void); - -void timersSetRegularPeriod(uint32_t period); - -#endif /* __DEVICE_TIMERS_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUser.c --- a/DeviceUser.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -#include "Device.h" - -extern Device device; - -void InitUserDefaultSettings(void){ - device.user.address = 0; - InitUserDecoderDefaultSettings(); - InitUserEncoderDefaultSettings(); - InitUserRequestDefaultSettings(); - InitUserResponseDefaultSettings(); -} - -void InitUserState(void){ - InitUserDecoderState(); - InitUserEncoderState(); - InitUserRequestState(); - InitUserResponseState(); -} - -void DeviceStartUser(void){ - DeviceStartUserDecoder(); - DeviceStartUserEncoder(); - DeviceStartUserRequest(); - DeviceStartUserResponse(); -} - -void userDecodePin(void) { - /* - *** Action *** - int ChkSumm; - - if ((Device_Mode == DM_EXT_LATCH_DELTA_PS_PULSE) || (Device_Mode == DM_EXT_LATCH_DELTA_BINS_PULSE)) //e. exteranal latch with autoanswer on external pulse //r. внешняя защелка с автоответом по внешнему импульсу - { - if (Ext_Latch_Rdy) - { - // B_Delta_PS - // cc 00 a0 00 00 a0 ; 38400/38400 - // cc 00 a0 30 00 d0 ; 115200/115200 - // cc 1F a0 60 01 1f ; 38400/921200 - rcv_num_byt = 6; - rcv_buf[0] = COMMAND_PREFIX; - rcv_buf[1] = 0x1f; //Device_blk.My_Addres; //e. set the broadcasting address for delay on line for different addresses //r. задаем широковещательный адрес, чтобы была задержка на линии для разл.адресов - if (Device_Mode == DM_EXT_LATCH_DELTA_PS_PULSE) - { - rcv_buf[2] = Bcmd_DeltaPS; // 0xA0; - } - else - { - rcv_buf[2] = Bcmd_DeltaBINS; // 0xB0; - } - rcv_buf[3] = ((Copy_SRgR & 0x38) << 1) & 0x70; //r. 0x30; // 0x60; - ChkSumm = rcv_buf[1] + rcv_buf[2] + rcv_buf[3]; - rcv_buf[4] = Hi(ChkSumm); - rcv_buf[5] = Lo(ChkSumm); - rcv_Rdy = 1; - } - } - */ - - if (device.counters.latch.state.enabled) { - //TODO: - // device.counters.latch.state.clock = ... - // if (device.counters.latch.state.format == 0) { - // //DeltaPS - // device.counters.latch.state.angle = ... - // if (device.counters.latch.state.reset) { - // device.counters.dither.state.angle -= device.counters.latch.state.angle; - // } - // } else if (device.counters.latch.state.format == 1) { - // //DeltaBINS - // device.counters.latch.state.angle = ... - // if (device.counters.latch.state.reset) { - // device.counters.dither.state.angle = 0; - // } - // } else if (device.counters.latch.state.format == 3) { - // //DeltaSF - // device.counters.latch.state.angle = ... - // if (device.counters.latch.state.reset) { - // device.counters.dither.state.angle = 0; - // } - // } - - device.user.response.counter = 0; - device.user.response.trigger = BROADCAST_FRAME * device.user.address; //0/100/200 mks - device.user.response.type = RESPONSE_DELAYED; - if (device.counters.latch.state.format == 0){ - device.user.response.code = DELTA_PS; - } else if (device.counters.latch.state.format == 1){ - device.user.response.code = DELTA_BINS; - } else if (device.counters.latch.state.format == 2){ - device.user.response.code = DELTA_SF; - }; - - device.user.response.enabled = 1; - }; -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUser.h --- a/DeviceUser.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -#ifndef __DEVICE_USER_H__ -#define __DEVICE_USER_H__ - -#include "stdint.h" -#include "DeviceUserRequest.h" -#include "DeviceUserResponse.h" -#include "DeviceUserDecoder.h" -#include "DeviceUserEncoder.h" - -#define BROADCAST_ADDRESS 0x1f -#define BROADCAST_FRAME 100 //100 mks - -//All commands -#define DELTA_PS 0xa000 //B_DeltaPS command code: output of accumulated pulses and ACS parameters as 22 indexed packets sequence -#define DELTA_BINS 0xb000 //B_DeltaBINS command code: output of accumulated pulses and data validity attribute in one packet -#define DELTA_SF 0xb200 //B_DeltaSF command code: scale factor measurement data output in one packet -#define DEV_MODE 0xa500 //Device_Mode command code -#define BIT_MODE 0xa700 //B.I.T. (built-in test) command code - -#define MAINTENANCE 0x9900 //Maintenance mode command code -//Maintenance command set versions -#define M0_MAINTENANCE 0x99 //: initial version -//Maintenance basic commands group -#define M0_BASIC 0xda00 //Basic maintenance commands group code -#define M0_CLEAR 0xda00 //group command select: reset line 485 error register -#define M0_MIRROR 0xda01 //group command select: return previous contents of the receiver buffer -#define M0_LDPAR_F 0xda02 //group command select: load device parameters from Flash-memory -#define M0_LDPAR_D 0xda03 //group command select: set device parameters by procedure of initialization -#define M0_START 0xda04 //group command select: switch on the device -#define M0_STOP 0xda40 //group command select: switch off the device -#define M0_PULSE 0xda0a //group command select: generation of the light-up pulse -//Maintenance rate commands group -#define M0_RATE 0xdd00 //M_Rate commands group code -#define M0_RATE_1 0xdd01 //group command select: output parameters set 1 (MRate) -#define M0_RATE_2 0xdd02 //group command select: output parameters set 2 (MRate2) -#define M0_RATE_3 0xdd03 //group command select: output parameters set 3 (MRate3) -#define M0_RATE_4 0xdd04 //group command select: output parameters set 4 (MRate4) -#define M0_RATE_7 0xdd07 //group command select: output parameters set 7 (MRate7) - -//Other maintenance commands -#define M0_STIMUL 0x0a00 //MStimul command code -#define M0_RESET 0x8000 //software device reset(restart) - -#define M0_CTL_R 0xd900 //reading the control register RgConA/B of the device -#define M0_CTL_A_R 0xd900 //MCtlR command code mask: reading the control register RgConA of the device -#define M0_CTL_B_R 0xd910 //MCtlR command code mask: reading the control register RgConB of the device -#define M0_CTL_M 0xd800 //modification of bit of the control register -#define M0_CTL_A_M 0xd800 //MCtlM command code mask: modification control register RgConA of the device -#define M0_CTL_B_M 0xd810 //MCtlM command code mask: modification the control register RgConB of the device - -#define M0_TMP_W 0xe000 //writing to the AD7714 circuit (temperature sensors) -#define M0_TMP_R 0xe100 //reading from the AD7714 circuit (temperature sensors) -#define M0_E5R_W 0xe200 //writing to the register of a mode of the Elio5 card -#define M0_ADC_R 0xe300 //reading data from the ADC of the Elio5 card -#define M0_VIB_W 0xe400 //loading of the oscillation period of the dither drive -#define M0_CNT_R 0xe500 //reading data from the counters of the Elio5 card -#define M0_GPH_W 0xe600 //loading gain factors of photodetector channels -#define M0_FLG_R 0xe700 //reading data from the register of input flags -#define M0_PARAM_W 0xe800 //writing working parameter to the data memory -#define M0_PARAM_R 0xe900 //reading working parameter of the GLD from the data memory -#define M0_E5RA_W 0xea00 //writing in 1st additional (A) register of a mode of the Elio5 card - -//Factory maintenance commands -#define FACTORY_ACCESS 0xff00 //Factory access: command mask - -#define H_PARAM8_R 0xff00 //Hash access: 0000b read 1-byte param -#define H_PARAM16_R 0xff01 //Hash access: 0001b read 2-byte param -#define H_PARAM32_R 0xff03 //Hash access: 0010b read 4-byte param -#define H_BYTES_R 0xff0f //Hash access: 1111b read bytes param - -#define H_PARAM8_W 0xff10 //Hash access: 0000b write 1-byte param -#define H_PARAM16_W 0xff11 //Hash access: 0001b write 2-byte param -#define H_PARAM32_W 0xff13 //Hash access: 0010b write 4-byte param -#define H_BYTES_W 0xff1f //Hash access: 1111b write bytes param - -#define H_FUNC_PARAM0_BY_IMM8 0xff20 //Hash access: 0000b set function parameter 0 by 8 bit immediate value -#define H_FUNC_PARAM1_BY_IMM8 0xff24 //Hash access: 0100b set function parameter 1 by 8 bit immediate value -#define H_FUNC_PARAM2_BY_IMM8 0xff28 //Hash access: 1000b set function parameter 2 by 8 bit immediate value -#define H_FUNC_PARAM3_BY_IMM8 0xff2c //Hash access: 1100b set function parameter 3 by 8 bit immediate value - -#define H_FUNC_PARAM0_BY_IMM16 0xff21 //Hash access: 0001b set function parameter 0 by 16 bit immediate value -#define H_FUNC_PARAM1_BY_IMM16 0xff25 //Hash access: 0101b set function parameter 1 by 16 bit immediate value -#define H_FUNC_PARAM2_BY_IMM16 0xff29 //Hash access: 1001b set function parameter 2 by 16 bit immediate value -#define H_FUNC_PARAM3_BY_IMM16 0xff2d //Hash access: 1101b set function parameter 3 by 16 bit immediate value - -#define H_FUNC_PARAM0_BY_IMM32 0xff23 //Hash access: 0011b set function parameter 0 by 32 bit immediate value -#define H_FUNC_PARAM1_BY_IMM32 0xff27 //Hash access: 0111b set function parameter 1 by 32 bit immediate value -#define H_FUNC_PARAM2_BY_IMM32 0xff2b //Hash access: 1011b set function parameter 2 by 32 bit immediate value -#define H_FUNC_PARAM3_BY_IMM32 0xff2f //Hash access: 1111b set function parameter 3 by 32 bit immediate value - -#define H_FUNC_PARAM0_BY_VAL8 0xff30 //Hash access: 0000b set function parameter 0 by 8 bit variable value -#define H_FUNC_PARAM1_BY_VAL8 0xff34 //Hash access: 0100b set function parameter 1 by 8 bit variable value -#define H_FUNC_PARAM2_BY_VAL8 0xff38 //Hash access: 1000b set function parameter 2 by 8 bit variable value -#define H_FUNC_PARAM3_BY_VAL8 0xff3c //Hash access: 1100b set function parameter 3 by 8 bit variable value - -#define H_FUNC_PARAM0_BY_VAL16 0xff31 //Hash access: 0001b set function parameter 0 by 16 bit variable value -#define H_FUNC_PARAM1_BY_VAL16 0xff35 //Hash access: 0101b set function parameter 1 by 16 bit variable value -#define H_FUNC_PARAM2_BY_VAL16 0xff39 //Hash access: 1001b set function parameter 2 by 16 bit variable value -#define H_FUNC_PARAM3_BY_VAL16 0xff3d //Hash access: 1101b set function parameter 3 by 16 bit variable value - -#define H_FUNC_PARAM0_BY_VAL32 0xff33 //Hash access: 0011b set function parameter 0 by 32 bit variable value -#define H_FUNC_PARAM1_BY_VAL32 0xff37 //Hash access: 0111b set function parameter 1 by 32 bit variable value -#define H_FUNC_PARAM2_BY_VAL32 0xff3b //Hash access: 1011b set function parameter 2 by 32 bit variable value -#define H_FUNC_PARAM3_BY_VAL32 0xff3f //Hash access: 1111b set function parameter 3 by 32 bit variable value - -#define H_FUNC_PARAM0_BY_REF8 0xff40 //Hash access: 0000b set function parameter 0 by 8 bit variable reference -#define H_FUNC_PARAM1_BY_REF8 0xff44 //Hash access: 0100b set function parameter 1 by 8 bit variable reference -#define H_FUNC_PARAM2_BY_REF8 0xff48 //Hash access: 1000b set function parameter 2 by 8 bit variable reference -#define H_FUNC_PARAM3_BY_REF8 0xff4c //Hash access: 1100b set function parameter 3 by 8 bit variable reference - -#define H_FUNC_PARAM0_BY_REF16 0xff41 //Hash access: 0001b set function parameter 0 by 16 bit variable reference -#define H_FUNC_PARAM1_BY_REF16 0xff45 //Hash access: 0101b set function parameter 1 by 16 bit variable reference -#define H_FUNC_PARAM2_BY_REF16 0xff49 //Hash access: 1001b set function parameter 2 by 16 bit variable reference -#define H_FUNC_PARAM3_BY_REF16 0xff4d //Hash access: 1101b set function parameter 3 by 16 bit variable reference - -#define H_FUNC_PARAM0_BY_REF32 0xff43 //Hash access: 0011b set function parameter 0 by 32 bit variable reference -#define H_FUNC_PARAM1_BY_REF32 0xff47 //Hash access: 0111b set function parameter 1 by 32 bit variable reference -#define H_FUNC_PARAM2_BY_REF32 0xff4b //Hash access: 1011b set function parameter 2 by 32 bit variable reference -#define H_FUNC_PARAM3_BY_REF32 0xff4f //Hash access: 1111b set function parameter 3 by 32 bit variable reference - -#define FUNCTION_CALL 0xff50 //Hash access: function call - no parameters -#define FUNCTION_CALL_1 0xff51 //Hash access: function call - 1 parameter -#define FUNCTION_CALL_2 0xff52 //Hash access: function call - 2 parameters -#define FUNCTION_CALL_3 0xff53 //Hash access: function call - 3 parameters -#define FUNCTION_CALL_4 0xff54 //Hash access: function call - 4 parameters - -#define FLASH_READ_ALL 0xff60 //Flash access: read all from flash -#define FLASH_WRITE_ALL 0xff70 //Flash access: write all to flash - -//Common response messages -#define MESSAGE_OK 0x0000 -#define MESSAGE_UNKNOWN_REQUEST_CODE 0x8000 -#define MESSAGE_UNKNOWN_REQUEST_PARAMETER 0x8001 -#define MESSAGE_UNKNOWN_REQUEST_HASH 0x8002 -#define MESSAGE_WRONG_REQUEST_VALUE_SIZE 0x8003 -#define MESSAGE_WRONG_REQUEST_VALUE_RANGE 0x8004 - -//Actual commands: -//BINS -// GLD initialization sequence: -// a5 04 - external latch with DeltaPS format -// a0 70 - DeltaPS 921600/921600 by request only -// Other: -// 80 00 - reset -//BINS/AskGLD/Techno -// 99 99 - maintenance -//Techno -// d8 90 - set bit 0 of RgConB -// d8 10 - reset bit 0 of RgConB -// dd 81 - periodic 38400 MRate -// a0 b0 - periodic 115200/115200 DeltaPS - -//Registers: -// RgConA - flags of regulator loops -// RgConB - counting mode: 00 - reference counters, 01 - dither counters and moving average filter - -//User protocol typedefs -typedef struct _DeviceUser { - //Device address - uint16_t address; - //Units - DeviceUserPort port; - DeviceUserDecoder decoder; - DeviceUserEncoder encoder; - DeviceUserRequest request; - DeviceUserResponse response; -} DeviceUser; - -//User communication initialization functions -void InitUserDefaultSettings(void); -void InitUserState(void); -void DeviceStartUser(void); - -#endif /* __DEVICE_USER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserDecoder.c --- a/DeviceUserDecoder.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1892 +0,0 @@ -#include "Device.h" - -extern Device device; -extern HashParam hashParamTable[HASH_PARAM_COUNT]; -extern HashFunc hashFuncTable[HASH_FUNC_COUNT]; - -void InitUserDecoderDefaultSettings(void) { -} - -void InitUserDecoderState(void) { - device.user.decoder.error = 0; - device.user.decoder.count = 0; - device.user.decoder.canceled = 1; - device.user.decoder.address = 0; - device.user.decoder.version = 0; - device.user.decoder.code = 0; - device.user.decoder.position = 0; - device.user.decoder.CRC = 0; -} - -void DeviceStartUserDecoder(void) { -} - -void userDecodeRequests(void) { - do { - DecodeStart(); if (device.user.decoder.error) continue; - DecodeAddress(); if (device.user.decoder.error) continue; - DecodeCode(); if (device.user.decoder.error) continue; - switch(device.user.decoder.code){ - case FACTORY_ACCESS: DecodeFactory(); break; - case DEV_MODE: DecodeDeviceMode(); break; - case DELTA_BINS: DecodeDelta(); break; - case DELTA_PS: DecodeDelta(); break; - case DELTA_SF: DecodeDelta(); break; - case BIT_MODE: DecodeBITMode(); break; - case MAINTENANCE: DecodeMaintenanceMode(); break; - case M0_BASIC: DecodeMBasic(); break; - case M0_RATE: DecodeMRate(); break; - case M0_STIMUL: DecodeMStymul(); break; - case M0_RESET: DecodeMReset(); break; - case M0_CTL_R: DecodeMCtlR(); break; - case M0_CTL_M: DecodeMCtlM(); break; - case M0_TMP_W: DecodeMTmpW(); break; - case M0_TMP_R: DecodeMTmpR(); break; - //case M0_E5R_W: break; - //case M0_ADC_R: break; - //case M0_VIB_W: break; - case M0_CNT_R: DecodeMCntR(); break; - case M0_GPH_W: DecodeMGphW(); break; - //case M0_FLG_R: break; - case M0_PARAM_W: DecodeMParamW(); break; - case M0_PARAM_R: DecodeMParamR(); break; - //case M0_E5RA_W: break; - default: DecodeFail(); - } - } while (device.user.decoder.count > 0); -} - -uint8_t Decode8(void) { - if (device.user.decoder.position != device.user.request.buffer.end) { - uint8_t param = device.user.request.buffer.data[device.user.decoder.position]; - - //sprintf(device.service.buffer, "Decode8(): %02x %04d %04d %04d\r\n", param, device.user.decoder.position, device.user.request.buffer.start, device.user.request.buffer.end); WriteConcole(); //Development message - - device.user.decoder.position = (device.user.decoder.position + 1) % InputBufferSize; - device.user.decoder.count++; - device.user.decoder.CRC += param; - return param; - } else { - DecodeCancel(); - return 0; - } -} - -uint16_t Decode16(void) { - uint8_t hi = Decode8(); if (device.user.decoder.error) return 0; - uint8_t lo = Decode8(); if (device.user.decoder.error) return 0; - return (hi << 8) | lo; -} - -uint32_t Decode32(void) { - uint32_t b3 = Decode8(); if (device.user.decoder.error) return 0; - uint32_t b2 = Decode8(); if (device.user.decoder.error) return 0; - uint32_t b1 = Decode8(); if (device.user.decoder.error) return 0; - uint32_t b0 = Decode8(); if (device.user.decoder.error) return 0; - return (b3 << 24) | (b2 << 16) | (b1 << 8) | b0; -} - -void DecodeStart(void) { - if (device.user.decoder.canceled){ - DecodeCancel(); //Prevent next decode attempts until more data arrive - } else { - //Reset answer - //device.user.response.ready = 0; - //device.user.response.enabled = 0; - //device.user.response.trigger = 0x7fffffff; - //device.user.response.triggered = 0; - //device.user.response.counter = 0; - //Reset decoder - device.user.decoder.error = 0; - device.user.decoder.count = 0; - device.user.decoder.position = device.user.request.buffer.start; - - uint8_t param = Decode8(); if (device.user.decoder.error) return; - - //sprintf(tmp,"DecodeStart()\r\n"); WriteConcole(tmp); //Development message - - if (param != 0xcc) DecodeFail(); - - device.user.response.type = RESPONSE_IMMEDIATE; //Default type - device.user.response.packet = 0; - } -} - -void DecodeAddress(void) { - uint8_t address = Decode8(); if (device.user.decoder.error) return; - device.user.decoder.CRC = 0; - if ((address == device.user.address) || (address == BROADCAST_ADDRESS)) { - device.user.decoder.address = address; - } else { - DecodeFail(); - } - //sprintf(tmp,"DecodeAddress()\r\n"); WriteConcole(tmp); //Development message -} - -void DecodeCode(void) { - uint8_t code = Decode8(); if (device.user.decoder.error) return; - device.user.decoder.code = code << 8; - //sprintf(tmp,"DecodeCode()\r\n"); WriteConcole(tmp); //Development message -} - -void DecodeExtentionCode(void) { - uint8_t ext = Decode8(); if (device.user.decoder.error) return; - device.user.decoder.code |= ext; - //sprintf(tmp,"DecodeExtensionCode()\r\n"); WriteConcole(tmp); //Development message -} - -void DecodeEnd(void) { - #ifdef DEBUG_DECODER_INPUT - static char h[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66};//0123456789abcdef; - device.service.buffer[0] = 0x44; //D - uint8_t c; - for (uint8_t i = 0; i < device.user.decoder.count; i++) { - c = device.user.request.buffer.data[(device.user.request.buffer.start + i) % InputBufferSize]; - device.service.buffer[i * 3 + 1] = 0x20; - device.service.buffer[i * 3 + 2] = h[c >> 4]; - device.service.buffer[i * 3 + 3] = h[c & 0x0f]; - } - device.service.buffer[device.user.decoder.count * 3 + 1] = 13; - device.service.buffer[device.user.decoder.count * 3 + 2] = 10; - device.service.buffer[device.user.decoder.count * 3 + 3] = 0; - WriteConcole(); //Development message - #endif - - device.user.request.buffer.start = (device.user.request.buffer.start + device.user.decoder.count) % InputBufferSize; - if (device.user.request.buffer.start == device.user.request.buffer.end) device.user.request.buffer.empty = 1; - - device.user.decoder.count = 0; - if (device.user.decoder.error == 0) { - device.user.response.code = device.user.decoder.code; - - if (device.user.decoder.address == BROADCAST_ADDRESS) { - device.user.response.type = RESPONSE_DELAYED; - device.user.response.counter = 0; - device.user.response.trigger = BROADCAST_FRAME * device.user.address; //0/100/200 mks - } - - device.user.response.enabled = 1; - } -} - -void DecodeCancel(void) { - device.user.decoder.error = 1; - device.user.decoder.canceled = 1; //Set canceled flag: do not try to decode until new data arrive - device.user.decoder.count = 0; -} - -void DecodeFail(void) { - //sprintf(tmp,"DecodeFail()\r\n"); WriteConcole(tmp); //Development message - - device.user.decoder.error = 2; - device.user.decoder.count = 1; - DecodeEnd(); -} - -void DecodeCRC(void) { - uint16_t CRC = device.user.decoder.CRC; - //sprintf(tmp,"CS1 %4x\r\n", device.host.decoder.CRC); WriteConcole(tmp); //Development message - - device.user.decoder.CRC = Decode16(); if (device.user.decoder.error) return; - //sprintf(tmp,"CS2 %4x\r\n", device.host.decoder.CRC); WriteConcole(tmp); //Development message - - if (CRC == device.user.decoder.CRC) - DecodeEnd(); - else - DecodeFail(); -} - -void DecodeHashParam(uint32_t * size, void ** ref) { - uint32_t hash = Decode32(); if (device.user.decoder.error) return; - for (uint32_t i = 0; i < HASH_PARAM_COUNT; i++){ - if (hashParamTable[i].hash == hash){ - *ref = hashParamTable[i].ref; - *size = hashParamTable[i].size; - return; - } - } - DecodeFail(); -} - -void DecodeFactoryReadParam(void) { - void * ref; - uint32_t size; - - DecodeHashParam(&size, &ref); if (device.user.decoder.error) return; - switch (device.user.decoder.code & 0x0f) { - //Read 8 bit - case 0x00: - DecodeCRC(); if (device.user.decoder.error) return; - device.user.response.parametersCount = 1; - device.user.response.parameters[0].ref = ref; - device.user.response.parameters[0].size = size; - device.user.response.message = MESSAGE_OK; - break; - //Read 16 bit - case 0x01: - DecodeCRC(); if (device.user.decoder.error) return; - device.user.response.parametersCount = 1; - device.user.response.parameters[0].ref = ref; - device.user.response.parameters[0].size = size; - device.user.response.message = MESSAGE_OK; - break; - //Read 32 bit - case 0x03: - DecodeCRC(); if (device.user.decoder.error) return; - device.user.response.parametersCount = 1; - device.user.response.parameters[0].ref = ref; - device.user.response.parameters[0].size = size; - device.user.response.message = MESSAGE_OK; - break; - //Read array - case 0x0f: - DecodeCRC(); if (device.user.decoder.error) return; - device.user.response.parametersCount = 1; - device.user.response.parameters[0].ref = ref; - device.user.response.parameters[0].size = size; - device.user.response.message = MESSAGE_OK; - break; - default: - DecodeFail(); - device.user.response.message = MESSAGE_UNKNOWN_REQUEST_CODE; - device.user.response.parametersCount = 0; - } -} - -void DecodeFactoryWriteParam(void) { - void * ref; - uint32_t size; - uint8_t param8; - uint16_t param16; - uint32_t param32; - - DecodeHashParam(&size, &ref); if (device.user.decoder.error) return; - switch (device.user.decoder.code & 0x0f) { - //Write 8 bit - case 0x00: - param8 = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - *((uint8_t *)ref) = param8; - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - //Write 16 bit - case 0x01: - param16 = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - *((uint16_t *)ref) = param16; - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - //Write 32 bit - case 0x03: - param32 = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - *((uint32_t *)ref) = param32; - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - //Write array - case 0x0f: - param16 = Decode16(); if (device.user.decoder.error) return; - for (uint16_t i = 0; i < param16; i++){ - param8 = Decode8(); if (device.user.decoder.error) return; - *(((uint8_t *)ref + i)) = param8; - } - DecodeCRC(); if (device.user.decoder.error) return; - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - default: - DecodeFail(); - device.user.response.message = MESSAGE_UNKNOWN_REQUEST_CODE; - device.user.response.parametersCount = 0; - } -} - -void DecodeFactoryFunctionCall(uint16_t parametersLength) { - uint32_t hash = Decode32(); if (device.user.decoder.error) return; - for (uint32_t i = 0; i < HASH_FUNC_COUNT; i++){ - if (hashFuncTable[i].hash == hash){ - void * ref = hashFuncTable[i].ref; - uint32_t resultSize = hashFuncTable[i].resultSize; - uint32_t paramCount = hashFuncTable[i].paramCount; - if (paramCount == parametersLength){ - if (paramCount == 0){ - //FunctionCall(ref); - ((void (*)())ref)(); - return; - } else if (paramCount == 1){ - ((void (*)())ref)(device.user.decoder.param0); - return; - } else if (paramCount == 2){ - ((void (*)())ref)(device.user.decoder.param0, device.user.decoder.param1); - return; - } else if (paramCount == 3){ - ((void (*)())ref)(device.user.decoder.param0, device.user.decoder.param1, device.user.decoder.param2); - return; - } else if (paramCount == 4){ - ((void (*)())ref)(device.user.decoder.param0, device.user.decoder.param1, device.user.decoder.param2, device.user.decoder.param3); - return; - } - } - } - } - DecodeFail(); -} - -void DecodeFactory(void) { - //sprintf(tmp," DecodeFactory()\r\n"); WriteConcole(tmp); //Development message - DecodeExtentionCode(); if (device.user.decoder.error) return; - - switch (device.user.decoder.code & 0xf0) { - //Read param - case 0x00: - DecodeFactoryReadParam(); - break; - //Write param - case 0x10: - DecodeFactoryWriteParam(); - break; - //Set function parameter by immediate value - case 0x20: - break; - //Set function parameter by variable value - case 0x30: - break; - //Set function parameter by variable reference - case 0x40: - break; - //Call function - no parameters - case 0x50: - case 0x51: - case 0x52: - case 0x53: - case 0x54: - DecodeFactoryFunctionCall(device.user.decoder.code & 0x0f); - break; - //Read flash - case 0x60: - DecodeCRC(); if (device.user.decoder.error) return; - DeviceFlashReadAll(); - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - //Write flash - case 0x70: - DecodeCRC(); if (device.user.decoder.error) return; - DeviceFlashWriteAll(); - device.user.response.message = MESSAGE_OK; - device.user.response.parametersCount = 0; - break; - default: - DecodeFail(); - device.user.response.message = MESSAGE_UNKNOWN_REQUEST_CODE; - } -} - -void DecodeDeviceMode(void) { - uint8_t mode = Decode8(); if (device.user.decoder.error) return; - if ((mode > 0) && (mode < 7)){ - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "Dev_Mode %02x\r\n", mode); WriteConcole(); //Development message - - switch (mode) { - case 1: - //DM_INT_10KHZ_LATCH: latch by pulses 10 kHz (power on default mode) - device.counters.latch.state.enabled = 0;//Internal latch - //TODO: should switch meander/dither latched counters here or ignore command and continue to use use RgConB setting instead? - break; - case 2: - //DM_INT_SIGN_MEANDER_LATCH: latch by signed meander pulses - device.counters.latch.state.enabled = 0;//Internal latch - //TODO: should switch meander/dither latched counters here or ignore command and continue to use use RgConB setting instead? - break; - case 3: - //DM_EXT_LATCH_DELTA_PS_LINE: external latch mode with B_Delta_PS format data and RS422 request by command B_Delta_PS - device.counters.latch.state.enabled = 1;//External latch - device.counters.latch.state.signal = 0; //RS422 latch signal - device.counters.latch.state.format = 0; //DeltaPS output format - break; - case 4: - //DM_EXT_LATCH_DELTA_PS_PULSE: external latch mode with B_Delta_PS format data and latch pulse request - device.counters.latch.state.enabled = 1;//External latch - device.counters.latch.state.signal = 1; //Wire latch signal - device.counters.latch.state.format = 0; //DeltaPS output format - break; - case 5: - //DM_EXT_LATCH_DELTA_BINS_LINE: external latch mode with B_Delta_BINS format data and RS422 request by command B_Delta_BINS - device.counters.latch.state.enabled = 1;//External latch - device.counters.latch.state.signal = 0; //RS422 latch signal - device.counters.latch.state.format = 1; //DeltaBINS output format - break; - case 6: - //DM_EXT_LATCH_DELTA_BINS_PULSE: external latch mode with B_Delta_BINS format data and latch pulse request - device.counters.latch.state.enabled = 1;//External latch - device.counters.latch.state.signal = 1; //Wire latch signal - device.counters.latch.state.format = 1; //DeltaBINS output format - break; - } - } else { - DecodeFail(); - } -} - -void DecodeBITMode(void) { - //In commandset.c - look as useless: set not used Is_BIT and BIT_Number variables - //Consume required amount of input: - Decode8(); if (device.user.decoder.error) return; //Is_BIT = 1/0; - Decode8(); if (device.user.decoder.error) return; //BIT_number = (long)(rcv_buf[4] & 0x00FF) << 24; - Decode8(); if (device.user.decoder.error) return; //BIT_number |= (long)(rcv_buf[5] & 0x00FF) << 16; - Decode8(); if (device.user.decoder.error) return; //BIT_number |= (long)(rcv_buf[6] & 0x00FF) << 8; - Decode8(); if (device.user.decoder.error) return; //BIT_number |= (long)(rcv_buf[7] & 0x00FF); - DecodeCRC(); if (device.user.decoder.error) return; -} - -void DecodeDelta(void) { - //Same for DELTA_PS,DELTA_BINS,DELTA_SF - only code different and it processed already - uint8_t mode = Decode8(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "Delta %02x\r\n", mode); WriteConcole(); //Development message - - //if ((mode & 0x0f) == 0){ //DELTA_PS,DELTA_BINS - if ((mode & 0x0e) == 0){ //DELTA_PS,DELTA_BINS,DELTA_SF - DecodeCRC(); if (device.user.decoder.error) return; - //SRgR bits 4-5 - reponse rate - uint32_t baud; - switch ((mode >> 5) & 0x03){ - case 0: baud = 38400; break; - case 1: baud = 115200; break; - case 2: baud = 460800; break; - case 3: baud = 921600; break; - default: baud = 38400; - } - userSetBaudRate(baud); - //Not supported - //if (mode & 0x04) { - // device.user.request.rate = device.user.response.rate; - //} else { - // device.user.request.rate = 38400; - //} - if (mode & 0x01) { //DELTA_SF - device.counters.latch.state.reset = 0; - } else { - device.counters.latch.state.reset = 1; - } - - if (device.user.decoder.address == device.user.address) { - if (mode & 0x80) { - //Reset device counters here - device.counters.dither.state.angle = 0; - - device.user.response.counter = 0; - device.user.response.trigger = 2000; //2000 mks - 500Hz - device.user.response.type = RESPONSE_PERIODIC; //Override default type - device.user.response.packet = 0; - } - } - } else { - DecodeFail(); - } -} - -void DecodeMaintenanceMode(void) { - uint8_t version = Decode8(); if (device.user.decoder.error) return; - if (version == 0x99) { - DecodeCRC(); if (device.user.decoder.error) return; - device.user.decoder.version = 0; - - userSetBaudRate(38400); - - //sprintf(device.service.buffer, "MaintenanceMode()\r\n"); WriteConcole(); //Development message - } else { - DecodeFail(); - } -} - -void DecodeMBasic(void) { - DecodeExtentionCode(); if (device.user.decoder.error) return; - switch (device.user.decoder.code) { - case M0_CLEAR: - DecodeCRC(); if (device.user.decoder.error) return; - DoMaintenanceClear(); - break; - case M0_MIRROR: - DecodeCRC(); if (device.user.decoder.error) return; - DoMaintenanceMirror(); - break; - case M0_LDPAR_F: - DecodeCRC(); if (device.user.decoder.error) return; - DeviceFlashReadAll(); - DeviceInitState(); - break; - case M0_LDPAR_D: - DecodeCRC(); if (device.user.decoder.error) return; - DeviceInitDefaultSettings(); - DeviceInitState(); - break; - case M0_START: - DecodeCRC(); if (device.user.decoder.error) return; - DoMaintenanceStart(); - break; - case M0_STOP: - DecodeCRC(); if (device.user.decoder.error) return; - DoMaintenanceStop(); - break; - case M0_PULSE: - DecodeCRC(); if (device.user.decoder.error) return; - DeviceStartLightUp(); - break; - default: DecodeFail(); - } -} - -void DoMaintenanceClear(void) { - //TODO -} - -void DoMaintenanceMirror(void) { - //TODO -} - -void DoMaintenanceStart(void) { - //TODO -} - -void DoMaintenanceStop(void) { - //TODO -} - -//Deprecated -void DecodeMRate(void) { - uint8_t mode = Decode8(); if (device.user.decoder.error) return; - if ((mode & 0x1f) == 1){ - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "MRate %02x\r\n", mode); WriteConcole(); //Development message - - device.user.response.code |= mode & 0x1f; - - uint32_t baud; - switch ((mode>>5) & 0x03) { - case 0: baud = 38400; break; - case 1: baud = 115200; break; - default: baud = 38400; - } - userSetBaudRate(baud); - - if (mode & 0x80) { - //Reset device counters here - device.counters.dither.state.angle = 0; - device.counters.meander.state.angle[0] = 0; - device.counters.meander.state.angle[1] = 0; - - device.user.response.type = RESPONSE_PERIODIC; //Override default type - device.user.response.trigger = 1000000; //1000000mks - 1Hz - //device.user.response.counter = device.user.response.trigger; //Ask_Gld expect immediate answer? - device.user.response.counter = 0; //No? - } - } else { - DecodeFail(); - } -} - -/* Template for MRate2,... -void DecodeMRate(void) { - uint8_t mode = Decode8(); if (device.user.decoder.error) return; - if ((mode & 0x1f) == 0){ - //MRate - DecodeCRC(); if (device.user.decoder.error) return; - - device.user.response.code |= mode & 0x1f; - - switch ((mode>>5) & 0x03) { - case 0: device.user.response.rate = 38400; break; - case 1: device.user.response.rate = 115200; break; - case 2: device.user.response.rate = 460800; break; - case 3: device.user.response.rate = 921600; break; - } - - if (mode & 0x80) { - //TODO: reset device.counters here - device.user.response.counter = 0; - switch (mode & 0x03) { - case 1: device.user.response.trigger = 1000000; break; //1 000 000 mks - 1Hz - case 2: device.user.response.trigger = 3276700; break; //??? - case 3: device.user.response.trigger = 100; break; //100 mks - 10000Hz - case 4: device.user.response.trigger = 800; break; //800 mks - 1250Hz - case 7: device.user.response.trigger = 800; break; //800 mks - 1250Hz - } - device.user.response.type = RESPONSE_PERIODIC; //Override default type - } - } else { - DecodeFail(); - } -}*/ - -void DecodeMStymul(void) { - uint8_t param = Decode8(); if (device.user.decoder.error) return; - if ((param & 0x18) == 0){ - uint8_t hi = Decode8(); if (device.user.decoder.error) return; - uint8_t lo = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "MStymul %02x %02x %02x\r\n", param, hi, lo); WriteConcole(); //Development message - - device.user.decoder.code |= param & 0x04; - userSetBaudRate(38400); - - device.user.response.enabled = (param & 0x80) >> 7; - - uint8_t channel = param & 0x03; - if (param & 0x04) { - uint32_t flags = (hi << 8) | lo; - //TODO: write flags - only flag register 0 defined - if (channel == 0){ - //Potentiometers data - if (flags & 0x01){ - } else { - } - //Potentiometers data input enable/disable flag - if (flags & 0x02){ - } else { - } - //Laser Up - if (flags & 0x03){ - } else { - } - //Software reper - if (flags & 0x04){ - } else { - } - } - } else { - uint32_t voltage = ((hi << 4) | (lo >> 4)); //TODO: do correct transformations - //TODO: write DAC - switch (channel){ - case 0://PLC regulator - break; - case 1://PLC modulator - break; - case 2://laser power regulator - break; - case 3://worms - break; - } - } - } else { - DecodeFail(); - } -} - -void DecodeMReset(void) { - DecodeCRC(); if (device.user.decoder.error) return; - - while (1); //Wait watch dog reset -} - -//Deprecated -void DecodeMCtlR(void) { - uint8_t param = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "MCtlR %02x\r\n", param); WriteConcole(); //Development message - - if ((param & 0x60) == 0) - userSetBaudRate(38400); - else - userSetBaudRate(115200); - - device.user.response.code |= param & 0x10; -} - -//Deprecated -void DecodeMCtlM(void) { - uint8_t param = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "MCtlM %02x\r\n", param); WriteConcole(); //Development message - - if ((param & 0x60) == 0) - userSetBaudRate(38400); - else - userSetBaudRate(115200); - - uint8_t bit = param & 0x0f; - uint8_t value = (param & 0x80) >> 7; - if ((param & 0x10) == 0) { - //RgConA - flags of regulator loops - switch (bit){ - case 0://Laser switch - //TODO - break; - - case 1://HFO loop switch - device.isacs.regulator.state.enabled = value; - break; - - case 3://PLC loop switch - device.plcs.regulator.state.enabled = value; - break; - - case 4://Modulator switch - //device.plcs.modulator.state.enabled = value; - device.sequencer.output.analog.state.enabled = value; - break; - - case 5://Dither drive pulse width/output frequency loop switch - device.dither.amplitude.state.enabled = value; - break; - - case 6://Dither drive oscillation frequency loop switch - device.dither.frequency.state.enabled = value; - break; - - case 7: //All loops switch - device.isacs.regulator.state.enabled = value; - device.plcs.regulator.state.enabled = value; - device.sequencer.output.analog.state.enabled = value; - device.dither.amplitude.state.enabled = value; - device.dither.frequency.state.enabled = value; - break; - } - } else { - //RgConB - counting mode: 00 - reference counters, 01 - dither counters and moving average filter - switch (bit){ - case 0://Moving average filter - device.counters.rate.state.source = value; - #ifdef DEBUG_DECODER_INPUT - if (value == 0) - sprintf(device.service.buffer, "RgConB reset bit %1d\r\n", bit); - else - sprintf(device.service.buffer, "RgConB set bit %1d\r\n", bit); - WriteConcole(); - #endif - break; - - case 1://Not used - //TODO - break; - - case 2://Not used - //TODO - break; - } - } - - device.user.response.code |= param & 0x10; -} - -//Deprecated -void DecodeMADCR(void) { - //TODO -} - -//Deprecated -void DecodeMTmpW(void) { - //Not compatible with new ADC - //Just consume required amount of input: - Decode8(); if (device.user.decoder.error) return; - Decode8(); if (device.user.decoder.error) return; - Decode8(); if (device.user.decoder.error) return; - Decode8(); if (device.user.decoder.error) return; - Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; -} - -//Deprecated -void DecodeMTmpR(void) { - //Not compatible with new ADC - //Just consume required amount of input: - Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; -} - -//Deprecated -void DecodeMe5rW(void) { - //TODO -} - -void DecodeMCntR(void) { - uint8_t param = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - //sprintf(device.service.buffer, "MCntR %02x\r\n", param); WriteConcole(); //Development message - - if ((param & 0x60) == 0) - userSetBaudRate(38400); - else - userSetBaudRate(115200); - - if (param & 0x80) { - device.user.response.counter = 0; - device.user.response.trigger = 200; //200 mks - 500Hz - device.user.response.type = RESPONSE_PERIODIC; //Override default type - } -} - -//Deprecated -void DecodeMFlgR(void) { - //TODO -} - -//Deprecated -void DecodeMVibW(void) { - //TODO -} - -//Deprecated -void DecodeMGphW(void) { - uint8_t reply = Decode8(); if (device.user.decoder.error) return; - uint8_t gainA = Decode8(); if (device.user.decoder.error) return; - uint8_t gainB = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - device.isacs.potentiometers.state.a = gainA; - device.isacs.potentiometers.state.b = gainB; - DeviceISACSSetPotentiometers(); - if (!reply) device.user.response.enabled = 0; -} - -uint16_t GetCompatibilityValue(uint8_t index) { - - return 0; -} - -//Deprecated -void DecodeMParamR(void) { - uint8_t index = Decode8(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - uint32_t param32; - switch (index){ - case 0: - //My_Address s16 device address - device.user.response.message = device.user.address; - break; - - case 1: - //HF_ref s16 value of the reference - //int32_t device.isacs.regulator.settings.reference - device.user.response.message = param_HF_ref(); - break; - - case 2: - //HF_scl s16 HFO gain factor - //int32_t device.isacs.regulator.settings.scale - device.user.response.message = param_HF_scl(); - break; - - case 3: - //HF_min dac ttf:minimum DAC code in HFO channel; value:maximal voltage of HFO; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V - //int32_t device.isacs.output.settings.max - device.user.response.message = param_HF_min(); - break; - - case 4: - //HF_max dac ttf:maximum DAC code in HFO channel; value:minimal voltage of HFO; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V - //int32_t device.isacs.output.settings.min - device.user.response.message = param_HF_max(); - break; - - case 5: - //RI_ref s16 not used (DS reference) - device.user.response.message = 0; - break; - - case 6: - //RI_scl s16 not used (DS gain factor) - device.user.response.message = 0; - break; - - case 7: - //WP_ref s16 PLCS reference - //int32_t device.plcs.regulator.reference - device.user.response.message = param_WP_ref(); - break; - - case 8: - //WP_scl s16 PLCS gain factor (1.15) 5..20 - //int32_t device.plcs.regulator.scale - device.user.response.message = param_WP_scl(); - break; - - case 9: - //WP_mdy s16 PLCS reset delay in 10kHz cycles - //device.plcs.reset.up/down.state.duration - device.user.response.message = param_WP_mdy(); - break; - - case 10: - //WP_rup dac ttf:PLCS maximum DAC code in heater channel; value:minimal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V - //device.plcs.reset.up.state.trigger - device.user.response.message = param_WP_rup(); - break; - - case 11: - //WP_rdw dac ttf:PLCS minimum DAC code in heater channel; value:maximal voltage on the heater; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V - //device.plcs.reset.down.state.trigger - device.user.response.message = param_WP_rdw(); - break; - - case 12: - //VB_phs s16 the phase delay parameter of the dither drive PLL - //0 - device.user.response.message = 0; - break; - - case 13: - //VB_scl s16 the gain factor (1.15) of the dither drive PLL - param32 = device.dither.frequency.settings.scale >> 16; - device.user.response.message = (uint16_t)param32; - break; - - case 14: - //VB_N vbd ttf:dither drive oscillation central frequency divider 7680000/F; value:dither drive central oscillation frequency - device.user.response.message = param_VB_N(); - break; - - case 15: - //VB_Nmin vbd ttf:minimum dither drive oscillation frequency divider 7680000/F; value:maximum dither drive oscillation frequency - device.user.response.message = param_VB_Nmin(); - break; - - case 16: - //VB_Nmax vbd ttf:maximum dither drive oscillation frequency divider 7680000/F; value:minimum dither drive oscillation frequency - device.user.response.message = param_VB_Nmax(); - break; - - case 17: - //VB_Fdf s32 double output frequency (Hi) - param32 = param_VB_Fdf() >> 16; - device.user.response.message = (uint16_t)param32; - break; - - case 18: - //VB_Fdf s32 double output frequency (Lo) - param32 = param_VB_Fdf() & 0xffff; - device.user.response.message = (uint16_t)param32; - break; - - case 19: - //VB_Fsc s16 the gain factor of the frequency regulator - param32 = device.dither.amplitude.settings.scale >> 16; - device.user.response.message = (uint16_t)param32; - break; - - case 20: - //VB_Tmin tau minimum pulse width of the dither drive; value=ttf/15360000 in seconds - device.user.response.message = param_VB_Tmin(); - break; - - case 21: - //VB_Tmax tau maximum pulse width of the dither drive; value=ttf/15360000 in seconds - device.user.response.message = param_VB_Tmax(); - break; - - case 22: - //VB_tau tau pulse width of the dither drive without noise or current pulse width of the dither drive with noise; value=ttf/15360000 in seconds - device.user.response.message = param_VB_tau(); - break; - - case 23: - //VBN_Tzd s16 adjusted noise period - //int32_t device.dither.noise.settings.period - device.user.response.message = param_VBN_Tzd(); - break; - - case 24: - //VBN_Ran s16 range of the random component of noise - //int32_t device.dither.noise.settings.range - device.user.response.message = param_VBN_Ran(); - break; - - case 25: - //VBN_k s16 adjusted noise constant: pulse width = VB_tau +/- VBN_k - //int32_t device.dither.noise.settings.amplitude - device.user.response.message = param_VBN_k(); - break; - - case 26: - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - //Reserved s16 not used - device.user.response.message = 0; - break; - - case 43: - case 44: - case 45: - case 46: - case 47: - case 48: - //Tmp_bias0[0] ... Tmp_bias0[5] s16 Tmp_bias[6]: an array of shifts of the 0..5 temperature sensors - //? - device.user.response.message = 0; - break; - - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - //Tmp_scal0[0] ... Tmp_scal0[5] s16 Tmp_scal[6]: an array of the scale coefficients of the 0..5 temperature sensors - //? - device.user.response.message = 0; - break; - - case 55: - //WP_reset dac ttf:PLCS DAC code after reset at heating; value:heater voltage after reset at heating; value=(ttf>>4)/2048*(-12)-1.3; Range -13.2V...10.7V - //int32_t device.plcs.reset.up.state.target - device.user.response.message = param_WP_reset(); - break; - - case 56: - //KSin s16 Gain_Ph_A: initial gain factor of the A channel of photodetector - //uint32_t device.isacs.potentiometers.settings.a - device.user.response.message = 0; - break; - - case 57: - //KCos s16 Gain_Ph_B: initial gain factor of the B channel of photodetector - //uint32_t device.isacs.potentiometers.settings.b - device.user.response.message = 0; - break; - - case 58: - //Header s16 flash memory load validity control value: should be 0x55AA - device.user.response.message = 0x55AA; - break; - - case 59: - //LoadFlash_Enable s16 parameters load switch: 1 - load from the flash 0 - load default parameters (factory) - //? - device.user.response.message = 1; - break; - - case 60: - //SerialNumber u16 serial number of device - // - device.user.response.message = 0; - break; - - case 61: - //WP_start dac not used (ttf:PLCS initial DAC code after switch-on; value:heater voltage after switch-on; value=(ttf>>4)/2048*(-12))-1.3; Range -13.2V...10.7V - device.user.response.message = 0; - break; - - case 62: - //TermoMode u16 device operation mode switch: 0-raw output, 1-thermocompensated output, 2-thermocompensation value only for debug purposes - //? - device.user.response.message = 0; - break; - - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - //TemperInt[0] ... TemperInt[13] s16 reserved: should be zero! - // - device.user.response.message = 0; - break; - - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - case 91: - case 92: - case 93: - case 94: - case 95: - case 96: - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - //TermoFunc[0]...TermoFunc[13] f32 reserved: should be zero! (Hi)/(Lo) - device.user.response.message = 0; - break; - - case 105: - //WP_reset2 dac ttf:PLCS DAC code after reset at cooling; value:heater voltage after reset at cooling; value=(ttf>>4)/2048*(-12)-1.3 - //int32_t device.plcs.reset.down.state.target - device.user.response.message = param_WP_reset2(); - break; - - case 106: - case 107: - //TermoHeatDelta f32 reserved: should be zero! (Lo) - device.user.response.message = 0; - break; - - case 108: - case 109: - //TermoCoolDelta f32 reserved: should be zero! (Lo) - device.user.response.message = 0; - break; - - case 110: - //K_vb_tu s16 slope of dependence of the VB_N division factor from temperature (as though Hz/degree, but in c.u.) - //? - device.user.response.message = 0; - break; - - case 111: - //TemperNormal s16 temperature for which the VB_N division factor of the dither drive is set - //? - device.user.response.message = 0; - break; - - case 112: - //K_WP_rst_heating s16 - //? - device.user.response.message = 0; - break; - - case 113: - //K_WP_rst_cooling s16 slope of dependence of a reset voltage at cooling from temperature (as though Volt/degree, but in c.u. of DAC and temperature sensors) - //? - device.user.response.message = 0; - break; - - case 114: - //WP_transition_step s16 step of change of a heater voltage at resetting - //? - device.user.response.message = 0; - break; - - case 115: - //Reserved s16 not used - device.user.response.message = 0; - break; - - case 116: - //HF_scl_2 s16 HFO scale factor during PLCS reset - //Deprecated: always same as HF_scl - device.user.response.message = param_HF_scl(); - break; - - case 117: - //TemperIntDyn[0] s16 thermal sensor value for first point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 118: - //TemperIntDyn[1] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 119: - //TemperIntDyn[2] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 120: - //TemperIntDyn[3] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 121: - //TemperIntDyn[4] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 122: - //TemperIntDyn[5] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 123: - //TemperIntDyn[6] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 124: - //TemperIntDyn[7] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 125: - //TemperIntDyn[8] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 126: - //TemperIntDyn[9] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 127: - //TemperIntDyn[10] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 128: - //TemperIntDyn[11] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 129: - //TemperIntDyn[12] s16 thermal sensor value for interim point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 130: - //TemperIntDyn[13] s16 thermal sensor value for last point of thermo error interpolation at heating - //? - device.user.response.message = 0; - break; - - case 131: - //ThermoHeatDelta[0] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 132: - //ThermoHeatDelta[0] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 133: - //ThermoHeatDelta[1] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 134: - //ThermoHeatDelta[1] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 135: - //ThermoHeatDelta[2] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 136: - //ThermoHeatDelta[2] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 137: - //ThermoHeatDelta[3] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 138: - //ThermoHeatDelta[3] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 139: - //ThermoHeatDelta[4] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 140: - //ThermoHeatDelta[4] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 141: - //ThermoHeatDelta[5] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 142: - //ThermoHeatDelta[5] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 143: - //ThermoHeatDelta[6] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 144: - //ThermoHeatDelta[6] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 145: - //ThermoHeatDelta[7] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 146: - //ThermoHeatDelta[7] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 147: - //ThermoHeatDelta[8] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 148: - //ThermoHeatDelta[8] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 149: - //ThermoHeatDelta[9] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 150: - //ThermoHeatDelta[9] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 151: - //ThermoHeatDelta[10] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 152: - //ThermoHeatDelta[10] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 153: - //ThermoHeatDelta[11] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 154: - //ThermoHeatDelta[11] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 155: - //ThermoHeatDelta[12] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 156: - //ThermoHeatDelta[12] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 157: - //ThermoHeatDelta[13] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 158: - //ThermoHeatDelta[13] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 159: - //DeltaTempRecalc s16 - //? - device.user.response.message = 0; - break; - - case 160: - //TemperCoolIntDyn[0] s16 thermal sensor value for first point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 161: - //TemperCoolIntDyn[1] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 162: - //TemperCoolIntDyn[2] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 163: - //TemperCoolIntDyn[3] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 164: - //TemperCoolIntDyn[4] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 165: - //TemperCoolIntDyn[5] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 166: - //TemperCoolIntDyn[6] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 167: - //TemperCoolIntDyn[7] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 168: - //TemperCoolIntDyn[8] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 169: - //TemperCoolIntDyn[9] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 170: - //TemperCoolIntDyn[10] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 171: - //TemperCoolIntDyn[11] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 172: - //TemperCoolIntDyn[12] s16 thermal sensor value for interim point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 173: - //TemperCoolIntDyn[13] s16 thermal sensor value for last point of thermo error interpolation at cooling - //? - device.user.response.message = 0; - break; - - case 174: - //ThermoCoolDelta[0] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 175: - //ThermoCoolDelta[0] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 176: - //ThermoCoolDelta[1] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 177: - //ThermoCoolDelta[1] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 178: - //ThermoCoolDelta[2] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 179: - //ThermoCoolDelta[2] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 180: - //ThermoCoolDelta[3] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 181: - //ThermoCoolDelta[3] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 182: - //ThermoCoolDelta[4] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 183: - //ThermoCoolDelta[4] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 184: - //ThermoCoolDelta[5] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 185: - //ThermoCoolDelta[5] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 186: - //ThermoCoolDelta[6] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 187: - //ThermoCoolDelta[6] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 188: - //ThermoCoolDelta[7] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 189: - //ThermoCoolDelta[7] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 190: - //ThermoCoolDelta[8] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 191: - //ThermoCoolDelta[8] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 192: - //ThermoCoolDelta[9] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 193: - //ThermoCoolDelta[9] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 194: - //ThermoCoolDelta[10] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 195: - //ThermoCoolDelta[10] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 196: - //ThermoCoolDelta[11] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 197: - //ThermoCoolDelta[11] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 198: - //ThermoCoolDelta[12] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 199: - //ThermoCoolDelta[12] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - - case 200: - //ThermoCoolDelta[13] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Hi) - //? - device.user.response.message = 0; - break; - - case 201: - //ThermoCoolDelta[13] tc ttf:value of thermo error per 10kHz cycle; value:value of thermo error for 100 second accumulation (Lo) - //? - device.user.response.message = 0; - break; - /* - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - break; - - case 61: - param16 = device.sensor.settings.id; - break; - - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 81: - case 82: - case 84: - case 85: - case 87: - case 88: - case 90: - case 91: - case 93: - case 94: - case 96: - case 97: - case 99: - case 100: - case 102: - case 103: - case 105: - case 106: - case 108: - case 109: - case 111: - case 112: - case 114: - case 115: - case 117: - case 118: - case 121: - case 122: - case 124: - case 125: - //reserved - break; - */ - default: DecodeFail(); - } -} - -void DecodeMParamW(void) { - uint8_t index = Decode8(); if (device.user.decoder.error) return; - uint8_t param = Decode16(); if (device.user.decoder.error) return; - DecodeCRC(); if (device.user.decoder.error) return; - - switch (index){ - case 0: - device.user.address = param; - break; - - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - break; - - case 61: - device.sensor.settings.id = param; - break; - - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 81: - case 82: - case 84: - case 85: - case 87: - case 88: - case 90: - case 91: - case 93: - case 94: - case 96: - case 97: - case 99: - case 100: - case 102: - case 103: - case 105: - case 106: - case 108: - case 109: - case 111: - case 112: - case 114: - case 115: - case 117: - case 118: - case 121: - case 122: - case 124: - case 125: - /*reserved*/ - break; - - default: DecodeFail(); - } -} - -void DecodeMRate2(void) { - //TODO -} - -void DecodeMRate3(void) { - //TODO -} - -//Deprecated -void DecodeMe5raW(void) { - //TODO -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserDecoder.h --- a/DeviceUserDecoder.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -#ifndef __DEVICE_USER_DECODER_H__ -#define __DEVICE_USER_DECODER_H__ - -//Requests decoding state -typedef struct _DeviceUserDecoder { - uint8_t error; //Decode error encountered - uint8_t canceled; //Decode canceled flag: continue decoding when clear (new data arrived) - uint8_t count; //Decoded bytes count - uint8_t address; //Decoded request address - uint8_t version; //Decoded protocol version (currently only 0 version exist) - uint16_t code; //Decoded command code - uint16_t position;//Current decoder position in input buffer - uint16_t CRC; //Current/final CRC of decoded packet - uint32_t param0; //Function call parameter 0 - uint32_t param1; //Function call parameter 1 - uint32_t param2; //Function call parameter 2 - uint32_t param3; //Function call parameter 3 -} DeviceUserDecoder; - -void InitUserDecoderDefaultSettings(void); -void InitUserDecoderState(void); -void DeviceStartUserDecoder(void); - -//Host communication main functions -void userDecodeRequests(void); //Decode requests from receive buffer -void userDecodePin(void); //Decode hardware pin request -void userEncodeResponse(void); //Encode response to transmit buffer - -//Decoder elementary functions -uint8_t Decode8(void); -uint16_t Decode16(void); -uint32_t Decode32(void); - -//Decoder common functions -void DecodeStart(void); -void DecodeEnd(void); -void DecodeCancel(void); -void DecodeFail(void); - -void DecodeAddress(void); -void DecodeCode(void); -void DecodeExtentionCode(void); -void DecodeCRC(void); - -//Decoder factory functions -void DecodeFactory(void); - -//Decoder data output functions -void DecodeDeviceMode(void); -void DecodeDelta(void); - -//Decoder maintenance functions -void DecodeMaintenanceMode(void); - -void DecodeMBasic(void); -void DoMaintenanceClear(void); -void DoMaintenanceMirror(void); -void DoMaintenanceStart(void); -void DoMaintenanceStop(void); - -void DecodeBITMode(void); -void DecodeMStymul(void); -void DecodeMReset(void); -void DecodeMCtlR(void); -void DecodeMCtlM(void); -void DecodeMADCR(void); -void DecodeMTmpW(void); -void DecodeMTmpR(void); -void DecodeMe5rW(void); -void DecodeMCntR(void); -void DecodeMFlgR(void); -void DecodeMVibW(void); -void DecodeMGphW(void); - -void DecodeMRate(void); -void DecodeMRate2(void); -void DecodeMRate3(void); - -void DecodeMParamR(void); -void DecodeMParamW(void); -void DecodeMe5raW(void); - -#endif /* __DEVICE_USER_DECODER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserEncoder.c --- a/DeviceUserEncoder.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,396 +0,0 @@ -#include "Device.h" - -extern Device device; -extern HashParam hashParamTable[HASH_PARAM_COUNT]; -extern HashFunc hashFuncTable[HASH_FUNC_COUNT]; - -void InitUserEncoderDefaultSettings(void) { -} - -void InitUserEncoderState(void) { - device.user.encoder.error = 0; - device.user.encoder.count = 0; - device.user.encoder.CRC = 0; -} - -void DeviceStartUserEncoder(void) { -} - -//Next to LineDecode(), PinDecode() -void userEncodeResponse(void) { - if (device.user.response.enabled) { - if (device.user.response.type == RESPONSE_PERIODIC) { - if (device.user.response.triggered) - device.user.response.triggered = 0; //Clear trigger event. Here ok - encode response in one pass - else - return; - } - - switch(device.user.response.code){ //TODO: switch(device.user.response.code & 0xff00) { case group: switch (device.user.response.code & 0x00ff) { case cmd: ...}...} - case DEV_MODE: EncodeDeviceMode(); break; - case DELTA_BINS: EncodeDeltaBINS(); break; - case DELTA_PS: EncodeDeltaPS(); break; - case DELTA_SF: EncodeDeltaSF(); break; - case BIT_MODE: EncodeDeviceMode(); break; //Same response as DEV_MODE - case MAINTENANCE: EncodeMainMode(); break; - case M0_RATE_1: EncodeMRate(); break; - case M0_PARAM_R: EncodeMParamR(); break; - case M0_PARAM_W: EncodeMParamW(); break; - case M0_CTL_R: EncodeMCtlR(); break; - case M0_CTL_A_M: EncodeMCtlAM(); break; - case M0_CTL_B_M: EncodeMCtlBM(); break; - case M0_CNT_R: EncodeMCntR(); break; - case M0_GPH_W: EncodeStart(); EncodeAddress(); Encode8(0xe6); Encode8(0); EncodeCRC(); break; - case H_PARAM8_W: - case H_PARAM8_R: - case H_PARAM16_W: - case H_PARAM16_R: - case H_PARAM32_W: - case H_PARAM32_R: - case H_BYTES_W: - case H_BYTES_R: - case FLASH_READ_ALL: - case FLASH_WRITE_ALL: - EncodeStart(); EncodeAddress(); Encode16(device.user.response.code); EncodeMessage(); if (device.user.response.message == 0) EncodeParameters(); EncodeCRC(); - break; - default: EncodeFail(); - } - } -} - -void Encode8(uint8_t param){ - device.user.response.buffer.data[device.user.response.buffer.count] = param; - device.user.response.buffer.count += 1; - - //sprintf(device.service.buffer,"- %2x\r\n", param); WriteConcole(); //Development message -} - -void Encode16(uint16_t param) { - Encode8((param >> 8) & 0xff); - Encode8(param & 0xff); -} - -void EncodeStart(void) { - device.user.response.ready = 0; //Disable transmission - device.user.response.buffer.count = 0; //Clear buffer - Encode8(0xdd); //Write response header code -} - -void EncodeEnd(void) { - #ifdef DEBUG_ENCODER_OUTPUT - static char h[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66};//0123456789abcdef; - device.service.buffer[0] = 0x45; //E - uint8_t c; - for (uint8_t i = 0; i < device.user.response.buffer.count; i++) { - c = device.user.response.buffer.data[i]; - device.service.buffer[i * 3 + 1] = 0x20; - device.service.buffer[i * 3 + 2] = h[c >> 4]; - device.service.buffer[i * 3 + 3] = h[c & 0x0f]; - } - device.service.buffer[device.user.response.buffer.count * 3 + 1] = 13; - device.service.buffer[device.user.response.buffer.count * 3 + 2] = 10; - device.service.buffer[device.user.response.buffer.count * 3 + 3] = 0; - WriteConcole(); //Development message - #endif - - device.user.response.enabled = 0; //Disable response overwrite - device.user.response.ready = 1; //Enable transmission - device.user.response.buffer.position = 0; //Reset transmitter -} - -void EncodeFail(void) { - device.user.response.buffer.count = 0; //Clear buffer - device.user.response.enabled = 0; //Disable response overwrite -} - -void EncodeAddress(void) { - Encode8(device.user.address); -} - -//TODO: EncodePacket(uint16_t length) - auto reset packet index -void EncodePacket(void) { - Encode8(device.user.response.packet); - device.user.response.packet++; -} - -void EncodeMessage(void) { - Encode16(device.user.response.message); -} - -void EncodeParameters(void) { - for (uint8_t i = 0; i < device.user.response.parametersCount; i++){ - uint8_t * b = (uint8_t *)device.user.response.parameters[i].ref; - for (uint8_t j = 0; j < device.user.response.parameters[i].size; j++){ - Encode8(*b); b++; - } - } -} - -void EncodeCRC(void) { - int16_t crc = 0; - for (int i = 2; i < device.user.response.buffer.count; i++) crc += device.user.response.buffer.data[i]; - Encode16(crc); - EncodeEnd(); -} - -//Deprecated -void EncodeDeviceMode(void) { - EncodeStart(); - EncodeAddress(); - Encode8(var_Device_Mode()); - Encode8(var_SRgR()); - EncodeCRC(); -} - -//Deprecated -void EncodeDeltaPS(void) { - static uint16_t param16; - EncodeStart(); - EncodeAddress(); - //Encode angle counts - Encode16(var_PSdiff()); - //Prepare parameter - uint8_t param; - switch (device.user.response.packet) { - case 0: - //Dither output frequency - param16 = var_F_ras(); - //High byte of output frequency - param = (uint8_t)(param16 >> 8); - break; - case 1: - //Lo byte of output frequency - param = (uint8_t)param16; - break; - case 2: - //ISACS output - param16 = var_HF_reg(); - //Hi byte of ISACS output - param = (uint8_t)(param16 >> 8); - break; - case 3: - //Lo byte of ISACS output - param = (uint8_t)param16; - break; - case 4: - //T_Vibro Dither drive period - param16 = var_T_Vibro(); - //Hi byte of dither oscillation frequency divider - param = (uint8_t)(param16 >> 8); - break; - case 5: - //Lo byte of dither oscillation frequency divider - param = (uint8_t)param16; - break; - case 6: - //L_Vibro Dither pulse width - param16 = var_L_Vibro(); - //Hi byte of dither pulse width - param = (uint8_t)(param16 >> 8); - break; - case 7: - //Lo byte of dither pulse width - param = (uint8_t)param16; - break; - case 8: - //PLCS output - param16 = var_WP_reg(); - //Hi byte of PLCS output - param = (uint8_t)(param16 >> 8); - break; - //Lo byte of PLCS output - case 9: - param = (uint8_t)(param16 & 0xff); - break; - //Unused - case 10: param = 0; break; - //Unused - case 11: param = 0; break; - //Unused - case 12: param = 0; break; - //Unused - case 13: param = 0; break; - case 14: - param16 = (uint16_t)device.ccs.current[0].state.raw; - //Hi byte of CCS current[0] - param = (uint8_t)(param16 >> 8); - break; - case 15: - //Lo byte of CCS current[0] - param = (uint8_t)(param16 & 0xff); - break; - case 16: - param16 = (uint16_t)device.ccs.current[1].state.raw; - //Hi byte of CCS current[1] - param = (uint8_t)(param16 >> 8); - break; - case 17: - param = (uint8_t)(param16 & 0xff); - //Lo byte of CCS current[1] - break; - case 18: - param16 = (uint16_t)device.tss.gradient.state.raw; - //Hi byte of TSS gradient - param = (uint8_t)(param16 >> 8); - break; - case 19: - //Lo byte of TSS gradient - param = (uint8_t)(param16 & 0xff); - break; - case 20: - param16 = (uint16_t)device.tss.temperature.state.raw; - //Hi byte of TSS temperature - param = (uint8_t)(param16 >> 8); - break; - case 21: - //Lo byte of TSS temperature - param = (uint8_t)(param16 & 0xff); - break; - } - //Encode packet index - EncodePacket(); - //Reset packet index - if (device.user.response.packet > 21) device.user.response.packet = 0; - //Encode parameter - Encode8(param); - //Finish encoding - EncodeCRC(); -} - -void EncodeDeltaBINS(void) { - EncodeStart(); - EncodeAddress(); - Encode16(0); Encode16(0); //TODO: BINSDiff_32 - Encode8(0); //Data ok - EncodeCRC(); -} - -void EncodeDeltaSF(void) { -//TODO -} - -//Usage: Ask_Gld "Maintenance" button -//Usage: Ask_Gld "x" button -void EncodeMainMode(void) { - EncodeStart(); - EncodeAddress(); - Encode8(0); //Version - 0: use extended command to get version - Encode8(0); //Serial number - 0: use extended command to get serial number - EncodeMessage(); - EncodeCRC(); -} - -//Deprecated -void EncodeMCntR(void) { - EncodeStart(); - EncodeAddress(); - Encode16((int16_t)device.counters.meander.state.a); - Encode16((int16_t)device.counters.meander.state.b); - EncodeCRC(); -} - -//Deprecated -void EncodeMRate(void) { - EncodeStart(); - EncodeAddress(); - //Encode positive meander latched counter data - Encode16((int16_t)device.counters.meander.state.a); - //Encode negative meander latched counter data - Encode16((int16_t)device.counters.meander.state.b); - //Encode accumulated meander latched counters difference - Encode16(var_Cnt_Dif()); - //Encode output frequency - Encode16(var_F_ras()); - //Encode ISACS output - Encode16(var_HF_reg()); - //Encode ISACS error - Encode16(var_HF_dif()); - //Encode dither divider - Encode16(var_T_Vibro()); - //Encode dither phase detector output - Encode16(var_T_VB_pll()); - //Encode dither pulse width - Encode16(var_L_Vibro()); - //Encode unused - Encode16(0); - //Encode PLCS output - Encode16(var_WP_reg()); - //Encode PLCS error - Encode16(var_WP_pll()); - //Encode unused - Encode16(0); //T0 - //Encode unused - Encode16(0); //T1 - //Encode CCS data - Encode16((int16_t)device.ccs.current[0].state.raw); //T2 - Encode16((int16_t)device.ccs.current[1].state.raw); //T3 - //Encode TSS data - Encode16((int16_t)device.tss.gradient.state.raw); //T4 - Encode16((int16_t)device.tss.temperature.state.raw); //T5 - //Encode unused - Encode16(0); - //Encode unused - Encode16(0); - //Finish encoding - EncodeCRC(); -} - -//Deprecated -void EncodeMCtlR(void) { - EncodeStart(); - EncodeAddress(); - Encode8(device.user.response.code >> 8); - if (device.user.response.code & 0x10 == 0){ - Encode8(0); //Encode error status and RgConA attribute (clear register RgConB bit) - //Prepare RgConA - uint16_t param = 0; - if (device.dither.frequency.state.enabled) param |= 1 << 6; - if (device.dither.amplitude.state.enabled) param |= 1 << 5; - if (device.sequencer.sampler.state.enabled) param |= 1 << 4; - if (device.plcs.regulator.state.enabled) param |= 1 << 3; - if (device.isacs.regulator.state.enabled) param |= 1 << 1; - Encode16(param); //Encode RgConA - } else { - Encode8(0x10); //Encode error status and RgConB attribute (set register RgConB bit) - Encode16(device.counters.rate.state.source); //Encode RgConB - } - //Finish encoding - EncodeCRC(); -} - -//Deprecated -void EncodeMCtlAM(void) { - EncodeStart(); - EncodeAddress(); - Encode8(device.user.response.code >> 8); - //TODO: - Encode8(0x10); Encode8(0);Encode8(0); //Encode RgConA content - //Finish encoding - EncodeCRC(); -} - -//Deprecated -void EncodeMCtlBM(void) { - EncodeStart(); - EncodeAddress(); - Encode16(device.user.response.code); //TODO: Embed error code - Encode16(device.counters.rate.state.source); - EncodeCRC(); -} - -//Deprecated -void EncodeMParamR(void) { - EncodeStart(); - EncodeAddress(); - EncodeMessage(); - EncodeCRC(); -} - -//Deprecated -void EncodeMParamW(void) { - EncodeStart(); - EncodeAddress(); - Encode8(device.user.response.code >> 8); - Encode8(0); //TODO: Encode error code - EncodeCRC(); -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserEncoder.h --- a/DeviceUserEncoder.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -#ifndef __DEVICE_USER_ENCODER_H__ -#define __DEVICE_USER_ENCODER_H__ - -//Response encoding state -typedef struct _DeviceUserEncoder { - uint8_t error; //Encode error encountered - uint8_t count; //Encoded bytes count - uint16_t CRC; //Current/final CRC of encoded packet -} DeviceUserEncoder; - -void InitUserEncoderDefaultSettings(void); -void InitUserEncoderState(void); -void DeviceStartUserEncoder(void); - -//Encoder elementary functions -void Encode8(uint8_t); -void Encode16(uint16_t); - -//Encoder common functions -void EncodeStart(void); -void EncodeEnd(void); -void EncodeFail(void); -void EncodeAddress(void); -void EncodeMessage(void); -void EncodeParameters(void); -void EncodeCRC(void); - -//Encoder specific functions -void EncodeDeviceMode(void); -void EncodeSysRgR(void); - -void EncodeDeltaPS(void); -void EncodeDeltaBINS(void); -void EncodeDeltaSF(void); -void EncodeMainMode(void); -void EncodeMCntR(void); -void EncodeMRate(void); -void EncodeMCtlR(void); -void EncodeMCtlAM(void); -void EncodeMCtlBM(void); -void EncodeMParamR(void); -void EncodeMParamW(void); - -#endif /* __DEVICE_USER_ENCODER_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserPort.c --- a/DeviceUserPort.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -#include "Device.h" - -extern Device device; -extern unsigned int SystemCoreClock1; - -void InitUserPortDefaultSettings(void) { - device.user.port.settings.mode = 0; //Baud rate usage: 0 - accept baud rate change; 1 - always 921600 - device.user.port.settings.baud = 38400; -} - -void InitUserPortState(void) { - device.user.port.state.mode = device.user.port.settings.mode; - device.user.port.state.baud = userSelectBaudRate(device.user.port.settings.baud); -} - -void DeviceStartUserPort(void) -{ - LPC_PINCON->PINSEL4 &= ~0x0000000F; - LPC_PINCON->PINSEL4 |= 0x0000000A; //Enable RxD1 P2.1, TxD1 P2.0 - - userSetBaudRate(device.user.port.state.baud); - - device.controller.uart[1].state.FCR = 0x03; - LPC_UART1->FCR = device.controller.uart[1].state.FCR; //Enable and reset TX and RX FIFO. - - /* - //Uncomment to use interrupts - //NVIC_EnableIRQ(UART1_IRQn); - //LPC_UART1->IER = IER_RBR | IER_THRE | IER_RLS; //Enable UART1 interrupt - */ -} - -uint32_t userSelectBaudRate(uint32_t baud) { - if (device.user.port.state.mode == 1) - return 921600; - else - return baud; -} - -void userSetBaudRate(uint32_t baud) { - baud = userSelectBaudRate(baud); - //Peripheral clock of UART1 - uint32_t pclkdiv = (LPC_SC->PCLKSEL0 >> 8) & 0x03; //Bits 8,9 are for UART1 - uint32_t pclk; - switch ( pclkdiv ) { - case 0x00: - default: - pclk = SystemCoreClock1/4; - break; - case 0x01: - pclk = SystemCoreClock1; - break; - case 0x02: - pclk = SystemCoreClock1/2; - break; - case 0x03: - pclk = SystemCoreClock1/8; - break; - } - //Divider - uint32_t Fdiv = ( pclk / 16 ) / baud; - //Enable divider write - device.controller.uart[1].state.LCR = 0x83; - LPC_UART1->LCR = device.controller.uart[1].state.LCR; //8 bits, no Parity, 1 Stop bit - //Write divider hi byte - device.controller.uart[1].state.DLM = Fdiv / 256; - LPC_UART1->DLM = device.controller.uart[1].state.DLM; - //Write divider lo byte - device.controller.uart[1].state.DLL = Fdiv % 256; - LPC_UART1->DLL = device.controller.uart[1].state.DLL; - //Disable divider write - device.controller.uart[1].state.LCR = 0x03; - LPC_UART1->LCR = device.controller.uart[1].state.LCR; //DLAB = 0 - - device.user.port.state.baud = baud; - - #ifdef DEBUG_USER_BAUD - sprintf(device.service.buffer, "userSetBaudRate(%06d)\r\n", baud); WriteConcole(); - #endif -} - -void userReceive(void){ - if (LPC_UART1->LSR & 0x01) { - device.user.request.buffer.data[device.user.request.buffer.end] = LPC_UART1->RBR; - device.user.request.buffer.end = (device.user.request.buffer.end + 1) % InputBufferSize; - device.user.request.buffer.empty = 0; - device.user.decoder.canceled = 0; //Clear decode canceled flag - } -} - -void userTransmit(void){ - if (device.user.response.ready) { - if (device.user.response.type == RESPONSE_DELAYED) { - if (!device.user.response.triggered) return; - } - - if (device.user.response.buffer.position < device.user.response.buffer.count) { - if (LPC_UART1->LSR & 0x20) { - LPC_UART1->THR = device.user.response.buffer.data[device.user.response.buffer.position]; - device.user.response.buffer.position++; - if (device.user.response.buffer.position == device.user.response.buffer.count){ - device.user.response.ready = 0; - if (device.user.response.type == RESPONSE_PERIODIC) { - device.user.response.enabled = 1; //next response encoding required - } - if (device.user.response.type == RESPONSE_DELAYED) { - device.user.response.triggered = 0; //Clear transmission flag, wait next trigger event. Here ok - transmit response in multiple passes! - } - device.user.response.buffer.count = 0; - device.user.response.buffer.position = 0; - } - } - } - } -} - -// -//Compatibility section -// -uint8_t var_SRgR(void) { - //SysRgR - // Unused 3 bits: => xxxxx000 - // Hardware: transmitter rate = receiver rate => xxxx1000 - // Sending response, so transmitter enabled, no case => 1xxx1000 - // Request received, so receiver enabled, no case => 11xx1000 - uint8_t res; - switch (device.user.port.state.baud) { - case 38400: res = 0xc8; break; //11001000 - case 115200: res = 0xd8; break; //11011000 - case 460800: res = 0xe8; break; //11101000 - case 921600: res = 0xf8; break; //11111000 - default: res = 0xc8; //11001000 - 38400 - } - return res; -} - -// -//Not used section -// Communication using interrupt -/* -#define IER_RBR 0x01 -#define IER_THRE 0x02 -#define IER_RLS 0x04 - -#define IIR_PEND 0x01 -#define IIR_RLS 0x03 -#define IIR_RDA 0x02 -#define IIR_CTI 0x06 -#define IIR_THRE 0x01 - -#define LSR_RDR 0x01 -#define LSR_OE 0x02 -#define LSR_PE 0x04 -#define LSR_FE 0x08 -#define LSR_BI 0x10 -#define LSR_THRE 0x20 -#define LSR_TEMT 0x40 -#define LSR_RXFE 0x80 - -void UART1Send(void) -{ - uint8_t pos = 0; - while (device.host.response.buffer.count != pos ) { - //THRE status, contain valid data - while ( !(device.host.port.TxEmpty & 0x01) ); - LPC_UART1->THR = device.host.response.buffer.data[pos]; - device.host.port.TxEmpty = 0; //not empty in the THR until it shifts out - pos++; - } - device.host.response.buffer.count = 0; -} - -//Not used -__irq void UART1_IRQHandler (void) -{ - uint8_t IIRValue, LSRValue; - uint8_t Dummy = Dummy; - - IIRValue = LPC_UART1->IIR; - - IIRValue >>= 1; //skip pending bit in IIR - IIRValue &= 0x07; //check bit 1~3, interrupt identification - if ( IIRValue == IIR_RLS ) // Receive Line Status - { - LSRValue = LPC_UART1->LSR; - //Receive Line Status - if ( LSRValue & (LSR_OE|LSR_PE|LSR_FE|LSR_RXFE|LSR_BI) ) - { - //There are errors or break interrupt - //Read LSR will clear the interrupt - device.host.port.status = LSRValue; - Dummy = LPC_UART1->RBR;//Dummy read on RX to clear interrupt, then bail out - return; - } - if ( LSRValue & LSR_RDR )//Receive Data Ready - { - //If no error on RLS, normal ready, save into the data buffer. - //Note: read RBR will clear the interrupt - device.host.request.buffer.data[device.host.request.buffer.end] = LPC_UART1->RBR; - device.host.request.buffer.end = (device.host.request.buffer.end + 1) % InputBufferSize; - } - } - else if ( IIRValue == IIR_RDA ) //Receive Data Available - { - device.host.request.buffer.data[device.host.request.buffer.end] = LPC_UART1->RBR; - device.host.request.buffer.end = (device.host.request.buffer.end + 1) % InputBufferSize; - } - else if ( IIRValue == IIR_CTI ) //Character timeout indicator - { - //Character Time-out indicator - device.host.port.status |= 0x100; //Bit 9 as the CTI error - } - else if ( IIRValue == IIR_THRE ) //THRE, transmit holding register empty - { - //THRE interrupt - LSRValue = LPC_UART1->LSR; //Check status in the LSR to see if valid data in U0THR or not - if ( LSRValue & LSR_THRE ) - { - device.host.port.TxEmpty = 1; - } - else - { - device.host.port.TxEmpty = 0; - } - } -}*/ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserPort.h --- a/DeviceUserPort.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -#ifndef __DEVICE_USER_PORT_H__ -#define __DEVICE_USER_PORT_H__ - -//User port typedefs -typedef struct _DeviceUserPortSettings { - uint32_t mode; //Baud rate usage: 0 - accept baud rate change; 1 - always 921600 - uint32_t baud; //Baud rate -} DeviceUserPortSettings; - -typedef struct _DeviceUserPortState { - uint32_t mode; //Baud rate usage: 0 - accept baud rate change; 1 - always 921600 - uint32_t baud; //Baud rate -} DeviceUserPortState; - -typedef struct _DeviceUserPort { - DeviceUserPortSettings settings; - DeviceUserPortState state; -} DeviceUserPort; - -void InitUserPortDefaultSettings(void); -void InitUserPortState(void); -void DeviceStartUserPort(void); - -uint32_t userSelectBaudRate(uint32_t baud); -void userSetBaudRate(uint32_t baud); -void userReceive(void); -void userTransmit(void); - -// -//Compatibility section -// -uint8_t var_SRgR(void); - -#endif /* __DEVICE_USER_PORT_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserRequest.c --- a/DeviceUserRequest.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -#include "Device.h" - -extern Device device; - -void InitUserRequestDefaultSettings(void) { -} - -void InitUserRequestState(void) { - device.user.request.buffer.start = 0; - device.user.request.buffer.end = 0; - device.user.request.buffer.empty = 1; -} - -void DeviceStartUserRequest(void) { -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserRequest.h --- a/DeviceUserRequest.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#ifndef __DEVICE_USER_REQUEST_H__ -#define __DEVICE_USER_REQUEST_H__ - -#define InputBufferSize 1024 -typedef struct _DeviceInputBuffer { - uint8_t data[InputBufferSize]; - uint16_t start; //read start position - uint16_t end; //write start position - uint8_t empty; //empty flag -} DeviceInputBuffer; - -//Requests queue state -typedef struct _DeviceUserRequest { - //uint32_t rate; //response baud rate - DeviceInputBuffer buffer; -} DeviceUserRequest; - -void InitUserRequestDefaultSettings(void); -void InitUserRequestState(void); -void DeviceStartUserRequest(void); - -#endif /* __DEVICE_USER_REQUEST_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserResponse.c --- a/DeviceUserResponse.c Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#include "Device.h" - -extern Device device; - -void InitUserResponseDefaultSettings(void) { -} - -void InitUserResponseState(void) { - device.user.response.buffer.count = 0; - device.user.response.buffer.position = 0; - device.user.response.enabled = 0; - device.user.response.ready = 0; -} - -void DeviceStartUserResponse(void) { -} \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 DeviceUserResponse.h --- a/DeviceUserResponse.h Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -#ifndef __DEVICE_USER_RESPONSE_H__ -#define __DEVICE_USER_RESPONSE_H__ - -typedef enum _ResponseType { - RESPONSE_NONE, //no sheduled response - RESPONSE_IMMEDIATE, //immediate response for most of requests - RESPONSE_DELAYED, //delayed response for broadcast requests - RESPONSE_PERIODIC //periodic response for some of requests -} ResponseType; - -typedef enum _ResponseData { - RESPONSE_BUFFER, //response buffer content as is if not empty - RESPONSE_DELTA_BINS, //fill buffer with Delta_BINS data set - RESPONSE_DELTA_PS, //fill buffer with Delta_PS data set - RESPONSE_DELTA_SF, //fill buffer with Delta_SF data set - RESPONSE_RATE //fill buffer with M_Rate data set -} ResponseData; - -#define OutputBufferSize 64 -typedef struct _DeviceOutputBuffer { - uint8_t data[OutputBufferSize]; //Buffer - uint8_t count; //Buffer byte count - uint8_t position; //Transmission position -} DeviceOutputBuffer; - -typedef struct _DeviceResponseParameter { - void * ref; //parameter address - uint16_t size; //parameter byte size -} DeviceResponseParameter; - -//Response state -typedef struct _DeviceUserResponse { - uint16_t code; //request code - ResponseType type; //how send: immediately/delayed/periodic - uint8_t enabled; //Enabled to fill response data - uint8_t ready; //Ready to transmit - uint32_t counter; //time from: broadcast line request/broadcast pin request/latest periodic response; values in mks; access this only from timer interrupt - uint32_t trigger; //counter trigger value to response; values in mks; - uint8_t triggered;//set this only from timer interrupt, clear from main loop - DeviceOutputBuffer buffer; - uint16_t message; //message: ok, error, ... - uint8_t parametersCount; - DeviceResponseParameter parameters[4]; //Response parameters list - uint16_t packet; //packet to send (for periodic answers) -} DeviceUserResponse; - -void InitUserResponseDefaultSettings(void); -void InitUserResponseState(void); -void DeviceStartUserResponse(void); - -#endif /* __DEVICE_USER_RESPONSE_H__ */ \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 develop.txt --- a/develop.txt Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -01.07.2016 Dile Tant -Основные циклы: - Измерительный плавающий цикл/Measurment floating cycle - Цикл задается измерительным таймером с переменной частотой следования прерываний - таймер 1 контроллера - Регулярный внутренний цикл/Regular internal cycle - Цикл задается управляющим таймером с постоянной частотой следования прерываний - таймер 2 контроллера - Основной последовательный плавающий цикл/Main sequential floating cycle - Цикл выполняется с переменной частотой, определяемой загрузкой процессора. - Регулярный внешний цикл/Regular external cycle - Цикл задается внешним периодическим сигналом - защелкой - -Замечание: - Измерение частоты расщепления производится в плавающем цикле, результат измерения - количество импульсов за период вибропривода, - для получения частоты нужно поделить импульсы на текущий период измерения. - Остальные измеряемые параметры от периода измерений не зависят. - -Параметры: - Представление параметров алгоритма в виде единого последовательного блока параметров с фиксированным положением и размером - параметров нецелесообразно. Для удобства, независимости модулей и упрощения их модификации следует определять параметры в модулях подсистем. - При этом удобно представить параметры в виде дерева, каждая ветвь которого относится к соответствующей подсистеме. - Следует разделять неизменяемые в процессе работы параметры настройки (settings) и изменяемые (текущие) параметры состояния (state). - Параметры настройки определяются при настройке и калибровке устройства и записываются во флэш-память. - Параметры состояния вычисляются в процессе работы на основе параметров настройки. Параметры настройки могут задавать начальное значение - параметров состояния, значения параметров состояния при определенных событиях (например при обнулении СРП) или функцию зависимости - параметров состояния (например от температуры). - Параметры настройки делятся на настройки по умолчанию (default), которые инициализируются в коде программы, - и настройки, загружаемые из флэш-памяти. - В частности, в протоколе есть команды установки состояния из настроек по умолчанию и из флэш-памяти, что означает необходимость - раздельного хранения параметров настройки и параметров состояния состояния. - -Идентификация параметров: - Всем параметрам присваивается хэш/hash. В качестве хэш-функции можно использовать - hash(name, type) = crc32(name) ^ crc32(type), - где name - имя переменной в RAM или константы в ROM, type - тип. - Например: crc32("uint16_t") ^ crc32("device.settings.address") = 0x4d8e4523 - -Хранение констант и переменных в RAM: - Все параметры хранятся в переменной device в виде иерархической структуры. - При загрузке инициализируется таблица адресов переменных hashParamTable[HASH_PARAM_COUNT] в формате hash32 : address32 : size32, - где hash32 - хэш параметра, address32 - ссылка на параметр, size32 - размер в байтах. - -Хранение констант и переменных в ROM: - Сектор 22 - таблица адресов в формате hash32 : address32 - Сектор 23 - данные по адресам из таблицы адресов - Чтение из ROM: - FlashReadAll() - Запись в ROM: - FlashWriteAll() - -Использование портов: - UART0 - порт обслуживания / Service port - UART1 - порт команд/данных / User port - -Доступ к параметрам через User port - Формат команды: - cc address8 code16 hash32 crc16 - code16: - H_PARAM8_R : чтение 1-байтного параметра - H_PARAM16_R: чтение 2-байтного параметра - H_PARAM32_R: чтение 4-байтного параметра - H_PARAM8_W : запись 1-байтного параметра - H_PARAM16_W: запись 2-байтного параметра - H_PARAM32_W: запись 4-байтного параметра - -Последовательность старта системы: - 1. Инициализация настроек по умолчанию - InitDefaultSettings(). В идеале - инициализация абсолютно всех настроек - на случай отсутствия настроек во флэш-памяти или отказа флэш-памяти. - 2. Загрузка настроек подсистем из флэш-памяти с перезаписью настроек по умолчанию - FlashReadAll(). - 3. Инициализация начального состояния подсистем из сформированных на этапах 1 и 2 настроек - InitState(). - 4. Старт модулей после установки начального состояния всех подсистем - DeviceStart(). - -Работа управляющего алгоритма в вольтах: - Вычисления в алгоритме можно проводить в виде напряжения на исполнительном элементе (ГВЧ, нагреватель, пъезоэлемент и т.д.). - Для этого требуется в настройках задать параметры преобразования в виде линейной интерполяции: код на ЦАП - напряжение на элементе. - Плюсы: - - настройки для конкретного датчика сохраняются на разных основаниях, в том числе с разной электрической схемой - - настройки для конкретного основания (параметры преобразования) сохраняются для разных датчиков - - калибровка оснований может производиться отдельно от датчиков и отражаться в паспорте основания - - учет нелинейностей (16 контрольных точек) - - передача потребителю истинных напряжений (без необходимости учета знаков, падений напряжений на транзисторе и т.п.) - Минусы: - - требуется постоянный пересчет вольты - коды при работе алгоритма - - требуется калибровка оснований - -Передаточные функции: - 1. При вычислениях с фиксированной точкой есть 2 существенные проблемы: - - переполнение - - округление - 2. С целью обеспечения независимости собственно алгоритма от диапазона входных данных, определяемого "железом" и - полного использования битности процессора требуется преобразование входных данных в нормализованный диапазон (-1 ... +1 - например). Такое преобразование может быть выполнено с помощью передаточной функции (например, в виде линейной - интерполяции: код АЦП - нормализованная величина). - 3. Для управления исполнительным элементом также требуется преобразование нормализованных данных с - помощью передаточной функции (например в виде линейной интерполяции: нормализованная величина - код ЦАП). - -Работа СРП: - Режимы работы: - - по опорному генератору - - с запоминанием - Детектор: - Опорный сигнал: - - выходное напряжение опорного генератора - - выходное напряжение СРП - Обратная связь: - - выходное напряжение амплитудного детектора - - выходное напряжение стабилизатора амплитуды - Функции передачи: - - опорный сигнал (В) - опорный сигнал (у.е. -1...+1) - - обратная связь (В) - обратная связь (у.е. -1...+1). Требуется отфильтровать постоянную составляющую, чтобы попасть в диапазон -1...+1? - - рассогласование (у.е. -1...+1) - рассогласование (-0.5 ... +0.5) - - ошибка регулятора (-1...+1) - коррекция выходного напряжения СРП (В) - - выходное напряжение СРП (В) - код ЦАП (у.е.) \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 device.xml --- a/device.xml Wed Oct 19 10:55:05 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1308 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<root> - <structure name="device" typedef="Device"> - <structure name="sensor" typedef="DeviceSensor"> - <structure name="settings" typedef="DeviceSensorSettings"> - <variable name="id" typedef="uint16_t" value="0"/> - <variable name="block" typedef="uint16_t" value="0"/> - </structure> - </structure> - - <structure name="user" typedef="DeviceUser"> - <variable name="address" typedef="uint16_t" value="0"/> - - <structure name="port" typedef="DeviceUserPort"> - <structure name="settings" typedef="DeviceUserPortSettings"> - <variable name="mode" typedef="uint32_t" value="0"/> - <variable name="baud" typedef="uint32_t" value="38400"/> - </structure> - <structure name="state" typedef="DeviceUserPortState"> - <variable name="mode" typedef="uint32_t" value="0"/> - <variable name="baud" typedef="uint32_t" value="38400"/> - </structure> - </structure> - </structure> - - <structure name="service" typedef="DeviceService"> - <structure name="port" typedef="DeviceServicePort"> - <structure name="settings" typedef="DeviceServicePortSettings"> - <variable name="baud" typedef="uint32_t" value="38400"/> - </structure> - <structure name="state" typedef="DeviceServicePortState"> - <variable name="baud" typedef="uint32_t" value="38400"/> - </structure> - </structure> - </structure> - - <structure name="counters" typedef="DeviceCounters"> - <structure name="dither" typedef="DeviceCountersDitherLatched"> - <structure name="settings" typedef="DeviceCountersDitherLatchedSettings"> - </structure> - <structure name="state" typedef="DeviceCountersDitherLatchedState"> - <variable name="delta[0]" typedef="uint32_t" value="0"/> - <variable name="delta[1]" typedef="uint32_t" value="0"/> - <variable name="delta[2]" typedef="uint32_t" value="0"/> - <variable name="delta[3]" typedef="uint32_t" value="0"/> - <variable name="delta[4]" typedef="uint32_t" value="0"/> - <variable name="delta[5]" typedef="uint32_t" value="0"/> - <variable name="delta[6]" typedef="uint32_t" value="0"/> - <variable name="delta[7]" typedef="uint32_t" value="0"/> - <variable name="delta[8]" typedef="uint32_t" value="0"/> - <variable name="delta[9]" typedef="uint32_t" value="0"/> - <variable name="delta[10]" typedef="uint32_t" value="0"/> - <variable name="delta[11]" typedef="uint32_t" value="0"/> - <variable name="delta[12]" typedef="uint32_t" value="0"/> - <variable name="delta[13]" typedef="uint32_t" value="0"/> - <variable name="delta[14]" typedef="uint32_t" value="0"/> - <variable name="delta[15]" typedef="uint32_t" value="0"/> - <variable name="delta[16]" typedef="uint32_t" value="0"/> - <variable name="delta[17]" typedef="uint32_t" value="0"/> - <variable name="delta[18]" typedef="uint32_t" value="0"/> - <variable name="delta[19]" typedef="uint32_t" value="0"/> - <variable name="delta[20]" typedef="uint32_t" value="0"/> - <variable name="delta[21]" typedef="uint32_t" value="0"/> - <variable name="delta[22]" typedef="uint32_t" value="0"/> - <variable name="delta[23]" typedef="uint32_t" value="0"/> - <variable name="delta[24]" typedef="uint32_t" value="0"/> - <variable name="delta[25]" typedef="uint32_t" value="0"/> - <variable name="delta[26]" typedef="uint32_t" value="0"/> - <variable name="delta[27]" typedef="uint32_t" value="0"/> - <variable name="delta[28]" typedef="uint32_t" value="0"/> - <variable name="delta[29]" typedef="uint32_t" value="0"/> - <variable name="delta[30]" typedef="uint32_t" value="0"/> - <variable name="delta[31]" typedef="uint32_t" value="0"/> - <variable name="rate" typedef="uint32_t" value="0"/> - <variable name="angle" typedef="uint32_t" value="0"/> - <variable name="amplitude" typedef="uint32_t" value="0"/> - <variable name="displacement" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="meander" typedef="DeviceCountersMeanderLatched"> - <structure name="settings" typedef="DeviceCountersMeanderLatchedSettings"> - </structure> - <structure name="state" typedef="DeviceCountersMeanderLatchedState"> - <variable name="a" typedef="uint32_t" value="0"/> - <variable name="b" typedef="uint32_t" value="0"/> - <variable name="rate[0]" typedef="uint32_t" value="0"/> - <variable name="rate[1]" typedef="uint32_t" value="0"/> - <variable name="angle[0]" typedef="uint32_t" value="0"/> - <variable name="angle[1]" typedef="uint32_t" value="0"/> - <variable name="amplitude" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="zero" typedef="DeviceCountersZeroLatched"> - <structure name="settings" typedef="DeviceCountersZeroLatchedSettings"> - </structure> - <structure name="state" typedef="DeviceCountersZeroLatchedState"> - <variable name="a" typedef="uint32_t" value="0"/> - <variable name="b" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="latch" typedef="DeviceCountersExternalLatch"> - <structure name="settings" typedef="DeviceCountersExternalLatchSettings"> - <variable name="enabled" typedef="uint16_t" value="0"/> - <variable name="signal" typedef="uint16_t" value="0"/> - <variable name="format" typedef="uint16_t" value="0"/> - <variable name="reset" typedef="uint16_t" value="1"/> - </structure> - <structure name="state" typedef="DeviceCountersExternalLatchState"> - <variable name="enabled" typedef="uint16_t" value="0"/> - <variable name="signal" typedef="uint16_t" value="0"/> - <variable name="format" typedef="uint16_t" value="0"/> - <variable name="reset" typedef="uint16_t" value="1"/> - <variable name="clock" typedef="uint16_t" value="0"/> - <variable name="angle" typedef="uint32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="lightUp" typedef="DeviceLightUp"> - <structure name="settings" typedef="DeviceLightUpSettings"> - <variable name="sequence" typedef="uint16_t" value="0x0055"/> - </structure> - <structure name="state" typedef="DeviceLightUpState"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="sequence" typedef="uint16_t" value="0x0055"/> - </structure> - </structure> - - <structure name="tss" typedef="DeviceTSS"> - <structure name="temperature" typedef="DeviceTSSTemperature"> - <structure name="settings" typedef="DeviceTSSTemperatureSettings"> - <structure name="transfer" typedef="DeviceTSSTransferFunction"> - <variable name="points" typedef="int32_t" value="16"/> - <variable name="raw[0]" typedef="int32_t" value="-0x8e0ba2e"/> - <variable name="celsius[0]" typedef="int32_t" value="-0x3c0000"/> - <variable name="raw[1]" typedef="int32_t" value="-0x6645d17"/> - <variable name="celsius[1]" typedef="int32_t" value="-0x320000"/> - <variable name="raw[2]" typedef="int32_t" value="-0x3e80000"/> - <variable name="celsius[2]" typedef="int32_t" value="-0x280000"/> - <variable name="raw[3]" typedef="int32_t" value="-0x16ba2e8"/> - <variable name="celsius[3]" typedef="int32_t" value="-0x1e0000"/> - <variable name="raw[4]" typedef="int32_t" value="0x110ba2e"/> - <variable name="celsius[4]" typedef="int32_t" value="-0x140000"/> - <variable name="raw[5]" typedef="int32_t" value="0x38d1745"/> - <variable name="celsius[5]" typedef="int32_t" value="-0xa0000"/> - <variable name="raw[6]" typedef="int32_t" value="0x609745d"/> - <variable name="celsius[6]" typedef="int32_t" value="0x0"/> - <variable name="raw[7]" typedef="int32_t" value="0x885d174"/> - <variable name="celsius[7]" typedef="int32_t" value="0xa0000"/> - <variable name="raw[8]" typedef="int32_t" value="0xb022e8b"/> - <variable name="celsius[8]" typedef="int32_t" value="0x140000"/> - <variable name="raw[9]" typedef="int32_t" value="0xd7e8ba2"/> - <variable name="celsius[9]" typedef="int32_t" value="0x1e0000"/> - <variable name="raw[10]" typedef="int32_t" value="0xffae8ba"/> - <variable name="celsius[10]" typedef="int32_t" value="0x280000"/> - <variable name="raw[11]" typedef="int32_t" value="0x127745d1"/> - <variable name="celsius[11]" typedef="int32_t" value="0x320000"/> - <variable name="raw[12]" typedef="int32_t" value="0x14f3a2e8"/> - <variable name="celsius[12]" typedef="int32_t" value="0x3c0000"/> - <variable name="raw[13]" typedef="int32_t" value="0x176fffff"/> - <variable name="celsius[13]" typedef="int32_t" value="0x460000"/> - <variable name="raw[14]" typedef="int32_t" value="0x19ec5d17"/> - <variable name="celsius[14]" typedef="int32_t" value="0x500000"/> - <variable name="raw[15]" typedef="int32_t" value="0x1c68ba2e"/> - <variable name="celsius[15]" typedef="int32_t" value="0x5a0000"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceTSSTemperatureState"> - <variable name="sum" typedef="int32_t" value="0"/> - <variable name="raw" typedef="int32_t" value="0"/> - <variable name="celsius" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="gradient" typedef="DeviceTSSGradient"> - <structure name="settings" typedef="DeviceTSSGradientSettings"> - <structure name="transfer" typedef="DeviceTSSTransferFunction"> - <variable name="points" typedef="int32_t" value="16"/> - <variable name="raw[0]" typedef="int32_t" value="-0x640000"/> - <variable name="celsius[0]" typedef="int32_t" value="-0xa0000"/> - <variable name="raw[1]" typedef="int32_t" value="-0x56aaaa"/> - <variable name="celsius[1]" typedef="int32_t" value="-0x8aaaa"/> - <variable name="raw[2]" typedef="int32_t" value="-0x495555"/> - <variable name="celsius[2]" typedef="int32_t" value="-0x75555"/> - <variable name="raw[3]" typedef="int32_t" value="-0x3c0000"/> - <variable name="celsius[3]" typedef="int32_t" value="-0x60000"/> - <variable name="raw[4]" typedef="int32_t" value="-0x2eaaaa"/> - <variable name="celsius[4]" typedef="int32_t" value="-0x4aaaa"/> - <variable name="raw[5]" typedef="int32_t" value="-0x215555"/> - <variable name="celsius[5]" typedef="int32_t" value="-0x35555"/> - <variable name="raw[6]" typedef="int32_t" value="-0x140000"/> - <variable name="celsius[6]" typedef="int32_t" value="-0x20000"/> - <variable name="raw[7]" typedef="int32_t" value="-0x6aaaa"/> - <variable name="celsius[7]" typedef="int32_t" value="-0xaaaa"/> - <variable name="raw[8]" typedef="int32_t" value="0x6aaaa"/> - <variable name="celsius[8]" typedef="int32_t" value="0xaaaa"/> - <variable name="raw[9]" typedef="int32_t" value="0x140000"/> - <variable name="celsius[9]" typedef="int32_t" value="0x20000"/> - <variable name="raw[10]" typedef="int32_t" value="0x215555"/> - <variable name="celsius[10]" typedef="int32_t" value="0x35555"/> - <variable name="raw[11]" typedef="int32_t" value="0x2eaaaa"/> - <variable name="celsius[11]" typedef="int32_t" value="0x4aaaa"/> - <variable name="raw[12]" typedef="int32_t" value="0x3c0000"/> - <variable name="celsius[12]" typedef="int32_t" value="0x60000"/> - <variable name="raw[13]" typedef="int32_t" value="0x495555"/> - <variable name="celsius[13]" typedef="int32_t" value="0x75555"/> - <variable name="raw[14]" typedef="int32_t" value="0x56aaaa"/> - <variable name="celsius[14]" typedef="int32_t" value="0x8aaaa"/> - <variable name="raw[15]" typedef="int32_t" value="0x640000"/> - <variable name="celsius[15]" typedef="int32_t" value="0xa0000"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceTSSGradientState"> - <variable name="sum" typedef="int32_t" value="0"/> - <variable name="raw" typedef="int32_t" value="0"/> - <variable name="celsius" typedef="int32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="ccs" typedef="DeviceCCS"> - <structure name="current[0]" typedef="DeviceCCSCurrent"> - <structure name="settings" typedef="DeviceCCSCurrentSettings"> - <structure name="transfer" typedef="DeviceCCSTransferFunction"> - <variable name="points" typedef="int32_t" value="16"/> - <variable name="raw[0]" typedef="int32_t" value="0x0"/> - <variable name="mA[0]" typedef="int32_t" value="0x0"/> - <variable name="raw[1]" typedef="int32_t" value="0x1111111"/> - <variable name="mA[1]" typedef="int32_t" value="0x6aaaa"/> - <variable name="raw[2]" typedef="int32_t" value="0x2222222"/> - <variable name="mA[2]" typedef="int32_t" value="0xd5555"/> - <variable name="raw[3]" typedef="int32_t" value="0x3333333"/> - <variable name="mA[3]" typedef="int32_t" value="0x140000"/> - <variable name="raw[4]" typedef="int32_t" value="0x4444444"/> - <variable name="mA[4]" typedef="int32_t" value="0x1aaaaa"/> - <variable name="raw[5]" typedef="int32_t" value="0x5555555"/> - <variable name="mA[5]" typedef="int32_t" value="0x215555"/> - <variable name="raw[6]" typedef="int32_t" value="0x6666666"/> - <variable name="mA[6]" typedef="int32_t" value="0x280000"/> - <variable name="raw[7]" typedef="int32_t" value="0x7777777"/> - <variable name="mA[7]" typedef="int32_t" value="0x2eaaaa"/> - <variable name="raw[8]" typedef="int32_t" value="0x8888888"/> - <variable name="mA[8]" typedef="int32_t" value="0x355555"/> - <variable name="raw[9]" typedef="int32_t" value="0x9999999"/> - <variable name="mA[9]" typedef="int32_t" value="0x3c0000"/> - <variable name="raw[10]" typedef="int32_t" value="0xaaaaaaa"/> - <variable name="mA[10]" typedef="int32_t" value="0x42aaaa"/> - <variable name="raw[11]" typedef="int32_t" value="0xbbbbbbb"/> - <variable name="mA[11]" typedef="int32_t" value="0x495555"/> - <variable name="raw[12]" typedef="int32_t" value="0xccccccc"/> - <variable name="mA[12]" typedef="int32_t" value="0x500000"/> - <variable name="raw[13]" typedef="int32_t" value="0xddddddd"/> - <variable name="mA[13]" typedef="int32_t" value="0x56aaaa"/> - <variable name="raw[14]" typedef="int32_t" value="0xeeeeeee"/> - <variable name="mA[14]" typedef="int32_t" value="0x5d5555"/> - <variable name="raw[15]" typedef="int32_t" value="0x10000000"/> - <variable name="mA[15]" typedef="int32_t" value="0x640000"/> - </structure> - </structure> - <structure name="state" typedef="DeviceCCSCurrentState"> - <variable name="sum" typedef="int32_t" value="0"/> - <variable name="raw" typedef="int32_t" value="0"/> - <variable name="mA" typedef="int32_t" value="0"/> - </structure> - </structure> - <structure name="current[1]" typedef="DeviceCCSCurrent"> - <structure name="settings" typedef="DeviceCCSCurrentSettings"> - </structure> - <structure name="state" typedef="DeviceCCSCurrentState"> - <variable name="sum" typedef="int32_t" value="0"/> - <variable name="raw" typedef="int32_t" value="0"/> - <variable name="mA" typedef="int32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="dither" typedef="DeviceDither"> - <structure name="pulse" typedef="DeviceDitherPulse"> - <structure name="settings" typedef="DeviceDitherPulseSettings"> - <variable name="width" typedef="int32_t" value="0"/> - <variable name="min" typedef="int32_t" value="0"/> - <variable name="max" typedef="int32_t" value="0"/> - </structure> - - <structure name="state" typedef="DeviceDitherPulseState"> - <variable name="width" typedef="int32_t" value="0"/> - <variable name="min" typedef="int32_t" value="0"/> - <variable name="max" typedef="int32_t" value="0"/> - <variable name="rise" typedef="int32_t" value="0"/> - <variable name="fall" typedef="int32_t" value="0"/> - <variable name="counter" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="noise" typedef="DeviceDitherNoise"> - <structure name="settings" typedef="DeviceDitherNoiseSettings"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="period" typedef="int32_t" value="0"/> - <variable name="range" typedef="int32_t" value="0"/> - <variable name="amplitude" typedef="int32_t" value="0"/> - </structure> - - <structure name="state" typedef="DeviceDitherNoiseState"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="period" typedef="int32_t" value="0"/> - <variable name="range" typedef="int32_t" value="0"/> - <variable name="amplitude" typedef="int32_t" value="0"/> - <variable name="counter" typedef="int32_t" value="0"/> - <variable name="trigger" typedef="int32_t" value="0"/> - <variable name="disturbance" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="cycle" typedef="DeviceDitherCycle"> - <structure name="settings" typedef="DeviceDitherCycleSettings"> - <variable name="enabled" typedef="int8_t" value="1"/> - </structure> - - <structure name="state" typedef="DeviceDitherCycleState"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="pin1" typedef="int8_t" value="0"/> - <variable name="pin2" typedef="int8_t" value="0"/> - </structure> - </structure> - - <structure name="detector" typedef="DeviceDitherPhaseDetector"> - <structure name="settings" typedef="DeviceDitherPhaseDetectorSettings"> - <structure name="filter" typedef="DeviceDitherPhaseDetectorFilterFunction"> - <variable name="factor[0]" typedef="int32_t" value="-1"/> - <variable name="factor[1]" typedef="int32_t" value="-1"/> - <variable name="factor[2]" typedef="int32_t" value="-1"/> - <variable name="factor[3]" typedef="int32_t" value="-1"/> - <variable name="factor[4]" typedef="int32_t" value="-1"/> - <variable name="factor[5]" typedef="int32_t" value="-1"/> - <variable name="factor[6]" typedef="int32_t" value="-1"/> - <variable name="factor[7]" typedef="int32_t" value="-1"/> - - <variable name="factor[8]" typedef="int32_t" value="-1"/> - <variable name="factor[9]" typedef="int32_t" value="-1"/> - <variable name="factor[10]" typedef="int32_t" value="-1"/> - <variable name="factor[11]" typedef="int32_t" value="-1"/> - <variable name="factor[12]" typedef="int32_t" value="-1"/> - <variable name="factor[13]" typedef="int32_t" value="-1"/> - <variable name="factor[14]" typedef="int32_t" value="-1"/> - <variable name="factor[15]" typedef="int32_t" value="-1"/> - - <variable name="factor[16]" typedef="int32_t" value="1"/> - <variable name="factor[17]" typedef="int32_t" value="1"/> - <variable name="factor[18]" typedef="int32_t" value="1"/> - <variable name="factor[19]" typedef="int32_t" value="1"/> - <variable name="factor[20]" typedef="int32_t" value="1"/> - <variable name="factor[21]" typedef="int32_t" value="1"/> - <variable name="factor[22]" typedef="int32_t" value="1"/> - <variable name="factor[23]" typedef="int32_t" value="1"/> - - <variable name="factor[24]" typedef="int32_t" value="1"/> - <variable name="factor[25]" typedef="int32_t" value="1"/> - <variable name="factor[26]" typedef="int32_t" value="1"/> - <variable name="factor[27]" typedef="int32_t" value="1"/> - <variable name="factor[28]" typedef="int32_t" value="1"/> - <variable name="factor[29]" typedef="int32_t" value="1"/> - <variable name="factor[30]" typedef="int32_t" value="1"/> - <variable name="factor[31]" typedef="int32_t" value="1"/> - </structure> - <structure name="transfer" typedef="DeviceDitherPhaseTransferFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="raw[0]" typedef="uint32_t" value="-0x10000"/> - <variable name="restored[0]" typedef="uint32_t" value="-0x1921f"/> - <variable name="raw[1]" typedef="uint32_t" value="-0xfa67"/> - <variable name="restored[1]" typedef="uint32_t" value="-0x15c81"/> - <variable name="raw[2]" typedef="uint32_t" value="-0xe9de"/> - <variable name="restored[2]" typedef="uint32_t" value="-0x126e4"/> - <variable name="raw[3]" typedef="uint32_t" value="-0xcf1b"/> - <variable name="restored[3]" typedef="uint32_t" value="-0xf146"/> - <variable name="raw[4]" typedef="uint32_t" value="-0xab4c"/> - <variable name="restored[4]" typedef="uint32_t" value="-0xbba8"/> - <variable name="raw[5]" typedef="uint32_t" value="-0x8000"/> - <variable name="restored[5]" typedef="uint32_t" value="-0x860a"/> - <variable name="raw[6]" typedef="uint32_t" value="-0x4f1b"/> - <variable name="restored[6]" typedef="uint32_t" value="-0x506c"/> - <variable name="raw[7]" typedef="uint32_t" value="-0x1ac2"/> - <variable name="restored[7]" typedef="uint32_t" value="-0x1ace"/> - <variable name="raw[8]" typedef="uint32_t" value="0x1ac2"/> - <variable name="restored[8]" typedef="uint32_t" value="0x1ace"/> - <variable name="raw[9]" typedef="uint32_t" value="0x4f1b"/> - <variable name="restored[9]" typedef="uint32_t" value="0x506c"/> - <variable name="raw[10]" typedef="uint32_t" value="0x7fff"/> - <variable name="restored[10]" typedef="uint32_t" value="0x860a"/> - <variable name="raw[11]" typedef="uint32_t" value="0xab4c"/> - <variable name="restored[11]" typedef="uint32_t" value="0xbba8"/> - <variable name="raw[12]" typedef="uint32_t" value="0xcf1b"/> - <variable name="restored[12]" typedef="uint32_t" value="0xf146"/> - <variable name="raw[13]" typedef="uint32_t" value="0xe9de"/> - <variable name="restored[13]" typedef="uint32_t" value="0x126e4"/> - <variable name="raw[14]" typedef="uint32_t" value="0xfa67"/> - <variable name="restored[14]" typedef="uint32_t" value="0x15c81"/> - <variable name="raw[15]" typedef="uint32_t" value="0x10000"/> - <variable name="restored[15]" typedef="uint32_t" value="0x1921f"/> - </structure> - </structure> - <structure name="state" typedef="DeviceDitherPhaseDetectorState"> - <variable name="phase" typedef="int32_t" value="0"/> - <variable name="sum" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="frequency" typedef="DeviceDitherFrequencyRegulator"> - <structure name="settings" typedef="DeviceDitherFrequencyRegulatorSettings"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="min" typedef="int32_t" value="0x01860000"/> - <variable name="max" typedef="int32_t" value="0x019A0000"/> - <variable name="scale" typedef="int32_t" value="1"/> - <structure name="transfer" typedef="DeviceDitherFrequencyRegulatorTransferSettings"> - <variable name="points" typedef="int32_t" value="16"/> - <variable name="error[0]" typedef="int32_t" value="-0x140000"/> - <variable name="correction[0]" typedef="int32_t" value="0x10000"/> - <variable name="error[1]" typedef="int32_t" value="-0x115555"/> - <variable name="correction[1]" typedef="int32_t" value="0xb473"/> - <variable name="error[2]" typedef="int32_t" value="-0xeaaaa"/> - <variable name="correction[2]" typedef="int32_t" value="0x7aa7"/> - <variable name="error[3]" typedef="int32_t" value="-0xc0000"/> - <variable name="correction[3]" typedef="int32_t" value="0x4fdf"/> - <variable name="error[4]" typedef="int32_t" value="-0x95555"/> - <variable name="correction[4]" typedef="int32_t" value="0x3161"/> - <variable name="error[5]" typedef="int32_t" value="-0x6aaaa"/> - <variable name="correction[5]" typedef="int32_t" value="0x1c71"/> - <variable name="error[6]" typedef="int32_t" value="-0x40000"/> - <variable name="correction[6]" typedef="int32_t" value="0xe56"/> - <variable name="error[7]" typedef="int32_t" value="-0x15555"/> - <variable name="correction[7]" typedef="int32_t" value="0x452"/> - <variable name="error[8]" typedef="int32_t" value="0x15555"/> - <variable name="correction[8]" typedef="int32_t" value="-0x452"/> - <variable name="error[9]" typedef="int32_t" value="0x40000"/> - <variable name="correction[9]" typedef="int32_t" value="-0xe56"/> - <variable name="error[10]" typedef="int32_t" value="0x6aaaa"/> - <variable name="correction[10]" typedef="int32_t" value="-0x1c71"/> - <variable name="error[11]" typedef="int32_t" value="0x95555"/> - <variable name="correction[11]" typedef="int32_t" value="-0x3161"/> - <variable name="error[12]" typedef="int32_t" value="0xc0000"/> - <variable name="correction[12]" typedef="int32_t" value="-0x4fdf"/> - <variable name="error[13]" typedef="int32_t" value="0xeaaaa"/> - <variable name="correction[13]" typedef="int32_t" value="-0x7aa7"/> - <variable name="error[14]" typedef="int32_t" value="0x115555"/> - <variable name="correction[14]" typedef="int32_t" value="-0xb473"/> - <variable name="error[15]" typedef="int32_t" value="0x140000"/> - <variable name="correction[15]" typedef="int32_t" value="-0x10000"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceDitherFrequencyRegulatorState"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="min" typedef="uint32_t" value="0x01860000"/> - <variable name="max" typedef="uint32_t" value="0x019A0000"/> - <variable name="frequency" typedef="uint32_t" value="1"/> - <variable name="scale" typedef="uint32_t" value="1"/> - <variable name="error" typedef="uint32_t" value="0"/> - <variable name="correction" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="amplitude" typedef="DeviceDitherAmplitudeRegulator"> - <structure name="settings" typedef="DeviceDitherAmplitudeRegulatorSettings"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="reference" typedef="int32_t" value="1"/> - <variable name="scale" typedef="int32_t" value="1"/> - <structure name="transfer" typedef="DeviceDitherAmplitudeRegulatorTransferSettings"> - <variable name="points" typedef="int32_t" value="16"/> - <variable name="error[0]" typedef="int32_t" value="-0x140000"/> - <variable name="correction[0]" typedef="int32_t" value="0x10000"/> - <variable name="error[1]" typedef="int32_t" value="-0x115555"/> - <variable name="correction[1]" typedef="int32_t" value="0xb473"/> - <variable name="error[2]" typedef="int32_t" value="-0xeaaaa"/> - <variable name="correction[2]" typedef="int32_t" value="0x7aa7"/> - <variable name="error[3]" typedef="int32_t" value="-0xc0000"/> - <variable name="correction[3]" typedef="int32_t" value="0x4fdf"/> - <variable name="error[4]" typedef="int32_t" value="-0x95555"/> - <variable name="correction[4]" typedef="int32_t" value="0x3161"/> - <variable name="error[5]" typedef="int32_t" value="-0x6aaaa"/> - <variable name="correction[5]" typedef="int32_t" value="0x1c71"/> - <variable name="error[6]" typedef="int32_t" value="-0x40000"/> - <variable name="correction[6]" typedef="int32_t" value="0xe56"/> - <variable name="error[7]" typedef="int32_t" value="-0x15555"/> - <variable name="correction[7]" typedef="int32_t" value="0x452"/> - <variable name="error[8]" typedef="int32_t" value="0x15555"/> - <variable name="correction[8]" typedef="int32_t" value="-0x452"/> - <variable name="error[9]" typedef="int32_t" value="0x40000"/> - <variable name="correction[9]" typedef="int32_t" value="-0xe56"/> - <variable name="error[10]" typedef="int32_t" value="0x6aaaa"/> - <variable name="correction[10]" typedef="int32_t" value="-0x1c71"/> - <variable name="error[11]" typedef="int32_t" value="0x95555"/> - <variable name="correction[11]" typedef="int32_t" value="-0x3161"/> - <variable name="error[12]" typedef="int32_t" value="0xc0000"/> - <variable name="correction[12]" typedef="int32_t" value="-0x4fdf"/> - <variable name="error[13]" typedef="int32_t" value="0xeaaaa"/> - <variable name="correction[13]" typedef="int32_t" value="-0x7aa7"/> - <variable name="error[14]" typedef="int32_t" value="0x115555"/> - <variable name="correction[14]" typedef="int32_t" value="-0xb473"/> - <variable name="error[15]" typedef="int32_t" value="0x140000"/> - <variable name="correction[15]" typedef="int32_t" value="-0x10000"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceDitherAmplitudeRegulatorState"> - <variable name="enabled" typedef="int8_t" value="1"/> - <variable name="reference" typedef="int32_t" value="1"/> - <variable name="scale" typedef="int32_t" value="1"/> - <variable name="frequency" typedef="int32_t" value="1"/> - <variable name="error" typedef="int32_t" value="0"/> - <variable name="correction" typedef="int32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="isacs" typedef="DeviceISACS"> - <structure name="potentiometers" typedef="DeviceISACSPotentiometers"> - <structure name="settings" typedef="DeviceISACSPotentiometersSettings"> - <variable name="a" typedef="uint32_t" value="150"/> - <variable name="b" typedef="uint32_t" value="150"/> - </structure> - <structure name="state" typedef="DeviceISACSPotentiometersState"> - <variable name="a" typedef="uint32_t" value="150"/> - <variable name="b" typedef="uint32_t" value="150"/> - </structure> - </structure> - - <structure name="input" typedef="DeviceISACSInput"> - <structure name="settings" typedef="DeviceISACSInputSettings"> - <structure name="transfer" typedef="DeviceISACSInputTransferFunction"> - <variable name="points" typedef="uint32_t" value="2"/> - <variable name="V[0]" typedef="uint32_t" value="0x00000000"/> - <variable name="raw[0]" typedef="uint32_t" value="0"/> - <variable name="V[1]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[1]" typedef="uint32_t" value="4095"/> - <variable name="V[2]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[2]" typedef="uint32_t" value="4095"/> - <variable name="V[3]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[3]" typedef="uint32_t" value="4095"/> - <variable name="V[4]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[4]" typedef="uint32_t" value="4095"/> - <variable name="V[5]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[5]" typedef="uint32_t" value="4095"/> - <variable name="V[6]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[6]" typedef="uint32_t" value="4095"/> - <variable name="V[7]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[7]" typedef="uint32_t" value="4095"/> - <variable name="V[8]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[8]" typedef="uint32_t" value="4095"/> - <variable name="V[9]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[9]" typedef="uint32_t" value="4095"/> - <variable name="V[10]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[10]" typedef="uint32_t" value="4095"/> - <variable name="V[11]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[11]" typedef="uint32_t" value="4095"/> - <variable name="V[12]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[12]" typedef="uint32_t" value="4095"/> - <variable name="V[13]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[13]" typedef="uint32_t" value="4095"/> - <variable name="V[14]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[14]" typedef="uint32_t" value="4095"/> - <variable name="V[15]" typedef="uint32_t" value="0x00040000"/> - <variable name="raw[15]" typedef="uint32_t" value="4095"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceISACSInputState"> - <variable name="sum" typedef="uint32_t" value="0"/> - <variable name="raw" typedef="uint32_t" value="0"/> - <variable name="V" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="output" typedef="DeviceISACSOutput"> - <structure name="settings" typedef="DeviceISACSOutputSettings"> - <structure name="start" typedef="DeviceISACSOutputStart"> - <variable name="voltage" typedef="int32_t" value="0x000c7fff"/> - </structure> - <structure name="reset" typedef="DeviceISACSOutputReset"> - <variable name="voltage" typedef="int32_t" value="0x000c7fff"/> - </structure> - <structure name="transfer" typedef="DeviceISACSOutputTransferFunction"> - <variable name="points" typedef="uint32_t" value="2"/> - <variable name="voltage[0]" typedef="uint32_t" value="0x00017fff"/> - <variable name="code[0]" typedef="uint32_t" value="800"/> - <variable name="voltage[1]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[1]" typedef="uint32_t" value="2048"/> - <variable name="voltage[2]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[2]" typedef="uint32_t" value="2048"/> - <variable name="voltage[3]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[3]" typedef="uint32_t" value="2048"/> - <variable name="voltage[4]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[4]" typedef="uint32_t" value="2048"/> - <variable name="voltage[5]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[5]" typedef="uint32_t" value="2048"/> - <variable name="voltage[6]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[6]" typedef="uint32_t" value="2048"/> - <variable name="voltage[7]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[7]" typedef="uint32_t" value="2048"/> - <variable name="voltage[8]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[8]" typedef="uint32_t" value="2048"/> - <variable name="voltage[9]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[9]" typedef="uint32_t" value="2048"/> - <variable name="voltage[10]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[10]" typedef="uint32_t" value="2048"/> - <variable name="voltage[11]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[11]" typedef="uint32_t" value="2048"/> - <variable name="voltage[12]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[12]" typedef="uint32_t" value="2048"/> - <variable name="voltage[13]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[13]" typedef="uint32_t" value="2048"/> - <variable name="voltage[14]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[14]" typedef="uint32_t" value="2048"/> - <variable name="voltage[15]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[15]" typedef="uint32_t" value="2048"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceISACSOutputState"> - <variable name="voltage" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="regulator" typedef="DeviceISACSRegulator"> - <structure name="settings" typedef="DeviceISACSRegulatorSettings"> - <structure name="start" typedef="DeviceISACSRegulatorConditionSettings"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="uint32_t" value="1"/> - <variable name="scale" typedef="uint32_t" value="1"/> - </structure> - - <structure name="regular" typedef="DeviceISACSRegulatorConditionSettings"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="uint32_t" value="1"/> - <variable name="scale" typedef="uint32_t" value="1"/> - </structure> - - <structure name="reset" typedef="DeviceISACSRegulatorConditionSettings"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="uint32_t" value="1"/> - <variable name="scale" typedef="uint32_t" value="1"/> - </structure> - - <structure name="transfer" typedef="DeviceISACSCorrectionTransferFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="error[0]" typedef="uint32_t" value="-0x20000"/> - <variable name="correction[0]" typedef="uint32_t" value="0x10000"/> - <variable name="error[1]" typedef="uint32_t" value="-0x1bbbb"/> - <variable name="correction[1]" typedef="uint32_t" value="0xb473"/> - <variable name="error[2]" typedef="uint32_t" value="-0x17777"/> - <variable name="correction[2]" typedef="uint32_t" value="0x7aa7"/> - <variable name="error[3]" typedef="uint32_t" value="-0x13333"/> - <variable name="correction[3]" typedef="uint32_t" value="0x4fdf"/> - <variable name="error[4]" typedef="uint32_t" value="-0xeeee"/> - <variable name="correction[4]" typedef="uint32_t" value="0x3161"/> - <variable name="error[5]" typedef="uint32_t" value="-0xaaaa"/> - <variable name="correction[5]" typedef="uint32_t" value="0x1c71"/> - <variable name="error[6]" typedef="uint32_t" value="-0x6666"/> - <variable name="correction[6]" typedef="uint32_t" value="0xe56"/> - <variable name="error[7]" typedef="uint32_t" value="-0x2222"/> - <variable name="correction[7]" typedef="uint32_t" value="0x452"/> - <variable name="error[8]" typedef="uint32_t" value="0x2222"/> - <variable name="correction[8]" typedef="uint32_t" value="-0x452"/> - <variable name="error[9]" typedef="uint32_t" value="0x6666"/> - <variable name="correction[9]" typedef="uint32_t" value="-0xe56"/> - <variable name="error[10]" typedef="uint32_t" value="0xaaaa"/> - <variable name="correction[10]" typedef="uint32_t" value="-0x1c71"/> - <variable name="error[11]" typedef="uint32_t" value="0xeeee"/> - <variable name="correction[11]" typedef="uint32_t" value="-0x3161"/> - <variable name="error[12]" typedef="uint32_t" value="0x13333"/> - <variable name="correction[12]" typedef="uint32_t" value="-0x4fdf"/> - <variable name="error[13]" typedef="uint32_t" value="0x17777"/> - <variable name="correction[13]" typedef="uint32_t" value="-0x7aa7"/> - <variable name="error[14]" typedef="uint32_t" value="0x1bbbb"/> - <variable name="correction[14]" typedef="uint32_t" value="-0xb473"/> - <variable name="error[15]" typedef="uint32_t" value="0x20000"/> - <variable name="correction[15]" typedef="uint32_t" value="-0x10000"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceISACSRegulatorState"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="uint32_t" value="1"/> - <variable name="scale" typedef="uint32_t" value="1"/> - <variable name="error" typedef="uint32_t" value="0"/> - <variable name="correction" typedef="uint32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="sequencer" typedef="DeviceSequencer"> - <structure name="sampler" typedef="DeviceSequencerSampler"> - <structure name="settings" typedef="DeviceSequencerSamplerSettings"> - <variable name="enabled" typedef="uint8_t" value="0"/> - <variable name="amplitude" typedef="uint32_t" value="0"/> - <variable name="sequence[0]" typedef="uint32_t" value="0"/> - <variable name="sequence[1]" typedef="uint32_t" value="0"/> - <variable name="sequence[2]" typedef="uint32_t" value="0"/> - <variable name="sequence[3]" typedef="uint32_t" value="0"/> - <variable name="sequence[4]" typedef="uint32_t" value="0"/> - <variable name="sequence[5]" typedef="uint32_t" value="0"/> - <variable name="sequence[6]" typedef="uint32_t" value="0"/> - <variable name="sequence[7]" typedef="uint32_t" value="0"/> - <variable name="sequence[8]" typedef="uint32_t" value="0"/> - <variable name="sequence[9]" typedef="uint32_t" value="0"/> - <variable name="sequence[10]" typedef="uint32_t" value="0"/> - <variable name="sequence[11]" typedef="uint32_t" value="0"/> - <variable name="sequence[12]" typedef="uint32_t" value="0"/> - <variable name="sequence[13]" typedef="uint32_t" value="0"/> - <variable name="sequence[14]" typedef="uint32_t" value="0"/> - <variable name="sequence[15]" typedef="uint32_t" value="0"/> - <variable name="sequence[16]" typedef="uint32_t" value="0"/> - <variable name="sequence[17]" typedef="uint32_t" value="0"/> - <variable name="sequence[18]" typedef="uint32_t" value="0"/> - <variable name="sequence[19]" typedef="uint32_t" value="0"/> - <variable name="sequence[20]" typedef="uint32_t" value="0"/> - <variable name="sequence[21]" typedef="uint32_t" value="0"/> - <variable name="sequence[22]" typedef="uint32_t" value="0"/> - <variable name="sequence[23]" typedef="uint32_t" value="0"/> - <variable name="sequence[24]" typedef="uint32_t" value="0"/> - <variable name="sequence[25]" typedef="uint32_t" value="0"/> - <variable name="sequence[26]" typedef="uint32_t" value="0"/> - <variable name="sequence[27]" typedef="uint32_t" value="0"/> - <variable name="sequence[28]" typedef="uint32_t" value="0"/> - <variable name="sequence[29]" typedef="uint32_t" value="0"/> - <variable name="sequence[30]" typedef="uint32_t" value="0"/> - <variable name="sequence[31]" typedef="uint32_t" value="0"/> - <variable name="sequence[32]" typedef="uint32_t" value="1"/> - <variable name="sequence[33]" typedef="uint32_t" value="1"/> - <variable name="sequence[34]" typedef="uint32_t" value="1"/> - <variable name="sequence[35]" typedef="uint32_t" value="1"/> - <variable name="sequence[36]" typedef="uint32_t" value="1"/> - <variable name="sequence[37]" typedef="uint32_t" value="1"/> - <variable name="sequence[38]" typedef="uint32_t" value="1"/> - <variable name="sequence[39]" typedef="uint32_t" value="1"/> - <variable name="sequence[40]" typedef="uint32_t" value="1"/> - <variable name="sequence[41]" typedef="uint32_t" value="1"/> - <variable name="sequence[42]" typedef="uint32_t" value="1"/> - <variable name="sequence[43]" typedef="uint32_t" value="1"/> - <variable name="sequence[44]" typedef="uint32_t" value="1"/> - <variable name="sequence[45]" typedef="uint32_t" value="1"/> - <variable name="sequence[46]" typedef="uint32_t" value="1"/> - <variable name="sequence[47]" typedef="uint32_t" value="1"/> - <variable name="sequence[48]" typedef="uint32_t" value="1"/> - <variable name="sequence[49]" typedef="uint32_t" value="1"/> - <variable name="sequence[50]" typedef="uint32_t" value="1"/> - <variable name="sequence[51]" typedef="uint32_t" value="1"/> - <variable name="sequence[52]" typedef="uint32_t" value="1"/> - <variable name="sequence[53]" typedef="uint32_t" value="1"/> - <variable name="sequence[54]" typedef="uint32_t" value="1"/> - <variable name="sequence[55]" typedef="uint32_t" value="1"/> - <variable name="sequence[56]" typedef="uint32_t" value="1"/> - <variable name="sequence[57]" typedef="uint32_t" value="1"/> - <variable name="sequence[58]" typedef="uint32_t" value="1"/> - <variable name="sequence[59]" typedef="uint32_t" value="1"/> - <vaiable name="sequence[60]" typedef="uint32_t" value="1"/> - <variable name="sequence[61]" typedef="uint32_t" value="1"/> - <variable name="sequence[62]" typedef="uint32_t" value="1"/> - <variable name="sequence[63]" typedef="uint32_t" value="1"/> - <variable name="position[0]" typedef="uint32_t" value="0"/> - <variable name="position[1]" typedef="uint32_t" value="16"/> - </structure> - - <structure name="state" typedef="DeviceSequencerSamplerState"> - <variable name="enabled" typedef="uint8_t" value="0"/> - <variable name="amplitude" typedef="uint32_t" value="0"/> - <variable name="position[0]" typedef="uint32_t" value="0"/> - <variable name="position[1]" typedef="uint32_t" value="16"/> - <variable name="sample[0]" typedef="uint32_t" value="0"/> - <variable name="sample[1]" typedef="uint32_t" value="0"/> - <variable name="voltage" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="output" typedef="DeviceSequencerOutput"> - <structure name="logic" typedef="DeviceSequencerLogicOutput"> - <structure name="settings" typedef="DeviceSequencerLogicOutputSettings"> - <variable name="enabled" typedef="uint8_t" value="0"/> - </structure> - - <structure name="state" typedef="DeviceSequencerLogicOutputState"> - <variable name="enabled" typedef="uint8_t" value="0"/> - <variable name="level" typedef="uint8_t" value="0"/> - </structure> - </structure> - - <structure name="analog" typedef="DeviceSequencerAnalogOutput"> - <structure name="settings" typedef="DeviceSequencerAnalogOutputSettings"> - <variable name="enabled" typedef="uint8_t" value="0"/> - <structure name="transfer" typedef="DeviceSequencerAnalogOutputTransferFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="code[0]" typedef="uint32_t" value="0x0"/> - <variable name="voltage[0]" typedef="uint32_t" value="-30.0V"/> - <variable name="code[1]" typedef="uint32_t" value="0x1100"/> - <variable name="voltage[1]" typedef="uint32_t" value="-26.0V"/> - <variable name="code[2]" typedef="uint32_t" value="0x2200"/> - <variable name="voltage[2]" typedef="uint32_t" value="-22.0V"/> - <variable name="code[3]" typedef="uint32_t" value="0x3300"/> - <variable name="voltage[3]" typedef="uint32_t" value="-18.0V"/> - <variable name="code[4]" typedef="uint32_t" value="0x4440"/> - <variable name="voltage[4]" typedef="uint32_t" value="-14.0V"/> - <variable name="code[5]" typedef="uint32_t" value="0x5540"/> - <variable name="voltage[5]" typedef="uint32_t" value="-10.0V"/> - <variable name="code[6]" typedef="uint32_t" value="0x6640"/> - <variable name="voltage[6]" typedef="uint32_t" value="-6.0V"/> - <variable name="code[7]" typedef="uint32_t" value="0x7740"/> - <variable name="voltage[7]" typedef="uint32_t" value="-2.0V"/> - <variable name="code[8]" typedef="uint32_t" value="0x8880"/> - <variable name="voltage[8]" typedef="uint32_t" value="2.0V"/> - <variable name="code[9]" typedef="uint32_t" value="0x9980"/> - <variable name="voltage[9]" typedef="uint32_t" value="6.0V"/> - <variable name="code[10]" typedef="uint32_t" value="0xaa80"/> - <variable name="voltage[10]" typedef="uint32_t" value="10.0V"/> - <variable name="code[11]" typedef="uint32_t" value="0xbb80"/> - <variable name="voltage[11]" typedef="uint32_t" value="14.0V"/> - <variable name="code[12]" typedef="uint32_t" value="0xccc0"/> - <variable name="voltage[12]" typedef="uint32_t" value="18.0V"/> - <variable name="code[13]" typedef="uint32_t" value="0xddc0"/> - <variable name="voltage[13]" typedef="uint32_t" value="22.0V"/> - <variable name="code[14]" typedef="uint32_t" value="0xeec0"/> - <variable name="voltage[14]" typedef="uint32_t" value="26.0V"/> - <variable name="code[15]" typedef="uint32_t" value="0xffc0"/> - <variable name="voltage[15]" typedef="uint32_t" value="30.0V"/> - </structure> - </structure> - - <structure name="state" typedef="DeviceSequencerAnalogOutputState"> - <variable name="enabled" typedef="uint8_t" value="0"/> - <variable name="voltage" typedef="uint32_t" value="0"/> - </structure> - </structure> - </structure> - </structure> - - <structure name="plcs" typedef="DevicePathLengthControlSystem"> - <structure name="feedback" typedef="DevicePLCSFeedback"> - <structure name="settings" typedef="DevicePLCSFeedbackSettings"> - <variable name="input" typedef="uint32_t" value="1"/> - <variable name="output" typedef="uint32_t" value="0"/> - <structure name="transfer" typedef="DevicePLCSFeedbackTransferFunctionSettings"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="raw[0]" typedef="int32_t" value="-0x20000"/> - <variable name="normalized[0]" typedef="int32_t" value="-0x10000"/> - <variable name="raw[1]" typedef="int32_t" value="-0x1bbbb"/> - <variable name="normalized[1]" typedef="int32_t" value="-0xdddd"/> - <variable name="raw[2]" typedef="int32_t" value="-0x17777"/> - <variable name="normalized[2]" typedef="int32_t" value="-0xbbbb"/> - <variable name="raw[3]" typedef="int32_t" value="-0x13333"/> - <variable name="normalized[3]" typedef="int32_t" value="-0x9999"/> - <variable name="raw[4]" typedef="int32_t" value="-0xeeee"/> - <variable name="normalized[4]" typedef="int32_t" value="-0x7777"/> - <variable name="raw[5]" typedef="int32_t" value="-0xaaaa"/> - <variable name="normalized[5]" typedef="int32_t" value="-0x5555"/> - <variable name="raw[6]" typedef="int32_t" value="-0x6666"/> - <variable name="normalized[6]" typedef="int32_t" value="-0x3333"/> - <variable name="raw[7]" typedef="int32_t" value="-0x2222"/> - <variable name="normalized[7]" typedef="int32_t" value="-0x1111"/> - <variable name="raw[8]" typedef="int32_t" value="0x2222"/> - <variable name="normalized[8]" typedef="int32_t" value="0x1111"/> - <variable name="raw[9]" typedef="int32_t" value="0x6666"/> - <variable name="normalized[9]" typedef="int32_t" value="0x3333"/> - <variable name="raw[10]" typedef="int32_t" value="0xaaaa"/> - <variable name="normalized[10]" typedef="int32_t" value="0x5555"/> - <variable name="raw[11]" typedef="int32_t" value="0xeeee"/> - <variable name="normalized[11]" typedef="int32_t" value="0x7777"/> - <variable name="raw[12]" typedef="int32_t" value="0x13333"/> - <variable name="normalized[12]" typedef="int32_t" value="0x9999"/> - <variable name="raw[13]" typedef="int32_t" value="0x17777"/> - <variable name="normalized[13]" typedef="int32_t" value="0xbbbb"/> - <variable name="raw[14]" typedef="int32_t" value="0x1bbbb"/> - <variable name="normalized[14]" typedef="int32_t" value="0xdddd"/> - <variable name="raw[15]" typedef="int32_t" value="0x20000"/> - <variable name="normalized[15]" typedef="int32_t" value="0x10000"/> - </structure> - </structure> - - <structure name="state" typedef="DevicePLCSFeedbackState"> - <variable name="input" typedef="uint32_t" value="1"/> - <variable name="output" typedef="uint32_t" value="0"/> - <variable name="voltage" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="reference" typedef="DevicePLCSReference"> - <structure name="settings" typedef="DevicePLCSReferenceSettings"> - <variable name="sequencer" typedef="uint32_t" value="0"/> - <variable name="delta" typedef="uint32_t" value="1"/> - </structure> - - <structure name="state" typedef="DevicePLCSReferenceState"> - <variable name="sequencer" typedef="uint32_t" value="0"/> - <variable name="delta" typedef="uint32_t" value="1"/> - </structure> - </structure> - - <structure name="detector" typedef="DevicePLCSDetector"> - <structure name="state" typedef="DevicePLCSDetectorState"> - <variable name="in[0]" typedef="uint32_t" value="0"/> - <variable name="in[1]" typedef="uint32_t" value="0"/> - <variable name="out" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="bias" typedef="DevicePLCSBias"> - <structure name="settings" typedef="DevicePLCSBiasSettings"> - <structure name="transfer" typedef="DevicePLCSBiasTransferFunction"> - <variable name="points" typedef="uint32_t" value="2"/> - <variable name="raw[0]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[0]" typedef="uint32_t" value="800"/> - <variable name="raw[1]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[1]" typedef="uint32_t" value="800"/> - <variable name="raw[2]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[2]" typedef="uint32_t" value="800"/> - <variable name="raw[3]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[3]" typedef="uint32_t" value="800"/> - <variable name="raw[4]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[4]" typedef="uint32_t" value="800"/> - <variable name="raw[5]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[5]" typedef="uint32_t" value="800"/> - <variable name="raw[6]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[6]" typedef="uint32_t" value="800"/> - <variable name="raw[7]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[7]" typedef="uint32_t" value="800"/> - <variable name="raw[8]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[8]" typedef="uint32_t" value="800"/> - <variable name="raw[9]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[9]" typedef="uint32_t" value="800"/> - <variable name="raw[10]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[10]" typedef="uint32_t" value="800"/> - <variable name="raw[11]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[11]" typedef="uint32_t" value="800"/> - <variable name="raw[12]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[12]" typedef="uint32_t" value="800"/> - <variable name="raw[13]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[13]" typedef="uint32_t" value="800"/> - <variable name="raw[14]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[14]" typedef="uint32_t" value="800"/> - <variable name="raw[15]" typedef="uint32_t" value="0x00017fff"/> - <variable name="normalized[15]" typedef="uint32_t" value="800"/> - </structure> - </structure> - <structure name="state" typedef="DevicePLCSBiasState"> - <variable name="raw" typedef="uint32_t" value="0"/> - <variable name="sum" typedef="uint32_t" value="0"/> - <variable name="counter" typedef="uint32_t" value="0"/> - <variable name="average" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="reset" typedef="DevicePLCSReset"> - <structure name="up" typedef="DevicePLCSResetDirection"> - <structure name="settings" typedef="DevicePLCSResetDirectionSettings"> - <structure name="environment" typedef="DevicePLCSResetTemperatureFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="temperature[0]" typedef="int32_t" value="-60C"/> - <variable name="trigger[0]" typedef="int32_t" value="13.0V"/> - <variable name="target[0]" typedef="int32_t" value="2.5V"/> - <variable name="duration[0]" typedef="uint32_t" value="3s"/> - <variable name="temperature[1]" typedef="int32_t" value="-50C"/> - <variable name="trigger[1]" typedef="int32_t" value="13.0V"/> - <variable name="target[1]" typedef="int32_t" value="2.5V"/> - <variable name="duration[1]" typedef="uint32_t" value="3s"/> - <variable name="temperature[2]" typedef="int32_t" value="-40C"/> - <variable name="trigger[2]" typedef="int32_t" value="13.0V"/> - <variable name="target[2]" typedef="int32_t" value="2.5V"/> - <variable name="duration[2]" typedef="uint32_t" value="3s"/> - <variable name="temperature[3]" typedef="int32_t" value="-30C"/> - <variable name="trigger[3]" typedef="int32_t" value="13.0V"/> - <variable name="target[3]" typedef="int32_t" value="2.5V"/> - <variable name="duration[3]" typedef="uint32_t" value="3s"/> - <variable name="temperature[4]" typedef="int32_t" value="-20C"/> - <variable name="trigger[4]" typedef="int32_t" value="13.0V"/> - <variable name="target[4]" typedef="int32_t" value="2.5V"/> - <variable name="duration[4]" typedef="uint32_t" value="3s"/> - <variable name="temperature[5]" typedef="int32_t" value="-10C"/> - <variable name="trigger[5]" typedef="int32_t" value="13.0V"/> - <variable name="target[5]" typedef="int32_t" value="2.5V"/> - <variable name="duration[5]" typedef="uint32_t" value="3s"/> - <variable name="temperature[6]" typedef="int32_t" value="0C"/> - <variable name="trigger[6]" typedef="int32_t" value="13.0V"/> - <variable name="target[6]" typedef="int32_t" value="2.5V"/> - <variable name="duration[6]" typedef="uint32_t" value="3s"/> - <variable name="temperature[7]" typedef="int32_t" value="10C"/> - <variable name="trigger[7]" typedef="int32_t" value="13.0V"/> - <variable name="target[7]" typedef="int32_t" value="2.5V"/> - <variable name="duration[7]" typedef="uint32_t" value="3s"/> - <variable name="temperature[8]" typedef="int32_t" value="20C"/> - <variable name="trigger[8]" typedef="int32_t" value="13.0V"/> - <variable name="target[8]" typedef="int32_t" value="2.5V"/> - <variable name="duration[8]" typedef="uint32_t" value="3s"/> - <variable name="temperature[9]" typedef="int32_t" value="30C"/> - <variable name="trigger[9]" typedef="int32_t" value="13.0V"/> - <variable name="target[9]" typedef="int32_t" value="2.5V"/> - <variable name="duration[9]" typedef="uint32_t" value="3s"/> - <variable name="temperature[10]" typedef="int32_t" value="40C"/> - <variable name="trigger[10]" typedef="int32_t" value="13.0V"/> - <variable name="target[10]" typedef="int32_t" value="2.5V"/> - <variable name="duration[10]" typedef="uint32_t" value="3s"/> - <variable name="temperature[11]" typedef="int32_t" value="50C"/> - <variable name="trigger[11]" typedef="int32_t" value="13.0V"/> - <variable name="target[11]" typedef="int32_t" value="2.5V"/> - <variable name="duration[11]" typedef="uint32_t" value="3s"/> - <variable name="temperature[12]" typedef="int32_t" value="60C"/> - <variable name="trigger[12]" typedef="int32_t" value="13.0V"/> - <variable name="target[12]" typedef="int32_t" value="2.5V"/> - <variable name="duration[12]" typedef="uint32_t" value="3s"/> - <variable name="temperature[13]" typedef="int32_t" value="70C"/> - <variable name="trigger[13]" typedef="int32_t" value="13.0V"/> - <variable name="target[13]" typedef="int32_t" value="2.5V"/> - <variable name="duration[13]" typedef="uint32_t" value="3s"/> - <variable name="temperature[14]" typedef="int32_t" value="80C"/> - <variable name="trigger[14]" typedef="int32_t" value="13.0V"/> - <variable name="target[14]" typedef="int32_t" value="2.5V"/> - <variable name="duration[14]" typedef="uint32_t" value="3s"/> - <variable name="temperature[15]" typedef="int32_t" value="90C"/> - <variable name="trigger[15]" typedef="int32_t" value="13.0V"/> - <variable name="target[15]" typedef="int32_t" value="2.5V"/> - <variable name="duration[15]" typedef="uint32_t" value="3s"/> - </structure> - </structure> - <structure name="state" typedef="DevicePLCSResetDirectionState"> - <variable name="trigger" typedef="int32_t" value="0"/> - <variable name="target" typedef="int32_t" value="0"/> - <variable name="duration" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="down" typedef="DevicePLCSResetDirection"> - <structure name="settings" typedef="DevicePLCSResetDirectionSettings"> - <structure name="environment" typedef="DevicePLCSResetTemperatureFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="temperature[0]" typedef="int32_t" value="-60C"/> - <variable name="trigger[0]" typedef="int32_t" value="1.5V"/> - <variable name="target[0]" typedef="int32_t" value="12.0V"/> - <variable name="duration[0]" typedef="uint32_t" value="3s"/> - <variable name="temperature[1]" typedef="int32_t" value="-50C"/> - <variable name="trigger[1]" typedef="int32_t" value="1.5V"/> - <variable name="target[1]" typedef="int32_t" value="12.0V"/> - <variable name="duration[1]" typedef="uint32_t" value="3s"/> - <variable name="temperature[2]" typedef="int32_t" value="-40C"/> - <variable name="trigger[2]" typedef="int32_t" value="1.5V"/> - <variable name="target[2]" typedef="int32_t" value="12.0V"/> - <variable name="duration[2]" typedef="uint32_t" value="3s"/> - <variable name="temperature[3]" typedef="int32_t" value="-30C"/> - <variable name="trigger[3]" typedef="int32_t" value="1.5V"/> - <variable name="target[3]" typedef="int32_t" value="12.0V"/> - <variable name="duration[3]" typedef="uint32_t" value="3s"/> - <variable name="temperature[4]" typedef="int32_t" value="-20C"/> - <variable name="trigger[4]" typedef="int32_t" value="1.5V"/> - <variable name="target[4]" typedef="int32_t" value="12.0V"/> - <variable name="duration[4]" typedef="uint32_t" value="3s"/> - <variable name="temperature[5]" typedef="int32_t" value="-10C"/> - <variable name="trigger[5]" typedef="int32_t" value="1.5V"/> - <variable name="target[5]" typedef="int32_t" value="12.0V"/> - <variable name="duration[5]" typedef="uint32_t" value="3s"/> - <variable name="temperature[6]" typedef="int32_t" value="0C"/> - <variable name="trigger[6]" typedef="int32_t" value="1.5V"/> - <variable name="target[6]" typedef="int32_t" value="12.0V"/> - <variable name="duration[6]" typedef="uint32_t" value="3s"/> - <variable name="temperature[7]" typedef="int32_t" value="10C"/> - <variable name="trigger[7]" typedef="int32_t" value="1.5V"/> - <variable name="target[7]" typedef="int32_t" value="12.0V"/> - <variable name="duration[7]" typedef="uint32_t" value="3s"/> - <variable name="temperature[8]" typedef="int32_t" value="20C"/> - <variable name="trigger[8]" typedef="int32_t" value="1.5V"/> - <variable name="target[8]" typedef="int32_t" value="12.0V"/> - <variable name="duration[8]" typedef="uint32_t" value="3s"/> - <variable name="temperature[9]" typedef="int32_t" value="30C"/> - <variable name="trigger[9]" typedef="int32_t" value="1.5V"/> - <variable name="target[9]" typedef="int32_t" value="12.0V"/> - <variable name="duration[9]" typedef="uint32_t" value="3s"/> - <variable name="temperature[10]" typedef="int32_t" value="40C"/> - <variable name="trigger[10]" typedef="int32_t" value="1.5V"/> - <variable name="target[10]" typedef="int32_t" value="12.0V"/> - <variable name="duration[10]" typedef="uint32_t" value="3s"/> - <variable name="temperature[11]" typedef="int32_t" value="50C"/> - <variable name="trigger[11]" typedef="int32_t" value="1.5V"/> - <variable name="target[11]" typedef="int32_t" value="12.0V"/> - <variable name="duration[11]" typedef="uint32_t" value="3s"/> - <variable name="temperature[12]" typedef="int32_t" value="60C"/> - <variable name="trigger[12]" typedef="int32_t" value="1.5V"/> - <variable name="target[12]" typedef="int32_t" value="12.0V"/> - <variable name="duration[12]" typedef="uint32_t" value="3s"/> - <variable name="temperature[13]" typedef="int32_t" value="70C"/> - <variable name="trigger[13]" typedef="int32_t" value="1.5V"/> - <variable name="target[13]" typedef="int32_t" value="12.0V"/> - <variable name="duration[13]" typedef="uint32_t" value="3s"/> - <variable name="temperature[14]" typedef="int32_t" value="80C"/> - <variable name="trigger[14]" typedef="int32_t" value="1.5V"/> - <variable name="target[14]" typedef="int32_t" value="12.0V"/> - <variable name="duration[14]" typedef="uint32_t" value="3s"/> - <variable name="temperature[15]" typedef="int32_t" value="90C"/> - <variable name="trigger[15]" typedef="int32_t" value="1.5V"/> - <variable name="target[15]" typedef="int32_t" value="12.0V"/> - <variable name="duration[15]" typedef="uint32_t" value="3s"/> - </structure> - </structure> - <structure name="state" typedef="DevicePLCSResetDirectionState"> - <variable name="trigger" typedef="int32_t" value="0"/> - <variable name="target" typedef="int32_t" value="0"/> - <variable name="duration" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="state" typedef="DevicePLCSResetState"> - <variable name="countdown" typedef="int32_t" value="0"/> - <variable name="voltage" typedef="int32_t" value="0"/> - </structure> - </structure> - - <structure name="regulator" typedef="DevicePLCSRegulator"> - <structure name="settings" typedef="DevicePLCSRegulatorSettings"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="uint32_t" value="0"/> - <structure name="transfer" typedef="DevicePLCSCorrectionTransferFunction"> - <variable name="points" typedef="uint32_t" value="16"/> - <variable name="error[0]" typedef="int32_t" value="-0x80000"/> - <variable name="correction[0]" typedef="int32_t" value="0x10000"/> - <variable name="error[1]" typedef="int32_t" value="-0x6eeee"/> - <variable name="correction[1]" typedef="int32_t" value="0xb473"/> - <variable name="error[2]" typedef="int32_t" value="-0x5dddd"/> - <variable name="correction[2]" typedef="int32_t" value="0x7aa7"/> - <variable name="error[3]" typedef="int32_t" value="-0x4cccc"/> - <variable name="correction[3]" typedef="int32_t" value="0x4fdf"/> - <variable name="error[4]" typedef="int32_t" value="-0x3bbbb"/> - <variable name="correction[4]" typedef="int32_t" value="0x3161"/> - <variable name="error[5]" typedef="int32_t" value="-0x2aaaa"/> - <variable name="correction[5]" typedef="int32_t" value="0x1c71"/> - <variable name="error[6]" typedef="int32_t" value="-0x19999"/> - <variable name="correction[6]" typedef="int32_t" value="0xe56"/> - <variable name="error[7]" typedef="int32_t" value="-0x8888"/> - <variable name="correction[7]" typedef="int32_t" value="0x452"/> - <variable name="error[8]" typedef="int32_t" value="0x8888"/> - <variable name="correction[8]" typedef="int32_t" value="-0x452"/> - <variable name="error[9]" typedef="int32_t" value="0x19999"/> - <variable name="correction[9]" typedef="int32_t" value="-0xe56"/> - <variable name="error[10]" typedef="int32_t" value="0x2aaaa"/> - <variable name="correction[10]" typedef="int32_t" value="-0x1c71"/> - <variable name="error[11]" typedef="int32_t" value="0x3bbbb"/> - <variable name="correction[11]" typedef="int32_t" value="-0x3161"/> - <variable name="error[12]" typedef="int32_t" value="0x4cccc"/> - <variable name="correction[12]" typedef="int32_t" value="-0x4fdf"/> - <variable name="error[13]" typedef="int32_t" value="0x5dddd"/> - <variable name="correction[13]" typedef="int32_t" value="-0x7aa7"/> - <variable name="error[14]" typedef="int32_t" value="0x6eeee"/> - <variable name="correction[14]" typedef="int32_t" value="-0xb473"/> - <variable name="error[15]" typedef="int32_t" value="0x80000"/> - <variable name="correction[15]" typedef="int32_t" value="-0x10000"/> - </structure> - </structure> - - <structure name="state" typedef="DevicePLCSRegulatorState"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="reference" typedef="int32_t" value="0"/> - <variable name="error" typedef="int32_t" value="1"/> - <variable name="correction" typedef="int32_t" value="1"/> - </structure> - </structure> - - <structure name="output" typedef="DevicePLCSOutput"> - <structure name="settings" typedef="DevicePLCSOutputSettings"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="sequencer" typedef="uint8_t" value="1"/> - <structure name="start" typedef="DevicePLCSOutputStart"> - <variable name="voltage" typedef="int32_t" value="0x000c7fff"/> - </structure> - <structure name="transfer" typedef="DevicePLCSOutputTransferFunction"> - <variable name="points" typedef="uint32_t" value="2"/> - <variable name="voltage[0]" typedef="uint32_t" value="0x00017fff"/> - <variable name="code[0]" typedef="uint32_t" value="800"/> - <variable name="voltage[1]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[1]" typedef="uint32_t" value="2048"/> - <variable name="voltage[2]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[2]" typedef="uint32_t" value="2048"/> - <variable name="voltage[3]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[3]" typedef="uint32_t" value="2048"/> - <variable name="voltage[4]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[4]" typedef="uint32_t" value="2048"/> - <variable name="voltage[5]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[5]" typedef="uint32_t" value="2048"/> - <variable name="voltage[6]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[6]" typedef="uint32_t" value="2048"/> - <variable name="voltage[7]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[7]" typedef="uint32_t" value="2048"/> - <variable name="voltage[8]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[8]" typedef="uint32_t" value="2048"/> - <variable name="voltage[9]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[9]" typedef="uint32_t" value="2048"/> - <variable name="voltage[10]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[10]" typedef="uint32_t" value="2048"/> - <variable name="voltage[11]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[11]" typedef="uint32_t" value="2048"/> - <variable name="voltage[12]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[12]" typedef="uint32_t" value="2048"/> - <variable name="voltage[13]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[13]" typedef="uint32_t" value="2048"/> - <variable name="voltage[14]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[14]" typedef="uint32_t" value="2048"/> - <variable name="voltage[15]" typedef="uint32_t" value="0x000c7fff"/> - <variable name="code[15]" typedef="uint32_t" value="2048"/> - </structure> - </structure> - - <structure name="state" typedef="DevicePLCSOutputState"> - <variable name="enabled" typedef="uint8_t" value="1"/> - <variable name="sequencer" typedef="uint8_t" value="1"/> - <variable name="voltage" typedef="uint32_t" value="0"/> - </structure> - </structure> - </structure> - - <structure name="controller" typedef="DeviceController"> - <variable name="chip" typedef="uint32_t" value="(1768 lsh 16) | 100"/> - - <structure name="flash" typedef="DeviceFlash"> - <structure name="settings" typedef="DeviceFlashSettings"> - <variable name="hashSector" typedef="uint16_t" value="22"/> - <variable name="dataSector" typedef="uint16_t" value="23"/> - </structure> - </structure> - - <structure name="uart[0]" typedef="DeviceUART"> - <structure name="settings" typedef="DeviceUARTSettings"> - </structure> - - <structure name="state" typedef="DeviceUARTState"> - <variable name="LCR" typedef="uint8_t" value="0"/> - <variable name="DLM" typedef="uint8_t" value="0"/> - <variable name="DLL" typedef="uint8_t" value="0"/> - <variable name="FCR" typedef="uint8_t" value="0"/> - </structure> - </structure> - - <structure name="uart[1]" typedef="DeviceUART"> - <structure name="settings" typedef="DeviceUARTSettings"> - </structure> - - <structure name="state" typedef="DeviceUARTState"> - <variable name="LCR" typedef="uint8_t" value="0"/> - <variable name="DLM" typedef="uint8_t" value="0"/> - <variable name="DLL" typedef="uint8_t" value="0"/> - <variable name="FCR" typedef="uint8_t" value="0"/> - </structure> - </structure> - - <structure name="timer[0]" typedef="DeviceTimer"> - <structure name="settings" typedef="DeviceTimerSettings"> - </structure> - - <structure name="state" typedef="DeviceTimerState"> - <variable name="MR0" typedef="uint32_t" value="0"/> - <variable name="MCR" typedef="uint32_t" value="0"/> - <variable name="TCR" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="SSP" typedef="DeviceSSP"> - <variable name="in[0]" typedef="uint32_t" value="0"/> - <variable name="in[1]" typedef="uint32_t" value="0"/> - <variable name="in[2]" typedef="uint32_t" value="0"/> - <variable name="in[3]" typedef="uint32_t" value="0"/> - <variable name="in[4]" typedef="uint32_t" value="0"/> - <variable name="out[0]" typedef="uint32_t" value="0"/> - <variable name="out[1]" typedef="uint32_t" value="0"/> - </structure> - - <structure name="I2C" typedef="DeviceI2C"> - <structure name="settings" typedef="DeviceI2CSettings"> - <variable name="trigger" typedef="uint32_t" value="38400"/> - </structure> - - <structure name="state" typedef="DeviceI2CState"> - <variable name="CON0" typedef="uint32_t" value="0"/> - <variable name="buffer[0]" typedef="uint32_t" value="0"/> - <variable name="buffer[1]" typedef="uint32_t" value="0"/> - <variable name="buffer[2]" typedef="uint32_t" value="0"/> - <variable name="buffer[3]" typedef="uint32_t" value="0"/> - <variable name="buffer[4]" typedef="uint32_t" value="0"/> - <variable name="buffer[5]" typedef="uint32_t" value="0"/> - <variable name="position" typedef="uint32_t" value="0"/> - <variable name="counter" typedef="uint32_t" value="0"/> - <variable name="trigger" typedef="uint32_t" value="0"/> - <variable name="enabled" typedef="uint32_t" value="0"/> - </structure> - </structure> - - <structure name="QEI" typedef="DeviceQEI"> - <structure name="settings" typedef="DeviceQEISettings"> - </structure> - - <structure name="state" typedef="DeviceQEIState"> - <variable name="position" typedef="uint32_t" value="0"/> - <variable name="delta" typedef="uint32_t" value="0"/> - </structure> - </structure> - </structure> - </structure> - - <function name="FlashReadAll" result="void"> - </function> - <function name="FlashWriteAll" result="void"> - </function> - <function name="StartLightUp" result="void"> - </function> -</root> \ No newline at end of file
diff -r 7a05523bf588 -r 78dd6d14d108 main.c --- a/main.c Wed Oct 19 10:55:05 2016 +0000 +++ b/main.c Wed Feb 08 06:33:40 2017 +0000 @@ -14,11 +14,9 @@ **-------------------------------------------------------------------------------------------------------- *********************************************************************************************************/ #include "Global.h" -#include "Device.h" /****************************************************************************** ** Main Function main() ******************************************************************************/ -extern Device device; //Single global for all device hardware-independent algorithm unsigned int addres; uint32_t Result[5]; extern uint32_t CMD_Mode;