fome-fw/firmware/controllers/core/fsio_impl.h

44 lines
1.2 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file fsio_impl.h
* @brief FSIO as it's used for GPIO
*
* @date Oct 5, 2014
2015-12-31 13:02:30 -08:00
* @author Andrey Belomutskiy, (c) 2012-2016
2015-07-10 06:01:56 -07:00
*/
#ifndef LE_FUNCTIONS_H_
#define LE_FUNCTIONS_H_
#include "fsio_core.h"
#include "engine.h"
2016-04-04 07:01:43 -07:00
#include "table_helper.h"
typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8> fsio8_Map3D_t;
2015-07-10 06:01:56 -07:00
/**
* In human language that's
* (time_since_boot < 4) OR (rpm > 0)
*/
// todo: the delay should probably be configurable?
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
#define AC_RELAY_LOGIC "ac_on_switch"
#define ALTERNATOR_LOGIC "vbatt 14.5 <"
/**
* In human language that's
* (fan and (coolant > fan_off_setting)) OR (coolant > fan_on_setting)
*/
#define FAN_CONTROL_LOGIC "fan coolant fan_off_setting > & coolant fan_on_setting > OR"
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action);
void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_ENGINE_PARAMETER_S);
void setFsioExt(int index, brain_pin_e pin, const char * exp, int freq DECLARE_ENGINE_PARAMETER_S);
2016-01-12 07:04:06 -08:00
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S);
2015-07-10 06:01:56 -07:00
void runFsio(void);
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F);
#endif /* LE_FUNCTIONS_H_ */