Commit Graph

35 Commits

Author SHA1 Message Date
Matthew Kennedy 5865f65e1e
remove getDebugChannels (#3850) 2022-01-27 19:21:05 -05:00
Matthew Kennedy a54a5e7f90
convert gpiochips to c++ (#2761)
* core

* basic header

* tests are happy

* tle6240

* tle8888

* 33972

* 33810

* tle8888_req_init

* unused warning

* warning

* unsigned

* 8888 debug

* fix

* don't qualify

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-06-10 04:11:01 -04:00
Matthew Kennedy 0ea1f15ca3
compile gpiochips as cpp (#2702)
* rename

* core

* structing

* more

* makefile

* structing

* 6240 compiles

* explicit cast instead of implicit narrowing

* 8888

* no extern C

* fix tests build

* extern "C"

* 33810

* 8860

* 33810

* linker

* unbreak master

* don't need that if compiling as C++

* bump config

* fix test

* tests

* unit tests bad merge

* build

* move subaru logic to cpp file

* cpp goodness

* hpp include

* this is probably the right thing to do

* simulator
2021-05-17 08:42:56 +03:00
rusefillc ac6c8a6c9f let's build for h7 2021-02-05 21:37:33 -05:00
Andrey G f96ae7525f
Gpio cleanup #2 (#1530)
* pin repository: PIN_USED size in now equal to brain_pin_e enum size

expect special values...

* smart gpios: register gpio chip to given base (no auto-allocation)

* drivers: gpio: core: add gpiochip_unregister()

* drivers: gpio: MC33810 intergation

* smart_gpio.cpp: cleanup ifdef mess, minor cleanups

* gpio: core: additional check for gpio ranges overlaps

* unit test: gpio chip: fixed and extended
2021-01-06 18:29:47 -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
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 07e6e2c4ad steps towards tle8888 2020-05-06 19:20:12 -04:00
rusefi c52c7e2f1f TLE8888 mode flexibility 2020-04-23 16:57:37 -04:00
rusefi efc8d69085 and fixing build now! 2020-02-12 17:23:22 -05:00
rusefi 6c843e6954 tle8888 refactoring already - extracting method 2020-02-12 17:19:58 -05:00
rusEfi 6b874c12c0 TLE8888 watchdog #917
still no luck. responses 0x85c and 0xa5c
2020-02-11 00:54:15 -05:00
rusEfi 0b8c1e69dc TLE8888 watchdog #917 2020-02-10 14:37:52 -05:00
rusEfi 59eb424ba0 TLE8888 watchdog #917
window watchdog progress
2020-02-10 13:24:09 -05:00
rusefi b3bc3325b9 TLE8888 watchdog #917
first steps
2020-02-10 11:11:00 -05:00
rusefi cb8612a15c code style 2020-02-10 09:29:11 -05:00
rusefi b83a5310be happy new year 2020-01-08 00:02:40 -05:00
Matthew Kennedy 9645130527 Shrink output channels, now with passing CI (#1077)
* reorder fields

* temporary tle8888 fix

* comment, simplify

* hand tweak generated

* oops, those are reciprocal

* fix engineLoadAccelExtra

* aggressive priority order

* fix output size

* comments

* reorder fields, no sizes yet

* should've been signed

* simplify constructor mess, hook up scaling

* notes

* typo

* if -> switch

* rev signature

* correct map offset

* handle unsigned properly

* RPM is unsigned

* vss isn't scaled

* extract magic

* required generated for build

* de-scale rpm

* field type cases
2019-12-22 08:12:45 -05:00
rusefi 871f86967f Revert "DRAFT Shrink output channels, again (#1074)"
This reverts commit 562ce6cc
2019-12-21 15:02:49 -05:00
Matthew Kennedy 562ce6ccaf DRAFT Shrink output channels, again (#1074)
* reorder fields

* temporary tle8888 fix

* comment, simplify

* hand tweak generated

* oops, those are reciprocal

* fix engineLoadAccelExtra

* aggressive priority order

* fix output size

* comments

* reorder fields, no sizes yet

* should've been signed

* simplify constructor mess, hook up scaling

* notes

* typo

* if -> switch
2019-12-21 08:55:19 -05:00
rusefi 22f2739764 Revert "Shrink output channels, use scaling (#1069)"
This reverts commit 89405014
2019-12-19 22:35:06 -05:00
Matthew Kennedy 89405014cf Shrink output channels, use scaling (#1069)
* reorder fields

* temporary tle8888 fix

* comment, simplify

* hand tweak generated

* oops, those are reciprocal

* fix engineLoadAccelExtra

* aggressive priority order
2019-12-19 20:37:42 -05:00
andreika-git ee5ee1942c Kinetis & TLE8888 compatibility & fixes... (#991)
* TLE8888: More compatibility & postTunerStudioState

* activeConfiguration & EFI_ACTIVE_CONFIGURATION_IN_FLASH fix

* Kinetis: jump_to_bootloader() impl.

* Kinetis: UART baudrate safety check

* Kinetis: OMG!..
2019-10-31 16:06:34 -04:00
rusefi 5d8e1f6c73 tle8888 reinit command 2019-09-05 10:30:27 -04:00
rusefi 07cc3cffff Hall mode for TLE88888 - VRSConfig1 VRSM #915 2019-09-04 00:27:19 -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
rusefi f8afa29a0f we need TLE8888 driver #714 2019-04-14 08:20:25 -04:00
rusEfi 265b70433e reducing risks 2019-04-13 18:26:29 -04:00
rusefi db9456902f steps towards smarter gpio 2019-04-13 10:58:52 -04:00
dron0gus 6d1ca92dac gpio-chips: TLE8888 add initial support of spi-driven outputs (#750) 2019-04-13 01:22:16 +02:00
rusefi 334af50f3f we need TLE8888 driver #714 2019-04-04 19:56:03 -04:00
dron0gus bb0fcf3f87 TLE8888: initial support (#733) 2019-04-04 15:55:18 +02:00
rusefi c9b022d562 we need TLE8888 driver #714 2019-03-25 15:08:32 -04:00