-- Primitive Types ----------------------------------------------------------- ??? should bits be here? bits - A structured primitve, always 8-bits long, but with mappings for each bit field held within those 8 bits. Bit fields may overlap or be duplicated. byte - An array of 1 or more 8-bit values. const - Scalar value declaration, may appear in any context. Stored internally as a 32-bit integer, usage is not checked so may cause overflows at assemble time. dword - An array of 1 or more 32-bit values. port - A virtual bits object, which does not define storage. string - Byte array, automatically prefaced or terminated with ???. word - An array of 1 or more 16-bit values. -- Bits ---------------------------------------------------------------------- bitmap config11 { bits mapType [0:1] { label = "Map sensor type" selections = { "MPX4115", "MPX4250", "User 1", "User 2" } value = 1 } bits twoStroke [ 2] { label = "Engine stroke type" selections = { "Four stroke", "Two stroke" } value = 0 } bits throttleBody [ 3] { label = "Injector type" selections = { "Throttle body", "Port injection" } value = 0 } bits nCylinders [4:7] { label = "Number of cylinders" selections = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16" } value = 7 } } -- Struct -------------------------------------------------------------------- A struct is a heterogenous collection of primitives or other structured types. Display as a stand-alone dialog. Example struct inj1 { label = "Bank 1 Injector Characteristics" byte InjOpen { value = 10T label = "Injector Open Time" } byte InjOCFuel { label = "Injector Open/Close Fuel" help = "Amount of fuel injected during injector opening period." } byte InjPWM { value = 30T label = "PWM Duty Cycle" help = "Duty cycle after full-current injector opening period." } byte InjPWMT { value = 255T label = "PWM mmillisec time at which to activate." /> } byte BattFac { value = 12T label = "Battery Gamma Factor" help = "Rate at which opening time decays with increasing battery voltage." scale = (30.0/255.0) offset = 0.0 } } -- Line ---------------------------------------------------------------------- A structured type with either one or two components. The X coordinate component is optional, but the Y coordinate is required. Display as a numerical array of X-Y columns in table editor. Graphical display as an interpolated curve, end points extrapolated as necessary. Either component can be designated as X or Y, and may be either editable or readonly, the latter characteristic dictating how the gui should deal with that column. The input processor verifies that each of the components has the same number of initial values or explicit size. Generates a macro in asm... bcSP_interpolate(x) Example line bcSP { label = "PD Boost Controller Setpoint Curve" size = 4 ; Becomes bcSP_size in asm code byte X:ctl { ; Becomes bcSP_X? or bcSP_ctl in asm code. editable = true units = "%" value[size] = { ; Control variable bins for boost controller set point. ; Use TPS or RPM or whatever you want to control setpoint, ; I use TP. 0T, ; 0% throttle 35T, ; 35 50T, ; 50 100T ; 100 } } byte Y:value { ; Becomes bcSP_Y? or bcSP_value editable = true units = "kPa" value[size] = { ; Set Point Values corresponding to each ctl var bin. 90T, ; kPa at 0% throttle 100T, ; 35 167T, ; 50 167T ; 100 } } } -- Surface ------------------------------------------------------------------- A surface is a structured type with from one to three components, the R (row) and C (column) coordinate vectors are optional, but the S (surface) data object itself is required. Display as numerical data in a 2-D grid using the hex editor technology, the vectors defining the optional R and C coordinates may either be editable or readonly, as with the line type above. Graphical representation is done using the tuning screen 3-D surface. Example surface ve2 { label = "Bank 2 Volumetric Efficiency Table" rows = 8 ; ve2_rows in asm, ve2_size implicitly defined as rows*cols. cols = 8 byte R:LoadRange { editable = true value[rows] = { 20T, 30T, 40T, 50T, 60T, 75T, 90T, 100T ; kPa values by default. } } byte C:RPMRange { editable = true value[cols] = { 5T, 10T, 15T, 20T, 28T, 36T, 44T, 52T } } byte T:VE { editable = true value[rows, cols] = { { 18T, 18T, 18T, 18T, 18T, 18T, 18T, 18T }, ; LOAD[0] RPM[0-N] { 22T, 25T, 30T, 32T, 35T, 35T, 35T, 35T }, ; LOAD[1] RPM[0-N] { 35T, 35T, 35T, 35T, 35T, 35T, 35T, 35T }, ; ... { 50T, 50T, 50T, 50T, 50T, 50T, 50T, 50T }, { 50T, 50T, 50T, 50T, 50T, 50T, 50T, 50T }, { 50T, 50T, 50T, 50T, 50T, 50T, 50T, 50T }, { 65T, 65T, 65T, 65T, 65T, 65T, 65T, 65T }, { 80T, 80T, 80T, 80T, 80T, 80T, 80T, 90T } } } } --------------------------------------------------------------------------------