diff options
| author | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-07-11 19:11:51 +0300 |
|---|---|---|
| committer | Tero Kontkanen <tero.kontkanen@granitedevices.fi> | 2017-07-11 19:12:23 +0300 |
| commit | c008e7a262a111e93a24816fd487dbc3c9507fb4 (patch) | |
| tree | c8544b51c13d1279bf952ac1a210a4147677be1c /devicedeployment.h | |
| parent | 91085eeac735c022238bb58bd3432e84ac8772f3 (diff) | |
| download | SimpleMotionV2-c008e7a262a111e93a24816fd487dbc3c9507fb4.tar.gz SimpleMotionV2-c008e7a262a111e93a24816fd487dbc3c9507fb4.zip | |
Add FW upload function that takes file contents as pointer to memory
Diffstat (limited to 'devicedeployment.h')
| -rw-r--r-- | devicedeployment.h | 10 |
1 files changed, 10 insertions, 0 deletions
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, |
