summaryrefslogtreecommitdiff
path: root/include/stream.h
blob: 9c6da54ea4d45ca58884a9a3dfa22740fb3b001e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#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;

typedef enum {
    STDIO,    
} devices;


#endif /* __STREAM_H */