rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
lua_hooks.h
Go to the documentation of this file.
1// file lua_hooks.h
2
3#pragma once
4
5struct lua_State;
6void configureRusefiLuaHooks(lua_State*);
7void luaDeInitPins();
8
11bool getAuxDigital(int index);
12uint32_t getLuaArray(lua_State* l, int paramIndex, uint8_t *data, uint32_t size);
13
14struct LuaOverrideSensor final : public Sensor {
16 m_underlyingType = underlyingType;
17 reset();
18 }
19
20 void reset() {
21 overrideValue = -1;
22 }
23
24 void setOverrideValue(float value) {
25 overrideValue = value;
26 }
27
28 SensorResult get() const final override {
29 if (overrideValue < 0)
31 return overrideValue;
32 }
33
34 void showInfo(const char* sensorName) const override {
35 efiPrintf("LuaOverrideSensor \"%s\": override value %.2f", sensorName, overrideValue);
36 }
37
38 float overrideValue = -1;
40};
41
42void startPwm(int index, float freq, float duty);
43void setPwmDuty(int index, float duty);
virtual SensorResult get() const =0
SensorType type() const
Definition sensor.h:162
void startPwm(int index, float freq, float duty)
void configureRusefiLuaHooks(lua_State *)
void setPwmDuty(int index, float duty)
uint32_t getLuaArray(lua_State *l, int paramIndex, uint8_t *data, uint32_t size)
bool getAuxDigital(int index)
AirmassModelBase & getLuaAirmassModel()
void luaDeInitPins()
expected< float > SensorResult
Definition sensor.h:46
SensorType
Definition sensor_type.h:18
LuaOverrideSensor(SensorType type, SensorType underlyingType)
Definition lua_hooks.h:15
void showInfo(const char *sensorName) const override
Definition lua_hooks.h:34
SensorType m_underlyingType
Definition lua_hooks.h:39
SensorResult get() const final override
Definition lua_hooks.h:28
void setOverrideValue(float value)
Definition lua_hooks.h:24
static float duty
composite packet size