File tree Expand file tree Collapse file tree 2 files changed +22
-19
lines changed
targets/TARGET_Realtek/TARGET_AMEBA Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 19
19
#include "mbed_wait_api.h"
20
20
21
21
#include "rtl8195a.h"
22
+ #include "ota_api.h"
22
23
#include "flash_ext.h"
23
24
24
- #define FLASH_TOP 0x200000
25
- #define FLASH_SECTOR_SIZE 0x1000
26
- #define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
27
- #define OTA_REGION1 0x0b000
28
- #define OTA_REGION2 0xc0000
29
- #define TAG_OFS 0xc
30
- #define VER_OFS 0x10
31
-
32
- #define TAG_DOWNLOAD 0x81950001
33
- #define TAG_VERIFIED 0x81950003
34
-
35
25
static flash_t flash_obj ;
36
26
37
- typedef struct imginfo_s {
38
- uint32_t base ;
39
- uint32_t tag ;
40
- uint64_t ver ;
41
- } imginfo_t ;
42
-
43
-
44
27
void OTA_GetImageInfo (imginfo_t * info )
45
28
{
46
29
uint32_t ver_hi , ver_lo ;
Original file line number Diff line number Diff line change 1
1
#ifndef MBED_OTA_API_H
2
2
#define MBED_OTA_API_H
3
3
4
+ #define FLASH_TOP 0x200000
5
+ #define FLASH_SECTOR_SIZE 0x1000
6
+ #define FLASH_SECTOR_MASK ~(FLASH_SECTOR_SIZE - 1)
7
+ #define OTA_REGION1 0x0b000
8
+ #define OTA_REGION2 0xc0000
9
+ #define TAG_OFS 0xc
10
+ #define VER_OFS 0x10
11
+
12
+ #define TAG_DOWNLOAD 0x81950001
13
+ #define TAG_VERIFIED 0x81950003
14
+
15
+ typedef struct imginfo_s {
16
+ uint32_t base ;
17
+ uint32_t tag ;
18
+ uint64_t ver ;
19
+ } imginfo_t ;
20
+
4
21
#ifdef __cplusplus
5
- extern "C" {
22
+ extern "C" {
6
23
#endif
7
24
25
+ extern void OTA_GetImageInfo (imginfo_t * info );
26
+ extern uint32_t OTA_GetBase (void );
27
+
8
28
extern uint32_t OTA_UpdateImage (uint32_t offset , uint32_t len , uint8_t * data );
9
29
extern uint32_t OTA_ReadImage (uint32_t offset , uint32_t len , uint8_t * data );
10
30
extern uint32_t OTA_MarkUpdateDone (void );
You can’t perform that action at this time.
0 commit comments