Commit Graph

391 Commits

Author SHA1 Message Date
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
shadowm60 61446a6170
Handle can message cyclicity (#2573)
* Handle can message cyclicity

update of canDash to support different cyclicity of messages

* review updates
2021-04-23 20:16:27 -04:00
Matthew Kennedy bd1c84fa62
Logging remove 3 (#2568)
* ts logger

* sensors

* wideband too

* missed one

* init

* motors, pid, etc

* vvt

* more

* idle

* missed one

* dynoview

* launch

* can

* console IO

* s

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-20 14:09:41 -04:00
Matthew Kennedy bbb6b6dd14
remove simple cases of LoggingWithStorage (#2569)
* remove simple cases

* more simple

* serial

* s

* more

* try memory

* easy

* mmc acc

* that's how much memory

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-04-19 08:11:59 -04:00
Matthew Kennedy 40c4238f13
enable CAN on H7 (#2393)
* enable

* guard correctly

* h7 bit timing

* allow longer frames

* allow data smaller than maximum

* mcu temperature

* typo

* tx message

* testing

* check for CAN or FDCAN

* don't need that any more

* h7 bitrate config

* undo testing

* h7-ify msg tx

* comment

* break out SID/EID macros

* guard differently

* update ChibiOS

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-03-09 18:54:01 -05:00
Matthew Kennedy 3d17e62d65
finish off vbatt -> sensor model (#2433)
* more vbatt

* s

* goodbye voltage

* makefile

* apparently that part was in use

* include

* mocking
2021-03-07 20:18:32 -05:00
Matthew Kennedy b1873b3d8b
set all thread priorities in the same place (#2412)
* unify thread priority

* header

* mmc
2021-02-28 07:30:45 -05:00
Matthew Kennedy d933d18e29
use spiPolledExchange for small transfers (#2358)
* configure for no cache

* this doesn't need a setting

* now we don't need invalidate

* reorder and comment

* mmc

* sw knock

* use spiPolledExchange for small transfers

* mock spi

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2021-02-17 14:48:21 -05:00
Andrey G 3166076839
Some fixes prior to board pull request (#2291)
* ChibiOS: add support for STM32F765

This chip is used on Subaru EG33 p'n'p RusEFI board from Dron_Gus

* drivers: gpio: mc33810: commulative update

- use BIT macro
- fix wake-up method
- fix order of arguments in _add function

* port: stm32f4/7: detectCanDevice check for enabled interfaces only

* ADC: fix internal array size

internalAdcIndexByHardwareIndex should be EFI_ADC_LAST_CHANNEL size
couse adc_channel_e is used as index

* status LEDs: support status LEDs that driven by low level
2021-02-06 12:22:57 -05:00
rusefillc 7c231d968f H7 compilation #2284 2021-02-05 23:57:28 -05:00
rusefillc ac6c8a6c9f let's build for h7 2021-02-05 21:37:33 -05:00
Andrey G baea67eccf
Simplify Makefile, unify board.mk files (#2229)
* Proper way to add lis302 driver

* Proper way to add license directory to includes

* Makefile: simplify

All ChibiOS stuff is accumulated in ALLCSRC, ALLINC and so on.

* board.mk: append sources and includes to ALLSRC, ALLCPPSRC, ALLINC

* Cypress: fix CANv2 includence into build
2021-01-17 09:32:06 -05: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
Andrey G cd546cf932
TLE8888: temp fix of #2065 (#2079) 2020-12-14 15:33:27 -05:00
Matthew Kennedy 360a8c7524
add support for ext ids (#2060)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-12-12 16:34:21 -05:00
rusefillc 96c29840ce basic hw in the loop - pwm self validation #2028 2020-12-07 20:42:47 -05:00
Andrey G 7c6974ab43
Fixes after clenup (#2019)
* We still need consoleEventListener for boards with EFI_CONSOLE_SERIAL_DEVICE

* MC33810: add MC_ prefix for command defines

As CMD_PWM define is now used by console command
2020-12-05 11:54:09 -05:00
rusefillc 2f91ae6f73 Starter is engaged on start-up in pull-up configuration #1969 2020-11-26 10:55:39 -05:00
Matthew Kennedy f3b7a1d9da
Remove lockAnyContext, replace with CriticalSectionLocker (#1938)
* switch to CriticalSectionLocker

* that's just about all

* clean up last usage

* include hpp for sim

* need the cpp wrappers in the makefile too

* include dir

* include
2020-11-19 06:56:02 -05:00
Andrey G f48621e4c2
TLE8888: disable diagnostic for OUTPUT8..13 (#1956)
Enabled pull-down affects analog inputs that shares same pins.
Disable it.
DOTO: enable diagnostic if ouput requested through tle8888_setPadMode
2020-11-17 18:33:37 -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 02573713f3 Hellen says drivers 2020-09-07 12:00:16 -04:00
rusefi 7d0c8b4870 microRusEFI used as Body Control Module BCM BCU
got stack too low warning with DBG_CAN
2020-09-06 21:45:17 -04:00
rusefi 1f6b820a96 microRusEFI used as Body Control Module BCM BCU 2020-09-06 21:30:14 -04:00
rusefi 39d09bc976 microRusEFI used as Body Control Module BCM BCU 2020-09-06 20:21:01 -04:00
rusefi e3b41c2387 dead code 2020-08-31 20:52:25 -04:00
rusefi 94daeb7922 OBD CAN sensors #1733 2020-08-29 14:36:23 -04:00
Matthew Kennedy 727f6e78ba explicit 2020-07-29 02:49:31 -07:00
kon 03f4efa0b2
BMW E90 Kombi (#1494)
* second can bus, first steps

* added most important messages; no more errors

* cleaned up can messages

* second can bus, first steps

* added most important messages; no more errors

* cleaned up can messages

* post rebase/merge fixes

* more rebase/merge fixes

* even more rebase/merge fixes

* more fixes, removed auto-gen files

* removed more auto-gen files...
2020-06-14 16:59:43 -04:00
rusefi a4329169e9 better file name 2020-05-25 13:02:05 -04:00
rusefi fc28692258 more readable error message thank you Matt! 2020-05-23 17:20:46 -04:00
rusefi 44b5e38d3a "TLE8888 SR Unexpected response" does not work as intended fix #1466 2020-05-22 22:56:19 -04:00
rusefi a0a1a9f9bb "TLE8888 SR Unexpected response" does not work as intended #1466 2020-05-22 08:23:49 -04:00
rusefi c95a4c552b more info into error message 2020-05-22 01:05:07 -04:00
dron0gus 7500e44c8c
tle6240: fix crash in driver wake routine (#1435) 2020-05-15 15:54:41 -04:00
rusefi 4e5a69891d new LED logic: constant WARNING if VBATT is below 7v 2020-05-13 01:52:27 -04:00
rusefi 257ed04fac new LED logic: constant WARNING if VBATT is below 7v 2020-05-13 01:17:48 -04:00
rusefi 52ad619b15 I think it's OK to crash very visibly if no proper SPI response 2020-05-13 01:07:11 -04:00
dron0gus e10259de99
either newline at end of mk file either no backslash on last line (#1425)
This fixes following build issue under linux:
make: *** No rule to make target 'build/obj/.cpp cj125.cpp', needed by 'build/obj/ build/obj/cj125.o'.  Stop.
make: *** Waiting for unfinished jobs....

Introduces in 8d35c35035
2020-05-12 09:55:43 -04:00
kon 8d35c35035
Aux serial (#1422)
* aux serial updates from last PR

* trying to guess

* wow that's old! also not working maybe?

* hiding diag code which was messing with GP2/GP3 i.e. TLE8888_PIN_22 TLE8888_PIN_23

* date

* Mc33 undervolt (#1421)

* mc33 flash check

* DI sanity checks for setting HV config

* mc33 under voltage check

* mc33 under voltage check

Co-authored-by: Christopher W. Anderson <gitstuff@pswitch.com>

* fixed {}

Co-authored-by: rusefi <rusefillc@gmail.com>
Co-authored-by: NOx-z <50815960+NOx-z@users.noreply.github.com>
Co-authored-by: Christopher W. Anderson <gitstuff@pswitch.com>
Co-authored-by: kon <dev@triggerdevel>
2020-05-11 12:17:42 -04:00
rusefi 75781f1262 hiding diag code which was messing with GP2/GP3 i.e. TLE8888_PIN_22 TLE8888_PIN_23 2020-05-11 00:53:50 -04:00
rusefi 633afc10c8 trying to guess 2020-05-09 20:45:20 -04:00
rusefi 19a1ad05b1 tle8888 restoration 2020-05-09 16:59:54 -04:00
rusefi b88b1e4aa5 mre 050 compromise 2020-05-09 09:40:00 -04:00
rusefi 8c3485a8dc Revert "Tle8888 for mre 050 (#1408)"
This reverts commit ba1a606d
2020-05-08 23:58:34 -04:00
dron0gus ba1a606d9a
Tle8888 for mre 050 (#1408)
* tle8888: fix tle8888_chip_init flow

* tle8888: set correct pin modes for mcu gpios in tle8888_chip_init

Direct drive, reset, inj_en and ign_en gpio should be outputs
2020-05-08 19:05: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
dron0gus 98bca0cb23
Tle8888 stage 1 (#1404)
* TLE8888: implement diagnostic

* TLE8888: add support for PP mode on OUT21..24

* tle8888: use helpers to extract register value from 16bit reply
2020-05-07 09:49:57 -04:00
dron0gus 5987fb8b88
[SAFE] Debug cleanups (#1403)
* electronic throttle: inprove debug

* idle thread: show debug info for configured idle driver

* gpio-chips: make private functions static
2020-05-06 20:06:50 -04:00
rusefi 07e6e2c4ad steps towards tle8888 2020-05-06 19:20:12 -04:00
rusefi 0c5e41a36d fix master #1375 2020-04-28 08:10:36 -04:00
Matthew Kennedy cb668e5234
fix master (#1375)
* fix

* put back how it was

* missed a spot
2020-04-28 08:08:41 -04:00
Matthew Kennedy 83cca6ec7a
allow overriding configuration (#1341)
* config overrides

* proteus too

* comment

* remove wno-error

* comment
2020-04-26 00:07:59 -04:00
rusefi c52c7e2f1f TLE8888 mode flexibility 2020-04-23 16:57:37 -04:00
shadowm60 fe3030bb23
Vss over Can implementation proposal (#1340)
* Vss over Can implementation proposal

Working for BMW e46

* fixed Firmware CI?

* kinetis fix.

* minor fixes
2020-04-21 20:48:37 -04:00
Matthew Kennedy 89736f85f7
allow different dlc (#1294)
Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-04-13 17:05:52 -04:00
rusefi d3745c0f9e smart gpio clean-up 2020-04-06 14:13:29 -04:00
rusefi 2efa22f926 code style 2020-04-06 12:34:21 -04:00
rusEfi ba9424f538 clean-up by Dron0Gus 2020-04-06 11:55:44 -04:00
Matthew Kennedy a193ae3e42 switch (#1250) 2020-04-02 16:26:06 -04:00
rusefi a47dce4025 code style 2020-04-01 21:32:21 -04:00
Matthew Kennedy 15c40ffb5b
Sensor-via-CAN (#1241)
* CAN sensor impl

* subscription hookup

* printing

* init

* inject stamp

* don't init const field

* clarify

* guard for non-CAN builds

* fix merge

* guard with EFI_CANBUS_SLAVE

* headers, guards

* include

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-31 23:21:05 -04:00
rusEfi 96828ae017 CAN progress 2020-03-31 20:57:52 -04:00
rusefi 81211219f2 CAN progress 2020-03-31 16:49:19 -04:00
Matthew Kennedy 8fd9842310
cleanup extern mess (#1237)
* cleanup

* move outside define
2020-03-29 19:06:03 -04:00
Matthew Kennedy 7b44f618e7
custom verbose can format (#1200)
* config

* ts

* default cfg

* hand generate

* tx struct helper

* add data sending

* wire up

* value_or helper

* add file

* more sensors

* header

* compactify

* add status frame

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-19 17:58:46 -04:00
Matthew Kennedy 30cdeb0d7f
split out can tx logic (#1197)
* move to can folder

* split out can rx

* only print in debug mode

* guard on feature flag

* split out tx

* headers

* headers

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-19 14:01:07 -04:00
Matthew Kennedy aeee5a1391
split out can rx logic (#1196)
* move to can folder

* split out can rx

* only print in debug mode

* guard on feature flag

* headers

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-19 08:43:37 -04:00
Matthew Kennedy 194bf2e0bf
Add new CanTxMessage class, consume in OBD2 (#1186)
* relocate

* include path

* simulator makefile

* fix mre while we're at it

* it would help if I fixed it right

* add can_msg

* convert obd2

* guard properly

* better include order

* docs & headers

* inject CAN device

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
2020-03-18 22:07:41 -04:00
Matthew Kennedy 5fc82e21f8
Move can_hw.cpp in to drivers folder (#1184)
* relocate

* include path

* simulator makefile

* fix mre while we're at it

* it would help if I fixed it right
2020-03-13 09:50:43 -04:00
rusEfi 8c38bd5ad1 verboseTLE8888 2020-02-27 02:11:20 -05:00
rusefi 333a7a6608 TLE8888 watchdog #917 2020-02-12 19:32:40 -05:00
rusefi deb73f505b #917 progress 2020-02-12 17:37:45 -05: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
dron0gus 3b61334714
tle8888: disable diagnostic for outputs (#1144)
DS is not clear, may be tle8888 clears OE bit in case of error on
output.
2020-02-12 08:53:35 -05:00
rusEfi 74ead04e84 tle8888 dump at init 2020-02-12 08:34:26 -05:00
rusEfi 86b3332cfe have nothing else to do :( 2020-02-12 08:24:24 -05:00
rusEfi 4dbff5ff30 tle8888 output fix 2020-02-12 08:15:55 -05:00
rusEfi 2eec13007e FATAL error running MRE blinking test #1137
typo
2020-02-11 17:52:01 -05:00
rusEfi 1e010c8e82 Merge branch 'master' of https://github.com/rusefi/rusefi 2020-02-11 17:49:49 -05:00
rusEfi 8c1536dd0e FATAL error running MRE blinking test #1137
still not the fix?
2020-02-11 17:49:39 -05:00
dron0gus 82e33e45af
Tle8888 wd (#1143)
* tle8888: watchdog: debug over TS: remove tailing register address

* tle8888: ann console command to dump all regs
2020-02-11 17:49:14 -05:00
dron0gus 678c3525b8
tle8888: watchdog: debug using TS (#1142) 2020-02-11 16:56:52 -05:00
dron0gus 95ce978c23
tle8888: watchdog: use FWDRespSyncCmd for last response (#1140) 2020-02-11 15:49:17 -05:00
dron0gus 7bd68beae9
tle8888: watchdog: do not overwrite defaults, response table fix (#1139) 2020-02-11 15:36:53 -05:00
rusEfi 6b874c12c0 TLE8888 watchdog #917
still no luck. responses 0x85c and 0xa5c
2020-02-11 00:54:15 -05:00
rusEfi cd9c291e3e WdDiag 2020-02-10 21:28:55 -05:00
rusEfi 41253b88b8 TLE8888 watchdog #917
time to start working?!
2020-02-10 18:32:32 -05:00
rusEfi a29d6fc241 TLE8888 watchdog #917
maybe better start-up sequence
2020-02-10 17:08:37 -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 551273a336 FATAL error running MRE blinking test fix #1137 2020-02-09 21:16:31 -05:00
rusEfi 51cfc6bcf1 tle8888 start-up clean-up 2020-02-09 20:41:25 -05:00
rusefi 8a88c90f3b code style: trying to get used to this syntax 2020-01-22 00:45:09 -05:00
rusefi bb217b01dd happy new year unification 2020-01-13 21:57:43 -05:00
dron0gus 618d6f5a5e Gpio diagnostic (#1100)
* enums: add brain_pin_diag_e enum for pin diagnostic

* gpio core: add pin diagnostic call

* gpio: mc33810: add diagnostic support

* gpio: mc33972: add diagnostic support

* gpio: tle6240: add diagnostic

* pin_repository: output diagnostic data for gpio chips

* enums: kinetis: add brain_pin_diag_e enum for pin diagnostic
2020-01-12 10:20:10 -05:00
dron0gus 85a460f2ba hw: gpio: use unsigned int as pin number inside gpiochip drives (#1097)
Not brain_pin_e. Drivers like to see pin number within current
chip.
2020-01-11 10:29:41 -05: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
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
rusefi 7dfdfc6378 docs & code formatting 2019-11-19 18:17:03 -05:00
andreika-git 63702dbeeb TLE6240 outputs fix (#994) 2019-11-01 15:49:55 -04: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
Matthew Kennedy 29804cbc8a move tsOutputChannels to header (#970) 2019-10-08 21:02:51 -04:00
rusefi 5d8e1f6c73 tle8888 reinit command 2019-09-05 10:30:27 -04:00
rusefi e4566ba6aa TLE8888: NB2 solution + reset counter 2019-09-05 10:01:59 -04:00
dron0gus 51db88de18 TLE8888: track reset event by cleared OE bit in status register (#918)
As tle8888 suposed to be reset master and reset MCU there is no
flag showing POR reset. So try to poll OE bit.
2019-09-05 08:55:17 -04:00
rusefi c9241b89da Hall mode for TLE88888 - VRSConfig1 VRSM #915 2019-09-04 20:02:32 -04: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 b09ab8a57f TLE8888 should be re-initialized every time we get +12 volts fix #901
fuel pump test passed, also longer start-up timeout is needed for reliable start
2019-08-16 23:21:03 -04:00
rusefi 51902c12c5 TLE8888 should be re-initialized every time we get +12 volts #901
moving SPI initialization to thread - still works on real hardware
2019-08-16 22:56:06 -04:00
rusefi 7eb3c7122f TLE8888 should be re-initialized every time we get +12 volts #901
refactoring: extracting method
2019-08-16 22:41:19 -04:00
rusefi ed854a3828 refactoring 2019-08-16 22:01:32 -04:00
rusefi 9d32f2c40a refactoring: ChibiOS now offers native 'lockAnyContext' pattern 2019-08-11 15:23:15 -04:00
rusefi ee41d37c08 code style/type safety/docs/typos 2019-08-10 11:13:41 -04:00
rusefi c29a6bb323 MRE hangs up on bench fix #899 2019-08-10 00:53:16 -04:00
rusefi cdac02429c refactoring: better file name 2019-07-06 20:15:49 -04:00
rusefi 7280d65cf8 we need TLE8888 driver #714 2019-06-08 21:58:23 -04:00
rusefi 787af95050 tle8888 driver bug #803
undoing since this breaks start-up
2019-06-08 20:28:13 -04:00
rusefi d6be89d9b0 we need TLE8888 driver #714
trying a sleep before first command
2019-06-08 18:31:56 -04:00
rusefi bd4c5a017e we need TLE8888 driver #714
saving exact TLE8888 reponses
2019-06-08 16:13:24 -04:00
rusefi 061e7c6bf0 https://github.com/rusefi/rusefi/issues/803 2019-06-08 00:44:18 -04:00
rusefi 0fb89c4f7b better status code 2019-06-07 19:14:55 -04:00
rusefi 7dff7a08c9 reviving tle8888 configuration 2019-06-05 22:32:30 -04:00
rusefi c7c613a7fa code style 2019-06-05 21:44:58 -04:00
rusefi 0b5572d229 docs 2019-05-30 17:43:40 -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 ba118e61f2 tle8888: fix pin names array (#771) 2019-04-21 08:50:07 -04:00
rusefi f62731cc99 USB and TLE8888 not working for F4 or F767 #764 2019-04-20 23:39:06 -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 21346c0063 Add more portability to smart_gpio & SPI (#754) 2019-04-14 13:35:30 -04:00
rusefi f8afa29a0f we need TLE8888 driver #714 2019-04-14 08:20:25 -04:00
dron0gus c1593ea31e TLE8888: remove hacks (#753) 2019-04-14 08:15:01 -04:00
rusefi 623c07a1e4 last part of this typo 2019-04-14 07:45:28 -04:00
rusefi e2e44f923f typo 2019-04-13 22:56:33 -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 b04b1ce5c4 my hope is gone 2019-04-13 19:09:39 -04:00
rusEfi 519299ecc3 talk to me? 2019-04-13 18:47:32 -04:00
rusEfi 265b70433e reducing risks 2019-04-13 18:26:29 -04:00
rusEfi 41a56b0d85 I am in macro hell :( 2019-04-13 17:34:26 -04:00
rusefi 75ea5cd812 we need TLE8888 driver #714 2019-04-13 12:43:19 -04: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
rusefi ea87042798 steps towards smarter gpio 2019-04-13 10:11:28 -04:00
rusefi 508e9d74e7 defined(__DOXYGEN__) ? #748 2019-04-12 20:52:51 -04:00
dron0gus 6d1ca92dac gpio-chips: TLE8888 add initial support of spi-driven outputs (#750) 2019-04-13 01:22:16 +02:00
dron0gus 2447f5ea1a gpio chips (#744)
* tle8888: fix building for stm32f765

* gpio-chips: add mc33972 driver
2019-04-12 22:14:25 +02:00
dron0gus 1b39480e64 Gpiochips integration (#740)
* gpio-chips core function renames

* efi_gpio, pin_repository: add support for external gpios

* gpio-chips update

* gpio-chips: add api to name each pin of gpiochip

* tle6240: provide individual names for each pin
2019-04-10 14:43:54 +02:00
dron0gus c6a1d0cbe0 gpios rework (#739)
* Some more include fixes for linux

* Pass cross-compile path through CROSS_COMPILE

* Lower-upper case conversion fixes for linux

* Rename unmarkPin to brain_pin_markUnused

This is part of external gpiochip integration

* Add gpio_pin prefix to markUsed and markUnused

To distinguish from similar functions using brain_pin

* pin_repository: add helpers

this is part of gpio chips integration

* efi_gpio: simplify getHwPin using brain_pin_is_onchip
2019-04-10 01:31:10 +02:00
rusefi bbcb86ec1f we need TLE8888 driver #714 2019-04-07 08:35:04 -04:00
rusefi d8f8d10369 we need TLE8888 driver #714
F7 support
2019-04-06 22:04:35 -04:00
rusefi 9bf052c000 we need TLE8888 driver #714 2019-04-06 13:11:46 -04:00
rusefi 8ae8d3d58f we need TLE8888 driver #714 2019-04-06 12:26:37 -04:00
rusefi 35b0b2c211 we need TLE8888 driver #714
it works now! all SPI/CS pins in 'default' mode
2019-04-06 10:30:20 -04:00
rusefi 17f073a439 we need TLE8888 driver #714 2019-04-06 07:38:02 -04:00
dron0gus 8cf20976f6 tle8888: fix spi confog for STM32F4 (#735)
* tle8888: fix spi confog for STM32F4

* TLE8888: fix array out of bounds access due to incorrect define used in loop
2019-04-06 00:37:00 +02:00
rusefi 0aac3c8f41 we need TLE8888 driver #714 2019-04-04 23:03:32 -04:00
rusefi a8442d5f32 we need TLE8888 driver #714 2019-04-04 20:57:51 -04:00
rusefi 41fa8bdcec we need TLE8888 driver #714 2019-04-04 20:03:31 -04:00
rusefi 334af50f3f we need TLE8888 driver #714 2019-04-04 19:56:03 -04:00
rusefi 5b11926fea we need TLE8888 driver #714 2019-04-04 19:29:33 -04:00
rusefi d30009af16 fixing build 2019-04-04 18:52:00 -04:00
rusefi 43f289e4c2 fixing unit tests 2019-04-04 10:08:50 -04:00
dron0gus bb0fcf3f87 TLE8888: initial support (#733) 2019-04-04 15:55:18 +02:00
andreika-git b80806182f More portability & small fixes (#719)
* Use hw_stm32.mk

* Fix bootloader

* Use more common hw_ports.mk filename instead of hw_stm32.mk

* More CPU compatibility for Makefile

* TS_UART_MODE & rename TS_SERIAL_UART_DEVICE->TS_SERIAL_DEVICE

* Move lockAnyContext()/unlockAnyContext() to rfiutil.c

* USE_FATFS

* EFI_LCD

* Less compilation errors

* STATUS_LOGGING_BUFFER_SIZE & SETTINGS_LOGGING_BUFFER_SIZE

* EFI_ALTERNATOR_CONTROL, EFI_SERVO, EFI_DISABLE_CONSOLE_ACTIONS

* #ifndef PWM_PHASE_MAX_COUNT & more flexible GPIO inside portname()

* merge

* EFI_ALTERNATOR_CONTROL, EFI_ELECTRONIC_THROTTLE_BODY
2019-03-29 15:29:01 +01:00
andreika-git c34d7cac48 More compatibility for ADC_inputs, etc. (#716)
* Move STM32-specific ADC pinouts to ports/stm32/stm32_common.cpp

* Move STM32-specific files to ports/*

* setAdcChannelOverrides()

* Add #ifdefs for adc_inputs (PWM_FREQ_*, PWM_PERIOD_*, ADC_*_DEVICE)

* addChannel(), removeChannel()

* fix tle6240 compilation

* Add stm32_common.cpp to Makefile

* More ports/stm32/* paths

* More ports/stm32/* paths

* More flexible GPIO ports

* Add #ifdef for GPTDEVICE

* EFI_BOARD_TEST and EFI_JOYSTICK

* EFI_TLE8888

* Fix HIP9011_logic compilation

* ADC_CHANNEL_SENSOR

* Move ioportid_t PORTS[] to ports/*

* Fix simulator
2019-03-28 22:46:10 -04:00
rusefi 6104a831c1 we need TLE8888 driver #714 2019-03-27 04:02:34 -04:00
rusefi 0dadb6de68 we need TLE8888 driver #714 2019-03-26 12:30:30 -04:00
rusefi 7e58e54976 better error handling for invalid SPI settings 2019-03-26 09:38:23 -04:00
rusefi cf740411f2 SPI prescaler refactoring 2019-03-25 22:41:31 -04:00
rusefi fc590524c2 we need TLE8888 driver #714 2019-03-25 20:30:36 -04:00
rusefi b823a00f8e we need TLE8888 driver #714 2019-03-25 15:50:14 -04:00
rusefi c9b022d562 we need TLE8888 driver #714 2019-03-25 15:08:32 -04:00
rusefi 8f2a385b58 typos and better parameter name 2019-03-25 14:29:34 -04:00
dron0gus 47950dcf5e tle6240 gpio driver implementation (#704)
* TLE6240: move to gpio drivers directory

* TLE6240: add gpiochip driver code
2019-03-13 08:03:22 -04:00
dron0gus 70ebc06517 gpiochips API, core and unit test (#703)
* Add external gpiochips driver API and core

* gpiochips: add unit test
2019-03-12 10:12:37 -04:00