From 35b0b2c211ae699c5fdb1867800b5472f38a6e82 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 6 Apr 2019 10:30:20 -0400 Subject: [PATCH] we need TLE8888 driver #714 it works now! all SPI/CS pins in 'default' mode --- firmware/hw_layer/drivers/gpio/tle8888.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/firmware/hw_layer/drivers/gpio/tle8888.c b/firmware/hw_layer/drivers/gpio/tle8888.c index 46e8e740ee..9695baaf82 100644 --- a/firmware/hw_layer/drivers/gpio/tle8888.c +++ b/firmware/hw_layer/drivers/gpio/tle8888.c @@ -63,9 +63,12 @@ extern TunerStudioOutputChannels tsOutputChannels; #define CMD_WR(a, d) (CMD_WRITE | CMD_REG_ADDR(a) | CMD_REG_DATA(d)) #define CMD_SR CMD_WR(0x1a, 0x03) +// 0x238 = 568 #define CMD_OE_SET CMD_WR(0x1c, 0x02) +/* not used #define CMD_OE_CLR CMD_WR(0x1c, 0x01) #define CMD_LOCK CMD_WR(0x1e, 0x02) +*/ #define CMD_UNLOCK CMD_WR(0x1e, 0x01) #define CMD_INCONFIG(n, d) CMD_WR(0x53 + (n & 0x03), d) #define CMD_DDCONFIG(n, d) CMD_WR(0x57 + (n & 0x03), d) @@ -175,7 +178,11 @@ int tle8888_chip_init(void * data) /* Software reset */ tle8888_spi_rw(chip, CMD_SR, NULL); - /* delay? */ + /** + * Table 8. Reset Times. All reset times not more than 20uS + * + */ + chThdSleepMilliseconds(3); /* Set LOCK bit to 0 */ tle8888_spi_rw(chip, CMD_UNLOCK, NULL);