blob: 73b3daa37b9a204f69794acd9448a1065c121d9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <stdint.h>
#include <stddef.h>
#ifndef __STREAM_H
#define __STREAM_H
/*
* Struct for abstract stream
*
* Stream properties: generalized variables for individual devices
* props[0]: Peripheral device (fd, hi2c, huart, and so on)
* props[1]: Bus device ID
*
*/
typedef struct {
int (*read)(uint8_t *buf, size_t len, void **vptr, void *sptr);
int (*write)(uint8_t *buf, size_t len, void **vptr, void *sptr);
int (*init)(void **vptr, void *sptr);
void **props;
} p_stream_t;
#endif
|