GDI progress
This commit is contained in:
parent
4fd37e808b
commit
8fb88197dd
|
@ -0,0 +1,60 @@
|
|||
-- communication with https://github.com/rusefi/rusefi-hardware/tree/main/GDI-4ch/firmware
|
||||
|
||||
GDI4_BASE_ADDRESS = 0xF0
|
||||
|
||||
hexstr = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "A", "B", "C", "D", "E", "F" }
|
||||
|
||||
function toHexString(num)
|
||||
if num == 0 then
|
||||
return '0'
|
||||
end
|
||||
|
||||
local result = ""
|
||||
while num > 0 do
|
||||
local n = num % 16
|
||||
result = hexstr[n + 1] ..result
|
||||
num = math.floor(num / 16)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
function arrayToString(arr)
|
||||
local str = ""
|
||||
local index = 1
|
||||
while arr[index] ~= nil do
|
||||
str = str.." "..toHexString(arr[index])
|
||||
index = index + 1
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
function printPacket(bus, id, dlc, data)
|
||||
print('Received ' ..arrayToString(data))
|
||||
end
|
||||
|
||||
function getTwoBytesLSB(data, offset, factor)
|
||||
return (data[offset + 2] * 256 + data[offset + 1]) * factor
|
||||
end
|
||||
|
||||
|
||||
function onCanConfiguration(bus, id, dlc, data)
|
||||
print('Received configuration ' ..arrayToString(data))
|
||||
print ("BoostVoltage " ..getTwoBytesLSB(data, 0, 0.01) )
|
||||
print ("BoostCurrent " ..getTwoBytesLSB(data, 2, 0.01) )
|
||||
print ("PeakCurrent " ..getTwoBytesLSB(data, 4, 0.01) )
|
||||
print ("HoldCurrent " ..getTwoBytesLSB(data, 6, 0.01) )
|
||||
end
|
||||
|
||||
canRxAdd(GDI4_BASE_ADDRESS, printPacket)
|
||||
canRxAdd(GDI4_BASE_ADDRESS + 1, onCanConfiguration)
|
||||
canRxAdd(GDI4_BASE_ADDRESS + 2, printPacket)
|
||||
|
||||
local data_0x1ae0092c = { 0x00, 0x00, 0x22, 0xe0, 0x41, 0x90, 0x00, 0x00 }
|
||||
|
||||
function onTick()
|
||||
|
||||
txCan(1, 0x200, 1, data_0x1ae0092c)
|
||||
|
||||
end
|
||||
|
||||
|
|
@ -795,7 +795,7 @@ pin_output_mode_e hip9011IntHoldPinMode;
|
|||
! 536870911 = 2^29-1, the maximum valid extended ID
|
||||
uint32_t verboseCanBaseAddress;;"", 1, 0, 0, 536870911, 0
|
||||
|
||||
uint8_t mc33_hvolt;;"v", 1, 0, 40, 70, 0
|
||||
uint8_t mc33_hvolt;Boost Voltage;"v", 1, 0, 40, 70, 0
|
||||
uint8_t minimumBoostClosedLoopMap;Minimum MAP before closed loop boost is enabled. Use to prevent misbehavior upon entering boost.;"kPa", 1, 0, 0, 255, 0
|
||||
|
||||
output_pin_e acFanPin;Optional Radiator Fan used with A/C
|
||||
|
@ -1424,12 +1424,12 @@ tChargeMode_e tChargeMode;
|
|||
|
||||
gppwm_channel[GPPWM_CHANNELS iterate] gppwm;
|
||||
|
||||
uint16_t mc33_i_boost;;"mA", 1, 0, 1000, 25000, 0
|
||||
uint16_t mc33_i_peak;;"mA", 1, 0, 1000, 20000, 0
|
||||
uint16_t mc33_i_hold;;"mA", 1, 0, 1000, 20000, 0
|
||||
uint16_t mc33_i_boost;Boost Current;"mA", 1, 0, 1000, 25000, 0
|
||||
uint16_t mc33_i_peak;Peak Current;"mA", 1, 0, 1000, 20000, 0
|
||||
uint16_t mc33_i_hold;Hold Current;"mA", 1, 0, 1000, 20000, 0
|
||||
uint16_t mc33_t_max_boost;Maximum allowed boost phase time. If the injector current doesn't reach the threshold before this time elapses, it is assumed that the injector is missing or has failed open circuit.;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_peak_off;;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_peak_tot;;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_peak_tot;Peak phase duration;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_bypass;;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_hold_off;;"us", 1, 0, 0, 10000, 0
|
||||
uint16_t mc33_t_hold_tot;;"us", 1, 0, 0, 10000, 0
|
||||
|
|
Loading…
Reference in New Issue