rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions

management functions More...

Collaboration diagram for Peripheral Control functions:

Functions

HAL_StatusTypeDef HAL_FLASH_Unlock (void)
 Unlock the FLASH control register access.
 
HAL_StatusTypeDef HAL_FLASH_Lock (void)
 Locks the FLASH control register access.
 
HAL_StatusTypeDef HAL_FLASH_OB_Unlock (void)
 Unlock the FLASH Option Control Registers access.
 
HAL_StatusTypeDef HAL_FLASH_OB_Lock (void)
 Lock the FLASH Option Control Registers access.
 
HAL_StatusTypeDef HAL_FLASH_OB_Launch (void)
 Launch the option byte loading.
 

Detailed Description

management functions

Management functions.

 ===============================================================================
                      ##### Peripheral Control functions #####
 ===============================================================================  
    [..]
    This subsection provides a set of functions allowing to control the FLASH 
    memory operations.

Function Documentation

◆ HAL_FLASH_Lock()

HAL_StatusTypeDef HAL_FLASH_Lock ( void  )

Locks the FLASH control register access.

Locks the FLASH control registers access.

Return values
HALStatus

Definition at line 474 of file stm32f4xx_hal_flash.c.

475{
476 /* Set the LOCK Bit to lock the FLASH Registers access */
477 FLASH->CR |= FLASH_CR_LOCK;
478
479 return HAL_OK;
480}

◆ HAL_FLASH_OB_Launch()

HAL_StatusTypeDef HAL_FLASH_OB_Launch ( void  )

Launch the option byte loading.

Launch the option bytes loading.

Return values
HALStatus

Definition at line 518 of file stm32f4xx_hal_flash.c.

519{
520 /* Set the OPTSTRT bit in OPTCR register */
521 *(__IO uint8_t *)OPTCR_BYTE0_ADDRESS |= FLASH_OPTCR_OPTSTRT;
522
523 /* Wait for last operation to be completed */
524 return(FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE));
525}
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
Wait for a FLASH operation to complete.

Referenced by BOR_Set().

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

◆ HAL_FLASH_OB_Lock()

HAL_StatusTypeDef HAL_FLASH_OB_Lock ( void  )

Lock the FLASH Option Control Registers access.

Return values
HALStatus

Definition at line 506 of file stm32f4xx_hal_flash.c.

507{
508 /* Set the OPTLOCK Bit to lock the FLASH Option Byte Registers access */
509 FLASH->OPTCR |= FLASH_OPTCR_OPTLOCK;
510
511 return HAL_OK;
512}

Referenced by BOR_Set().

Here is the caller graph for this function:

◆ HAL_FLASH_OB_Unlock()

HAL_StatusTypeDef HAL_FLASH_OB_Unlock ( void  )

Unlock the FLASH Option Control Registers access.

Return values
HALStatus

Definition at line 486 of file stm32f4xx_hal_flash.c.

487{
488 if((FLASH->OPTCR & FLASH_OPTCR_OPTLOCK) != RESET)
489 {
490 /* Authorizes the Option Byte register programming */
491 FLASH->OPTKEYR = FLASH_OPT_KEY1;
492 FLASH->OPTKEYR = FLASH_OPT_KEY2;
493 }
494 else
495 {
496 return HAL_ERROR;
497 }
498
499 return HAL_OK;
500}

Referenced by BOR_Set().

Here is the caller graph for this function:

◆ HAL_FLASH_Unlock()

HAL_StatusTypeDef HAL_FLASH_Unlock ( void  )

Unlock the FLASH control register access.

Unlock the FLASH control registers access.

Return values
HALStatus

Definition at line 454 of file stm32f4xx_hal_flash.c.

455{
456 if((FLASH->CR & FLASH_CR_LOCK) != RESET)
457 {
458 /* Authorize the FLASH Registers access */
459 FLASH->KEYR = FLASH_KEY1;
460 FLASH->KEYR = FLASH_KEY2;
461 }
462 else
463 {
464 return HAL_ERROR;
465 }
466
467 return HAL_OK;
468}