Commit cfb25c74 authored by Yurii Hamann's avatar Yurii Hamann Committed by Kumar Gala
Browse files

drivers: flash: stm32: STM32F7 flash memory suport



Added flash memory support for STM32F7 family microcontrollers

Signed-off-by: default avatarYurii Hamann <yurii@hamann.site>
parent 4df673f3
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018 Yurii Hamann
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef _STM32F7X_FLASH_REGISTERS_H_
#define _STM32F7X_FLASH_REGISTERS_H_

/**
 * @brief
 *
 * Based on reference manual:
 *   RM0385 Reference manual STM32F75xxx and STM32F74xxx
 *   advanced ARM(r)-based 32-bit MCUs
 *
 * Chapter 3: Embedded Flash Memory
 */

union __flash_acr {
	u32_t val;
	struct {
		u32_t latency :4 __packed;
		u32_t rsvd__4_7 :4 __packed;
		u32_t prften :1 __packed;
		u32_t arten :1 __packed;
		u32_t rsvd__10 :1 __packed;
		u32_t artrst :1 __packed;
		u32_t rsvd__12_31 :20 __packed;
	} bit;
};

/* 3.7 FLASH registers */
struct stm32f7x_flash {
	volatile union __flash_acr acr;
	volatile u32_t keyr;
	volatile u32_t optkeyr;
	volatile u32_t sr;
	volatile u32_t cr;
	volatile u32_t optcr;
	volatile u32_t optcr1;
};

#endif	/* _STM32F7X_FLASHREGISTERS_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -8,5 +8,6 @@
#define _STM32F7_SOC_REGISTERS_H_

/* include register mapping headers */
#include "flash_registers.h"

#endif /* _STM32F7_SOC_REGISTERS_H_ */