Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shim.h
Go to the documentation of this file.
1
8
9#ifndef INFUSE_SDK_INCLUDE_INFUSE_DATA_LOGGER_BACKEND_SHIM_H_
10#define INFUSE_SDK_INCLUDE_INFUSE_DATA_LOGGER_BACKEND_SHIM_H_
11
12#include <stdint.h>
13
14#include <zephyr/kernel.h>
15
16#include <infuse/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
28
31 struct {
33 uint32_t num_calls;
35 uint32_t block;
37 uint16_t data_len;
41 int rc;
43 struct {
45 uint32_t num_calls;
47 uint32_t block;
49 uint16_t block_offset;
51 uint16_t data_len;
53 void (*read_cb)(uint32_t block, uint16_t block_offset, uint16_t data_len);
55 int rc;
56 } read;
57 struct {
59 uint32_t num_calls;
61 uint32_t phy_block;
63 uint32_t num;
65 struct k_sem *block_until;
67 int rc;
69 struct {
71 uint32_t num_calls;
73 uint32_t block_hint;
75 struct k_sem *block_until;
77 int rc;
79};
80
89int logger_shim_init(const struct device *dev);
90
97void logger_shim_change_size(const struct device *dev, uint16_t block_size);
98
105void logger_shim_set_current_block(const struct device *dev, uint32_t current_block);
106
116
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* INFUSE_SDK_INCLUDE_INFUSE_DATA_LOGGER_BACKEND_SHIM_H_ */
struct data_logger_shim_function_data * data_logger_backend_shim_data_pointer(const struct device *dev)
Get the pointer to the function data struct.
void logger_shim_change_size(const struct device *dev, uint16_t block_size)
Update the current data size of the shim backend.
int logger_shim_init(const struct device *dev)
Re-initialise the logger.
void logger_shim_set_current_block(const struct device *dev, uint32_t current_block)
Set the current block of the shim backend.
infuse_type
Core Infuse Data Types.
Definition types.h:27
Core Infuse-IoT platform types.
Data structure used for shim.
Definition shim.h:30
uint32_t phy_block
First physical block of the last erase.
Definition shim.h:61
uint16_t block_offset
Block offset of the last read.
Definition shim.h:49
struct data_logger_shim_function_data::@257330224275320365353142355322376001177065306033 write
Write function state.
struct data_logger_shim_function_data::@145205330110353006117277112237043143371014161277 erase
Erase function state.
enum infuse_type data_type
Data type of the last write.
Definition shim.h:39
uint32_t block_hint
Block hint of the last reset.
Definition shim.h:73
uint32_t num_calls
Number of times the write function has been called.
Definition shim.h:33
struct data_logger_shim_function_data::@351310302151240024237375136123124047174032325304 read
Read function state.
struct data_logger_shim_function_data::@376163062331150005066152122033325033360351341143 reset
Reset function state.
uint32_t block
Physical block of the last write.
Definition shim.h:35
uint32_t num
Number of blocks in the last erase.
Definition shim.h:63
uint16_t data_len
Length of the last write.
Definition shim.h:37
struct k_sem * block_until
Optional semaphore the erase function waits on before returning.
Definition shim.h:65
void(* read_cb)(uint32_t block, uint16_t block_offset, uint16_t data_len)
Optional callback run on each read.
Definition shim.h:53
int rc
Value to return from the write function.
Definition shim.h:41