rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
mc33816.cpp File Reference

Functions

static THD_WORKING_AREA (mc33_thread_wa, 256)
 
static THD_FUNCTION (mc33_driver_thread, p)
 
void initMc33816 ()
 

Variables

static SPIConfig spiCfg
 
static Pt2001 pt
 
static IgnVoltageGatekeeper gatekeeper
 

Function Documentation

◆ initMc33816()

void initMc33816 ( )

Definition at line 280 of file mc33816.cpp.

280 {
281 bool isConfigured = pt.init();
282 if (isConfigured) {
283 chThdCreateStatic(mc33_thread_wa, sizeof(mc33_thread_wa), PRIO_GPIOCHIP, mc33_driver_thread, nullptr);
284 }
285}
static Pt2001 pt
Definition mc33816.cpp:195

Referenced by initHardware().

Here is the caller graph for this function:

◆ THD_FUNCTION()

static THD_FUNCTION ( mc33_driver_thread  ,
 
)
static

Definition at line 271 of file mc33816.cpp.

271 {
272 (void)p;
273
274 while (true) {
275 pt.initIfNeeded();
276 chThdSleepMilliseconds(100);
277 }
278}

◆ THD_WORKING_AREA()

static THD_WORKING_AREA ( mc33_thread_wa  ,
256   
)
static

Variable Documentation

◆ gatekeeper

IgnVoltageGatekeeper gatekeeper
static

Definition at line 252 of file mc33816.cpp.

◆ pt

Pt2001 pt
static

Definition at line 195 of file mc33816.cpp.

Referenced by initMc33816(), and THD_FUNCTION().

◆ spiCfg

SPIConfig spiCfg
static
Initial value:
= {
.circular = false,
#ifdef _CHIBIOS_RT_CONF_VER_6_1_
.end_cb = NULL,
#else
.slave = false,
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = nullptr,
.sspad = 0,
.cr1 =
SPI_CR1_MSTR |
SPI_CR1_SSM |
SPI_CR1_SSI |
SPI_CR1_CPHA |
SPI_CR1_BR_0 | SPI_CR1_BR_1 | SPI_CR1_BR_2 |
SPI_CR1_SPE,
.cr2 = SPI_CR2_SSOE |
SPI_CR2_16BIT_MODE
}

Definition at line 27 of file mc33816.cpp.

27 {
28 .circular = false,
29#ifdef _CHIBIOS_RT_CONF_VER_6_1_
30 .end_cb = NULL,
31#else
32 .slave = false,
33 .data_cb = NULL,
34 .error_cb = NULL,
35#endif
36 .ssport = nullptr,
37 .sspad = 0,
38 .cr1 =
39 SPI_CR1_MSTR |
40 SPI_CR1_SSM | // Software Slave Management, the SSI bit will be internal reference
41 SPI_CR1_SSI | // Internal Slave Select (active low) set High
42 SPI_CR1_CPHA |
43 //SPI_CR1_BR_1 // 5MHz
44 SPI_CR1_BR_0 | SPI_CR1_BR_1 | SPI_CR1_BR_2 |
45 SPI_CR1_SPE,
46 .cr2 = SPI_CR2_SSOE |
47 SPI_CR2_16BIT_MODE
48 };

Go to the source code of this file.