20140512-185246

This commit is contained in:
BlubbFish 2014-05-12 16:53:00 +00:00
parent 928eee8f55
commit b033055aaa
14 changed files with 1856 additions and 232 deletions

Binary file not shown.

View File

@ -12,10 +12,14 @@ Programm.d Programm.o: .././Programm.cpp .././peripheral.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/version.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/fuse.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h \
.././io/hardware/porth.hpp .././io/Led.hpp .././io/hardware/pin.hpp \
.././io/hardware/portc.hpp .././io/hardware/portd.hpp \
.././io/hardware/portg.hpp .././io/hardware/porth.hpp \
.././io/hardware/portl.hpp .././io/Led.hpp .././io/hardware/pin.hpp \
.././io/mcp4151.hpp \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay_basic.h \
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h \
.././io/Display.hpp
.././peripheral.h:
@ -45,14 +49,26 @@ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h:
.././io/hardware/portc.hpp:
.././io/hardware/portd.hpp:
.././io/hardware/portg.hpp:
.././io/hardware/porth.hpp:
.././io/hardware/portl.hpp:
.././io/Led.hpp:
.././io/hardware/pin.hpp:
.././io/mcp4151.hpp:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay_basic.h:
c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h:
.././io/Display.hpp:

View File

@ -12,20 +12,71 @@
:1000B0000C9499000C9499000C9499000C9499005C
:1000C0000C9499000C9499000C9499000C9499004C
:1000D0000C9499000C9499000C9499000C9499003C
:1000E0000C9499000C94D600D60011241FBECFEFBB
:1000E0000C9499000C946702670211241FBECFEF95
:1000F000D1E2DEBFCDBF00E00CBF22E0A0E0B2E065
:1001000001C01D92A030B207E1F710E0CAEED0E0C6
:1001100000E006C022970109FE010BBF0E94E90022
:1001000001C01D92A530B207E1F710E0CAEED0E0C1
:1001100000E006C022970109FE010BBF0E947E028B
:10012000C83ED10780E00807A9F70E949B000C9405
:10013000ED000C940000E2E0F1E0289A2FEF83E25A
:1001400094EF215080409040E1F700C000002898D3
:100150008081806480832FEF83ED90E32150804085
:100160009040E1F700C0000080818F7B8083808118
:10017000806280832FEF83E294EF21508040904093
:10018000E1F700C000008081806480832FEF83ED61
:1001900090E3215080409040E1F700C00000808152
:1001A0008F7B808380818F7D8083C7CFA1E0B1E08A
:1001B0008C9180628C93E2E0F1E080818F7D80837E
:1001C000209A28988C9180648C9380818F7B808387
:0E01D00008950790F691E02D1994F894FFCF52
:1001300082020C940000409888E0A098989AA19AB6
:10014000999A00C000C00000A198999A8150A9F71F
:1001500098E08DEC88231CF4A09A989A02C0A0988D
:10016000989AA19A999A880F00C000C00000A1989F
:10017000999A915079F7409AEBE0F1E0808188609C
:10018000808380818F7B80838081806280831BB8A5
:100190008081806880838FE99FE00197F1F700C03C
:1001A000000080818F7780830F2EF0E5FF2EF02DE9
:1001B00005E61EE6D9E6C3E76894EE24E5F874E4A4
:1001C00065E753E541E633E60F2EFBE6DF2EF02D23
:1001D000A2E0B1E090819F7B9083908190629083B8
:1001E000FBB89081906890838FE99FE00197F1F7C9
:1001F00000C0000090819F77908390819F7B9083C7
:100200009081906290830BB99081906890838FE980
:100210009FE00197F1F700C0000090819F779083E5
:1002200090819F7B90839081906290831BB9908195
:10023000906890838FE99FE00197F1F700C000007C
:1002400090819F77908390819F7B90839081906233
:100250009083DBB99081906890838FE99FE001974C
:10026000F1F700C0000090819F77908390819F7B81
:100270009083908190629083CBB9908190689083B5
:100280008FE99FE00197F1F700C0000090819F7710
:10029000908390819F7B9083908190629083EBB854
:1002A0009081906890838FE99FE00197F1F700C0FB
:1002B000000090819F77908390819F7B90839081B5
:1002C000906290837BB99081906890838FE99FE0E2
:1002D0000197F1F700C0000090819F779083908193
:1002E0009F7B90839081906290836BB9908190689E
:1002F00090838FE99FE00197F1F700C000009081A3
:100300009F77908390819F7B908390819062908370
:10031000EBB89081906890838FE99FE00197F1F7A7
:1003200000C0000090819F77908390819F7B908395
:100330009081906290835BB99081906890838FE9FF
:100340009FE00197F1F700C0000090819F779083B4
:1003500090819F7B90839081906290834BB9908134
:10036000906890838FE99FE00197F1F700C000004B
:1003700090819F77908390819F7B90839081906202
:1003800090833BB99081906890838FE99FE00197BB
:10039000F1F700C0000090819F77908390819F7B50
:1003A0009083908190629083DBB890819068908375
:1003B0008FE99FE00197F1F700C0000090819F77DF
:1003C0009083289A9FEF27EA81E691502040804051
:1003D000E1F700C0000028989C9190649C939FEFE7
:1003E00023ED80E3915020408040E1F700C0000001
:1003F0009C919F7B9C939C9190629C939FEF27EA9A
:1004000081E6915020408040E1F700C000009C91BF
:1004100090649C939FEF23ED80E3915020408040B7
:10042000E1F700C000009C919F7B9C939C919F7D75
:100430009C93D0CEA198999A409A389AA098989A6D
:10044000AAE0B1E08C9188608C93EBE0F1E08081D0
:10045000877F80838C9180688C938C9180648C934F
:100460008C9180628C938FEF8AB92FEF81EE94E0AC
:10047000215080409040E1F700C0000080818F7BD8
:10048000808380818F7D80838CE08BB980818068C0
:1004900080838FE99FE00197F1F700C00000808121
:1004A0008F77808380818F7B808380818F7D808325
:1004B00081E08BB98081806880838FE99FE001971C
:1004C000F1F700C0000080818F7780830895A1E05C
:1004D000B1E08C9180628C93E2E0F1E080818F7DCD
:1004E0008083209A28988C9180648C9380818F7B64
:1004F000808380E092E00E941A0208950790F691AE
:08050000E02D1994F894FFCFDF
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-
Discarded input sections
.bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o
.group 0x00000000 0x8 Programm.o
.text 0x00000000 0x0 Programm.o
.bss 0x00000000 0x3 Programm.o
.text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
.text.libgcc.mul
@ -182,7 +182,7 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.rela.plt
*(.rela.plt)
.text 0x00000000 0x1de
.text 0x00000000 0x508
*(.vectors)
.vectors 0x00000000 0xe4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o
0x00000000 __vector_default
@ -298,17 +298,21 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
0x00000132 __vector_42
0x00000136 . = ALIGN (0x2)
*(.text.*)
.text.main 0x00000136 0x76 Programm.o
.text.main 0x00000136 0x2fe Programm.o
0x00000136 main
.text._ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC2Ev
0x00000434 0x9a Programm.o
0x00000434 _ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC2Ev
0x00000434 _ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev
.text._GLOBAL__sub_I_rot
0x000001ac 0x26 Programm.o
.text.libgcc 0x000001d2 0x8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_tablejump_elpm.o)
0x000001d2 __tablejump_elpm__
0x000001da . = ALIGN (0x2)
0x000004ce 0x2e Programm.o
.text.libgcc 0x000004fc 0x8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_tablejump_elpm.o)
0x000004fc __tablejump_elpm__
0x00000504 . = ALIGN (0x2)
*(.fini9)
.fini9 0x000001da 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
0x000001da _exit
0x000001da exit
.fini9 0x00000504 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
0x00000504 _exit
0x00000504 exit
*(.fini9)
*(.fini8)
*(.fini8)
@ -327,11 +331,11 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
*(.fini1)
*(.fini1)
*(.fini0)
.fini0 0x000001da 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
.fini0 0x00000504 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o)
*(.fini0)
0x000001de _etext = .
0x00000508 _etext = .
.data 0x00800200 0x0 load address 0x000001de
.data 0x00800200 0x0 load address 0x00000508
0x00800200 PROVIDE (__data_start, .)
*(.data)
.data 0x00800200 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o
@ -348,21 +352,26 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
0x00800200 _edata = .
0x00800200 PROVIDE (__data_end, .)
.bss 0x00800200 0x0
.bss 0x00800200 0x5
0x00800200 PROVIDE (__bss_start, .)
*(.bss)
.bss 0x00800200 0x5 Programm.o
0x00800200 d
0x00800202 gelb
0x00800203 gruen
0x00800204 rot
*(.bss*)
*(COMMON)
0x00800200 PROVIDE (__bss_end, .)
0x000001de __data_load_start = LOADADDR (.data)
0x000001de __data_load_end = (__data_load_start + SIZEOF (.data))
0x00800205 PROVIDE (__bss_end, .)
0x00000508 __data_load_start = LOADADDR (.data)
0x00000508 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x00800200 0x0
0x00800200 PROVIDE (__noinit_start, .)
.noinit 0x00800205 0x0
0x00800205 PROVIDE (__noinit_start, .)
*(.noinit*)
0x00800200 PROVIDE (__noinit_end, .)
0x00800200 _end = .
0x00800200 PROVIDE (__heap_start, .)
0x00800205 PROVIDE (__noinit_end, .)
0x00800205 _end = .
0x00800205 PROVIDE (__heap_start, .)
.eeprom 0x00810000 0x0
*(.eeprom*)
@ -420,39 +429,39 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.debug_sfnames
*(.debug_sfnames)
.debug_aranges 0x00000000 0x28
.debug_aranges 0x00000000 0x30
*(.debug_aranges)
.debug_aranges
0x00000000 0x28 Programm.o
0x00000000 0x30 Programm.o
.debug_pubnames
*(.debug_pubnames)
.debug_info 0x00000000 0xee2
.debug_info 0x00000000 0x4170
*(.debug_info)
.debug_info 0x00000000 0xee2 Programm.o
.debug_info 0x00000000 0x4170 Programm.o
*(.gnu.linkonce.wi.*)
.debug_abbrev 0x00000000 0x2e1
.debug_abbrev 0x00000000 0x3c6
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x2e1 Programm.o
.debug_abbrev 0x00000000 0x3c6 Programm.o
.debug_line 0x00000000 0x2cd
.debug_line 0x00000000 0x977
*(.debug_line)
.debug_line 0x00000000 0x2cd Programm.o
.debug_line 0x00000000 0x977 Programm.o
.debug_frame 0x00000000 0x34
.debug_frame 0x00000000 0x44
*(.debug_frame)
.debug_frame 0x00000000 0x34 Programm.o
.debug_frame 0x00000000 0x44 Programm.o
.debug_str 0x00000000 0x693
.debug_str 0x00000000 0x1866
*(.debug_str)
.debug_str 0x00000000 0x693 Programm.o
0x6ce (size before relaxing)
.debug_str 0x00000000 0x1866 Programm.o
0x18a6 (size before relaxing)
.debug_loc 0x00000000 0xf0
.debug_loc 0x00000000 0x90d
*(.debug_loc)
.debug_loc 0x00000000 0xf0 Programm.o
.debug_loc 0x00000000 0x90d Programm.o
.debug_macinfo
*(.debug_macinfo)
@ -460,9 +469,9 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8
.debug_pubtypes
*(.debug_pubtypes)
.debug_ranges 0x00000000 0x60
.debug_ranges 0x00000000 0x2a8
*(.debug_ranges)
.debug_ranges 0x00000000 0x60 Programm.o
.debug_ranges 0x00000000 0x2a8 Programm.o
.debug_macro
*(.debug_macro)

