m2m_flash.h
Go to the documentation of this file.
1 
38 #ifndef __M2M_FLASH_H__
39 #define __M2M_FLASH_H__
40 
41 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
42 INCLUDES
43 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
46 
54 #define FLASH_UPDATEIMAGE_OPTION_UPDATE NBIT0
55 
58 #define FLASH_UPDATEIMAGE_OPTION_VALIDATE NBIT1
59 
62 #define FLASH_UPDATEIMAGE_OPTION_SWITCH NBIT2
63 
65 #define FLASH_SUCCESS 0
66 
67 #define FLASH_ERR_PARAM (-1)
68 
69 #define FLASH_ERR_LOCAL_ACCESS (-2)
70 
71 #define FLASH_ERR_WINC_ACCESS (-3)
72 
73 #define FLASH_ERR_SIZE (-4)
74 
78 #define FLASH_ERR_WINC_CONFLICT (-5)
79 
80 #define FLASH_ERR_UNINIT (-6)
81 
82 #define FLASH_ERR_INTERNAL (-7)
83 
95 typedef enum {
106 
112 typedef enum {
117 }tenuDataFnRW;
118 
124 typedef enum {
129 }tenuImageId;
130 
131 
230 typedef sint8 (*tpfDataAccessFn) (tenuFlashDataFnCtl enuCtl, void *pvStr);
231 
240 typedef struct {
242  uint32 u32TotalSize;
244  tenuDataFnRW enuRW;
246 
254 typedef struct {
256  uint8 *pu8Data;
258  uint32 u32DataSize;
260 
268 typedef struct {
270  uint16 u16LastAccessId;
272  uint8 u8Success;
274  uint8 u8Changed;
276  uint8 u8Init;
278  uint8 u8Reset;
280 
284 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
285 FUNCTION PROTOTYPES
286 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
314 sint8 m2m_flash_updateimage(uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize);
333 sint8 m2m_flash_readimage(tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize);
376 
393 sint8 m2m_flash_rootcert_remove(uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz);
414 sint8 m2m_flash_rootcert_read(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz);
433 sint8 m2m_flash_rootcert_readidx(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index);
434 
446 void m2m_flash_get_state(tstrFlashState *pstrState);
447 
448 
508 sint8 m2m_flash_init(void);
509 
511 #endif /* __M2M_FLASH_H__ */
This module contains common APIs declarations.
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:111
sint8 m2m_flash_rootcert_add(uint16 u16Id, tpfDataAccessFn pfFn, uint32 u32Size)
Add an entry to the WINC TLS root certificate store.
Definition: m2m_flash.c:441
tenuFlashDataFnCtl
Control parameter for tpfDataAccessFn.
Definition: m2m_flash.h:94
sint8 m2m_flash_init(void)
Initialize the module.
Definition: m2m_flash.c:540
sint8 m2m_flash_rootcert_read(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz)
Read an entry from the WINC TLS root certificate store, referenced by entry identifier.
Definition: m2m_flash.c:461
tenuDataFnRW
Indicates whether data is to be read or written.
Definition: m2m_flash.h:111
This structure contains data for local data access (read or write).
Definition: m2m_flash.h:253
WINC3400 IoT Application Interface Internal Types.
unsigned short uint16
Range of values between 0 to 65535.
Definition: nm_bsp.h:96
sint8 m2m_flash_updateimage(uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize)
Write/validate/switch a WINC firmware image.
Definition: m2m_flash.c:224
This structure contains parameters for initializing a local data access (read or write).
Definition: m2m_flash.h:239
tenuImageId
Indicates which image to access in WINC flash.
Definition: m2m_flash.h:123
void m2m_flash_get_state(tstrFlashState *pstrState)
Get information about the module current state and about the most recent access attempt.
Definition: m2m_flash.c:487
sint8 m2m_flash_rootcert_readidx(uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index)
Read an entry from the WINC TLS root certificate store, referenced by entry index.
Definition: m2m_flash.c:477
sint8 m2m_flash_rootcert_remove(uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz)
Remove an entry from the WINC TLS root certificate store.
Definition: m2m_flash.c:450
sint8(* tpfDataAccessFn)(tenuFlashDataFnCtl enuCtl, void *pvStr)
A function of this type is used for local data access. It can be implemented to handle simple RAM acc...
Definition: m2m_flash.h:229
unsigned long uint32
Range of values between 0 to 4294967295.
Definition: nm_bsp.h:103
unsigned char uint8
Range of values between 0 to 255.
Definition: nm_bsp.h:89
sint8 m2m_flash_readimage(tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize)
Read a WINC firmware image.
This structure contains information about an attempted transfer.
Definition: m2m_flash.h:267


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04