summaryrefslogtreecommitdiffstats
path: root/libk8055/k8055++.h
blob: 0f3a024a82a3477729821dbcd0160ff2da084eca (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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * This file is part of the libk8055 Library.
 *
 * The libk8055 Library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * The libk8055 Library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the
 * Free Software Foundation, Inc.,
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * http://opensource.org/licenses/
 *
 * Copyright (C) 2011 by Jérémy Zurcher
 *
 */

#ifndef K8055_CPP_H
#define K8055_CPP_H 1

#include "k8055.h"

class K8055 {
    public:
        K8055();
        ~K8055();

        int read( void );
        int write( void );

        int digital_output_1( void );
        int digital_output_2( void );
        int digital_output_3( void );
        int digital_output_4( void );
        int digital_output_5( void );
        int analog_output_1( void );
        int analog_output_2( void );
        int digital_input_1( void );
        int digital_input_2( void );
        int digital_input_3( void );
        int digital_input_4( void );
        int digital_input_5( void );
        int analog_input_1( void );
        int analog_input_2( void );
        int counter_1( void );
        int counter_2( void );

        static char* Version( void );
        static int SearchDevices( void );

        int OpenDevice( int board_address );
        int CloseDevice();

        int SetAnalogChannel( int channel );
        int ClearAnalogChannel( int channel );
        int ReadAnalogChannel( int channel );
        int WriteAnalogChannel( int channel, int data );

        int SetAllAnalog();
        int ClearAllAnalog();
        int ReadAllAnalog( int* data1, int* data2 );
        int WriteAllAnalog( int data1,int data2 );

        int SetDigitalChannel( int channel );
        int ClearDigitalChannel( int channel );
        int ReadDigitalChannel( int channel );

        int SetAllDigital();
        int ClearAllDigital();
        int ReadAllDigital();
        int WriteAllDigital( int data );

        int SetAllValues( int digital_data, int ad_data1, int ad_data2 );
        int ReadAllValues ( int*  data1, int* data2, int* data3, int* data4, int* data5 );

        int ResetCounter( int counter );
        int ReadCounter( int counter );

        int SetCounterDebounceTime( int counter, int debounce_time );

    private:
        struct k8055_dev dev;
};

#endif // K8055_CPP_H