View File

@ -13,20 +13,71 @@ S11300A00C9499000C9499000C9499000C94990068
S11300B00C9499000C9499000C9499000C94990058
S11300C00C9499000C9499000C9499000C94990048
S11300D00C9499000C9499000C9499000C94990038
S11300E00C9499000C94D600D60011241FBECFEFB7
S11300E00C9499000C946702670211241FBECFEF91
S11300F0D1E2DEBFCDBF00E00CBF22E0A0E0B2E061
S113010001C01D92A030B207E1F710E0CAEED0E0C2
S113011000E006C022970109FE010BBF0E94E9001E
S113010001C01D92A530B207E1F710E0CAEED0E0BD
S113011000E006C022970109FE010BBF0E947E0287
S1130120C83ED10780E00807A9F70E949B000C9401
S1130130ED000C940000E2E0F1E0289A2FEF83E256
S113014094EF215080409040E1F700C000002898CF
S11301508081806480832FEF83ED90E32150804081
S11301609040E1F700C0000080818F7B8083808114
S1130170806280832FEF83E294EF2150804090408F
S1130180E1F700C000008081806480832FEF83ED5D
S113019090E3215080409040E1F700C0000080814E
S11301A08F7B808380818F7D8083C7CFA1E0B1E086
S11301B08C9180628C93E2E0F1E080818F7D80837A
S11301C0209A28988C9180648C9380818F7B808383
S11101D008950790F691E02D1994F894FFCF4E
S113013082020C940000409888E0A098989AA19AB2
S1130140999A00C000C00000A198999A8150A9F71B
S113015098E08DEC88231CF4A09A989A02C0A09889
S1130160989AA19A999A880F00C000C00000A1989B
S1130170999A915079F7409AEBE0F1E08081886098
S1130180808380818F7B80838081806280831BB8A1
S11301908081806880838FE99FE00197F1F700C038
S11301A0000080818F7780830F2EF0E5FF2EF02DE5
S11301B005E61EE6D9E6C3E76894EE24E5F874E4A0
S11301C065E753E541E633E60F2EFBE6DF2EF02D1F
S11301D0A2E0B1E090819F7B9083908190629083B4
S11301E0FBB89081906890838FE99FE00197F1F7C5
S11301F000C0000090819F77908390819F7B9083C3
S11302009081906290830BB99081906890838FE97C
S11302109FE00197F1F700C0000090819F779083E1
S113022090819F7B90839081906290831BB9908191
S1130230906890838FE99FE00197F1F700C0000078
S113024090819F77908390819F7B9083908190622F
S11302509083DBB99081906890838FE99FE0019748
S1130260F1F700C0000090819F77908390819F7B7D
S11302709083908190629083CBB9908190689083B1
S11302808FE99FE00197F1F700C0000090819F770C
S1130290908390819F7B9083908190629083EBB850
S11302A09081906890838FE99FE00197F1F700C0F7
S11302B0000090819F77908390819F7B90839081B1
S11302C0906290837BB99081906890838FE99FE0DE
S11302D00197F1F700C0000090819F77908390818F
S11302E09F7B90839081906290836BB9908190689A
S11302F090838FE99FE00197F1F700C0000090819F
S11303009F77908390819F7B90839081906290836C
S1130310EBB89081906890838FE99FE00197F1F7A3
S113032000C0000090819F77908390819F7B908391
S11303309081906290835BB99081906890838FE9FB
S11303409FE00197F1F700C0000090819F779083B0
S113035090819F7B90839081906290834BB9908130
S1130360906890838FE99FE00197F1F700C0000047
S113037090819F77908390819F7B908390819062FE
S113038090833BB99081906890838FE99FE00197B7
S1130390F1F700C0000090819F77908390819F7B4C
S11303A09083908190629083DBB890819068908371
S11303B08FE99FE00197F1F700C0000090819F77DB
S11303C09083289A9FEF27EA81E69150204080404D
S11303D0E1F700C0000028989C9190649C939FEFE3
S11303E023ED80E3915020408040E1F700C00000FD
S11303F09C919F7B9C939C9190629C939FEF27EA96
S113040081E6915020408040E1F700C000009C91BB
S113041090649C939FEF23ED80E3915020408040B3
S1130420E1F700C000009C919F7B9C939C919F7D71
S11304309C93D0CEA198999A409A389AA098989A69
S1130440AAE0B1E08C9188608C93EBE0F1E08081CC
S1130450877F80838C9180688C938C9180648C934B
S11304608C9180628C938FEF8AB92FEF81EE94E0A8
S1130470215080409040E1F700C0000080818F7BD4
S1130480808380818F7D80838CE08BB980818068BC
S113049080838FE99FE00197F1F700C0000080811D
S11304A08F77808380818F7B808380818F7D808321
S11304B081E08BB98081806880838FE99FE0019718
S11304C0F1F700C0000080818F7780830895A1E058
S11304D0B1E08C9180628C93E2E0F1E080818F7DC9
S11304E08083209A28988C9180648C9380818F7B60
S11304F0808380E092E00E941A0208950790F691AA
S10B0500E02D1994F894FFCFDB
S9030000FC

