一、fstorage
1.nrf_fstorage_init 初始化
ret_code_t nrf_fstorage_init(nrf_fstorage_t * p_fs,
nrf_fstorage_api_t * p_api,//API接口(就是带不带协议栈)
void * p_param)//可选参数,可以设为NULL
{
NRF_FSTORAGE_PARAM_CHECK(p_fs, NRF_ERROR_NULL);
NRF_FSTORAGE_PARAM_CHECK(p_api, NRF_ERROR_NULL);
p_fs->p_api = p_api;
return (p_fs->p_api)->init(p_fs, p_param);
}
//定义名称为my_fs的FS实例:定义回调函数和FS空间
NRF_FSTORAGE_DEF(nrf_fstorage_t my_fs) =
{
//FS事件回调函数
.evt_handler = fstorage_evt_handler,
//定义FS的空间(起始地址和结束地址),我们必须自己设置起始地址和结