From c008e7a262a111e93a24816fd487dbc3c9507fb4 Mon Sep 17 00:00:00 2001 From: Tero Kontkanen Date: Tue, 11 Jul 2017 19:11:51 +0300 Subject: Add FW upload function that takes file contents as pointer to memory --- devicedeployment.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'devicedeployment.h') diff --git a/devicedeployment.h b/devicedeployment.h index f86c7dc..60f1a69 100644 --- a/devicedeployment.h +++ b/devicedeployment.h @@ -53,6 +53,16 @@ typedef enum */ LIB FirmwareUploadStatus smFirmwareUpload(const smbus smhandle, const int smaddress, const char *firmware_filename ); +/** + * @brief smFirmwareUpload Sets drive in firmware upgrade mode if necessary and uploads a new firmware. Call this many until it returns value 100 (complete) or a negative value (error). + * @param smhandle SM bus handle, must be opened before call + * @param smaddress Target SM device address. Can be device in DFU mode or main operating mode. For Argon, one device in a bus must be started into DFU mode by DIP switches and smaddress must be set to 255. + * @param fwData pointer to memory address where .gdf file contents are loaded. Note: on some architectures (such as ARM Cortex M) fwData must be aligned to nearest 4 byte boundary to avoid illegal machine instructions. + * @param fwDataLenght number of bytes in fwData + * @return Enum FirmwareUploadStatus that indicates errors or Complete status. Typecast to integer to get progress value 0-100. + */ +FirmwareUploadStatus smFirmwareUploadFromBuffer( const smbus smhandle, const int smaddress, smuint8 *fwData, const int fwDataLength ); + typedef enum { CFGComplete=100, -- cgit v1.2.3