rusefi-1/firmware/controllers/core/fsio_impl.h

51 lines
1.8 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
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2019-12-15 20:33:15 -08:00
#pragma once
2015-07-10 06:01:56 -07:00
#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 useFSIO4ForSeriousEngineWarning
#define MAGIC_OFFSET_FOR_ENGINE_WARNING 4
// see useFSIO5ForCriticalIssueEngineStop
#define MAGIC_OFFSET_FOR_CRITICAL_ENGINE 5
// see useFSIO12ForIdleOffset
#define MAGIC_OFFSET_FOR_IDLE_OFFSET 12
// see useFSIO13ForIdleMinValue
#define MAGIC_OFFSET_FOR_IDLE_MIN_VALUE 13
// see useFSIO15ForIdleRpmAdjustment
#define MAGIC_OFFSET_FOR_IDLE_TARGET_RPM 15
// see useFSIO16ForTimingAdjustment
#define MAGIC_OFFSET_FOR_TIMING_FSIO 16
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
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);