mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
186:707f6e361f3e
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 178:79309dc6340a 1 /*******************************************************************************
Anna Bridge 186:707f6e361f3e 2 * Copyright (c) 2010-2018 Analog Devices, Inc.
AnnaBridge 178:79309dc6340a 3 *
AnnaBridge 178:79309dc6340a 4 * All rights reserved.
AnnaBridge 178:79309dc6340a 5 *
AnnaBridge 178:79309dc6340a 6 * Redistribution and use in source and binary forms, with or without modification,
AnnaBridge 178:79309dc6340a 7 * are permitted provided that the following conditions are met:
AnnaBridge 178:79309dc6340a 8 * - Redistributions of source code must retain the above copyright notice,
AnnaBridge 178:79309dc6340a 9 * this list of conditions and the following disclaimer.
AnnaBridge 178:79309dc6340a 10 * - Redistributions in binary form must reproduce the above copyright notice,
AnnaBridge 178:79309dc6340a 11 * this list of conditions and the following disclaimer in the documentation
AnnaBridge 178:79309dc6340a 12 * and/or other materials provided with the distribution.
AnnaBridge 178:79309dc6340a 13 * - Modified versions of the software must be conspicuously marked as such.
AnnaBridge 178:79309dc6340a 14 * - This software is licensed solely and exclusively for use with processors
AnnaBridge 178:79309dc6340a 15 * manufactured by or for Analog Devices, Inc.
AnnaBridge 178:79309dc6340a 16 * - This software may not be combined or merged with other code in any manner
AnnaBridge 178:79309dc6340a 17 * that would cause the software to become subject to terms and conditions
AnnaBridge 178:79309dc6340a 18 * which differ from those listed here.
AnnaBridge 178:79309dc6340a 19 * - Neither the name of Analog Devices, Inc. nor the names of its
AnnaBridge 178:79309dc6340a 20 * contributors may be used to endorse or promote products derived
AnnaBridge 178:79309dc6340a 21 * from this software without specific prior written permission.
AnnaBridge 178:79309dc6340a 22 * - The use of this software may or may not infringe the patent rights of one
AnnaBridge 178:79309dc6340a 23 * or more patent holders. This license does not release you from the
AnnaBridge 178:79309dc6340a 24 * requirement that you obtain separate licenses from these patent holders
AnnaBridge 178:79309dc6340a 25 * to use this software.
AnnaBridge 178:79309dc6340a 26 *
AnnaBridge 178:79309dc6340a 27 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
AnnaBridge 178:79309dc6340a 28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
AnnaBridge 178:79309dc6340a 29 * INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
AnnaBridge 178:79309dc6340a 30 * DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
AnnaBridge 178:79309dc6340a 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
AnnaBridge 178:79309dc6340a 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
AnnaBridge 178:79309dc6340a 33 * CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
AnnaBridge 178:79309dc6340a 34 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
AnnaBridge 178:79309dc6340a 35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
AnnaBridge 178:79309dc6340a 36 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
AnnaBridge 178:79309dc6340a 37 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
AnnaBridge 178:79309dc6340a 38 * POSSIBILITY OF SUCH DAMAGE.
AnnaBridge 178:79309dc6340a 39 ******************************************************************************/
AnnaBridge 178:79309dc6340a 40
AnnaBridge 189:f392fc9709a3 41 #if DEVICE_FLASH
AnnaBridge 178:79309dc6340a 42 #include "flash_api.h"
AnnaBridge 178:79309dc6340a 43 #include "flash_data.h"
AnnaBridge 178:79309dc6340a 44 #include "mbed_critical.h"
AnnaBridge 178:79309dc6340a 45
AnnaBridge 178:79309dc6340a 46 // This file is automagically generated
AnnaBridge 178:79309dc6340a 47
AnnaBridge 178:79309dc6340a 48 // This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
AnnaBridge 178:79309dc6340a 49
AnnaBridge 178:79309dc6340a 50 static unsigned FLASH_ALGO[] = {
AnnaBridge 178:79309dc6340a 51 0x2000B508,0x4A5B1E41,0x495B6011,0x21076211,0xBF006091,0x68094957,0x99009100,0x0104F001,
AnnaBridge 178:79309dc6340a 52 0xD0F72900,0xF0019900,0xB1010130,0x21002001,0x62114A50,0xB5F0BD08,0x460F4606,0x4D4D4614,
AnnaBridge 178:79309dc6340a 53 0x20013554,0x20007028,0x6048494A,0xD1072C01,0x6D004608,0x0001F000,0xF7FFB110,0xBDF0FFD1,
AnnaBridge 178:79309dc6340a 54 0xE7FC2000,0x20004601,0x62104A42,0xB5084770,0x20004601,0x4B3F1E42,0x461A601A,0x4A3E6191,
AnnaBridge 178:79309dc6340a 55 0x2206621A,0xBF00609A,0x68124A3A,0x9A009200,0x0204F002,0xD0F72A00,0xF0029A00,0xB1020230,
AnnaBridge 178:79309dc6340a 56 0x22002001,0x621A4B33,0xB5FEBD08,0x460B4604,0x46252600,0x48304611,0x62384F2E,0xF04FE052,
AnnaBridge 178:79309dc6340a 57 0x4F2C30FF,0x2B086038,0x6808D304,0x68486138,0xE02F6178,0x3CFFF04F,0xC000F8CD,0xC004F8CD,
AnnaBridge 178:79309dc6340a 58 0x2B084668,0xE8DFD21A,0x1619F003,0x0A0D1013,0x798F0407,0xBF007187,0x7147794F,0x790FBF00,
AnnaBridge 178:79309dc6340a 59 0xBF007107,0x70C778CF,0x788FBF00,0xBF007087,0x7047784F,0x780FBF00,0xE0007007,0xBF00BF00,
AnnaBridge 178:79309dc6340a 60 0xC050F8DF,0xF8CC9F00,0x9F017010,0x7014F8CC,0xBF002308,0x60C5480F,0x4F0E2004,0x463860B8,
AnnaBridge 178:79309dc6340a 61 0xF0006800,0xB1080030,0xE00D2601,0x4809BF00,0x90026800,0xF0009802,0x28000004,0x3B08D0F7,
AnnaBridge 178:79309dc6340a 62 0x35083108,0xD1AA2B00,0x2000BF00,0x62384F01,0xBDFE4630,0x40018000,0x676C7565,0
AnnaBridge 178:79309dc6340a 63 };
AnnaBridge 178:79309dc6340a 64
AnnaBridge 178:79309dc6340a 65 static const flash_algo_t flash_algo_config = {
AnnaBridge 178:79309dc6340a 66 .init = 0x00000037,
AnnaBridge 178:79309dc6340a 67 .uninit = 0x00000065,
AnnaBridge 178:79309dc6340a 68 .erase_sector = 0x0000006F,
AnnaBridge 178:79309dc6340a 69 .program_page = 0x000000AB,
AnnaBridge 178:79309dc6340a 70 .static_base = 0x0000017C,
Anna Bridge 186:707f6e361f3e 71 .algo_blob = (uint32_t *)FLASH_ALGO
AnnaBridge 178:79309dc6340a 72 };
AnnaBridge 178:79309dc6340a 73
AnnaBridge 178:79309dc6340a 74 static const sector_info_t sectors_info[] = {
AnnaBridge 178:79309dc6340a 75 {0x0, 0x800},
AnnaBridge 178:79309dc6340a 76 };
AnnaBridge 178:79309dc6340a 77
AnnaBridge 178:79309dc6340a 78 static const flash_target_config_t flash_target_config = {
AnnaBridge 184:08ed48f1de7f 79 .page_size = 0x8, // minimal programmable unit size
AnnaBridge 178:79309dc6340a 80 .flash_start = 0x0,
AnnaBridge 178:79309dc6340a 81 .flash_size = 0x00040000,
AnnaBridge 178:79309dc6340a 82 .sectors = sectors_info,
AnnaBridge 178:79309dc6340a 83 .sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
AnnaBridge 178:79309dc6340a 84 };
AnnaBridge 178:79309dc6340a 85
AnnaBridge 178:79309dc6340a 86 void flash_set_target_config(flash_t *obj)
AnnaBridge 178:79309dc6340a 87 {
AnnaBridge 178:79309dc6340a 88 obj->flash_algo = &flash_algo_config;
AnnaBridge 178:79309dc6340a 89 obj->target_config = &flash_target_config;
AnnaBridge 178:79309dc6340a 90 }
AnnaBridge 178:79309dc6340a 91 #endif