34 lines
804 B
C
34 lines
804 B
C
#ifndef __BLOCK_DEV_DRV_IF_H__
|
|
#define __BLOCK_DEV_DRV_IF_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
#define BLOCK_DEV_SUCCESS (0)
|
|
#define BLOCK_DEV_ERROR (-1)
|
|
typedef struct
|
|
{
|
|
int (*init)(void);
|
|
int (*reset)(void);
|
|
int (*sect_erase)(uint32_t addr, uint32_t sect_cnt);
|
|
int (*block_erase)(uint32_t addr, uint32_t block_cnt);
|
|
int (*read_data)(uint8_t *p_dest, uint32_t addr, uint32_t size);
|
|
int (*page_prog)(uint8_t *p_src, uint32_t addr, uint32_t page_cnt);
|
|
const uint32_t page_size;
|
|
const uint32_t sect_size;
|
|
const uint32_t sect_count;
|
|
const uint32_t block_size;
|
|
const uint32_t block_count;
|
|
const uint32_t page_per_sect;
|
|
} block_dev_drv_if_t;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ! __BLOCK_DEV_DRV_IF_H__ */
|