PAL
A Platform Abstraction Layer connects the mbed-client with the underlying platform.
|
Functions | |
palStatus_t | pal_imageInitAPI (palImageSignalEvent_t CBfunction) |
palStatus_t | pal_imageDeInit (void) |
palStatus_t | pal_imagePrepare (palImageId_t imageId, palImageHeaderDeails_t *headerDetails) |
palStatus_t | pal_imageWrite (palImageId_t imageId, size_t offset, palConstBuffer_t *chunk) |
palStatus_t | pal_imageFinalize (palImageId_t imageId) |
palStatus_t | pal_imageGetDirectMemoryAccess (palImageId_t imageId, void **imagePtr, size_t *imageSizeInBytes) |
palStatus_t | pal_imageReadToBuffer (palImageId_t imageId, size_t offset, palBuffer_t *chunk) |
palStatus_t | pal_imageActivate (palImageId_t imageId) |
palStatus_t | pal_imageGetActiveHash (palBuffer_t *hash) |
palStatus_t | pal_imageGetActiveVersion (palBuffer_t *version) |
palStatus_t | pal_imageWriteDataToMemory (palImagePlatformData_t dataId, const palConstBuffer_t *const dataBuffer) |
palStatus_t pal_imageActivate | ( | palImageId_t | imageId | ) |
Sets image imageId to be the active image (after device reset). the function must call g_palUpdateServiceCBfunc before after finished
[in] | imageId | the image id |
palStatus_t pal_imageDeInit | ( | void | ) |
clearing all the resources used by the pal_update APIs
palStatus_t pal_imageFinalize | ( | palImageId_t | imageId | ) |
Flushes the image data and sets the version of imageId to imageVersion. the function must call g_palUpdateServiceCBfunc before after finished
[in] | imageId | the image id |
[in] | imageVersion | a struct containing the version as a buffer and the size |
palStatus_t pal_imageGetActiveHash | ( | palBuffer_t * | hash | ) |
Retrieve the hash value of the active image to hash buffer with max size hash maxBufferLength and sets to hash bufferLength to the hash size. the function must call g_palUpdateServiceCBfunc before after finished
[out] | hash | struct containing the hash and actual size of hash read |
palStatus_t pal_imageGetActiveVersion | ( | palBuffer_t * | version | ) |
Retrieve the version of the active image to version buffer with size set to version bufferLength. the function must call g_palUpdateServiceCBfunc before after finished
[out] | version | struct containing the version and actual size of version read |
palStatus_t pal_imageGetDirectMemoryAccess | ( | palImageId_t | imageId, |
void ** | imagePtr, | ||
size_t * | imageSizeInBytes | ||
) |
Verifies whether image imageId is readable and sets imagePtr to point to the beginning of start of the image in the memory and imageSizeInBytes to the image size. In case of failure sets imagePtr to NULL and returns relevant palStatus_t error
[in] | imageId | the image id |
[out] | imagePtr | pointer to the start of the image |
[out] | imageSizeInBytes | the size of the image |
palStatus_t pal_imageInitAPI | ( | palImageSignalEvent_t | CBfunction | ) |
setting the callback function that will be called before the end of each API (except imageGetDirectMemAccess)
WARNING: please do not change this function! this function loads a call back function received from the upper layer (service). the call back should be called at the end of each function (except pal_plat_imageGetDirectMemAccess) the call back receives the event type that just happened defined by the ENUM palImageEvents_t.
if you will not call the call back at the end the service behaver will be undefined the function must call g_palUpdateServiceCBfunc before after finished
[in] | CBfunction | pointer to the call back function |
palStatus_t pal_imagePrepare | ( | palImageId_t | imageId, |
palImageHeaderDeails_t * | headerDetails | ||
) |
Prepare to write image with id imageId and size imageSize in suitable memory region (Space availability will be verified and reserved). the function must call g_palUpdateServiceCBfunc before after finished
[in] | imageId | the image id |
[in] | imageSize | the size of the image |
palStatus_t pal_imageReadToBuffer | ( | palImageId_t | imageId, |
size_t | offset, | ||
palBuffer_t * | chunk | ||
) |
Reads max of chunk maxBufferLength bytes from image imageId with relative offset offset and stores it in chunk buffer. And sets chunk bufferLength value to the actual number of bytes read. Note: Please use this API in case image is not directly accessible via imageGetDirectMemAccess function.
the function must call g_palUpdateServiceCBfunc before after finished
[in] | imageId | the image id |
[in] | offset | offset to start read from |
[out] | chunk | struct containing the data and actual bytes read |
palStatus_t pal_imageWrite | ( | palImageId_t | imageId, |
size_t | offset, | ||
palConstBuffer_t * | chunk | ||
) |
Writes the data in chunk buffer with size chunk bufferLength in the location of imageId adding the relative offset. the function must call g_palUpdateServiceCBfunc before after finished
[in] | imageId | the image id |
[in] | offset | the offset to write the data into |
[in] | pointer | to struct containing the data and the data length to write |
palStatus_t pal_imageWriteDataToMemory | ( | palImagePlatformData_t | dataId, |
const palConstBuffer_t *const | dataBuffer | ||
) |
Writing the data of dataId stored in dataBuffer to memory accessible to bootloader. Currently only has is available. the function must call g_palUpdateServiceCBfunc before after finished
[in] | dataId | one of the members of palImagePlatformData_t enum |
[in] | dataBuffer | struct containing the data and actual bytes to be written |