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

Go to the source code of this file.

Functions

 ZRTOS_ASSERT__STATIC (sizeof(zrtos_vfs_offset_t) >=sizeof(zrtos_vfs_module_timeout_microseconds_t))
 
 ISR (TIMER4_OVF_vect)
 
zrtos_error_t zrtos_vfs_module_avr_timeout4__on_open (zrtos_vfs_file_t *thiz)
 
zrtos_error_t zrtos_vfs_module_avr_timeout4__on_mount (zrtos_vfs_dentry_t *thiz)
 
zrtos_error_t zrtos_vfs_module_avr_timeout4__on_umount (zrtos_vfs_dentry_t *thiz)
 
zrtos_error_t zrtos_vfs_module_avr_timeout4__on_ioctl (zrtos_vfs_file_t *thiz, char *path, int request, va_list args)
 
 ZRTOS_VFS_PLUGIN__INIT (avr_timeout4, ZRTOS_VFS_PLUGIN__0_ON_OPEN(zrtos_vfs_module_avr_timeout4__on_open) ZRTOS_VFS_PLUGIN__1_ON_CLOSE_DEFAULT() ZRTOS_VFS_PLUGIN__2_ON_MOUNT(zrtos_vfs_module_avr_timeout4__on_mount) ZRTOS_VFS_PLUGIN__3_ON_UMOUNT(zrtos_vfs_module_avr_timeout4__on_umount) ZRTOS_VFS_PLUGIN__4_ON_READ_DEFAULT() ZRTOS_VFS_PLUGIN__5_ON_WRITE_DEFAULT() 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(zrtos_vfs_module_avr_timeout4__on_ioctl))
 

Variables

zrtos_vfs_module_timeout_inode_t zrtos_vfs_module_avr_timeout4
 

Function Documentation

◆ ISR()

ISR ( TIMER4_OVF_vect  )

Definition at line 24 of file timeout4.h.

24  {
27  );
28 }
zrtos_vfs_module_timeout_callback_t callback
Definition: timeout.h:27
zrtos_vfs_module_timeout_inode_t zrtos_vfs_module_avr_timeout4
Definition: timeout4.h:22

◆ ZRTOS_ASSERT__STATIC()

ZRTOS_ASSERT__STATIC ( sizeof(zrtos_vfs_offset_t) >=sizeof(zrtos_vfs_module_timeout_microseconds_t )

◆ zrtos_vfs_module_avr_timeout4__on_ioctl()

zrtos_error_t zrtos_vfs_module_avr_timeout4__on_ioctl ( zrtos_vfs_file_t thiz,
char *  path,
int  request,
va_list  args 
)

Definition at line 50 of file timeout4.h.

55  {
57 
60  ,request
61  )){
63  TCCR4A = 0;
64  //TCCR4B = (inode_data->prescaler) & 0xff;
65  TCCR4B = _BV(CS42) | _BV(CS41) | _BV(CS40);//prescaler 1024
66  TIMSK4 = _BV(TOIE4);
67  //TIMSK4 |= _BV(TOIE4);
69  thiz
72  args
74  )
75  ,1024
76  )
77  );
79  TCNT4 = zrtos_vfs_file__get_offset(thiz);
80  break;
82  TIMSK4 = 0;
83  //TIMSK4 &= ~_BV(TOIE4);
84  break;
86  zrtos_vfs_module_avr_timeout0.callback = zrtos_va__arg(
87  args
89  );
90  zrtos_vfs_module_avr_timeout0.callback_data = zrtos_va__arg(
91  args
92  ,void*
93  );
94  break;
95  default:
96  ret = ZRTOS_ERROR__INVAL;
97  break;
98  }
99 
100  return ret;
101 }
uint16_t zrtos_vfs_module_timeout__get_overflow_counter_value(zrtos_vfs_module_timeout_microseconds_t us, uint16_t prescaler)
Definition: timeout.h:37
#define ZRTOS_CAST__REINTERPRET(type, value)
Definition: cast.h:19
zrtos_vfs_offset_t zrtos_vfs_file__get_offset(zrtos_vfs_file_t *thiz)
Definition: vfs_file.h:207
void(* zrtos_vfs_module_timeout_callback_t)(void *data)
Definition: timeout.h:22
Successful program execution status.
Definition: error.h:22
zrtos_vfs_module_timeout_ioctl_t
Definition: timeout.h:15
Invalid argument.
Definition: error.h:46
void zrtos_vfs_file__set_offset(zrtos_vfs_file_t *thiz, zrtos_vfs_offset_t offset)
Definition: vfs_file.h:203
uint16_t zrtos_vfs_module_timeout_microseconds_t
Definition: timeout.h:24
zrtos_error_t
Definition: error.h:20
#define zrtos_va__arg(ap, type)
Definition: va.h:21
Here is the call graph for this function:

◆ zrtos_vfs_module_avr_timeout4__on_mount()

zrtos_error_t zrtos_vfs_module_avr_timeout4__on_mount ( zrtos_vfs_dentry_t thiz)

Definition at line 39 of file timeout4.h.

39  {
40  TIMSK4 = 0;
41  return ZRTOS_ERROR__SUCCESS;
42 }
Successful program execution status.
Definition: error.h:22
Here is the caller graph for this function:

◆ zrtos_vfs_module_avr_timeout4__on_open()

zrtos_error_t zrtos_vfs_module_avr_timeout4__on_open ( zrtos_vfs_file_t thiz)

Definition at line 30 of file timeout4.h.

32  {
33  return zrtos_vfs_file__get_dentry_count(thiz) == 1
36  ;
37 }
Too many open files.
Definition: error.h:48
Successful program execution status.
Definition: error.h:22
size_t zrtos_vfs_file__get_dentry_count(zrtos_vfs_file_t *file)
Definition: vfs_file.h:67
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zrtos_vfs_module_avr_timeout4__on_umount()

zrtos_error_t zrtos_vfs_module_avr_timeout4__on_umount ( zrtos_vfs_dentry_t thiz)

Definition at line 44 of file timeout4.h.

44  {
45  TIMSK4 = 0;
46  //TIMSK4 &= ~_BV(TOIE4);
47  return ZRTOS_ERROR__SUCCESS;
48 }
Successful program execution status.
Definition: error.h:22
Here is the caller graph for this function:

◆ ZRTOS_VFS_PLUGIN__INIT()

Variable Documentation

◆ zrtos_vfs_module_avr_timeout4

zrtos_vfs_module_timeout_inode_t zrtos_vfs_module_avr_timeout4

Definition at line 22 of file timeout4.h.