rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
drivers
gpio
tle9201.h
Go to the documentation of this file.
1
/*
2
* tle9201.h
3
*
4
* TLE9201 H-Bridge with SPI
5
*
6
* @date Nov 1, 2024
7
*
8
* @author andreika, (c) 2024
9
* @author Andrey Belomutskiy, (c) 2012-2024
10
*/
11
12
#pragma once
13
14
#include "efifeatures.h"
15
#include <hal.h>
16
17
// 10 Hz
18
#define TLE9201_POLL_INTERVAL_MS 100
19
20
// used by tle9201_config.spi_config.cr1 & .cr2
21
#define TLE9201_CONFIG_CR1 (\
22
SPI_CR1_8BIT_MODE | \
23
SPI_CR1_SSM | \
24
SPI_CR1_SSI | \
25
((0b110 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | \
26
SPI_CR1_MSTR | \
27
SPI_CR1_CPHA)
28
#define TLE9201_CONFIG_CR2 (SPI_CR2_8BIT_MODE)
29
30
struct
tle9201_config
{
31
#if HAL_USE_SPI
32
SPIDriver *
spi_bus
;
33
SPIConfig
spi_config
;
34
#endif
35
};
36
37
int
tle9201_add
(
unsigned
int
index,
const
struct
tle9201_config
*cfg);
tle9201_config
Definition
tle9201.h:30
tle9201_config::spi_bus
SPIDriver * spi_bus
Definition
tle9201.h:32
tle9201_config::spi_config
SPIConfig spi_config
Definition
tle9201.h:33
tle9201_add
int tle9201_add(unsigned int index, const struct tle9201_config *cfg)
Generated on Sat Sep 27 2025 00:10:06 for rusEFI by
1.9.8