WE310F5  39.00.000
m2mb_flash.h
Go to the documentation of this file.
1 /*===============================================================================================*/
2 /* >>> Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. <<< */
23 #ifndef M2MB_FLASH_API_H
24 #define M2MB_FLASH_API_H
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
40 /*-----------------------------------------------------------------------------------------------*/
41 
46 /*-----------------------------------------------------------------------------------------------*/
47 
48 
49 /* Global declarations ==========================================================================*/
50 #define M2MB_FLASH_PARTITION_ALL 0x7FFF
51 
52 /* Global typedefs ==============================================================================*/
53 
54 typedef struct M2MB_FLASH_INFO
55 {
62 
63 /* Global functions =========================================================*/
64 
65 /*---------------------------------------------------------------------------*/
92 /*---------------------------------------------------------------------------*/
93 INT32 m2mb_flash_open( UINT32 partition_id, HANDLE *handle);
94 
121 /*---------------------------------------------------------------------------*/
122 INT32 m2mb_flash_close( HANDLE handle );
123 
158 /*---------------------------------------------------------------------------*/
159 INT32 m2mb_flash_get_info( HANDLE handle, M2MB_FLASH_INFO_T *flash_info );
160 
191 /*---------------------------------------------------------------------------*/
192 INT32 m2mb_flash_erase( HANDLE handle, UINT32 start_block, UINT32 block_count);
193 
227 /*---------------------------------------------------------------------------*/
228 INT32 m2mb_flash_write( HANDLE handle, UINT32 byte_offset, UINT32 byte_count,
229  void *buffer );
230 
265 /*---------------------------------------------------------------------------*/
266 INT32 m2mb_flash_read( HANDLE handle, UINT32 byte_offset, UINT32 byte_count,
267  void *buffer);
268 
299 /*---------------------------------------------------------------------------*/
300 INT32 m2mb_flash_erase_bulk( HANDLE handle, UINT32 start_block,
301  UINT32 block_count );
302 
303 
304 
308 /*-----------------------------------------------------------------------------------------------*/
309 
310 
311 #ifdef __cplusplus
312 }
313 #endif
314 #endif
INT32 m2mb_flash_erase_bulk(HANDLE handle, UINT32 start_block, UINT32 block_count)
m2mb_flash_erase_bulk Erases given flash blocks of specified block size.
INT32 m2mb_flash_open(UINT32 partition_id, HANDLE *handle)
m2mb_flash_open opens handle to a flash partition.
INT32 m2mb_flash_close(HANDLE handle)
m2mb_flash_close Closes handle to a flash partition.
INT32 m2mb_flash_write(HANDLE handle, UINT32 byte_offset, UINT32 byte_count, void *buffer)
m2mb_flash_write writes to the flash.
UINT16 page_size_bytes
Definition: m2mb_flash.h:60
unsigned short UINT16
Definition: m2mb_types.h:87
UINT32 version_id
Definition: m2mb_flash.h:57
INT32 m2mb_flash_read(HANDLE handle, UINT32 byte_offset, UINT32 byte_count, void *buffer)
m2mb_flash_read to read the flash.
struct M2MB_FLASH_INFO M2MB_FLASH_INFO_T
UINT32 block_count
Definition: m2mb_flash.h:58
INT32 m2mb_flash_erase(HANDLE handle, UINT32 start_block, UINT32 block_count)
m2mb_flash_erase erases given flash blocks.
UINT16 pages_per_block
Definition: m2mb_flash.h:59
INT32 m2mb_flash_get_info(HANDLE handle, M2MB_FLASH_INFO_T *flash_info)
m2mb_flash_get_info Gets flash device information.
unsigned long int UINT32
Definition: m2mb_types.h:88
signed int INT32
Definition: m2mb_types.h:82
void * HANDLE
Definition: m2mb_types.h:98
UINT32 device_id
Definition: m2mb_flash.h:56