summaryrefslogtreecommitdiffstats
path: root/libk8055/libk8055.c
diff options
context:
space:
mode:
Diffstat (limited to 'libk8055/libk8055.c')
-rw-r--r--libk8055/libk8055.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libk8055/libk8055.c b/libk8055/libk8055.c
index 33bff48..45f5c60 100644
--- a/libk8055/libk8055.c
+++ b/libk8055/libk8055.c
@@ -451,7 +451,7 @@ int k8055_read_all_digital( struct k8055_dev* dev ) {
return return_data;
}
-int k8055_read_all_values( struct k8055_dev* dev, int* digital, int* analog1, int* analog2, int* counter1, int* counter2 ) {
+int k8055_read_all_inputs( struct k8055_dev* dev, int* digital, int* analog1, int* analog2, int* counter1, int* counter2 ) {
if ( k8055_read( dev )!=0 ) return K8055_ERROR;
if(digital) *digital = (
( ( dev->data_in[DIGITAL_INP_OFFSET] >> 4 ) & 0x03 ) | /* Input 1 and 2 */
@@ -464,11 +464,11 @@ int k8055_read_all_values( struct k8055_dev* dev, int* digital, int* analog1, in
return 0;
}
-int k8055_set_all_values( struct k8055_dev* dev, int d_data, int a_data1, int a_data2 ) {
+int k8055_write_all_outputs( struct k8055_dev* dev, int digital, int analog1, int analog2 ) {
dev->data_out[CMD_OFFSET] = CMD_SET_ANALOG_DIGITAL;
- dev->data_out[DIGITAL_OUT_OFFSET] = ( unsigned char )d_data;
- dev->data_out[ANALOG_1_OFFSET] = ( unsigned char )a_data1;
- dev->data_out[ANALOG_2_OFFSET] = ( unsigned char )a_data2;
+ dev->data_out[DIGITAL_OUT_OFFSET] = ( unsigned char )digital;
+ dev->data_out[ANALOG_1_OFFSET] = ( unsigned char )analog1;
+ dev->data_out[ANALOG_2_OFFSET] = ( unsigned char )analog2;
return k8055_write( dev );
}
@@ -598,7 +598,7 @@ long ReadAllDigital() {
}
int ReadAllValues( long int* data1, long int* data2, long int* data3, long int* data4, long int* data5 ) {
int d1, d2, d3, d4, d5;
- int r = k8055_read_all_values( curr_dev, &d1, &d2, &d3, &d4, &d5 );
+ int r = k8055_read_all_inputs( curr_dev, &d1, &d2, &d3, &d4, &d5 );
if(data1) *data1 = d1;
if(data2) *data2 = d2;
if(data3) *data3 = d3;
@@ -607,7 +607,7 @@ int ReadAllValues( long int* data1, long int* data2, long int* data3, long int*
return r;
}
int SetAllValues( int DigitalData, int AdData1, int AdData2 ) {
- return k8055_set_all_values( curr_dev, DigitalData, AdData1, AdData2 );
+ return k8055_write_all_outputs( curr_dev, DigitalData, AdData1, AdData2 );
}
int ResetCounter( long counter ) {
return k8055_reset_counter( curr_dev, counter );