OSDN Git Service
(root)
/
uzume
/
uzume_bfin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d7c51a
)
AD7991 I2C ADCの読み取り機能を追加
author
takemasa
<suikan@users.sourceforge.jp>
Sun, 16 Sep 2012 06:01:05 +0000
(15:01 +0900)
committer
takemasa
<suikan@users.sourceforge.jp>
Sun, 16 Sep 2012 06:01:05 +0000
(15:01 +0900)
uzume_prototype/uzume_prototype.c
patch
|
blob
|
history
diff --git
a/uzume_prototype/uzume_prototype.c
b/uzume_prototype/uzume_prototype.c
index
47626d3
..
0f38932
100644
(file)
--- a/
uzume_prototype/uzume_prototype.c
+++ b/
uzume_prototype/uzume_prototype.c
@@
-2,6
+2,10
@@
#include <t_services.h>
#include "kernel_id.h"
#include "uzume_prototype.h"
+#include <i2c_subsystem.h>
+
+unsigned char adcbuf[8];
+#define ADCADDR 0x28
/*
@@
-10,7
+14,12
@@
void main_task(VP_INT exinf)
{
syslog(LOG_NOTICE, "Prototype started ");
- syslog(LOG_NOTICE, "CODEC Initializaed ");
- slp_tsk();
+
+ while(1)
+ {
+ i2c_master_read(0, ADCADDR, adcbuf, 2);
+ syslog( LOG_NOTICE, "ADC is : %02x%02x ", adcbuf[0], adcbuf[1]);
+ tslp_tsk(200);
+ }
}