Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MEMORY - ECCHRS - Error Corrected Code Controller

Hardware Error Corrected Code Generation (Hamming and Reed-Solomon).

Data Structures

struct  ecchrs_options_t
 Input parameters when initializing ECCHRS. More...
 

Functions

static __always_inline U32 ecchrs_4bit_check_error (volatile avr32_ecchrs_t *ecchrs)
 Check (in the 4-bit corrector mode) if an error is detected after reading one or more sectors from the Nand Flash. More...
 
static __always_inline void ecchrs_correct_rs (volatile avr32_ecchrs_t *ecchrs)
 Launch the 4-bit Reed Solomon correction. More...
 
static __always_inline void ecchrs_freeze (volatile avr32_ecchrs_t *ecchrs)
 Freeze the ECCHRS controller. More...
 
static __always_inline U32 ecchrs_get_cw (volatile avr32_ecchrs_t *ecchrs, U32 id)
 Get the ECCHRS codewords. More...
 
static __always_inline void ecchrs_init (volatile avr32_ecchrs_t *ecchrs, const ecchrs_options_t *opt)
 Initialize the ECCHRS. More...
 
static __always_inline void ecchrs_reset (volatile avr32_ecchrs_t *ecchrs)
 Reset the ECCHRS controller. More...
 
static __always_inline void ecchrs_unfreeze (volatile avr32_ecchrs_t *ecchrs)
 Unfreeze the ECCHRS controller. More...
 

Type Correct mode

#define ECCHRS_TYPECORRECT_1_BIT_MODE_0   AVR32_ECCHRS_MD_TYPECORREC_ECC1_PAGE
 1 bit correction for a page size of 512/1024/2048/4096 bytes. More...
 
#define ECCHRS_TYPECORRECT_1_BIT_MODE_1   AVR32_ECCHRS_MD_TYPECORREC_ECC1_256B
 1 bit correction for 256 bytes of data for a page size of 512/2048/4096 bytes. More...
 
#define ECCHRS_TYPECORRECT_1_BIT_MODE_2   AVR32_ECCHRS_MD_TYPECORREC_ECC1_512B
 1 bit correction for 512 bytes of data for a page size of 512/2048/4096 bytes. More...
 
#define ECCHRS_TYPECORRECT_4_BIT   AVR32_ECCHRS_MD_TYPECORREC_ECC4_512B
 4 correction for 512 bytes of data for a page size of 512 to 4096 bytes (by 512 bytes). More...
 

Nand Flash Page Size when using ECCHRS_TYPECORRECT_1_BIT_MODE_x

#define ECCHRS_PAGESIZE_1_BIT_528_W   0
 Page of 528 words. More...
 
#define ECCHRS_PAGESIZE_1_BIT_1056_W   1
 Page of 1056 words. More...
 
#define ECCHRS_PAGESIZE_1_BIT_2112_W   2
 Page of 2112 words. More...
 
#define ECCHRS_PAGESIZE_1_BIT_4224_W   3
 Page of 4224 words. More...
 

Nand Flash Page Size when using ECCHRS_TYPECORRECT_4_BIT

#define ECCHRS_PAGESIZE_4_BIT_528_W   0
 Page of 528 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_1056_W   1
 Page of 1056 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_1584_W   2
 Page of 1584 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_2112_W   3
 Page of 2112 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_2640_W   4
 Page of 2640 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_3168_W   5
 Page of 3168 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_3696_W   6
 Page of 3696 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_4224_W   7
 Page of 4224 words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_NR_W(x)   ((x)/528 -1)
 Page of (x) words. More...
 
#define ECCHRS_PAGESIZE_4_BIT_NR_S(x)   ((x) -1)
 Page of (x) sectors. More...
 

#define ECCHRS_PAGESIZE_1_BIT_1056_W   1

Page of 1056 words.

#define ECCHRS_PAGESIZE_1_BIT_2112_W   2

Page of 2112 words.

#define ECCHRS_PAGESIZE_1_BIT_4224_W   3

Page of 4224 words.

#define ECCHRS_PAGESIZE_1_BIT_528_W   0

