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

47 lines
1.6 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
2017-01-03 03:05:22 -08:00
* @author Andrey Belomutskiy, (c) 2012-2017
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"
2017-01-19 14:04:15 -08:00
#include "system_fsio.h"
2016-04-04 07:01:43 -07:00
// see useFSIO12ForIdleOffset
#define MAGIC_OFFSET_FOR_IDLE_OFFSET 12
// see useFSIO13ForIdleMinValue
#define MAGIC_OFFSET_FOR_IDLE_MIN_VALUE 13
2019-06-10 09:38:32 -07:00
typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8, float, float> fsio8_Map3D_f32t;
typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8, uint8_t, float> fsio8_Map3D_u8t;
2015-07-10 06:01:56 -07:00
#define MAGIC_OFFSET_FOR_ENGINE_WARNING 4
#define MAGIC_OFFSET_FOR_CRITICAL_ENGINE 5
2015-07-10 06:01:56 -07:00
2017-06-04 12:25:37 -07:00
float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX);
2019-08-14 22:59:15 -07:00
/**
* set_fsio_output_pin 7 PE3
* set_rpn_expression 1 "rpm 0 fsio_setting <"
*/
void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_CONFIG_PARAMETER_SUFFIX);
void setFsioExt(int index, brain_pin_e pin, const char * exp, int pwmFrequency DECLARE_CONFIG_PARAMETER_SUFFIX);
2015-07-10 06:01:56 -07:00
2017-05-15 20:33:22 -07:00
void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
2017-12-16 21:03:26 -08:00
void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE);
2019-09-18 18:48:46 -07:00
void setFsioExpression(const char *indexStr, const char *quotedLine DECLARE_ENGINE_PARAMETER_SUFFIX);
2017-12-16 21:03:26 -08:00
float getFsioOutputValue(int index DECLARE_ENGINE_PARAMETER_SUFFIX);
2017-05-15 20:33:22 -07:00
void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX);
void runHardcodedFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE);
2015-07-10 06:01:56 -07:00
2019-07-12 05:31:38 -07:00
ValueProvider3D *getFSIOTable(int index);
2015-07-10 06:01:56 -07:00
#endif /* LE_FUNCTIONS_H_ */