CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
stm32_internal_flash_drivers.h
Go to the documentation of this file.
1#ifndef INCLUDE_GUARD__STM32_INTERNAL_FLASH_DRIVERS_H__
2#define INCLUDE_GUARD__STM32_INTERNAL_FLASH_DRIVERS_H__
3
4#include <stdint.h>
5
6#include "stm32l4xx_hal.h"
7#include "stm32l4xx_hal_flash.h"
8
20
21typedef struct
22{
23 HAL_StatusTypeDef lock_status;
24 HAL_StatusTypeDef unlock_status;
25 HAL_StatusTypeDef write_status;
27
28uint8_t STM32_internal_flash_write(uint32_t address, uint8_t *data, uint32_t length, STM32_Internal_Flash_Write_Status_t *status);
29
30uint8_t STM32_internal_flash_read(uint32_t address, uint8_t *buffer, uint32_t length);
31
32uint8_t STM32_internal_flash_erase(uint16_t start_page_erase, uint16_t number_of_pages_to_erase, uint32_t *page_error);
33
34uint8_t STM32_internal_flash_get_option_bytes(FLASH_OBProgramInitTypeDef *ob_data);
35
36uint8_t STM32_internal_flash_set_active_flash_bank(uint8_t wanted_active_flash_bank);
37
39
40#endif // INCLUDE_GUARD__STM32_INTERNAL_FLASH_DRIVERS_H__
uint8_t STM32_internal_flash_write(uint32_t address, uint8_t *data, uint32_t length, STM32_Internal_Flash_Write_Status_t *status)
Writes data to the flash memory in chunks of 8 bytes.
Definition stm32_internal_flash_drivers.c:19
uint8_t STM32_internal_flash_set_active_flash_bank(uint8_t wanted_active_flash_bank)
Sets the active flash bank to either 1 or 2 (only if it is different than the current active flash ba...
Definition stm32_internal_flash_drivers.c:160
STM32_INTERNAL_FLASH_memory_region_addresses_t
Flash Partitions.
Definition stm32_internal_flash_drivers.h:13
@ STM32_INTERNAL_FLASH_MEMORY_REGION_RAM_2_ADDRESS
Definition stm32_internal_flash_drivers.h:15
@ STM32_INTERNAL_FLASH_MEMORY_REGION_GOLDEN_COPY_ADDRESS
Definition stm32_internal_flash_drivers.h:18
@ STM32_INTERNAL_FLASH_MEMORY_REGION_RAM_3_ADDRESS
Definition stm32_internal_flash_drivers.h:16
@ STM32_INTERNAL_FLASH_MEMORY_REGION_RAM_ADDRESS
Definition stm32_internal_flash_drivers.h:14
@ STM32_INTERNAL_FLASH_MEMORY_REGION_FLASH_ADDRESS
Definition stm32_internal_flash_drivers.h:17
uint8_t STM32_internal_flash_erase(uint16_t start_page_erase, uint16_t number_of_pages_to_erase, uint32_t *page_error)
Erase pages from bank 2 of flash memory which is located at 0x08100000.
Definition stm32_internal_flash_drivers.c:105
uint8_t STM32_internal_flash_get_option_bytes(FLASH_OBProgramInitTypeDef *ob_data)
Gets option bytes configuration from the stm32 internal flash memory.
Definition stm32_internal_flash_drivers.c:148
uint8_t STM32_internal_flash_read(uint32_t address, uint8_t *buffer, uint32_t length)
Reads data from the flash memory.
Definition stm32_internal_flash_drivers.c:85
uint8_t STM32_internal_flash_get_active_flash_bank()
Returns active flash bank.
Definition stm32_internal_flash_drivers.c:221
Definition stm32_internal_flash_drivers.h:22
HAL_StatusTypeDef unlock_status
Definition stm32_internal_flash_drivers.h:24
HAL_StatusTypeDef lock_status
Definition stm32_internal_flash_drivers.h:23
HAL_StatusTypeDef write_status
Definition stm32_internal_flash_drivers.h:25