rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
drivers
gpio
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
10
struct
tle9104_config
{
11
#if HAL_USE_SPI
12
SPIDriver *
spi_bus
;
13
SPIConfig
spi_config
;
14
#endif
15
16
struct
{
17
ioportid_t
port
;
18
uint_fast8_t
pad
;
19
}
direct_io
[TLE9204_OUT_COUNT];
20
21
Gpio
resn
;
22
Gpio
en
;
23
};
24
25
void
initAll9104
(
const
tle9104_config
*configs);
26
int
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
Gpio
Definition
rusefi_hw_enums.h:14
global.h
ioportid_t
GPIO_TypeDef * ioportid_t
Port Identifier.
Definition
hal_pal_lld.h:102
tle9104_config
Definition
tle9104.h:10
tle9104_config::resn
Gpio resn
Definition
tle9104.h:21
tle9104_config::en
Gpio en
Definition
tle9104.h:22
tle9104_config::pad
uint_fast8_t pad
Definition
tle9104.h:18
tle9104_config::port
ioportid_t port
Definition
tle9104.h:17
tle9104_config::direct_io
struct tle9104_config::@46 direct_io[TLE9204_OUT_COUNT]
tle9104_config::spi_config
SPIConfig spi_config
Definition
tle9104.h:13
tle9104_config::spi_bus
SPIDriver * spi_bus
Definition
tle9104.h:12
initAll9104
void initAll9104(const tle9104_config *configs)
Definition
tle9104.cpp:568
tle9104_add
int tle9104_add(Gpio base, int index, const tle9104_config *cfg)
Definition
tle9104.cpp:554
Generated on Fri Sep 26 2025 00:10:16 for rusEFI by
1.9.8