Opencv 3.1 project on GR-PEACH board
Fork of gr-peach-opencv-project by
hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h@170:54ff26da7eb6, 2017-07-04 (annotated)
- Committer:
- thedo
- Date:
- Tue Jul 04 06:23:13 2017 +0000
- Revision:
- 170:54ff26da7eb6
- Parent:
- 167:1657b442184c
project opencv 3.1 on GR PEACH board, no use SD card.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thedo | 167:1657b442184c | 1 | /* mbed Microcontroller Library |
thedo | 167:1657b442184c | 2 | * Copyright (c) 2017 ARM Limited |
thedo | 167:1657b442184c | 3 | * |
thedo | 167:1657b442184c | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
thedo | 167:1657b442184c | 5 | * you may not use this file except in compliance with the License. |
thedo | 167:1657b442184c | 6 | * You may obtain a copy of the License at |
thedo | 167:1657b442184c | 7 | * |
thedo | 167:1657b442184c | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
thedo | 167:1657b442184c | 9 | * |
thedo | 167:1657b442184c | 10 | * Unless required by applicable law or agreed to in writing, software |
thedo | 167:1657b442184c | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
thedo | 167:1657b442184c | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
thedo | 167:1657b442184c | 13 | * See the License for the specific language governing permissions and |
thedo | 167:1657b442184c | 14 | * limitations under the License. |
thedo | 167:1657b442184c | 15 | */ |
thedo | 167:1657b442184c | 16 | #ifndef MBED_FLASH_DATA_H |
thedo | 167:1657b442184c | 17 | #define MBED_FLASH_DATA_H |
thedo | 167:1657b442184c | 18 | |
thedo | 167:1657b442184c | 19 | #include <stdint.h> |
thedo | 167:1657b442184c | 20 | |
thedo | 167:1657b442184c | 21 | // Target flash algorithm structure |
thedo | 167:1657b442184c | 22 | typedef struct { |
thedo | 167:1657b442184c | 23 | const uint32_t init; |
thedo | 167:1657b442184c | 24 | const uint32_t uninit; |
thedo | 167:1657b442184c | 25 | const uint32_t erase_sector; |
thedo | 167:1657b442184c | 26 | const uint32_t program_page; |
thedo | 167:1657b442184c | 27 | const uint32_t static_base; |
thedo | 167:1657b442184c | 28 | uint32_t *algo_blob; |
thedo | 167:1657b442184c | 29 | } flash_algo_t; |
thedo | 167:1657b442184c | 30 | |
thedo | 167:1657b442184c | 31 | typedef struct { |
thedo | 167:1657b442184c | 32 | const uint32_t start; |
thedo | 167:1657b442184c | 33 | const uint32_t size; |
thedo | 167:1657b442184c | 34 | } sector_info_t; |
thedo | 167:1657b442184c | 35 | |
thedo | 167:1657b442184c | 36 | typedef struct { |
thedo | 167:1657b442184c | 37 | const uint32_t page_size; |
thedo | 167:1657b442184c | 38 | const uint32_t flash_start; |
thedo | 167:1657b442184c | 39 | const uint32_t flash_size; |
thedo | 167:1657b442184c | 40 | const sector_info_t *sectors; |
thedo | 167:1657b442184c | 41 | const uint32_t sector_info_count; |
thedo | 167:1657b442184c | 42 | } flash_target_config_t; |
thedo | 167:1657b442184c | 43 | |
thedo | 167:1657b442184c | 44 | // Target flash configuration |
thedo | 167:1657b442184c | 45 | struct flash_s { |
thedo | 167:1657b442184c | 46 | const flash_target_config_t *target_config; |
thedo | 167:1657b442184c | 47 | const flash_algo_t *flash_algo; |
thedo | 167:1657b442184c | 48 | }; |
thedo | 167:1657b442184c | 49 | |
thedo | 167:1657b442184c | 50 | typedef struct { |
thedo | 167:1657b442184c | 51 | uint32_t r0; |
thedo | 167:1657b442184c | 52 | uint32_t r1; |
thedo | 167:1657b442184c | 53 | uint32_t r2; |
thedo | 167:1657b442184c | 54 | uint32_t r3; |
thedo | 167:1657b442184c | 55 | uint32_t r9; |
thedo | 167:1657b442184c | 56 | uint32_t pc; |
thedo | 167:1657b442184c | 57 | } args_t; |
thedo | 167:1657b442184c | 58 | |
thedo | 167:1657b442184c | 59 | typedef int32_t (*flash_algo_jump_t)(args_t*); |
thedo | 167:1657b442184c | 60 | |
thedo | 167:1657b442184c | 61 | // prototypes for flash algo CMSIS API |
thedo | 167:1657b442184c | 62 | |
thedo | 167:1657b442184c | 63 | typedef int (*CMSIS_Algo_Function_Init)(unsigned long adr, unsigned long clk, unsigned long fnc); |
thedo | 167:1657b442184c | 64 | typedef int (*CMSIS_Algo_Function_UnInit)(unsigned long fnc); |
thedo | 167:1657b442184c | 65 | typedef int (*CMSIS_Algo_Function_EraseSector)(unsigned long adr); |
thedo | 167:1657b442184c | 66 | typedef int (*CMSIS_Algo_Function_EraseChip)(void); |
thedo | 167:1657b442184c | 67 | typedef int (*CMSIS_Algo_Function_ProgramPage)(unsigned long adr, unsigned long sz, unsigned char *buf); |
thedo | 167:1657b442184c | 68 | typedef unsigned long (*CMSIS_Algo_Function_Verify)(unsigned long adr, unsigned long sz, unsigned char *buf); |
thedo | 167:1657b442184c | 69 | |
thedo | 167:1657b442184c | 70 | #ifdef __cplusplus |
thedo | 167:1657b442184c | 71 | extern "C" { |
thedo | 167:1657b442184c | 72 | #endif |
thedo | 167:1657b442184c | 73 | |
thedo | 167:1657b442184c | 74 | /* Set target configuration |
thedo | 167:1657b442184c | 75 | */ |
thedo | 167:1657b442184c | 76 | void flash_set_target_config(flash_t *obj); |
thedo | 167:1657b442184c | 77 | |
thedo | 167:1657b442184c | 78 | #ifdef __cplusplus |
thedo | 167:1657b442184c | 79 | }; |
thedo | 167:1657b442184c | 80 | #endif |
thedo | 167:1657b442184c | 81 | |
thedo | 167:1657b442184c | 82 | |
thedo | 167:1657b442184c | 83 | #endif |
thedo | 167:1657b442184c | 84 |