mbed-os

Fork of mbed-os by erkin yucel

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /**
elessair 0:f269e3021894 2 ******************************************************************************
elessair 0:f269e3021894 3 * @file flash_map.h
elessair 0:f269e3021894 4 * @brief Flash controller HW register map
elessair 0:f269e3021894 5 * @internal
elessair 0:f269e3021894 6 * @author ON Semiconductor
elessair 0:f269e3021894 7 * $Rev: 2686 $
elessair 0:f269e3021894 8 * $Date: 2014-01-23 13:31:54 +0530 (Thu, 23 Jan 2014) $
elessair 0:f269e3021894 9 ******************************************************************************
elessair 0:f269e3021894 10 * Copyright 2016 Semiconductor Components Industries LLC (d/b/a “ON Semiconductor”).
elessair 0:f269e3021894 11 * All rights reserved. This software and/or documentation is licensed by ON Semiconductor
elessair 0:f269e3021894 12 * under limited terms and conditions. The terms and conditions pertaining to the software
elessair 0:f269e3021894 13 * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
elessair 0:f269e3021894 14 * (“ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software”) and
elessair 0:f269e3021894 15 * if applicable the software license agreement. Do not use this software and/or
elessair 0:f269e3021894 16 * documentation unless you have carefully read and you agree to the limited terms and
elessair 0:f269e3021894 17 * conditions. By using this software and/or documentation, you agree to the limited
elessair 0:f269e3021894 18 * terms and conditions.
elessair 0:f269e3021894 19 *
elessair 0:f269e3021894 20 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
elessair 0:f269e3021894 21 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
elessair 0:f269e3021894 22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
elessair 0:f269e3021894 23 * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
elessair 0:f269e3021894 24 * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
elessair 0:f269e3021894 25 * @endinternal
elessair 0:f269e3021894 26 *
elessair 0:f269e3021894 27 * @ingroup flash
elessair 0:f269e3021894 28 *
elessair 0:f269e3021894 29 * @details
elessair 0:f269e3021894 30 * <p>
elessair 0:f269e3021894 31 * Flash controller HW register map description
elessair 0:f269e3021894 32 * </p>
elessair 0:f269e3021894 33 *
elessair 0:f269e3021894 34 */
elessair 0:f269e3021894 35 #ifndef FLASH_MAP_H_
elessair 0:f269e3021894 36 #define FLASH_MAP_H_
elessair 0:f269e3021894 37
elessair 0:f269e3021894 38 #include "architecture.h"
elessair 0:f269e3021894 39
elessair 0:f269e3021894 40 /** Flash Control HW Structure Overlay */
elessair 0:f269e3021894 41 typedef struct {
elessair 0:f269e3021894 42 union {
elessair 0:f269e3021894 43 struct {
elessair 0:f269e3021894 44 __I uint32_t FLASH_A_BUSY:1; /**< Busy A */
elessair 0:f269e3021894 45 __I uint32_t FLASH_B_BUSY:1; /**< Busy B */
elessair 0:f269e3021894 46 __I uint32_t FLASH_A_UNLOCK:1; /**< Unlock A */
elessair 0:f269e3021894 47 __I uint32_t FLASH_B_UNLOCK:1; /**< Unlock B */
elessair 0:f269e3021894 48 __I uint32_t FLASH_ERROR:3; /**< 000 – No Error, 111 – Attempt to access an array while it is busy powering up, 001 – Attempt to erase bootloader in the field, 010 – Attempt to access array during erase, 100 – Attempt to access array during write */
elessair 0:f269e3021894 49 } BITS;
elessair 0:f269e3021894 50 __I uint32_t WORD;
elessair 0:f269e3021894 51 } STATUS;
elessair 0:f269e3021894 52 union {
elessair 0:f269e3021894 53 struct {
elessair 0:f269e3021894 54 __IO uint32_t FLASHB_PD:1;
elessair 0:f269e3021894 55 __IO uint32_t FLASHA_PD:1;
elessair 0:f269e3021894 56 __IO uint32_t REMAP:1;
elessair 0:f269e3021894 57 __IO uint32_t WR_INT_EN:1;
elessair 0:f269e3021894 58 __IO uint32_t ERASE_INT_EN:1;
elessair 0:f269e3021894 59 __IO uint32_t ERROR_INT_EN:1;
elessair 0:f269e3021894 60 __IO uint32_t WRITE_BLOCK:1;
elessair 0:f269e3021894 61 } BITS;
elessair 0:f269e3021894 62 __IO uint32_t WORD;
elessair 0:f269e3021894 63 } CONTROL;
elessair 0:f269e3021894 64 union {
elessair 0:f269e3021894 65 struct {
elessair 0:f269e3021894 66 __IO uint32_t PAGEERASE:1; /**< Erase a single page */
elessair 0:f269e3021894 67 __IO uint32_t MASSERASE:1; /**< MASS Erase */
elessair 0:f269e3021894 68 } BITS;
elessair 0:f269e3021894 69 __IO uint32_t WORD;
elessair 0:f269e3021894 70 } COMMAND;
elessair 0:f269e3021894 71 __IO uint32_t ADDR;
elessair 0:f269e3021894 72 __IO uint32_t UNLOCK1;
elessair 0:f269e3021894 73 __IO uint32_t UNLOCKA;
elessair 0:f269e3021894 74 __IO uint32_t UNLOCKB;
elessair 0:f269e3021894 75 union {
elessair 0:f269e3021894 76 struct {
elessair 0:f269e3021894 77 __I uint32_t INT_PEND:1; // Interrupt pending
elessair 0:f269e3021894 78 __I uint32_t INT_TYPE:3; // Interrupt type
elessair 0:f269e3021894 79 } BITS;
elessair 0:f269e3021894 80 __I uint32_t WORD;
elessair 0:f269e3021894 81 } INT_STATUS;
elessair 0:f269e3021894 82 } FlashReg_t, *FlashReg_pt;
elessair 0:f269e3021894 83
elessair 0:f269e3021894 84 #endif /* FLASH_MAP_H_ */