Page of 528 words.

#define ECCHRS_PAGESIZE_4_BIT_1056_W   1

Page of 1056 words.

#define ECCHRS_PAGESIZE_4_BIT_1584_W   2

Page of 1584 words.

#define ECCHRS_PAGESIZE_4_BIT_2112_W   3

Page of 2112 words.

#define ECCHRS_PAGESIZE_4_BIT_2640_W   4

Page of 2640 words.

#define ECCHRS_PAGESIZE_4_BIT_3168_W   5

Page of 3168 words.

#define ECCHRS_PAGESIZE_4_BIT_3696_W   6

Page of 3696 words.

#define ECCHRS_PAGESIZE_4_BIT_4224_W   7

Page of 4224 words.

#define ECCHRS_PAGESIZE_4_BIT_528_W   0

Page of 528 words.

#define ECCHRS_PAGESIZE_4_BIT_NR_S (   x)    ((x) -1)

Page of (x) sectors.

#define ECCHRS_PAGESIZE_4_BIT_NR_W (   x)    ((x)/528 -1)

Page of (x) words.

#define ECCHRS_TYPECORRECT_1_BIT_MODE_0   AVR32_ECCHRS_MD_TYPECORREC_ECC1_PAGE

1 bit correction for a page size of 512/1024/2048/4096 bytes.

#define ECCHRS_TYPECORRECT_1_BIT_MODE_1   AVR32_ECCHRS_MD_TYPECORREC_ECC1_256B

1 bit correction for 256 bytes of data for a page size of 512/2048/4096 bytes.

#define ECCHRS_TYPECORRECT_1_BIT_MODE_2   AVR32_ECCHRS_MD_TYPECORREC_ECC1_512B

1 bit correction for 512 bytes of data for a page size of 512/2048/4096 bytes.

#define ECCHRS_TYPECORRECT_4_BIT   AVR32_ECCHRS_MD_TYPECORREC_ECC4_512B

4 correction for 512 bytes of data for a page size of 512 to 4096 bytes (by 512 bytes).

static __always_inline U32 ecchrs_4bit_check_error ( volatile avr32_ecchrs_t *  ecchrs)
static

Check (in the 4-bit corrector mode) if an error is detected after reading one or more sectors from the Nand Flash.

Parameters
ecchrsBase address of the ECCHRS instance.
Returns
bitfield of the corrupted sector (bit 0: sector 0; bit 1: sector1, ../..).
static __always_inline void ecchrs_correct_rs ( volatile avr32_ecchrs_t *  ecchrs)
static

Launch the 4-bit Reed Solomon correction.

Parameters
ecchrsBase address of the ECCHRS instance.
static __always_inline void ecchrs_freeze ( volatile avr32_ecchrs_t *  ecchrs)
static

Freeze the ECCHRS controller.

Parameters
ecchrsBase address of the ECCHRS instance.

Referenced by nf_check_status(), and nf_wait_busy().

static __always_inline U32 ecchrs_get_cw ( volatile avr32_ecchrs_t *  ecchrs,
U32  id 
)
static

Get the ECCHRS codewords.

Parameters
ecchrsBase address of the ECCHRS instance.
idCodewords id to return.
static __always_inline void ecchrs_init ( volatile avr32_ecchrs_t *  ecchrs,
const ecchrs_options_t opt 
)
static

Initialize the ECCHRS.

Parameters
ecchrsBase address of the ECCHRS instance.
optOptions needed to set up the ECCHRS (see ecchrs_options_t).

References ecchrs_options_t::pagesize, and ecchrs_options_t::typecorrect.

static __always_inline void ecchrs_reset ( volatile avr32_ecchrs_t *  ecchrs)
static

Reset the ECCHRS controller.

Parameters
ecchrsBase address of the ECCHRS instance.
static __always_inline void ecchrs_unfreeze ( volatile avr32_ecchrs_t *  ecchrs)
static

Unfreeze the ECCHRS controller.

Parameters
ecchrsBase address of the ECCHRS instance.

Referenced by nf_check_status(), and nf_wait_busy().