rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
tle9104.h
Go to the documentation of this file.
1#pragma once
2
3#include "global.h"
4
5#include "efifeatures.h"
6#include <hal.h>
7
8#define TLE9204_OUT_COUNT 4
9
11#if HAL_USE_SPI
12 SPIDriver *spi_bus;
13 SPIConfig spi_config;
14#endif
15
16 struct {
18 uint_fast8_t pad;
19 } direct_io[TLE9204_OUT_COUNT];
20
23};
24
25void initAll9104(const tle9104_config *configs);
26int tle9104_add(Gpio base, int index, const tle9104_config* cfg);
27
28// This example config worked on the bench!
29// tle9104_config tle9104_cfg = {
30// .spi_bus = NULL,
31// .spi_config = {
32// .circular = false,
33// .end_cb = NULL,
34// .ssport = NULL,
35// .sspad = 0,
36// .cr1 =
37// SPI_CR1_16BIT_MODE |
38// SPI_CR1_SSM |
39// SPI_CR1_SSI |
40// ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
41// SPI_CR1_MSTR |
42// SPI_CR1_CPHA |
43// 0,
44// .cr2 = SPI_CR2_16BIT_MODE
45// },
46// .direct_io = {
47// { GPIOB, 12 },
48// { GPIOB, 13 },
49// { GPIOB, 14 },
50// { GPIOB, 15 }
51// },
52// .resn = Gpio::A3,
53// .en = Gpio::C9
54// };
GPIO_TypeDef * ioportid_t
Port Identifier.
uint_fast8_t pad
Definition tle9104.h:18
ioportid_t port
Definition tle9104.h:17
struct tle9104_config::@46 direct_io[TLE9204_OUT_COUNT]
SPIConfig spi_config
Definition tle9104.h:13
SPIDriver * spi_bus
Definition tle9104.h:12
void initAll9104(const tle9104_config *configs)
Definition tle9104.cpp:568
int tle9104_add(Gpio base, int index, const tle9104_config *cfg)
Definition tle9104.cpp:554