Commit Graph

63 Commits

Author SHA1 Message Date
rusEFI LLC 7cdb78d6fa only: TODO: use a timer instead 2024-04-25 20:32:40 -04:00
rusefillc a5278476a4 only:cleaner guards 2024-03-15 22:26:36 -06:00
Andrey cd74860f37 only: better guards 2024-03-15 18:50:01 -06:00
rusefi 318fc8c358 bench test 33810 module #5745
only:f407-discovery
2023-11-24 11:36:09 -05:00
Andrey ba66fdcf82 reducing code duplication around assert 2023-09-05 21:28:39 -04:00
Matthew Kennedy f7e6ccd9e2 de-pointerize outputMode #49 2023-06-05 10:25:00 -04:00
Matthew Kennedy 61e5b4b1ad change ObdCode to enum class builds firmware 2023-04-29 00:44:00 -04:00
rusefillc d716245edc helping build
only:mre_f4
2023-03-05 09:27:06 -05:00
Andrey 51c5c07432 progress: run more code in simulator
only:hellen-honda-k
2023-03-05 02:42:15 -05:00
Andrey 5854a5fc8b progress: run more code in simulator
only:hellen-honda-k
2023-03-05 02:35:36 -05:00
Andrey 130a1eed14 CAN GPIO #4096
only:hellen-honda-k
2023-03-04 22:11:45 -05:00
rusefillc 0e39ace44d todo? 2023-03-04 20:34:43 -05:00
rusefillc 180ae9b593 L9779WD driver L9779 #3768 2023-03-04 20:32:22 -05:00
Matthew Kennedy 18351dc43b
tle9104 driver (#4410)
* tle9104

* it works!

* cleanup

* cleanup for pr

* efifeatures

* guards
2022-08-02 19:02:03 -04:00
Andrey G ce7fc8e69d
MRE: tle8888 ls2 fix and friends (#4409)
* tle8888: ups IGN1

* tle8888: more BIT() macro

* tle8888: fix typos

* tle8888: fix LS2 output on MRE when stepper is enabled

Default settings casue one (or few) not used direct driver inputs
to be mapped to OUT5 (LS2 on MRE)

* smart_gpio: comments for TLE8888 on MicroRusEFI

* smart_gpio: typo

* tle8888: more comments
2022-08-02 00:50:56 +03:00
Matthew Kennedy e4a0979dc2
Brain pin is enum class (#4108)
* change most usages to Gpio::

* board configs

* engine configs etc

* isBrainPinValid, smart gpio

* generator

* generator

* generator

* connector yamls

* kinetis enums

* cypress txt

* kinetis config

* frankenso

* config generator

* actually do it for the others

* disable skips for pr ci

* fix tle8888

* misc

* weird cast from int

* needs this operator too

* this can be an unsigned subtract

* happy tests

* s

* kinetis isConfigurationChanged weirdness

* missed J/K

* cypress efifeatures

* build script mistake (!)

* mistake in smart gpio

* debounce

* eg33

* kinetis, so needy

* it's pretty green, we can skip these again
2022-04-28 17:32:39 -04:00
Andrey G c53fd0eaf9
L9779: update driver (#3898)
* L9779: update driver

* L9779: missed chip_init

* L9779: signature
2022-02-06 11:39:37 -05:00
Andrey G a50f848857
L9779: initial driver (#3897)
* smart_gpio.cpp: glue to L9779

* L9779: fill with some code

* L9779: missed getDiag

* L9779: no l9779 on subaru-eg33 board
2022-02-06 09:47:18 -05:00
rusefillc d0d8e95bd3 L9779WD driver #3768 2022-01-10 19:15:36 -05:00
Scott Smith 823d9a07e0
Programmatically replace ENGINE() and CONFIG() with engine-> etc (#3565)
git grep -l -w ENGINE | xargs sed -i -r "s/ENGINE\(([]a-zA-Z_0-9.[]+)\)/engine->\1/g"

git grep -l -w CONFIG | xargs sed -i -r "s/([^a-zA-Z_])CONFIG\(([]a-zA-Z_0-9.[]+)\)/\1engineConfiguration->\2/g"
2021-11-17 03:54:21 -05:00
Matthew Kennedy b52d50bbf2
Use pch in lots of files (#3066)
* most engine.h

* most engine_configuration

* more

* more

* more

* more

* more

* moooooore

* ok I'm done for now

* oops
2021-07-26 01:05:17 -04:00
Matthew Kennedy 2ce7777865
don't require EXTERN_ENGINE in every file (#2969)
* move enginePins

* no more extern engine

* uses

* more

* extern config too

* put this where it belongs

* include correct header

* merge
2021-07-16 18:13:33 -04:00
Matthew Kennedy c2cdc382a3
don't expose private state (#2696)
* don't expose private state

* fix tle init
2021-05-14 14:56:45 -04:00
rusefillc 08de271407 hiding 8888 mess under the rug
making LPS25 one step more available to Hellen
2021-05-14 10:54:40 -04:00
Andrey G 8ba38a8a63
Mc33972 update (#2599)
* MC33972: update

-per-instance thread
-enable pull-ups for enabled pins only

* smart-gpio: mc33972: uses 8-bit spi frames

3 bytes are sent to make 24-bit frame
2021-04-28 18:29:35 -04:00
Andrey G 2af32084f4
gpio helper (#2195)
* gpios: isBrainPinValid helper

* LCD HD44780: do not touch pins if DM_NONE or invalid gpio

* Fix isEnabled checks for GPS and Joystick

* LCD HD44780: writePad use this method wider
2021-01-08 20:01:26 -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
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