6 #ifndef ZRTOS_VFS_MODULE_SPI_SYNC_H 7 #define ZRTOS_VFS_MODULE_SPI_SYNC_H 53 zrtos_vfs_module_spi_sync_control_t
control;
87 ,zrtos_vfs_module_spi_sync_control_t
control 179 if(inode_data->
count == 0){
184 inode_data->
count = *data++;
191 ret = callback(inode_data,file_data,buf,len,l);
194 inode_data->
count -= l;
197 if(inode_data->
count == 0){
#define ZRTOS_CAST(type, value)
#define ZRTOS_TYPES__UINT8_MIN
#define ZRTOS_BINARY__00001100
size_t zrtos_vfs_offset_t
#define ZRTOS_BINARY__01000000
zrtos_vfs_module_spi_sync_control_t
zrtos_error_t zrtos_gpio__set_mode(zrtos_gpio_t *thiz, zrtos_gpio_pin_t pin, zrtos_gpio_mode_t mode)
#define ZRTOS_BINARY__00000011
#define ZRTOS_BINARY__00001000
#define ZRTOS_BINARY__00000001
zrtos_arch_gpio_pin_t zrtos_gpio_pin_t
send least significant bit (bit 0) first
#define ZRTOS_BINARY__00010000
zrtos_error_t zrtos_vfs_module_spi_sync__on_write_helper(zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out, zrtos_error_t(*callback)(zrtos_vfs_module_spi_sync_inode_t *inode_data, zrtos_vfs_module_spi_sync_file_t *file_data, void *buf, size_t len, size_t *l))
int zrtos_task_mutex__unlock(zrtos_task_mutex_t *thiz)
zrtos_error_t zrtos_vfs_module_spi_sync__on_open(zrtos_vfs_file_t *thiz)
Setup (Falling) Sample (Rising) CPOL=1, CPHA=1.
Setup (Rising) Sample (Falling) CPOL=0, CPHA=1.
#define ZRTOS_BINARY__00100000
zrtos_error_t zrtos_vfs_module_spi_sync__on_mount(zrtos_vfs_dentry_t *thiz)
void * zrtos_vfs_file__get_inode_data(zrtos_vfs_file_t *thiz)
bool zrtos_error__is_success(zrtos_error_t thiz)
int zrtos_task_mutex__lock(zrtos_task_mutex_t *thiz)
Sample (Rising) Setup (Falling) CPOL=0, CPHA=0.
struct _zrtos_vfs_module_spi_sync_file_t zrtos_vfs_module_spi_sync_file_t
void * zrtos_vfs_file__get_data(zrtos_vfs_file_t *thiz)
bool zrtos_vfs_module_spi_sync_inode__init(zrtos_vfs_module_spi_sync_inode_t *thiz, zrtos_gpio_t *gpio, zrtos_gpio_pin_t pin_sclk, zrtos_gpio_pin_t pin_mosi, zrtos_gpio_pin_t pin_miso)
Successful program execution status.
bool zrtos_task_mutex__init(zrtos_task_mutex_t *thiz)
bool zrtos_vfs_module_spi_sync_file__init(zrtos_vfs_module_spi_sync_file_t *thiz, zrtos_vfs_module_spi_sync_inode_t *ctx, zrtos_vfs_module_spi_sync_control_t control, zrtos_gpio_pin_t pin_cs, void *data)
zrtos_vfs_module_spi_sync_control_t control
zrtos_gpio_pin_t pin_sclk
#define ZRTOS_BINARY__00000010
zrtos_error_t zrtos_gpio__set_mode_ex(zrtos_gpio_t *thiz,...)
zrtos_error_t zrtos_vfs_module_spi_sync__on_umount(zrtos_vfs_dentry_t *thiz)
zrtos_error_t zrtos_vfs_module_spi_sync__on_close(zrtos_vfs_file_t *thiz)
zrtos_error_t zrtos_gpio__set_high(zrtos_gpio_t *thiz, zrtos_gpio_pin_t pin)
#define ZRTOS_TYPES__UINT8_MAX
send most significant bit (bit 7) first
#define ZRTOS_BINARY__00000100
#define ZRTOS_BINARY__00000000
zrtos_gpio_pin_t pin_miso
zrtos_gpio_pin_t pin_mosi
Sample (Falling) Setup (Rising) CPOL=1, CPHA=0.
void zrtos_vfs_module_spi_sync_inode__deinit(zrtos_vfs_module_spi_sync_file_t *thiz)
zrtos_error_t zrtos_gpio__set_low(zrtos_gpio_t *thiz, zrtos_gpio_pin_t pin)
struct _zrtos_vfs_module_spi_sync_inode_t zrtos_vfs_module_spi_sync_inode_t