/*
 * $Id: efm8ub2_userflash.h 462 2019-06-18 03:27:24Z true $
 * begin 20190527 true
 */

#ifndef INC_DRIVER_USERDATA_H_
#define INC_DRIVER_USERDATA_H_



#include "efm8_config.h"

#include "driver/efm8ub2_hwid.h"

#include <stdint.h>



#define FlashAddr	uint16_t



void userflash_init();

FlashAddr userflash_get_baseaddr();
FlashAddr userflash_reserve_pages(uint8_t erasepage_rsvd);

void userflash_read(FlashAddr addr, uint8_t xdata *dat, uint8_t len);

void userflash_write_byte(FlashAddr addr, uint8_t data dat);
void userflash_erase_page(FlashAddr addr);
void userflash_write(FlashAddr addr, uint8_t xdata *dat, uint8_t datlen);



#endif /* INC_DRIVER_USERDATA_H_ */
