STM8S/A Standard Peripherals Firmware Library: stm8s_flash.h File Reference

STM8S/A

stm8s_flash.h File Reference

This file contains all functions prototype and macros for the FLASH peripheral. More...

#include "stm8s.h"

Go to the source code of this file.

Defines

#define FLASH_OPTIONBYTE_ERROR   ((uint16_t)0x5555)
#define FLASH_PROG_START_PHYSICAL_ADDRESS   ((uint32_t)0x008000)
#define FLASH_RASS_KEY1   ((uint8_t)0x56)
#define FLASH_RASS_KEY2   ((uint8_t)0xAE)
#define IS_FLASH_ADDRESS_OK(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_ADDRESS_OK(ADDRESS)
 Macro used by the assert function in order to check the different sensitivity values for the data eeprom Address.
#define IS_FLASH_DATA_BLOCK_NUMBER_OK(BLOCKNUM)   ((BLOCKNUM) < FLASH_DATA_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_OK(FLAG)
 Macro used by the assert function in order to check the different flags values.
#define IS_FLASH_LOW_POWER_MODE_OK(LPMODE)
 Macro used by the assert function in order to check the different sensitivity values for the low power mode.
#define IS_FLASH_PROG_ADDRESS_OK(ADDRESS)
 Macro used by the assert function in order to check the different sensitivity values for the flash program Address.
#define IS_FLASH_PROG_BLOCK_NUMBER_OK(BLOCKNUM)   ((BLOCKNUM) < FLASH_PROG_BLOCKS_NUMBER)
 Macro used by the assert function in order to check the different sensitivity values for the flash program Block number.
#define IS_FLASH_PROGRAM_MODE_OK(MODE)
 Macro used by the assert function in order to check the different sensitivity values for the flash program mode.
#define IS_FLASH_PROGRAM_TIME_OK(TIME)
 Macro used by the assert function in order to check the program time mode.
#define IS_MEMORY_TYPE_OK(MEMTYPE)
 Macro used by the assert function in order to check the different sensitivity values for the flash memory type.
#define IS_OPTION_BYTE_ADDRESS_OK(ADDRESS)
 Macro used by the assert function in order to check the different sensitivity values for the option bytes Address.
#define OPTION_BYTE_END_PHYSICAL_ADDRESS   ((uint16_t)0x487F)
#define OPTION_BYTE_START_PHYSICAL_ADDRESS   ((uint16_t)0x4800)

Enumerations

enum  FLASH_Flag_TypeDef { 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 }
 FLASH flags definition. More...
enum  FLASH_LPMode_TypeDef { FLASH_LPMODE_POWERDOWN = (uint8_t)0x04, FLASH_LPMODE_STANDBY = (uint8_t)0x08, FLASH_LPMODE_POWERDOWN_STANDBY = (uint8_t)0x00, FLASH_LPMODE_STANDBY_POWERDOWN = (uint8_t)0x0C }
 FLASH Low Power mode select. More...
enum  FLASH_MemType_TypeDef { FLASH_MEMTYPE_PROG = (uint8_t)0xFD, FLASH_MEMTYPE_DATA = (uint8_t)0xF7 }
 FLASH Memory types. More...
enum  FLASH_ProgramMode_TypeDef { FLASH_PROGRAMMODE_STANDARD = (uint8_t)0x00, FLASH_PROGRAMMODE_FAST = (uint8_t)0x10 }
 FLASH programming modes. More...
enum  FLASH_ProgramTime_TypeDef { FLASH_PROGRAMTIME_STANDARD = (uint8_t)0x00, FLASH_PROGRAMTIME_TPROG = (uint8_t)0x01 }
 FLASH fixed programming time. More...
enum  FLASH_Status_TypeDef { FLASH_STATUS_SUCCESSFUL_OPERATION = (uint8_t)0x04, FLASH_STATUS_TIMEOUT = (uint8_t)0x02, FLASH_STATUS_WRITE_PROTECTION_ERROR = (uint8_t)0x01 }
 FLASH status of the last operation. More...

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.
uint32_t FLASH_GetBootSize (void)
 Returns the Boot memory size in bytes.
FlagStatus FLASH_GetFlagStatus (FLASH_Flag_TypeDef FLASH_FLAG)
 Checks whether the specified SPI flag is set or not.
FLASH_LPMode_TypeDef FLASH_GetLowPowerMode (void)
 Returns the Flash behaviour type in low power mode.
FLASH_ProgramTime_TypeDef FLASH_GetProgrammingTime (void)
 Returns the fixed programming time.
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_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 any byte from flash memory.
uint16_t FLASH_ReadOptionByte (uint16_t Address)
 Reads one option byte.
void FLASH_SetLowPowerMode (FLASH_LPMode_TypeDef FLASH_LPMode)
 Select the Flash behaviour in low power mode.
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_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))

Detailed Description

This file contains all functions prototype and macros for the FLASH peripheral.

Author:
MCD Application Team
Version:
V2.2.0
Date:
30-September-2014
Attention:

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm8s_flash.h.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com