PAL A Platform Abstraction Layer connects the mbed-client with the underlying platform.

- Main Page
- Data Structures
- Files

- File List
- Globals

pal_update.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2016 ARM Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 * Licensed under the Apache License, Version 2.0 (the License); you may
5 * not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef SOURCE_PAL_IMPL_SERVICES_API_PAL_UPDATE_H_
19 #define SOURCE_PAL_IMPL_SERVICES_API_PAL_UPDATE_H_
20
21 #include "pal_macros.h"
22 #include "pal_types.h"
23
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 typedef uint32_t palImageId_t;
32
33 typedef struct _palImageHeaderDeails_t
34 {
35 size_t imageSize;
36 palBuffer_t hash;
37 palBuffer_t version;
38 }palImageHeaderDeails_t;
39
40
41 typedef enum _palImagePlatformData_t
42 {
43 PAL_IMAGE_DATA_FIRST = 0,
44 PAL_IMAGE_DATA_HASH = PAL_IMAGE_DATA_FIRST,
45 PAL_IMAGE_DATA_LAST
46 }palImagePlatformData_t;
47
48 typedef enum _palImageEvents_t
49 {
50 PAL_IMAGE_EVENT_FIRST = -1,
51 PAL_IMAGE_EVENT_ERROR = PAL_IMAGE_EVENT_FIRST,
52 PAL_IMAGE_EVENT_INIT ,
53 PAL_IMAGE_EVENT_PREPARE,
54 PAL_IMAGE_EVENT_WRITE,
55 PAL_IMAGE_EVENT_FINALIZE,
56 PAL_IMAGE_EVENT_READTOBUFFER,
57 PAL_IMAGE_EVENT_ACTIVATE,
58 PAL_IMAGE_EVENT_GETACTIVEHASH,
59 PAL_IMAGE_EVENT_GETACTIVEVERSION,
60 PAL_IMAGE_EVENT_WRITEDATATOMEMORY,
61 PAL_IMAGE_EVENT_LAST
62 } palImageEvents_t;
63
64 typedef void (*palImageSignalEvent_t)( palImageEvents_t event);
65
66
67
81 palStatus_t pal_imageInitAPI(palImageSignalEvent_t CBfunction);
82
83
87 palStatus_t pal_imageDeInit(void);
88
89
90
97 palStatus_t pal_imagePrepare(palImageId_t imageId, palImageHeaderDeails_t* headerDetails);
98
106 palStatus_t pal_imageWrite (palImageId_t imageId, size_t offset, palConstBuffer_t *chunk);
107
108
109
116 palStatus_t pal_imageFinalize(palImageId_t imageId);
117
118
126 palStatus_t pal_imageGetDirectMemoryAccess(palImageId_t imageId, void** imagePtr, size_t *imageSizeInBytes);
127
139 palStatus_t pal_imageReadToBuffer(palImageId_t imageId, size_t offset, palBuffer_t* chunk);
140
146 palStatus_t pal_imageActivate(palImageId_t imageId);
147
152 palStatus_t pal_imageGetActiveHash(palBuffer_t* hash);
153
158 palStatus_t pal_imageGetActiveVersion(palBuffer_t* version);
159
165 palStatus_t pal_imageWriteDataToMemory(palImagePlatformData_t dataId, const palConstBuffer_t* const dataBuffer);
166
167 #ifdef __cplusplus
168 }
169 #endif
170 #endif /* SOURCE_PAL_IMPL_SERVICES_API_PAL_UPDATE_H_ */
pal_imageDeInit
palStatus_t pal_imageDeInit(void)
Definition: pal_update.c:34
_palBuffer_t
Definition: pal_types.h:34
PAL_IMAGE_EVENT_INIT
Definition: pal_update.h:52
_palImageHeaderDeails_t::imageSize
size_t imageSize
Definition: pal_update.h:35
PAL_IMAGE_EVENT_ERROR
Definition: pal_update.h:51
pal_imageWriteDataToMemory
palStatus_t pal_imageWriteDataToMemory(palImagePlatformData_t dataId, const palConstBuffer_t *const dataBuffer)
Definition: pal_update.c:111
PAL_IMAGE_EVENT_GETACTIVEVERSION
Definition: pal_update.h:59
pal_imageWrite
palStatus_t pal_imageWrite(palImageId_t imageId, size_t offset, palConstBuffer_t *chunk)
Definition: pal_update.c:54
pal_imageGetDirectMemoryAccess
palStatus_t pal_imageGetDirectMemoryAccess(palImageId_t imageId, void **imagePtr, size_t *imageSizeInBytes)
Definition: pal_update.c:70
PAL_IMAGE_EVENT_READTOBUFFER
Definition: pal_update.h:56
_palImageHeaderDeails_t
Definition: pal_update.h:33
PAL_IMAGE_EVENT_GETACTIVEHASH
Definition: pal_update.h:58
PAL_IMAGE_EVENT_LAST
Definition: pal_update.h:61
_palImagePlatformData_t
_palImagePlatformData_t
Definition: pal_update.h:41
pal_imagePrepare
palStatus_t pal_imagePrepare(palImageId_t imageId, palImageHeaderDeails_t *headerDetails)
Definition: pal_update.c:44
pal_imageActivate
palStatus_t pal_imageActivate(palImageId_t imageId)
Definition: pal_update.c:87
palImageHeaderDeails_t
struct _palImageHeaderDeails_t palImageHeaderDeails_t
PAL_IMAGE_EVENT_FIRST
Definition: pal_update.h:50
pal_imageReadToBuffer
palStatus_t pal_imageReadToBuffer(palImageId_t imageId, size_t offset, palBuffer_t *chunk)
Definition: pal_update.c:78
PAL_IMAGE_EVENT_ACTIVATE
Definition: pal_update.h:57
PAL_IMAGE_DATA_LAST
Definition: pal_update.h:45
_palConstBuffer_t
Definition: pal_types.h:41
pal_imageInitAPI
palStatus_t pal_imageInitAPI(palImageSignalEvent_t CBfunction)
Definition: pal_update.c:26
_palImageHeaderDeails_t::version
palBuffer_t version
Definition: pal_update.h:37
palImageSignalEvent_t
void(* palImageSignalEvent_t)(palImageEvents_t event)
Definition: pal_update.h:64
pal_types.h
PAL_IMAGE_EVENT_FINALIZE
Definition: pal_update.h:55
_palImageEvents_t
_palImageEvents_t
Definition: pal_update.h:48
palImageId_t
uint32_t palImageId_t
Definition: pal_update.h:31
pal_macros.h
palImagePlatformData_t
enum _palImagePlatformData_t palImagePlatformData_t
PAL_IMAGE_DATA_FIRST
Definition: pal_update.h:43
PAL_IMAGE_EVENT_WRITE
Definition: pal_update.h:54
_palImageHeaderDeails_t::hash
palBuffer_t hash
Definition: pal_update.h:36
PAL_IMAGE_DATA_HASH
Definition: pal_update.h:44
PAL_IMAGE_EVENT_WRITEDATATOMEMORY
Definition: pal_update.h:60
pal_imageGetActiveHash
palStatus_t pal_imageGetActiveHash(palBuffer_t *hash)
Definition: pal_update.c:95
palImageEvents_t
enum _palImageEvents_t palImageEvents_t
palStatus_t
int32_t palStatus_t
Definition: pal_types.h:31
pal_imageFinalize
palStatus_t pal_imageFinalize(palImageId_t imageId)
Definition: pal_update.c:62
pal_imageGetActiveVersion
palStatus_t pal_imageGetActiveVersion(palBuffer_t *version)
Definition: pal_update.c:103
PAL_IMAGE_EVENT_PREPARE
Definition: pal_update.h:53