View File

@ -12,28 +12,43 @@
ledrotclass rot;
ledgruenclass gruen;
ledgelbclass gelb;
displayclass d;
int main(void)
{
d.setContrast(20);
d.setBacklight(true);
d.write_char(0);
while(1)
{
gruen.on();
_delay_ms(5000);
gruen.off();
d.write_char('P');
d.write_char('e');
d.write_char('n');
d.write_char('i');
d.write_char('s');
d.write_char(' ');
d.write_char('D');
d.write_char('u');
d.write_char(' ');
d.write_char('S');
d.write_char('a');
d.write_char('c');
d.write_char('k');
gruen.on();
_delay_ms(2000);
gruen.off();
gelb.on();
_delay_ms(1000);
gelb.off();
rot.on();
_delay_ms(5000);
_delay_ms(2000);
gelb.on();
_delay_ms(1000);
gelb.off();
rot.off();
}
}

View File

@ -144,6 +144,9 @@
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="io\Display.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\hardware\pin.hpp">
<SubType>compile</SubType>
</Compile>
@ -156,12 +159,21 @@
<Compile Include="io\hardware\portd.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\hardware\portg.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\hardware\porth.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\hardware\portl.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\Led.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="io\mcp4151.hpp">
<SubType>compile</SubType>
</Compile>
<Compile Include="peripheral.h">
<SubType>compile</SubType>
</Compile>

