rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
rusefi_wideband.h
Go to the documentation of this file.
1// file rusefi_wideband.h
2
3#pragma once
4#include "can.h"
5
6// Return index of CAN bus where WBO(s) live
7size_t getWidebandBus();
8
9// Send info to the wideband controller like battery voltage, heater enable bit, etc.
10void sendWidebandInfo();
11
12// Handles ack and pong responses from the wideband bootloader
13void handleWidebandCan(const size_t busIndex, const CANRxFrame &frame);
14
15// Pings wideband controller, reply includes protocol version and FW build date
16void pingWideband(uint8_t hwIndex);
17
18// Set CAN index to given wideband controller, does not wait for ack, does not block calling thread
19void setWidebandOffsetNoWait(uint8_t hwIndex, uint8_t index);
20
21// Stops sending heating enabled bit for 0.5 sec
22void restartWideband();
23
24// WARNING:
25// Two following functions can block thread execution while waiting for ACK from WBO
26// Do not call from critical tasks!
27// Usually called from bench test task
28// Also do not call from ISR context
29
30// Set the CAN index offset of any (hwIndex = 0xff) or specific (hwIndex != 0xff) wideband controller
31// Addressing by hwIndex is supported by 2025 WBO FW
32void setWidebandOffset(uint8_t hwIndex, uint8_t index);
33
34// Set Sensor type for hwIndex wideband controller
35// Supported by late 2025 WBO FW
36void setWidebandSensorType(uint8_t hwIndex, uint8_t type);
37
38#if EFI_WIDEBAND_FIRMWARE_UPDATE
39// Update the firmware on any (hwIndex = 0xff) or hwIndex defined connected wideband controller
40// Support of hwIndex require WBO bootloader 09.2025+
41void updateWidebandFirmware(uint8_t hwIndex);
42#if EFI_PROD_CODE
43// Same, but loads FW from file
44void updateWidebandFirmwareFromFile(uint8_t hwIndex);
45#endif
46
47#endif //EFI_WIDEBAND_FIRMWARE_UPDATE
void handleWidebandCan(const size_t busIndex, const CANRxFrame &frame)
void updateWidebandFirmwareFromFile(uint8_t hwIndex)
void setWidebandSensorType(uint8_t hwIndex, uint8_t type)
void setWidebandOffsetNoWait(uint8_t hwIndex, uint8_t index)
void pingWideband(uint8_t hwIndex)
void sendWidebandInfo()
void setWidebandOffset(uint8_t hwIndex, uint8_t index)
void restartWideband()
void updateWidebandFirmware(uint8_t hwIndex)
size_t getWidebandBus()