Commit Graph

36 Commits

Author SHA1 Message Date
rusefillc 2f91ae6f73 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
Andrey G 62f441376c
Tle8888 stepper (#1936)
* TLE8888: enable PP mode for OUT21..24 in case of useTLE8888_stepper

* Lada Kalina is a test mule for stepper idle
2020-11-10 14:16:46 -05:00
Andrey G 63c25ab8a7
Tle8888 small update (#1908)
* TLE8888: add support MR switching from SW

Main Relay has limitation - it is always active while KEY=1. When
KEY=0 MR can be switched on from SW.

* TLE8888: support reading of KEY and WAKE inputs

* Rusefi enums: add new TLE8888 pins
2020-11-01 22:19:55 -05:00
Andrey G 8e11675afd
Tle8888 big update 1 (#1892)
* smart gpio: fix tle8888 direct pin mapping for MRE

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888

* TLE8888: cleanup

* TLE8888: do not reset driver private data on WD/undervoltage reset

* TLE8888: diagnostic updates

* TLE8888 driver: BIG driver rework

* TLE8888: check SPI answers for abnormal states

Reply with other than requested register can be a sign of:
-Power-On-Reset, then OpStat0 will be replyed
-WatchDog reset, then FWDStat1 will be replyed
-Invalid communication frame, then Diag0 will be replyed

Keep tracking last accessed register and check with the next reply.

* TLE8888: debug clean-up

* TLE8888: implement spi array write

This reduce CS inactive state time between two consequent accesses
from 8.8 uS to 1.4 uS

* TLE8888: fix PP outputs in OD mode

* TLE8888: cleanup register definitions

* TLE8888: run separate driver thread for each chip instance

Calculating poll interval for few chips become more complex, avoid
this running thread for each device.

* TLE8888: fix cypress and kinetic compilation

Both platforms define its own MAX and cause redifination error if
common.h is included in driver.

* MRE: update mapping.yaml and fix direct pin mapping for TLE8888

* TLE8888: diagnnostic: disable switch off in case of overcurrent

For all output, use current limiting instead

* TLE8888: check for overvoltage on OUT8..OUT13

* TLE8888: add TODO note about how to recover from failure condition

Currently TLE8888 automaticly recovers only from overcurrent and
(may be) overtemperature conditions.
Short to bat cause output disable (bit in OECONFIG is reset) and
needs driver/host intervention.

* TLE8888: save few bytes of RAM

* TLE8888: Lada Kalina is test mule for IDLE stepper on TLE8888

Don't forget to enable PP mode for TLE8888 outputs 21..24:
uncomment line 1087 in tle8888.c

* TLE8888: reorder code, cleanup

* TLE8888: mode all debug/statisctic to per-chip struct

* TLE8888: rework poll interval calculation

* MRE: use TLE8888 pins instead of MCU gpios that drives TLE8888 #2
2020-10-23 12:25:30 -04:00
rusefi 3a11ea7e31 Merge remote-tracking branch 'origin/Hellen_fork_point' into master
# Conflicts:
#	firmware/Makefile
#	firmware/hw_layer/smart_gpio.cpp
2020-09-09 17:19:41 -04:00
rusefi a0aeeb4919 Hellen says merge #1772 smart gpio 2020-09-09 17:16:51 -04:00
dron0gus d0d5cdd4dd
tle8888: on MRE 0.5.0 we can drive ING_EN and INJ_EN from STM (#1407)
Do it!
2020-05-08 17:47:41 -04:00
rusefi ac9ca1343a tle8888 modes corrected 2020-04-23 19:49:22 -04:00
rusefi c52c7e2f1f TLE8888 mode flexibility 2020-04-23 16:57:37 -04:00
rusefi 2f69beee31 a bit of header clean-up 2020-04-06 13:05:30 -04:00
rusefi b83a5310be happy new year 2020-01-08 00:02:40 -05:00
dron0gus 9f0d84f338 Gpio fixes (#1086)
* drivers: gpio: add MC33810 driver (skeleton)

* pin_repository: debug: do not show absent chips
2020-01-07 07:55:50 -05:00
dron0gus 1b42748e60 Spi fixes (#1083)
* spi: add support for SPI4

* mpu_util: spi: add 8BIT mode definitions for F4, F7 and kineris (?)
2020-01-06 08:44:23 -05:00
rusefi af4f20551b getting rid of boardConfiguration / binary compatible change 2019-12-11 17:48:55 -05:00
rusefi 6262a5e84e Hall mode for TLE88888 - VRSConfig1 VRSM #915 2019-09-04 09:24:01 -04:00
rusefi 07cc3cffff Hall mode for TLE88888 - VRSConfig1 VRSM #915 2019-09-04 00:27:19 -04:00
rusefi f393c5e2de low side channels on MRE #900
this kind of makes a bit more sense like this?
2019-08-10 15:53:03 -04:00
rusefi 074c99fab7 low side channels on MRE #900
this should NOT work but it works?

2019-08-10_15_19_19_770: EngineState: injection #1 @ ext:TLE8888.OUT22 led1
2019-08-10_15_19_19_771: EngineState: injection #2 @ PE10 led10
2019-08-10_15_19_19_773: EngineState: injection #3 @ PE12 led5
2019-08-10_15_19_19_774: EngineState: injection #4 @ PE14 led4
2019-08-10_15_19_19_775: EngineState: injection #5 @ ext:TLE8888.OUT24 led7
2019-08-10_15_19_19_775: EngineState: injection #6 @ PE11 led6
2019-08-10_15_19_19_777: EngineState: injection #7 @ PE9 led9
2019-08-10_15_19_19_777: EngineState: injection #8 @ PE8 led8
2019-08-10_15_19_19_779: EngineState: injection #9 @ PE13 led3
2019-08-10_15_19_19_780: EngineState: injection #10 @ ext:TLE8888.OUT23
 led2
2019-08-10 15:23:41 -04:00
rusefi 4ddf0ba5a2 low side channels on MRE #900
getting closer but still issues
2019-08-10 14:53:57 -04:00
rusefi ef79fb15ba low side channels on MRE #900
progress - now all 10 BLINK, but two are blinking together
2019-08-10 13:45:00 -04:00
rusefi 5503de12fb low side channels on MRE #900
progress - at least something is blinking now
2019-08-10 13:25:08 -04:00
dron0gus 04ee37548b Smart gpios fixes 3 (#795)
* pin_repository: provide readable pin names in error cases

* io_pins: remove getBrain_pin_eExt

We have getBrain_pin_eExt in io_pins.cpp and hwPortname in
pin_repository.cpp.
First uses auto-generated enums, second one uses runtime data to
provide name of hw pin.
Removing first saves us about 2K of flash couse big auto-generated
switch with pin names no more used by anyone and gets optimized out.

* gpios: mc33972: CS pin is now requested at smart_gpios.pcc

* getSpiDevice: support SPI4

* smart_gpios.cpp: startSmartCsPins set CSs to inactive state

OutputPin:initPin initializes pin with false value. This is active
state for SPI Chip Selects. Set to 1 to deselect all chips.
2019-05-09 18:09:24 -04:00
andreika-git b80d95578d EFI_CONSOLE_UART_DEVICE, flash->hw_ports, Fix TLE6240 and misc.fixes (#793)
* rename EFI_CONSOLE_UART_DEVICE -> EFI_CONSOLE_SERIAL_DEVICE

* Impl. EFI_CONSOLE_UART_DEVICE

* Move flash source files to ports/stm32/ & hw_ports.mk

* Fix TLE6240

* Fix EFI_NO_CONFIG_WORKING_COPY

* EFI_PRINT_MESSAGES_TO_TERMINAL
2019-05-05 11:06:27 -04:00
dron0gus e9aed8dd7a Smart gpio error path and minor fixes (#772)
* smart_gpio: fix error path

If chip driver disable in FW, disabled in settings or failed to init
we still need to ocupy its gpio range.

* smart_gpio: get tle6240 CS from config

* smart_gpio: fix debug messaging
2019-04-21 10:35:13 -04:00
rusefi f3a6ce0769 USB and TLE8888 not working for F4 or F767 #764 2019-04-20 23:49:26 -04:00
rusefi f62731cc99 USB and TLE8888 not working for F4 or F767 #764 2019-04-20 23:39:06 -04:00
rusefi f54887320e USB not working for F4 or F767 #764 2019-04-19 06:07:40 -04:00
dron0gus 71cc657f10 Smart gpio fixes 2 (#765)
* gpio chips: relax error checking on _add

Do not halt whole system if wrong or nulled config is passed.
In current smart-gpio implementation this can happen and it is not
as error. Let smart-gpio handle this, kust reurn negative.

* tle8888: return back includes needed for debug

* smar-gpio: -Werror=missing-field-initializers fix
2019-04-19 01:42:24 -04:00
dron0gus ec75c47b73 Smart gpios fixes - now without cleanup of smart_gpio.cpp (#758)
* smart_gpio.cpp: check _add return values

And occupy gpiochip's pin range if disabled of failed. So base will
align with enum.

* TLE8888: cleanup, move high level code to smart_gpio.cpp

* smart_gpio.cpp: fix compilation when BOARD_EXT_GPIOCHIPS == 0

* board-subaru: fix compilation after latest smart_gpio updates

* tle8888: now we have all 28 pins supported
2019-04-16 09:23:24 -04:00
andreika-git ffd44bf0fe More config portability: TLE6240, Trigger_input, UART/Serial (#759)
* Add fields to UART/Serial configs

* trigger_input: can be both HAL_USE_PAL and HAL_USE_COMP

* tle6240 config: local temporary solution

* Fix for custom_engine::setFsio

* EFI_ACTIVE_CONFIGURATION_IN_FLASH
2019-04-15 08:40:12 -04:00
andreika-git 21346c0063 Add more portability to smart_gpio & SPI (#754) 2019-04-14 13:35:30 -04:00
rusEfi f8fec2e2fb thank you Dron_gus fot the idea! 2019-04-13 19:55:18 -04:00
dron0gus 76cc822b1e Smart gpios (#752)
* efi_gpio: update cached pin value for ext gpios to

* tle6240: update and fix

* gpiochips_init should be called after all gpio chips are added

or we can lost calls to _init of chips

* smart_gpio.c: fix for tle6240 and mc33972

now config structs are not const. waste of ram...
2019-04-14 01:32:46 +02:00
rusefi fb0bbc075c steps towards smarter gpio 2019-04-13 12:02:34 -04:00
rusefi 00e848c243 steps towards smarter gpio 2019-04-13 11:22:40 -04:00
rusefi db9456902f steps towards smarter gpio 2019-04-13 10:58:52 -04:00