• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TWIペリフェラルを使ってI2Cプロトコルを制御する


Commit MetaInfo

Revisión87042c4ae2f1c64ba864a8181a1ad25f1200e2e9 (tree)
Tiempo2012-09-13 23:36:27
Autortakemasa <suikan@user...>
Commitertakemasa

Log Message

複数のプロセッサに対応

Cambiar Resumen

Diferencia incremental

--- a/i2c-test/Makefile
+++ b/i2c-test/Makefile
@@ -116,10 +116,10 @@ UTASK_CFG = $(UNAME).cfg
116116 UTASK_DIR = $(SRCDIR)/library
117117 UTASK_ASMOBJS =
118118 ifdef USE_CXX
119- UTASK_CXXOBJS = $(UNAME).o i2c_subsystem.o
119+ UTASK_CXXOBJS = $(UNAME).o
120120 UTASK_COBJS =
121121 else
122- UTASK_COBJS = $(UNAME).o i2c_subsystem.o
122+ UTASK_COBJS = $(UNAME).o
123123 endif
124124 UTASK_CFLAGS =
125125 UTASK_LIBS =
--- a/i2c-test/Makefile.depend
+++ b/i2c-test/Makefile.depend
@@ -209,6 +209,52 @@ chip_dump.o: \
209209 kernel/config/blackfin/_common_bf592/chip_config.h \
210210 kernel/include/itron.h \
211211 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include/stddef.h
212+i2c_subsystem.o: \
213+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF59x_base.h \
214+ kernel/config/blackfin/cpu_defs.h \
215+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/newlib.h \
216+ kernel/include/serial.h kernel/config/blackfin/tool_config.h \
217+ ./kernel_id.h \
218+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdefBF59x_base.h \
219+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/_default_types.h \
220+ kernel/include/t_stddef.h \
221+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/stdlib.h \
222+ kernel/config/blackfin/tool_defs.h \
223+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/builtins.h \
224+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/ccblkfn.h \
225+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/_ansi.h \
226+ kernel/include/s_services.h \
227+ kernel/config/blackfin/acb_bf592/sys_config.h \
228+ kernel/config/blackfin/_common_bf592/chip_config.h \
229+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/features.h \
230+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/alloca.h \
231+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/mc_typedef.h \
232+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/reent.h \
233+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/anomaly_macros_rtl.h \
234+ kernel/include/kernel.h \
235+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/config.h \
236+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/lock.h \
237+ kernel/config/blackfin/_common_bf592/chip_defs.h \
238+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/stdint.h \
239+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdef_LPBlackfin.h \
240+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/_types.h \
241+ kernel/include/t_config.h \
242+ kernel/config/blackfin/_common_bf592/sys_rename.h \
243+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF592-A.h \
244+ kernel/config/blackfin/acb_bf592/i2c_subsystem.h \
245+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdefBF592-A.h \
246+ kernel/config/blackfin/cpu_rename.h kernel/include/sil.h \
247+ kernel/include/t_services.h \
248+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/def_LPBlackfin.h \
249+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/stdlib.h \
250+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include-fixed/limits.h \
251+ kernel/include/t_syslog.h \
252+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/ieeefp.h \
253+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/_types.h \
254+ kernel/config/blackfin/acb_bf592/sys_defs.h \
255+ kernel/config/blackfin/cpu_config.h kernel/include/itron.h \
256+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include/stddef.h \
257+ kernel/config/blackfin/acb_bf592/i2c_subsystem.c
212258 cpu_config.o: kernel/include/kernel.h \
213259 kernel/config/blackfin/cpu_defs.h \
214260 kernel/config/blackfin/_common_bf592/chip_defs.h \
@@ -612,56 +658,11 @@ i2c-test.o: kernel/include/kernel.h kernel/include/t_services.h \
612658 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include-fixed/limits.h \
613659 kernel/include/t_syslog.h kernel/config/blackfin/tool_defs.h \
614660 i2c-test.c kernel/include/serial.h \
615- kernel/config/blackfin/acb_bf592/sys_defs.h i2c_subsystem.h \
616- kernel_id.h kernel/include/itron.h \
617- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include/stddef.h \
618- kernel/include/t_stddef.h
619-i2c_subsystem.o: \
620- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF59x_base.h \
621- kernel/config/blackfin/cpu_defs.h \
622- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/newlib.h \
623- kernel/include/serial.h kernel/config/blackfin/tool_config.h \
624- i2c_subsystem.c \
625- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdefBF59x_base.h \
626- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/_default_types.h \
627- kernel/include/t_stddef.h \
628- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/stdlib.h \
629- kernel/config/blackfin/tool_defs.h \
630- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/builtins.h \
631- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/ccblkfn.h \
632- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/_ansi.h \
633- kernel/include/s_services.h \
634- kernel/config/blackfin/acb_bf592/sys_config.h \
635- kernel/config/blackfin/_common_bf592/chip_config.h \
636- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/features.h \
637- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/alloca.h \
638- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/mc_typedef.h \
639- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/reent.h \
640- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/anomaly_macros_rtl.h \
641- kernel/include/kernel.h \
642- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/config.h \
643- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/lock.h \
644- kernel/config/blackfin/_common_bf592/chip_defs.h \
645- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/stdint.h \
646- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdef_LPBlackfin.h \
647- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/_types.h \
648- kernel/include/t_config.h \
649- kernel/config/blackfin/_common_bf592/sys_rename.h \
650- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF592-A.h \
651- i2c_subsystem.h \
652- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdefBF592-A.h \
653- kernel/config/blackfin/cpu_rename.h kernel/include/sil.h \
654- kernel/include/t_services.h \
655- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/def_LPBlackfin.h \
656- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/stdlib.h \
657- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include-fixed/limits.h \
658- kernel/include/t_syslog.h \
659- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/machine/ieeefp.h \
660- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/sys/_types.h \
661661 kernel/config/blackfin/acb_bf592/sys_defs.h \
662- kernel/config/blackfin/cpu_config.h kernel_id.h \
662+ kernel/config/blackfin/acb_bf592/i2c_subsystem.h kernel_id.h \
663663 kernel/include/itron.h \
664- /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include/stddef.h
664+ /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/include/stddef.h \
665+ kernel/include/t_stddef.h
665666 timer.o: \
666667 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF59x_base.h \
667668 kernel/include/kernel.h kernel/include/timer.h \
@@ -796,7 +797,8 @@ kernel_cfg.o: \
796797 kernel/include/t_config.h \
797798 kernel/config/blackfin/_common_bf592/sys_rename.h \
798799 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/defBF592-A.h \
799- kernel/include/../kernel/eventflag.h i2c_subsystem.h \
800+ kernel/include/../kernel/eventflag.h \
801+ kernel/config/blackfin/acb_bf592/i2c_subsystem.h \
800802 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/cdefBF592-A.h \
801803 kernel/config/blackfin/cpu_rename.h \
802804 /opt/uClinux2011R1RC4/bfin-elf/bin/../lib/gcc/bfin-elf/4.3.5/../../../../bfin-elf/include/def_LPBlackfin.h \
--- a/i2c-test/configure-project
+++ b/i2c-test/configure-project
@@ -1 +1 @@
1-kernel/configure -C blackfin -S acb_bf592 -A i2c-test -U "i2c_subsystem.o"
1+kernel/configure -C blackfin -S acb_bf592 -A i2c-test
--- a/i2c-test/kernel/config/blackfin/acb_bf592/Makefile.config
+++ b/i2c-test/kernel/config/blackfin/acb_bf592/Makefile.config
@@ -16,7 +16,7 @@ LDFLAGS := $(LDFLAGS)
1616 #
1717 KERNEL_DIR := $(KERNEL_DIR) :$(SRCDIR)/config/$(CPU)/$(SYS) :$(SRCDIR)/config/$(CPU)/_common_bf592 :$(SRCDIR)/pdic/simple_sio
1818 KERNEL_ASMOBJS := $(KERNEL_ASMOBJS)
19-KERNEL_COBJS := $(KERNEL_COBJS) chip_config.o uart.o chip_debugboot.o chip_dump.o
19+KERNEL_COBJS := $(KERNEL_COBJS) chip_config.o uart.o chip_debugboot.o chip_dump.o i2c_subsystem.o
2020
2121
2222 #
--- a/i2c-test/i2c_subsystem.c
+++ b/i2c-test/kernel/config/blackfin/acb_bf592/i2c_subsystem.c
@@ -11,6 +11,12 @@
1111
1212 #ifdef _COMMON_BF592
1313 #include <cdefBF592-A.h>
14+#elif defined(_COMMON_BF506)
15+#include <cdefBF506F.h>
16+#elif defined(_COMMON_BF518)
17+#include <cdefBF518.h>
18+#elif defined(_COMMON_BF537)
19+#include <cdefBF537.h>
1420 #else
1521 #error "This processor is not supported"
1622 #endif
@@ -61,18 +67,18 @@ struct I2C_MASTER_CONTROL_TYPE {
6167 ID signal; /**< データの送受信が全部終わったときに割り込みハンドラからタスクに知らせるためのセマフォ */
6268 ID blocking; /**< I2Cペリフェラルへの排他アクセスのためのセマフォ */
6369 unsigned short intr_state; /**< TWIペリフェラルの割り込みステータスのコピー **/
64- volatile uint16_t * clkdiv; /**< TWI_CLCKDIVレジスタのアドレス **/
65- volatile uint16_t * control; /**< TWI_CONTROLレジスタのアドレス **/
66- volatile uint16_t * master_ctl; /**< TWI_MASTER_CTLレジスタのアドレス **/
67- volatile uint16_t * master_stat; /**< TWI_MASTER_STATレジスタのアドレス **/
68- volatile uint16_t * master_addr; /**< TWI_MASTER_ADDRレジスタのアドレス **/
69- volatile uint16_t * int_stat; /**< TWI_MASTER_STATレジスタのアドレス **/
70- volatile uint16_t * int_mask; /**< TWI_INT_MASKレジスタのアドレス **/
71- volatile uint16_t * fifo_ctl; /**< TWI_FIFO_CTLレジスタのアドレス **/
72- volatile uint16_t * fifo_stat; /**< TWI_FIFO_STATレジスタのアドレス **/
73- volatile uint16_t * xmt_data8; /**< TWI_XMT_DATA8レジスタのアドレス **/
74- volatile uint16_t * rcv_data8; /**< TWI_RCV_DATA8レジスタのアドレス **/
75- volatile uint16_t * slave_ctl; /**< TWI_MASTER_CTLレジスタのアドレス **/
70+ volatile unsigned short * clkdiv; /**< TWI_CLCKDIVレジスタのアドレス **/
71+ volatile unsigned short * control; /**< TWI_CONTROLレジスタのアドレス **/
72+ volatile unsigned short * master_ctl; /**< TWI_MASTER_CTLレジスタのアドレス **/
73+ volatile unsigned short * master_stat; /**< TWI_MASTER_STATレジスタのアドレス **/
74+ volatile unsigned short * master_addr; /**< TWI_MASTER_ADDRレジスタのアドレス **/
75+ volatile unsigned short * int_stat; /**< TWI_MASTER_STATレジスタのアドレス **/
76+ volatile unsigned short * int_mask; /**< TWI_INT_MASKレジスタのアドレス **/
77+ volatile unsigned short * fifo_ctl; /**< TWI_FIFO_CTLレジスタのアドレス **/
78+ volatile unsigned short * fifo_stat; /**< TWI_FIFO_STATレジスタのアドレス **/
79+ volatile unsigned short * xmt_data8; /**< TWI_XMT_DATA8レジスタのアドレス **/
80+ volatile unsigned short * rcv_data8; /**< TWI_RCV_DATA8レジスタのアドレス **/
81+ volatile unsigned short * slave_ctl; /**< TWI_MASTER_CTLレジスタのアドレス **/
7682
7783 };
7884