This commit is contained in:
rusEfi 2019-08-15 01:59:15 -04:00
parent 36fd4e4b5d
commit 1a1fe77ff8
5 changed files with 33 additions and 6 deletions

View File

@ -91,6 +91,20 @@ static void setupEtb() {
// DIR pin
boardConfiguration->etb1.directionPin1 = GPIOA_8;
// set_fsio_output_pin 7 PC8
#if EFI_FSIO
// set_rpn_expression 7 "1"
// disable ETB by default
setFsio(7, GPIOC_8, "1" PASS_CONFIG_PARAMETER_SUFFIX);
// enable ETB
// set_rpn_expression 7 "0"
//setFsio(7, GPIOC_8, "0" PASS_CONFIG_PARAMETER_SUFFIX);
#endif /* EFI_FSIO */
// EFI_ADC_7: "31 - AN volt 3"
// engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_7;
// Unused
boardConfiguration->etb1.controlPin2 = GPIO_UNASSIGNED;
boardConfiguration->etb1.directionPin2 = GPIO_UNASSIGNED;
@ -110,15 +124,15 @@ static void setupDefaultSensorInputs() {
// Direct hall-only cam input
engineConfiguration->camInputs[0] = GPIOA_5;
// tps
// tps = "20 - AN volt 5"
engineConfiguration->tps1_1AdcChannel = EFI_ADC_13;
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
// clt = AN temp 1
// clt = "18 - AN temp 1"
engineConfiguration->clt.adcChannel = EFI_ADC_0;
engineConfiguration->clt.config.bias_resistor = 2700;
// iat = AN temp 2
// iat = "23 - AN temp 2"
engineConfiguration->iat.adcChannel = EFI_ADC_1;
engineConfiguration->iat.config.bias_resistor = 2700;
}

View File

@ -372,7 +372,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
#if EFI_FSIO
setFsio(12, GPIOF_12, "0" PASS_CONFIG_PARAMETER_SUFFIX);
setFsio(14, GPIOF_13, "1" PASS_CONFIG_PARAMETER_SUFFIX);
#endif
#endif /* EFI_FSIO */
CONFIGB(etb1.directionPin1) = GPIOF_15;
CONFIGB(etb1.directionPin2) = GPIOF_14;
#endif /* STM32_HAS_GPIOF */

View File

@ -697,9 +697,7 @@ void initFsioImpl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
addConsoleActionSS("set_fsio_pid_output_pin", (VoidCharPtrCharPtr) setFsioPidOutputPin);
addConsoleActionSS("set_fsio_output_pin", (VoidCharPtrCharPtr) setFsioOutputPin);
#if EFI_PROD_CODE
addConsoleActionII("set_fsio_output_frequency", (VoidIntInt) setFsioFrequency);
#endif
addConsoleActionSS("set_fsio_digital_input_pin", (VoidCharPtrCharPtr) setFsioDigitalInputPin);
addConsoleActionSS("set_fsio_analog_input_pin", (VoidCharPtrCharPtr) setFsioAnalogInputPin);

View File

@ -21,6 +21,10 @@ typedef Map3D<FSIO_TABLE_8, FSIO_TABLE_8, uint8_t, float> fsio8_Map3D_u8t;
#define MAGIC_OFFSET_FOR_CRITICAL_ENGINE 5
float getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX);
/**
* 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);

View File

@ -40,7 +40,18 @@ class TwoPinDcMotor : public DcMotor
public:
enum class ControlType
{
/**
* For example TLE7209 - two control wires:
* PWM on both wires - one to open, another to close
*/
PwmDirectionPins,
/**
* For example VNH2SP30 - three control wires:
* PWM on 'enable' PIN, two binary pins for direction
*
* TLE9201 with two wire control also uses this mode
* PWM on one pin, open/close using one binary direction pin, second direction pin unused
*/
PwmEnablePin,
};