Microchip® Advanced Software Framework

storage.h File Reference
#include <asf.h>

Macros

#define CRC8_POLYNOMIAL   (0x31)
 
#define EFLASH_BLANK_BYTE   (0xFF)
 
#define STORAGE_CRITICAL_ENTER()   (__disable_irq())
 
#define STORAGE_CRITICAL_EXIT()   (__enable_irq())
 
#define STORAGE_RESOURCE_GIVE()   {storage_setbusy(false);}
 
#define STORAGE_RESOURCE_TAKE()   {if(storage_isbusy()) {return STR_BUSY;} else {storage_setbusy(true);}}
 

Typedefs

typedef enum storage_status_s storage_status_t
 

Enumerations

enum  storage_status_s {
  STR_OK = 0,
  STR_BAD_LEN,
  STR_BAD_OFFSET,
  STR_HAL_ERR,
  STR_INCONSISTENCY,
  STR_BADALIGN,
  STR_VER_ERR,
  STR_BUSY
}
 

Functions

void frag_base_set (uint32_t base_idx)
 
void frag_init (void)
 
void frag_redund_set (uint32_t redund_idx, uint32_t offset)
 
void print_frame (uint8_t *data, uint32_t len)
 
uint8_t storage_calc_crc8 (uint8_t *data, uint8_t length, uint8_t initCRC)
 
storage_status_t storage_check_blank (void)
 
storage_status_t storage_erase (void)
 
uint8_t storage_fragcheck (uint32_t idx, uint32_t M)
 
void storage_get_own_version (uint32_t *fw, uint32_t *hw)
 
storage_status_t storage_init (void)
 
bool storage_isbusy (void)
 
storage_status_t storage_read_block (uint32_t idx, uint32_t M, uint8_t *data, uint32_t len, uint32_t fsize)
 
void storage_setbusy (bool busy)
 
storage_status_t storage_validate_img (uint32_t size, uint8_t expCRC)
 
storage_status_t storage_write_appinfo (uint32_t len, uint8_t crc)
 
storage_status_t storage_write_block (uint32_t idx, uint32_t M, uint8_t *data, uint32_t len, uint32_t fsize)
 

#define CRC8_POLYNOMIAL   (0x31)
#define EFLASH_BLANK_BYTE   (0xFF)
#define STORAGE_CRITICAL_ENTER ( )    (__disable_irq())
#define STORAGE_CRITICAL_EXIT ( )    (__enable_irq())
#define STORAGE_RESOURCE_GIVE ( )    {storage_setbusy(false);}
#define STORAGE_RESOURCE_TAKE ( )    {if(storage_isbusy()) {return STR_BUSY;} else {storage_setbusy(true);}}

Enumerator
STR_OK 
STR_BAD_LEN 
STR_BAD_OFFSET 
STR_HAL_ERR 
STR_INCONSISTENCY 
STR_BADALIGN 
STR_VER_ERR 
STR_BUSY 

void frag_base_set ( uint32_t  base_idx)
void frag_init ( void  )
void frag_redund_set ( uint32_t  redund_idx,
uint32_t  offset 
)
void print_frame ( uint8_t *  data,
uint32_t  len 
)
uint8_t storage_calc_crc8 ( uint8_t *  data,
uint8_t  length,
uint8_t  initCRC 
)
storage_status_t storage_check_blank ( void  )
storage_status_t storage_erase ( void  )
uint8_t storage_fragcheck ( uint32_t  idx,
uint32_t  M 
)
void storage_get_own_version ( uint32_t *  fw,
uint32_t *  hw 
)
storage_status_t storage_init ( void  )
bool storage_isbusy ( void  )
storage_status_t storage_read_block ( uint32_t  idx,
uint32_t  M,
uint8_t *  data,
uint32_t  len,
uint32_t  fsize 
)
void storage_setbusy ( bool  busy)
storage_status_t storage_validate_img ( uint32_t  size,
uint8_t  expCRC 
)
storage_status_t storage_write_appinfo ( uint32_t  len,
uint8_t  crc 
)
storage_status_t storage_write_block ( uint32_t  idx,
uint32_t  M,
uint8_t *  data,
uint32_t  len,
uint32_t  fsize 
)