rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Enumerations | Functions
port_mpu_util.h File Reference

Detailed Description

Low level common STM32 header.

Date
Aug 3, 2019
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file port_mpu_util.h.

Enumerations

enum  BOR_Level_t {
  BOR_Level_None = PWR_CR_PLS_LEV0 , BOR_Level_1 = PWR_CR_PLS_LEV1 , BOR_Level_2 = PWR_CR_PLS_LEV3 , BOR_Level_3 = PWR_CR_PLS_LEV7 ,
  BOR_Level_None = PWR_CR_PLS_LEV0 , BOR_Level_1 = PWR_CR_PLS_LEV1 , BOR_Level_2 = PWR_CR_PLS_LEV3 , BOR_Level_3 = PWR_CR_PLS_LEV7
}
 
enum  BOR_Level_t {
  BOR_Level_None = PWR_CR_PLS_LEV0 , BOR_Level_1 = PWR_CR_PLS_LEV1 , BOR_Level_2 = PWR_CR_PLS_LEV3 , BOR_Level_3 = PWR_CR_PLS_LEV7 ,
  BOR_Level_None = PWR_CR_PLS_LEV0 , BOR_Level_1 = PWR_CR_PLS_LEV1 , BOR_Level_2 = PWR_CR_PLS_LEV3 , BOR_Level_3 = PWR_CR_PLS_LEV7
}
 

Functions

uint32_t getMcuSerial ()
 
void stm32_standby ()
 
void boardPrepareForStop ()
 
void boardPrepareForStandby ()
 

Enumeration Type Documentation

◆ BOR_Level_t [1/2]

Enumerator
BOR_Level_None 
BOR_Level_1 
BOR_Level_2 
BOR_Level_3 
BOR_Level_None 
BOR_Level_1 
BOR_Level_2 
BOR_Level_3 

Definition at line 41 of file port_mpu_util.h.

41 {
42 BOR_Level_None = PWR_CR_PLS_LEV0, // 0x0C=12 Supply voltage ranges from 1.62 to 2.10 V
43 BOR_Level_1 = PWR_CR_PLS_LEV1, // 0x08 Supply voltage ranges from 2.10 to 2.40 V
44 BOR_Level_2 = PWR_CR_PLS_LEV3, // 0x04 Supply voltage ranges from 2.40 to 2.70 V
45 BOR_Level_3 = PWR_CR_PLS_LEV7 // 0x00 Supply voltage ranges from 2.70 to 3.60 V
BOR_Level_t
@ BOR_Level_None
@ BOR_Level_1
@ BOR_Level_3
@ BOR_Level_2

◆ BOR_Level_t [2/2]

Enumerator
BOR_Level_None 
BOR_Level_1 
BOR_Level_2 
BOR_Level_3 
BOR_Level_None 
BOR_Level_1 
BOR_Level_2 
BOR_Level_3 

Definition at line 48 of file port_mpu_util.h.

48 {
49 BOR_Level_None = OB_BOR_OFF, // 0x0C=12 Supply voltage ranges from 1.62 to 2.10 V
50 BOR_Level_1 = OB_BOR_LEVEL1, // 0x08 Supply voltage ranges from 2.10 to 2.40 V
51 BOR_Level_2 = OB_BOR_LEVEL2, // 0x04 Supply voltage ranges from 2.40 to 2.70 V
52 BOR_Level_3 = OB_BOR_LEVEL3 // 0x00 Supply voltage ranges from 2.70 to 3.60 V

Function Documentation

◆ boardPrepareForStandby()

void boardPrepareForStandby ( )

Definition at line 270 of file stm32_common.cpp.

270 {
272}
void boardPreparePA0ForStandby()

Referenced by stm32_standby().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boardPrepareForStop()

void boardPrepareForStop ( )

Definition at line 158 of file board_configuration.cpp.

158 {
159 // Wake on the CAN RX pin
160 palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE);
161}

◆ getMcuSerial()

uint32_t getMcuSerial ( )

Definition at line 186 of file stm32_common.cpp.

186 {
187 uint32_t *uid = ((uint32_t *)UID_BASE);
188 return uid[0] + uid[1] + uid[2];
189}

Referenced by baseMCUInit().

Here is the caller graph for this function:

◆ stm32_standby()

void stm32_standby ( )

Definition at line 18 of file mpu_util.cpp.

18 {
19 // Don't get bothered by interrupts
20 __disable_irq();
21
22 /* TODO: validate! */
23#if 0
24 SysTick->CTRL = 0;
25 SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
26 PWR->CR |= PWR_CR_PDDS; // PDDS = use standby mode (not stop mode)
27 PWR->CR |= PWR_CR_CSBF; // Clear standby flag
28#endif
29
30 // Do anything the board wants to prepare for standby mode - enabling wakeup sources!
32
33 __WFI();
34}
void boardPrepareForStandby()

Referenced by configureRusefiLuaUtilHooks(), and runRusEfi().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.