agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
sram.h File Reference
#include <zrtos/vfs_module.h>
Include dependency graph for sram.h:

Go to the source code of this file.

Data Structures

struct  _zrtos_vfs_module_sram_inode_t
 

Typedefs

typedef struct _zrtos_vfs_module_sram_inode_t zrtos_vfs_module_sram_inode_t
 

Functions

zrtos_error_t zrtos_vfs_module_sram__rw (zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out, bool is_write_op)
 
zrtos_error_t zrtos_vfs_module_sram__on_read (zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out)
 
zrtos_error_t zrtos_vfs_module_sram__on_write (zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out)
 
 ZRTOS_VFS_PLUGIN__INIT (sram, ZRTOS_VFS_PLUGIN__0_ON_OPEN_DEFAULT() ZRTOS_VFS_PLUGIN__1_ON_CLOSE_DEFAULT() ZRTOS_VFS_PLUGIN__2_ON_MOUNT_DEFAULT() ZRTOS_VFS_PLUGIN__3_ON_UMOUNT_DEFAULT() ZRTOS_VFS_PLUGIN__4_ON_READ(zrtos_vfs_module_sram__on_read) ZRTOS_VFS_PLUGIN__5_ON_WRITE(zrtos_vfs_module_sram__on_write) ZRTOS_VFS_PLUGIN__6_ON_CAN_READ_DEFAULT() ZRTOS_VFS_PLUGIN__7_ON_CAN_WRITE_DEFAULT() ZRTOS_VFS_PLUGIN__8_ON_SEEK_DEFAULT() ZRTOS_VFS_PLUGIN__9_ON_IOCTL_DEFAULT())
 

Typedef Documentation

◆ zrtos_vfs_module_sram_inode_t

Function Documentation

◆ zrtos_vfs_module_sram__on_read()

zrtos_error_t zrtos_vfs_module_sram__on_read ( zrtos_vfs_file_t thiz,
char *  path,
void *  buf,
size_t  len,
zrtos_vfs_offset_t  offset,
size_t out 
)

Definition at line 76 of file sram.h.

83  {
85  thiz
86  ,path
87  ,buf
88  ,len
89  ,offset
90  ,out
91  ,false
92  );
93 }
zrtos_error_t zrtos_vfs_module_sram__rw(zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out, bool is_write_op)
Definition: sram.h:22
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zrtos_vfs_module_sram__on_write()

zrtos_error_t zrtos_vfs_module_sram__on_write ( zrtos_vfs_file_t thiz,
char *  path,
void *  buf,
size_t  len,
zrtos_vfs_offset_t  offset,
size_t out 
)

Definition at line 95 of file sram.h.

102  {
104  thiz
105  ,path
106  ,buf
107  ,len
108  ,offset
109  ,out
110  ,true
111  );
112 }
zrtos_error_t zrtos_vfs_module_sram__rw(zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out, bool is_write_op)
Definition: sram.h:22
Here is the call graph for this function:

◆ zrtos_vfs_module_sram__rw()

zrtos_error_t zrtos_vfs_module_sram__rw ( zrtos_vfs_file_t thiz,
char *  path,
void *  buf,
size_t  len,
zrtos_vfs_offset_t  offset,
size_t out,
bool  is_write_op 
)

Definition at line 22 of file sram.h.

30  {
35  thiz
36  )
37  );
38  size_t start_offset = (size_t)offset;
39  uint8_t *data_ptr = ZRTOS_CAST(uint8_t *,buf);
40 
41  if(offset > ZRTOS_TYPES__SIZE_MAX){
42  ret = ZRTOS_ERROR__INVAL;
43  goto L_OUT;
44  }
45 
47  mod->start_addr
48  ,mod->end_addr
49  ,start_offset
50  ,&len
51  )){
52  uint8_t *start_ptr = ZRTOS_CAST(
53  uint8_t*
55  mod->start_addr
56  ,start_offset
57  )
58  );
59 
60  *out = len;
61 
62  if(is_write_op){
63  ZRTOS_TYPES__SWAP(data_ptr,start_ptr);
64  }
65 
66  zrtos_mem__cpy(data_ptr,start_ptr,len);
67 
69  }
70 
71 L_OUT:
72  return ret;
73 }
#define ZRTOS_CAST(type, value)
Definition: cast.h:18
#define ZRTOS_TYPES__SWAP(a, b)
Definition: types.h:149
#define ZRTOS_TYPES__SIZE_MAX
Definition: types.h:170
uint16_t size_t
Definition: types.h:22
void * zrtos_vfs_file__get_inode_data(zrtos_vfs_file_t *thiz)
Definition: vfs_file.h:191
void zrtos_mem__cpy(void *dest, void *src, size_t length)
Definition: mem.h:105
void * zrtos_types__ptr_add(void *ptr, size_t byte_len)
Definition: types.h:35
Successful program execution status.
Definition: error.h:22
Bad address.
Definition: error.h:38
Invalid argument.
Definition: error.h:46
bool zrtos_types__ptr_is_valid_address_range(void *first_address, void *last_address, size_t offset, size_t *length)
Definition: types.h:100
static uint8_t
Definition: mcp2515.h:159
zrtos_error_t
Definition: error.h:20
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZRTOS_VFS_PLUGIN__INIT()