diff options
Diffstat (limited to 'commandline/i2cwrite.c')
-rw-r--r-- | commandline/i2cwrite.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/commandline/i2cwrite.c b/commandline/i2cwrite.c new file mode 100644 index 0000000..56031f9 --- /dev/null +++ b/commandline/i2cwrite.c @@ -0,0 +1,22 @@ +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "i2c-util.h" + +int main(int argc, char **argv) +{ + int i; + + i2c_init(); + i2c_start(); + + for (i = 1; i < argc; i++) { + i2c_tx_byte(atoi(argv[i])); + } + + i2c_stop(); + i2c_deinit(); + + return 0; +} |