View File

@ -0,0 +1,81 @@
/*
* Display.hpp
*
* Created: 11.05.2014 22:47:23
* Author: netz
*/
#ifndef DISPLAY_H_
#define DISPLAY_H_
template <typename Mcp4151, typename Led, typename PortData, typename PortSettings, int pinen, int pinrw, int pinrs>
class Display {
public:
Display() {
pen::make_output();
prw::make_output();
prs::make_output();
PortData::dir(0xFF);
_delay_ms(100);
this->on();
this->clear();
}
void setContrast(uint8_t level) {
poti.set(level);
}
void setBacklight(bool level) {
if(level) {
backlight.on();
} else {
backlight.off();
}
}
void write_char(uint8_t data) {
prw::clear();
prs::set();
PortData::port(data);
pen::set();
_delay_ms(1);
pen::clear();
}
void clear() {
prw::clear();
prs::clear();
PortData::port(0b00000001);
pen::set();
_delay_ms(1);
pen::clear();
}
void on() {
prw::clear();
prs::clear();
PortData::port(0b00001100);
pen::set();
_delay_ms(1);
pen::clear();
}
private:
Mcp4151 poti;
Led backlight;
const typedef avrlib::pin<PortSettings, pinen> pen;
const typedef avrlib::pin<PortSettings, pinrw> prw;
const typedef avrlib::pin<PortSettings, pinrs> prs;
void ramenablemode() {
prs::set();
}
void ramdisablemode() {
prs::clear();
}
void writemode() {
prw::clear();
}
void readmode() {
prw::set();
}
};
#endif /* DISPLAY_H_ */

