agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
avr/spi/spi.h File Reference
#include <avr/io.h>
#include <avr/interrupt.h>
#include <zrtos/vfs_plugin.h>
#include <zrtos/vfs/module/spi/spi.h>
Include dependency graph for avr/spi/spi.h:

Go to the source code of this file.

Functions

void zrtos_vfs_module_avr_spi__on_interrupt ()
 
 ISR (SPI_STC_vect, ISR_NOBLOCK)
 
zrtos_error_t zrtos_vfs_module_avr_spi__on_mount (zrtos_vfs_dentry_t *thiz)
 
zrtos_error_t zrtos_vfs_module_avr_spi__on_umount (zrtos_vfs_dentry_t *thiz)
 
zrtos_error_t zrtos_vfs_module_avr_spi__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 (avr_spi, ZRTOS_VFS_PLUGIN__0_ON_OPEN(zrtos_vfs_module_spi__on_open) ZRTOS_VFS_PLUGIN__1_ON_CLOSE(zrtos_vfs_module_spi__on_close) ZRTOS_VFS_PLUGIN__2_ON_MOUNT(zrtos_vfs_module_avr_spi__on_mount) ZRTOS_VFS_PLUGIN__3_ON_UMOUNT(zrtos_vfs_module_avr_spi__on_umount) ZRTOS_VFS_PLUGIN__4_ON_READ(zrtos_vfs_module_spi__on_read) ZRTOS_VFS_PLUGIN__5_ON_WRITE(zrtos_vfs_module_avr_spi__on_write) ZRTOS_VFS_PLUGIN__6_ON_CAN_READ(zrtos_vfs_module_spi__on_can_read) ZRTOS_VFS_PLUGIN__7_ON_CAN_WRITE(zrtos_vfs_module_spi__on_can_write) ZRTOS_VFS_PLUGIN__8_ON_SEEK_DEFAULT() ZRTOS_VFS_PLUGIN__9_ON_IOCTL(zrtos_vfs_module_spi__on_ioctl))
 

Variables

zrtos_vfs_module_spi_inode_tzrtos_vfs_module_avr_spi__ctx
 
bool zrtos_vfs_module_avr_spi__isr_complete = true
 

Function Documentation

◆ ISR()

ISR ( SPI_STC_vect  ,
ISR_NOBLOCK   
)

Definition at line 41 of file avr/spi/spi.h.

41  {
43 }
void zrtos_vfs_module_avr_spi__on_interrupt()
Definition: avr/spi/spi.h:22
Here is the call graph for this function:

◆ zrtos_vfs_module_avr_spi__on_interrupt()

void zrtos_vfs_module_avr_spi__on_interrupt ( )

Definition at line 22 of file avr/spi/spi.h.

22  {
23  uint8_t data_in = SPDR;
24  uint8_t data_out;
27  ,(void*)&data_in
28  ,(void*)&data_out
29  ,sizeof(uint8_t)
30  );
31 
33  SPCR = 0;
34  }else{
36  SPDR = data_out;
37  }
38 
39 }
zrtos_vfs_module_spi_control_t control
Definition: spi/spi.h:65
bool zrtos_error__is_error(zrtos_error_t thiz)
Definition: error.h:156
zrtos_vfs_module_spi_file_t * last
Definition: spi/spi.h:76
zrtos_vfs_module_spi_inode_t * zrtos_vfs_module_avr_spi__ctx
Definition: avr/spi/spi.h:19
bool zrtos_vfs_module_avr_spi__isr_complete
Definition: avr/spi/spi.h:20
static uint8_t
Definition: mcp2515.h:159
zrtos_error_t
Definition: error.h:20
zrtos_error_t zrtos_vfs_module_spi__transfer(zrtos_vfs_module_spi_inode_t *thiz, void *data_in, void *data_out, size_t len)
Definition: spi/spi.h:286
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zrtos_vfs_module_avr_spi__on_mount()

zrtos_error_t zrtos_vfs_module_avr_spi__on_mount ( zrtos_vfs_dentry_t thiz)

Definition at line 45 of file avr/spi/spi.h.

45  {
49  );
50  return ZRTOS_ERROR__SUCCESS;
51 }
#define ZRTOS_CAST(type, value)
Definition: cast.h:18
zrtos_vfs_module_spi_inode_t * zrtos_vfs_module_avr_spi__ctx
Definition: avr/spi/spi.h:19
Successful program execution status.
Definition: error.h:22
void * zrtos_vfs_dentry__get_inode_data(zrtos_vfs_dentry_t *thiz)
Definition: vfs_dentry.h:196
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zrtos_vfs_module_avr_spi__on_umount()

zrtos_error_t zrtos_vfs_module_avr_spi__on_umount ( zrtos_vfs_dentry_t thiz)

Definition at line 53 of file avr/spi/spi.h.

53  {
55  return ZRTOS_ERROR__SUCCESS;
56 }
zrtos_vfs_module_spi_inode_t * zrtos_vfs_module_avr_spi__ctx
Definition: avr/spi/spi.h:19
Successful program execution status.
Definition: error.h:22
Here is the caller graph for this function:

◆ zrtos_vfs_module_avr_spi__on_write()

zrtos_error_t zrtos_vfs_module_avr_spi__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 58 of file avr/spi/spi.h.

65  {
69  );
71  thiz
72  ,path
73  ,buf
74  ,len
75  ,offset
76  ,out
77  );
78 
85 
87  }else{
89  }
90 
91  return ret;
92 }
#define ZRTOS_CAST(type, value)
Definition: cast.h:18
#define ZRTOS_ARCH__DISABLE_INTERRUPTS()
Definition: atmega2560.h:44
zrtos_vfs_module_spi_control_t control
Definition: spi/spi.h:65
bool zrtos_error__is_success(zrtos_error_t thiz)
Definition: error.h:152
void * zrtos_vfs_file__get_data(zrtos_vfs_file_t *thiz)
Definition: vfs_file.h:199
void zrtos_vfs_module_avr_spi__on_interrupt()
Definition: avr/spi/spi.h:22
#define ZRTOS_ARCH__ENABLE_INTERRUPTS()
Definition: atmega2560.h:47
bool zrtos_vfs_module_avr_spi__isr_complete
Definition: avr/spi/spi.h:20
zrtos_error_t
Definition: error.h:20
zrtos_error_t zrtos_vfs_module_spi__on_write(zrtos_vfs_file_t *thiz, char *path, void *buf, size_t len, zrtos_vfs_offset_t offset, size_t *out)
Definition: spi/spi.h:364
Here is the call graph for this function:

◆ ZRTOS_VFS_PLUGIN__INIT()

Variable Documentation

◆ zrtos_vfs_module_avr_spi__ctx

zrtos_vfs_module_spi_inode_t* zrtos_vfs_module_avr_spi__ctx

Definition at line 19 of file avr/spi/spi.h.

◆ zrtos_vfs_module_avr_spi__isr_complete

bool zrtos_vfs_module_avr_spi__isr_complete = true

Definition at line 20 of file avr/spi/spi.h.