STM8L15x Standard Peripherals Drivers: stm8l15x_flash.h File Reference

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_flash.h File Reference

This file contains all the functions prototypes for the FLASH firmware library. More...

#include "stm8l15x.h"

Go to the source code of this file.

Defines

#define FLASH_DATA_EEPROM_START_PHYSICAL_ADDRESS   ((uint32_t)0x00001000)
#define FLASH_OPTION_BYTES_END_PHYSICAL_ADDRESS   ((uint32_t)0x0000480A)
#define FLASH_OPTION_BYTES_START_PHYSICAL_ADDRESS   ((uint32_t)0x00004800)
#define FLASH_PROGRAM_START_PHYSICAL_ADDRESS   ((uint32_t)0x00008000)
#define FLASH_RASS_KEY1   ((uint8_t)0x56)
#define FLASH_RASS_KEY2   ((uint8_t)0xAE)
#define FLASH_READOUTPROTECTION_KEY   ((uint8_t)0xAA)
#define IS_FLASH_ADDRESS(Address)
 Macro used by the assert function in order to check the different sensitivity values for the data eeprom and flash program Address.
#define IS_FLASH_DATA_EEPROM_ADDRESS(Address)
 Macro used by the assert function in order to check the different sensitivity values for the data Eeprom Address.
#define IS_FLASH_DATA_EEPROM_BLOCK_NUMBER(BlockNum)   ((BlockNum) < FLASH_DATA_EEPROM_BLOCKS_NUMBER)
 Macro used by the assert function in order to check the different sensitivity values for the data eeprom Block number.
#define IS_FLASH_FLAGS(FLAG)
 Macro used by the assert function in order to check the different flags values.
#define IS_FLASH_MEMORY_TYPE(MemType)
 Macro used by the assert function in order to check the different sensitivity values for the flash memory type.
#define IS_FLASH_POWER(Power)
 Macro used by the assert function in order to check the power mode.
#define IS_FLASH_POWERSTATUS(PowerStatus)
 Macro used by the assert function in order to check the power status during wait and run modes.
#define IS_FLASH_PROGRAM_ADDRESS(Address)
 Macro used by the assert function in order to check the different sensitivity values for the flash Address.
#define IS_FLASH_PROGRAM_BLOCK_NUMBER(BlockNum)   ((BlockNum) < FLASH_PROGRAM_BLOCKS_NUMBER)
 Macro used by the assert function in order to check the different sensitivity values for the flash Block number.
#define IS_FLASH_PROGRAM_MODE(Mode)
 Macro used by the assert function in order to check the different sensitivity values for the flash program block mode.
#define IS_FLASH_PROGRAM_TIME(Time)
 Macro used by the assert function in order to check the program time mode.
#define IS_OPTION_BYTE_ADDRESS(ADDRESS)
 Macro used by the assert function in order to check the different sensitivity values for the option bytes Address.

Enumerations

enum  FLASH_FLAG_TypeDef {
  FLASH_FLAG_HVOFF = (uint8_t)0x40, FLASH_FLAG_DUL = (uint8_t)0x08, FLASH_FLAG_EOP = (uint8_t)0x04, FLASH_FLAG_PUL = (uint8_t)0x02,
  FLASH_FLAG_WR_PG_DIS = (uint8_t)0x01
}
enum  FLASH_MemType_TypeDef { FLASH_MemType_Program = (uint8_t)0xFD, FLASH_MemType_Data = (uint8_t)0xF7 }
enum  FLASH_Power_TypeDef { FLASH_Power_IDDQ = (uint8_t)0x00, FLASH_Power_On = (uint8_t)0x01 }
enum  FLASH_PowerStatus_TypeDef { FLASH_PowerStatus_IDDQDuringWaitMode = (uint8_t)0x04, FLASH_PowerStatus_IDDQDuringRunMode = (uint8_t)0x08, FLASH_PowerStatus_IDDQDuringWaitAndRunModes = (uint8_t)0x0C, FLASH_PowerStatus_On = (uint8_t)0x00 }
enum  FLASH_ProgramMode_TypeDef { FLASH_ProgramMode_Standard = (uint8_t)0x00, FLASH_ProgramMode_Fast = (uint8_t)0x10 }
enum  FLASH_ProgramTime_TypeDef { FLASH_ProgramTime_Standard = (uint8_t)0x00, FLASH_ProgramTime_TProg = (uint8_t)0x01 }
enum  FLASH_Status_TypeDef { FLASH_Status_Write_Protection_Error = (uint8_t)0x01, FLASH_Status_TimeOut = (uint8_t)0x02, FLASH_Status_Successful_Operation = (uint8_t)0x04 }

Functions

void FLASH_DeInit (void)
 Deinitializes the FLASH registers to their default reset values.
void FLASH_EraseByte (uint32_t Address)
 Erases one byte in the program or data EEPROM memory.
void FLASH_EraseOptionByte (uint16_t Address)
 Erases option byte.
uint16_t FLASH_GetBootSize (void)
 Returns the Boot memory size in bytes.
uint16_t FLASH_GetCodeSize (void)
 Returns the Code Area size in bytes.
FlagStatus FLASH_GetFlagStatus (FLASH_FLAG_TypeDef FLASH_FLAG)
 Checks whether the specified FLASH flag is set or not.
FLASH_ProgramTime_TypeDef FLASH_GetProgrammingTime (void)
 Returns the fixed programming time.
FunctionalState FLASH_GetReadOutProtectionStatus (void)
 Returns the FLASH Read Out Protection Status.
void FLASH_ITConfig (FunctionalState NewState)
 Enables or Disables the Flash interrupt mode.
void FLASH_Lock (FLASH_MemType_TypeDef FLASH_MemType)
 Locks the program or data EEPROM memory.
void FLASH_PowerWaitModeConfig (FLASH_Power_TypeDef FLASH_Power)
 Configures the power state for Flash program and data EEPROM during wait for interrupt mode.
void FLASH_ProgramByte (uint32_t Address, uint8_t Data)
 Programs one byte in program or data EEPROM memory.
void FLASH_ProgramOptionByte (uint16_t Address, uint8_t Data)
 Programs option byte.
void FLASH_ProgramWord (uint32_t Address, uint32_t Data)
 Programs one word (4 bytes) in program or data EEPROM memory.
uint8_t FLASH_ReadByte (uint32_t Address)
 Reads one byte from flash memory.
void FLASH_SetProgrammingTime (FLASH_ProgramTime_TypeDef FLASH_ProgTime)
 Sets the fixed programming time.
void FLASH_Unlock (FLASH_MemType_TypeDef FLASH_MemType)
 Unlocks the program or data EEPROM memory.
 IN_RAM (void FLASH_PowerRunModeConfig(FLASH_Power_TypeDef FLASH_Power))
 IN_RAM (void FLASH_EraseBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType))
 IN_RAM (void FLASH_ProgramBlock(uint16_t BlockNum, FLASH_MemType_TypeDef FLASH_MemType, FLASH_ProgramMode_TypeDef FLASH_ProgMode, uint8_t *Buffer))
 IN_RAM (FLASH_Status_TypeDef FLASH_WaitForLastOperation(FLASH_MemType_TypeDef FLASH_MemType))
 IN_RAM (FLASH_PowerStatus_TypeDef FLASH_GetPowerStatus(void))

Detailed Description

This file contains all the functions prototypes for the FLASH firmware library.

Author:
MCD Application Team
Version:
V1.5.0
Date:
13-May-2011
Attention:

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2011 STMicroelectronics

Definition in file stm8l15x_flash.h.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com