View File

@ -0,0 +1,22 @@
#ifndef AVRLIB_PORTG_HPP
#define AVRLIB_PORTG_HPP
#include <avr/io.h>
namespace avrlib {
struct portg
{
static uint8_t port() { return PORTG; }
static void port(uint8_t v) { PORTG = v; }
static uint8_t pin() { return PING; }
static void pin(uint8_t v) { PING = v; }
static uint8_t dir() { return DDRG; }
static void dir(uint8_t v) { DDRG = v; }
};
}
#endif

View File

@ -0,0 +1,22 @@
#ifndef AVRLIB_PORTL_HPP
#define AVRLIB_PORTL_HPP
#include <avr/io.h>
namespace avrlib {
struct portl
{
static uint8_t port() { return PORTL; }
static void port(uint8_t v) { PORTL = v; }
static uint8_t pin() { return PINL; }
static void pin(uint8_t v) { PINL = v; }
static uint8_t dir() { return DDRL; }
static void dir(uint8_t v) { DDRL = v; }
};
}
#endif

View File

@ -0,0 +1,92 @@
/*
* Spi.h
*
* Created: 06.11.2013 15:41:34
* Author: netz
*/
#ifndef MCP4151_H_
#define MCP4151_H_
#include <util/delay.h>
#include "hardware/pin.hpp"
template <typename PortCS, int cspin, typename PortSDI, int sdisdopin, typename PortSCK, int sckpin>
class Mcp4151 {
public:
const static uint16_t MAX = 256;
const static uint16_t MIN = 185;
Mcp4151() {
this->init();
}
void CSOn() {
cs::clear();
}
void CSOff() {
cs::set();
}
void digitalPotWrite(uint16_t value) {
this->CSOn();
this->send_soft((value>>8)&0b00000001); //high byte least significant bit
this->send_soft(value & 0xff);
this->CSOff();
}
void set(uint8_t v) {
this->digitalPotWrite(MIN+v);
}
void set_max() {
this->digitalPotWrite(MAX);
}
void set_min() {
this->digitalPotWrite(MIN);
}
uint8_t read() {
sdi::make_input();
return this->read_soft();
}
private:
const typedef avrlib::pin<PortCS, cspin> cs;
const typedef avrlib::pin<PortSDI, sdisdopin> sdi;
const typedef avrlib::pin<PortSCK, sckpin> sck;
void init() {
this->init_port();
//this->wiper_pos(0, 200); //Clear Poti
}
void init_port() {
sck::make_low(); //output und low;
cs::make_high(); //output und low;
sdi::make_low(); //output und low;
}
void send_soft(uint8_t data) {
for (uint8_t i=0; i<8; i++)
{
if (data & 0x80) {
sdi::make_high();
}
else {
sdi::make_low();
}
sck::make_high();
data<<=1;
_delay_us(0.3);
sck::make_low();
}
}
uint8_t read_soft() {
uint8_t datain=0;
for (uint8_t i=0; i<8; i++)
{
datain <<= 1;
if(sdi::read()) {
datain |= 1;
}
sck::make_high();
_delay_us(0.3);
sck::make_low();
}
return datain;
}
};
#endif /* MCP4151_H_ */

View File

@ -12,7 +12,11 @@
#define F_CPU 16000000
#include "io/hardware/portb.hpp"
#include "io/hardware/portc.hpp"
#include "io/hardware/portd.hpp"
#include "io/hardware/portg.hpp"
#include "io/hardware/porth.hpp"
#include "io/hardware/portl.hpp"
#include "io/Led.hpp"
typedef Led<
@ -27,7 +31,30 @@ typedef Led<
avrlib::porth, //LED an PORTB
PINH5 //Rot
> ledrotclass;
typedef Led<
avrlib::portl,
PINL3
> ledlcdclass;
#include "io/mcp4151.hpp"
typedef Mcp4151< //<typename PortCS, int cspin, typename PortSDI, int sdisdopin, typename PortSCK, int sckpin>
avrlib::portc,
PINC0,
avrlib::portg,
PING0,
avrlib::portg,
PING1
> lcdpoticlass;
#include "io/Display.hpp"
typedef Display< //<typename Mcp4151, typename PortData, typename PortSettings, int pine, int pinrw, int pinrs>
lcdpoticlass,
ledlcdclass,
avrlib::portd,
avrlib::portl,
PINL7,
PINL6,
PINL5
> displayclass;
#endif /* PERIPHERAL_H_ */