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 configureRusefiLuaHooksExt(lua_State*);
8void luaDeInitPins();
9
10struct AirmassModelBase;
12bool getAuxDigital(int index);
13uint32_t getLuaArray(lua_State* l, int paramIndex, uint8_t *data, uint32_t size);
14
15struct LuaOverrideSensor final : public Sensor {
17 m_underlyingType = underlyingType;
18 reset();
19 }
20
21 void reset() {
22 overrideValue = -1;
23 }
24
25 void setOverrideValue(float value) {
26 overrideValue = value;
27 }
28
29 SensorResult get() const final override {
30 if (overrideValue < 0)
32 return overrideValue;
33 }
34
35 void showInfo(const char* sensorName) const override {
36 efiPrintf("LuaOverrideSensor \"%s\": override value %.2f", sensorName, overrideValue);
37 }
38
39 float overrideValue = -1;
41};
42
43void startPwm(int index, float freq, float duty);
44void 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)
void configureRusefiLuaHooksExt(lua_State *)
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:16
void showInfo(const char *sensorName) const override
Definition lua_hooks.h:35
SensorType m_underlyingType
Definition lua_hooks.h:40
SensorResult get() const final override
Definition lua_hooks.h:29
void setOverrideValue(float value)
Definition lua_hooks.h:25
static float duty
composite packet size