-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.h
62 lines (41 loc) · 1.07 KB
/
io.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Wrapper for libComedi I/O.
// These functions provide and interface to libComedi limited to use in
// the real time lab.
//
// 2006, Martin Korsgaard
#ifndef __INCLUDE_IO_H__
#define __INCLUDE_IO_H__
/**
Initialize libComedi in "Sanntidssalen"
@return Non-zero on success and 0 on failure
*/
int io_init();
/**
Sets a digital channel bit.
@param channel Channel bit to set.
*/
void io_set_bit(int channel);
/**
Clears a digital channel bit.
@param channel Channel bit to set.
*/
void io_clear_bit(int channel);
/**
Writes a value to an analog channel.
@param channel Channel to write to.
@param value Value to write.
*/
void io_write_analog(int channel, int value);
/**
Reads a bit value from a digital channel.
@param channel Channel to read from.
@return Value read.
*/
int io_read_bit(int channel);
/**
Reads a bit value from an analog channel.
@param channel Channel to read from.
@return Value read.
*/
int io_read_analog(int channel);
#endif // #ifndef __INCLUDE_IO_H__