2014-10-05 11:03:00 -07:00
|
|
|
/**
|
2014-12-27 13:03:38 -08:00
|
|
|
* @file fsio_impl.h
|
|
|
|
* @brief FSIO as it's used for GPIO
|
2014-10-05 11:03:00 -07:00
|
|
|
*
|
|
|
|
* @date Oct 5, 2014
|
2015-01-12 15:04:10 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2015
|
2014-10-05 11:03:00 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LE_FUNCTIONS_H_
|
|
|
|
#define LE_FUNCTIONS_H_
|
|
|
|
|
2014-12-27 13:03:38 -08:00
|
|
|
#include "fsio_core.h"
|
2014-10-05 11:03:00 -07:00
|
|
|
#include "engine.h"
|
|
|
|
|
2014-11-06 10:04:30 -08:00
|
|
|
/**
|
|
|
|
* In human language that's
|
|
|
|
* (time_since_boot < 4) OR (rpm > 0)
|
|
|
|
*/
|
2014-10-13 09:03:10 -07:00
|
|
|
// todo: the delay should probably be configurable?
|
2014-10-09 00:02:51 -07:00
|
|
|
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
|
|
|
|
|
2014-11-29 08:03:49 -08:00
|
|
|
#define AC_RELAY_LOGIC "ac_on_switch"
|
|
|
|
|
2014-11-30 08:04:02 -08:00
|
|
|
#define ALTERNATOR_LOGIC "vbatt 14.5 <"
|
|
|
|
|
2014-11-06 10:04:30 -08:00
|
|
|
/**
|
|
|
|
* In human language that's
|
|
|
|
* (fan and (coolant > fan_off_setting)) OR (coolant > fan_on_setting)
|
|
|
|
*/
|
2014-12-04 10:03:13 -08:00
|
|
|
#define FAN_CONTROL_LOGIC "fan coolant fan_off_setting > & coolant fan_on_setting > OR"
|
2014-11-06 10:04:30 -08:00
|
|
|
|
2014-12-05 19:04:09 -08:00
|
|
|
float getLEValue(Engine *engine, calc_stack_t *s, le_action_e action);
|
2014-12-06 08:03:50 -08:00
|
|
|
void setFsio(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp);
|
2014-12-07 15:03:08 -08:00
|
|
|
void setFsioExt(engine_configuration_s *engineConfiguration, int index, brain_pin_e pin, const char * exp, int freq);
|
2014-10-05 11:03:00 -07:00
|
|
|
|
2015-01-14 17:06:02 -08:00
|
|
|
void initFsioImpl(Logging *sharedLogger, Engine *engine);
|
2014-12-27 13:03:38 -08:00
|
|
|
void runFsio(void);
|
|
|
|
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_F);
|
|
|
|
|
2014-10-05 11:03:00 -07:00
|
|
|
#endif /* LE_FUNCTIONS_H_ */
|