[vala/0.12] linux: bind i2c and smbus subsystem
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.12] linux: bind i2c and smbus subsystem
- Date: Tue, 31 May 2011 19:11:32 +0000 (UTC)
commit 07b4f0180bcdaf2965a9dd64d2e750233446628a
Author: Michael 'Mickey' Lauer <mickey vanille-media de>
Date: Mon May 30 21:02:55 2011 +0200
linux: bind i2c and smbus subsystem
vapi/linux.vapi | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/vapi/linux.vapi b/vapi/linux.vapi
index 531db08..a3f850a 100644
--- a/vapi/linux.vapi
+++ b/vapi/linux.vapi
@@ -859,6 +859,58 @@ namespace Linux {
}
/*
+ * I2C and System Management Bus
+ */
+ [CCode (cprefix = "I2C_", lower_case_cprefix = "i2c_")]
+ namespace I2C {
+
+ const int SLAVE;
+
+ [CCode (cprefix = "", lower_case_cprefix = "i2c_smbus_")]
+ namespace SMBUS {
+ int32 write_byte_data_masked (int file, uint8 mask, uint8 command, uint8 value)
+ {
+ int32 result = read_byte_data (file, command);
+ if (result == -1)
+ {
+ return -1;
+ }
+ uint8 oldvalue = (uint8) result & 0xff;
+ return write_byte_data (file, command, oldvalue | (value & mask) );
+ }
+
+ //[CCode (cheader_filename = "i2c.h")]
+ //int32 access(int file, char read_write, uint8 command, int size, union data *data);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_quick (int file, uint8 value);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 read_byte (int file);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_byte (int file, uint8 value);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 read_byte_data (int file, uint8 command);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_byte_data (int file, uint8 command, uint8 value);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 read_word_data (int file, uint8 command);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_word_data (int file, uint8 command, uint16 value);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 process_call (int file, uint8 command, uint16 value);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 read_block_data (int file, uint8 command, [CCode (array_length=false)] uint8[] values);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_block_data (int file, uint8 command, [CCode (array_length_pos = 2.3)] uint8[] values);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 read_i2c_block_data (int file, uint8 command, [CCode (array_length_pos = 2.3)] uint8[] values);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 write_i2c_block_data (int file, uint8 command, [CCode (array_length_pos = 2.3)] uint8[] values);
+ [CCode (cheader_filename = "i2c.h")]
+ int32 block_process_call (int file, uint8 command, [CCode (array_length_pos = 2.3)] uint8[] values);
+ }
+ }
+
+ /*
* Inotify
*/
[CCode (cname = "struct inotify_event", has_type_id = false, cheader_filename = "sys/inotify.h")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]