we need TLE8888 driver #714

This commit is contained in:
rusefi 2019-03-27 04:02:34 -04:00
parent 0dadb6de68
commit 6104a831c1
2 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@ DRIVERS_DIR=$(PROJECT_DIR)/hw_layer/drivers
HW_LAYER_DRIVERS_INC = \
$(DRIVERS_DIR) \
$(DRIVERS_DIR)\gpio \
$(DRIVERS_DIR)/gpio \
HW_LAYER_DRIVERS_CORE = \
$(DRIVERS_DIR)/gpio/core.c \

View File

@ -21,6 +21,7 @@
#define DATA_OE_ENABLE 0b00000010
static unsigned char tx_buff[2];
static unsigned char rx_buff[2];
extern TunerStudioOutputChannels tsOutputChannels;
@ -63,5 +64,19 @@ void initTle8888(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (engineConfiguration->debugMode == DBG_TLE8888) {
tsOutputChannels.debugIntField1 = 2;
}
/**
* 15.1 SPI Protocol
*
* after a read or write command: the address and content of the selected register
* is transmitted with the next SPI transmission (for not existing addresses or
* wrong access mode the data is always 0)
*/
spiReceive(driver, 2, rx_buff);
if (engineConfiguration->debugMode == DBG_TLE8888) {
tsOutputChannels.debugIntField2 = (rx_buff[1] << 8) + rx_buff[0];
}
spiUnselect(driver);
}