[oe-commits] Koen Kooi : pico-dlpcontrol: swith to msp430 address instead of fpga address

GIT User account git at amethyst.openembedded.net
Tue Dec 23 11:08:30 UTC 2008


Module: openembedded.git
Branch: org.openembedded.dev
Commit: e151a7673d67aa60c4c9ac1fa7f386393e5f404a
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e151a7673d67aa60c4c9ac1fa7f386393e5f404a

Author: Koen Kooi <koen at openembedded.org>
Date:   Tue Dec 23 12:04:08 2008 +0100

pico-dlpcontrol: swith to msp430 address instead of fpga address

---

 .../i2c-tools/picodlp-control/picodlp-control.c    |   23 ++++++++++++++++++-
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/packages/i2c-tools/picodlp-control/picodlp-control.c b/packages/i2c-tools/picodlp-control/picodlp-control.c
index 309b811..632ca83 100644
--- a/packages/i2c-tools/picodlp-control/picodlp-control.c
+++ b/packages/i2c-tools/picodlp-control/picodlp-control.c
@@ -29,7 +29,7 @@
 
 #include "i2c-dev.h"
 
-#define ADDRESS 0x1a
+#define ADDRESS 0x1b
 
 int main(int argc, char **argv)
 {
@@ -58,23 +58,38 @@ int main(int argc, char **argv)
 	uint16_t hflip;		/* The horizontal flip bit */
 	uint16_t vflip;		/* The vertical flip bit */
 
+    uint16_t hflip_temp;     /* The horizontal flip bit */
+    uint16_t vflip_temp;     /* The vertical flip bit */
+
+
 	/* Read the status bits for horizontal and vertical vlip */
 	fprintf(stdout, "Getting flip bits \n");
 	hflip = i2c_smbus_read_word_data(fd, 0x08);
 	vflip = i2c_smbus_read_word_data(fd, 0x09);
 
+    /* Output the values to stdout */
+    fprintf(stdout, "hflip: %d - vflip: %d\n", hflip, vflip);
+
 	/* set flip bits to 0 */
 	fprintf(stdout, "Setting flip bits to zero\n");
 	i2c_smbus_write_word_data(fd, 0x08, 0);
 	i2c_smbus_write_word_data(fd, 0x09, 0);
+    
+	hflip_temp = i2c_smbus_read_word_data(fd, 0x08);
+    vflip_temp = i2c_smbus_read_word_data(fd, 0x09);
+	fprintf(stdout, "hflip: %d - vflip: %d\n", hflip_temp, vflip_temp);
 
 	sleep(2);
 
 	/* set flip bits to 1 */
-	fprintf(stdout, "Getting flip bits to one\n");
+	fprintf(stdout, "Setting flip bits to one\n");
 	i2c_smbus_write_word_data(fd, 0x08, 1);
 	i2c_smbus_write_word_data(fd, 0x09, 1);
 
+    hflip_temp = i2c_smbus_read_word_data(fd, 0x08);
+    vflip_temp = i2c_smbus_read_word_data(fd, 0x09);
+    fprintf(stdout, "hflip: %d - vflip: %d\n", hflip_temp, vflip_temp);
+
 	sleep(2);
 
 	/* restore values */
@@ -82,6 +97,10 @@ int main(int argc, char **argv)
 	i2c_smbus_write_word_data(fd, 0x08, hflip);
 	i2c_smbus_write_word_data(fd, 0x09, vflip);
 
+    /* Read the status bits for horizontal and vertical vlip */
+    hflip = i2c_smbus_read_word_data(fd, 0x08);
+    vflip = i2c_smbus_read_word_data(fd, 0x09);
+
 	/* Output the values to stdout */
 	fprintf(stdout, "hflip: %d - vflip: %d\n", hflip, vflip);
 





More information about the Openembedded-commits mailing list