27 lines
732 B
C
27 lines
732 B
C
#pragma once
|
|
#ifndef __BLOCK_DRV_IF_H__
|
|
#define __BLOCK_DRV_IF_H__
|
|
|
|
#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;
|
|
|
|
#endif // !__BLOCK_DRV_IF_H__
|