• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision7dacd7c5c7af9ab2e41c321e7cbdf7ee4d0a3d9f (tree)
Zeit2013-06-11 11:52:33
AutorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[Device] ADD AKC6955(Initial), ADD ACM1602 LCD Controller.

Ändern Zusammenfassung

Diff

--- /dev/null
+++ b/akc6955.c
@@ -0,0 +1,285 @@
1+/*
2+ * OpenI2CRADIO
3+ * RADIO CHIP AKC6955 Handler
4+ * (C) 2013-06-10 K.Ohta <whatisthis.sowhat ai gmail.com>
5+ * License: GPL2
6+ */
7+
8+#include <stdarg.h>
9+#include <stdio.h>
10+#include <delay.h>
11+#include <string.h>
12+#include "akc6955.h"
13+#include "i2c_io.h"
14+
15+
16+
17+void akc6955_writecmd(unsigned char reg, unsigned char data)
18+{
19+ i2c_idle();
20+ OPENASMASTER();
21+ i2c_writechar(AKC6955_ADDRESS);
22+ i2c_writechar(reg);
23+ i2c_writechar(data);
24+ CLOSEASMASTER();
25+}
26+
27+unsigned char akc6955_readcmd(unsigned char reg)
28+{
29+ unsigned char c;
30+ i2c_idle();
31+ OPENASMASTER();
32+ i2c_writechar(AKC6955_ADDRESS);
33+ i2c_writechar(reg);
34+ c = i2c_readchar();
35+ CLOSEASMASTER();
36+ return c;
37+}
38+
39+
40+void akc6955_set_amband(unsigned char band)
41+{
42+ unsigned char b;
43+ b = akc6955_readcmd(AKC6955_BAND);
44+ b &= 0x07; // extract FM
45+ b = b | ((band & 0x1f) << 3);
46+ akc6955_writecmd(AKC6955_BAND, b);
47+}
48+
49+void akc6955_set_fmband(unsigned char band)
50+{
51+ unsigned char b;
52+ b = akc6955_readcmd(AKC6955_BAND);
53+ b &= 0xf8; // extract AM
54+ b = b | (band & 0x07);
55+ akc6955_writecmd(AKC6955_BAND, b);
56+}
57+
58+unsigned char akc6955_get_amband(void)
59+{
60+ unsigned char b;
61+ b = akc6955_readcmd(AKC6955_BAND);
62+ b = (b & 0xf8) >> 3;
63+ return b;
64+}
65+
66+unsigned char akc6955_get_fmband(void)
67+{
68+ unsigned char b;
69+ b = akc6955_readcmd(AKC6955_BAND);
70+ b = b & 0x07;
71+ return b;
72+}
73+
74+void akc6955_set_power(unsigned char on)
75+{
76+ unsigned char b;
77+ b = akc6955_readcmd(AKC6955_POWER);
78+ if(on != 0){
79+ b |= 0x80;
80+ } else {
81+ b &= 0x7f;
82+ }
83+ akc6955_writecmd(AKC6955_POWER, b);
84+}
85+
86+void akc6955_do_tune(void)
87+{
88+ unsigned char b;
89+ b = akc6955_readcmd(AKC6955_POWER);
90+ b &= 0xdf; // Tun = '0'
91+ akc6955_writecmd(AKC6955_POWER, b);
92+ // Need sleep?
93+ b |= 0x20; // Tun = '1'
94+ akc6955_writecmd(AKC6955_POWER, b);
95+}
96+
97+unsigned int akc6955_set_tune(unsigned char mode_3k, unsigned int ch)
98+{
99+ unsigned char band;
100+ unsigned char fm;
101+ unsigned char b;
102+ unsigned int i;
103+
104+ i = ch & 0x1fff;
105+ fm = akc6955_readcmd(AKC6955_POWER) & 0x40;
106+ if(fm == 0){
107+ // AM
108+ band = akc6955_get_amband();
109+ } else {
110+ band = 0;
111+ }
112+ if(band == 2){
113+ // BAND=AM && MW2
114+ i = (i / 3) * 3;
115+ }
116+ if(mode_3k == 0){
117+ b = ((i >> 8) & 0x1f) | 0x40; // 32.768KHz clock
118+ } else {
119+ b = ((i >> 8) & 0x1f) | 0x60;
120+ }
121+ akc6955_writecmd(AKC6955_CH_HI, b);
122+ b = i & 0xff;
123+ akc6955_writecmd(AKC6955_CH_LO, b);
124+ akc6955_do_tune();
125+}
126+
127+void akc6955_do_scan(unsigned char up)
128+{
129+ unsigned char b;
130+ unsigned char m;
131+ akc6955_do_tune();
132+ b = akc6955_readcmd(AKC6955_POWER);
133+ b &= 0xe3;
134+ if(up != 0) {
135+ b |= 0x08;
136+ }
137+ akc6955_writecmd(AKC6955_POWER, b); // Falldown seek bit to '0'.
138+ b |= 0x10;
139+ akc6955_writecmd(AKC6955_POWER, b); // Raise seek bit to '1'.
140+}
141+
142+void akc6955_abort_scan(void)
143+{
144+ unsigned char b;
145+ b = akc6955_readcmd(AKC6955_POWER);
146+ b &= 0xef;
147+ akc6955_writecmd(AKC6955_POWER, b); // Falldown seek bit to '0'.
148+}
149+
150+unsigned char akc6955_chk_donescan(void)
151+{
152+ unsigned char b;
153+ b = akc6955_readcmd(AKC6955_RCH_HI) & 0x40;
154+ if(b == 0) return 0;
155+ return 0xff;
156+}
157+
158+
159+/*
160+ * Get AM/FM Frequency: ret = KHz at AM, 10KHz @FM.
161+ */
162+unsigned int akc6955_get_freq(void)
163+{
164+ unsigned char b, h, l;
165+ unsigned char fm;
166+ unsigned int i;
167+ b = akc6955_readcmd(AKC6955_CNR_AM) & 0x80;
168+ l = akc6955_readcmd(AKC6955_RCH_LO) ;
169+ h = akc6955_readcmd(AKC6955_RCH_HI) & 0x1f;
170+ fm = akc6955_readcmd(AKC6955_POWER) & 0x40;
171+ i = l + h * 256;
172+ if(fm != 0){ // 25KHz
173+ i = i * 10; // 25 / 10 = 10/4
174+ i = i / 4;
175+ i += 3000; // 30MHz
176+ } else if(b == 0){ // 5K
177+ i = i * 5;
178+ } else { // 3K
179+ i = i * 3;
180+ }
181+ return i;
182+}
183+
184+void akc6955_set_freq(unsigned int freq)
185+{
186+ unsigned int ch;
187+ unsigned char b;
188+ unsigned char fm;
189+ unsigned char mode3k;
190+
191+ fm = akc6955_readcmd(AKC6955_POWER) & 0x40;
192+ if(fm != 0) { // FM
193+ ch = freq - 3000;
194+ ch = ch * 4;
195+ ch = ch / 10; // 10/25 = 0.4
196+ } else {
197+ mode3k = akc6955_readcmd(AKC6955_CNR_AM) & 0x80;
198+ if(mode3k == 0){
199+ ch = freq / 5;
200+ } else {
201+ ch = freq / 3;
202+ }
203+ }
204+ akc6955_set_tune(mode3k, ch);
205+}
206+
207+unsigned char akc6955_tune(void)
208+{
209+ unsigned char b;
210+ b = akc6955_readcmd(AKC6955_RCH_HI) & 0x20;
211+ if(b == 0x00) {
212+ return 0;
213+ } else {
214+ return 0xff;
215+ }
216+}
217+
218+unsigned char akc6955_get_cnr(void)
219+{
220+ unsigned char fm;
221+ unsigned char b;
222+ fm = akc6955_readcmd(AKC6955_POWER) & 0x40;
223+ if(fm != 0) { // FM
224+ b = akc6955_readcmd(AKC6955_CNR_FM);
225+ } else { // AM
226+ b = akc6955_readcmd(AKC6955_CNR_AM);
227+ }
228+ b &= 0x7f;
229+ return b;
230+}
231+
232+int akc6955_read_level(void)
233+{
234+ unsigned char fm;
235+ unsigned char rflevel, iflevel;
236+ unsigned char b;
237+ unsigned int rssi;
238+ unsigned int freq;
239+ int level;
240+
241+ fm = akc6955_readcmd(AKC6955_POWER) & 0x40;
242+ b = akc6955_readcmd(AKC6955_PGALEVEL);
243+ rflevel = (b & 0xe0) >> 5;
244+ iflevel = (b & 0x1c) >> 2;
245+ rssi = (unsigned int)(akc6955_readcmd(AKC6955_RSSI) & 0x7f);
246+ if(fm != 0){
247+ level = 103 - (rssi + 6 * (rflevel + iflevel));
248+ } else {
249+ freq = akc6955_get_freq();
250+ if(freq > 2560) { // ASSUME SW
251+ level = 103 - (rssi + 6 * (rflevel + iflevel));
252+ } else { // ASSUME MW,LW
253+ level = 123 - (rssi + 6 * (rflevel + iflevel));
254+ }
255+ }
256+ return level;
257+}
258+
259+unsigned int akc6955_up_freq(unsigned int step)
260+{
261+ unsigned int freq;
262+ freq = akc6955_get_freq();
263+ freq += step;
264+ akc6955_set_freq(freq);
265+ do{
266+ // Use software-delay, but recommands hardware-delay ;-(
267+ delay1ktcy(100); // Wait 100000 cycles = 12.5ms
268+ } while(akc6955_tune() == 0);
269+ return akc6955_get_freq();
270+}
271+
272+
273+unsigned int akc6955_down_freq(unsigned int step)
274+{
275+ unsigned int freq;
276+ freq = akc6955_get_freq();
277+ if(freq <= step) return freq;
278+ freq -= step;
279+ akc6955_set_freq(freq);
280+ do{
281+ // Use software-delay, but recommands hardware-delay ;-(
282+ delay1ktcy(100); // Wait 100000 cycles = 12.5ms
283+ } while(akc6955_tune() == 0);
284+ return akc6955_get_freq();
285+}
--- /dev/null
+++ b/akc6955.h
@@ -0,0 +1,68 @@
1+/*
2+ * File: akc6955.h
3+ * Author: whatisthis
4+ *
5+ * Created on 2013/06/11, 10:24
6+ */
7+
8+#ifndef AKC6955_H
9+#define AKC6955_H
10+
11+#ifdef __cplusplus
12+extern "C" {
13+#endif
14+
15+#define AKC6955_ADDRESS 0x20
16+
17+/*
18+ * Register definisions.
19+ */
20+#define AKC6955_POWER 0
21+#define AKC6955_BAND 1
22+#define AKC6955_CH_HI 2
23+#define AKC6955_CH_LO 3
24+#define AKC6955_UCH_ST 4
25+#define AKC6955_UCS_EN 5
26+#define AKC6955_VOLUME 6
27+#define AKC6955_STEREO 7
28+#define AKC6955_THRESH 8
29+#define AKC6955_ENABLE 9
30+// 10 = RESERVE
31+#define AKC6955_SPACE 11
32+// 12 = RESERVE
33+#define AKC6955_PRE 13
34+// 14-19 = RESERVE
35+
36+// Read only registers
37+#define AKC6955_RCH_HI 20
38+#define AKC6955_RCH_LO 21
39+#define AKC6955_CNR_AM 22
40+#define AKC6955_CNR_FM 23
41+#define AKC6955_PGALEVEL 24
42+#define AKC6955_VBAT 25
43+#define AKC6955_FDNUM 26
44+#define AKC6955_RSSI 27
45+
46+/*
47+ * Resister definitions
48+ */
49+ typedef union{
50+ unsigned char byte;
51+ struct {
52+ unsigned power_on :1;
53+ unsigned fm_en :1;
54+ unsigned tune :1;
55+ unsigned seek :1;
56+ unsigned seekdir :1;
57+ unsigned mute :1;
58+ unsigned reserve :2;
59+ };
60+ } AKC6955_Reg0;
61+
62+
63+#ifdef __cplusplus
64+}
65+#endif
66+
67+#endif /* AKC6955_H */
68+
--- a/i2c_io.c
+++ b/i2c_io.c
@@ -5,6 +5,8 @@
55 * License: GPL2
66 */
77
8-#include <sdcc-lib.h>
9-#include <pic18fregs.h> /* ONLY FOR PIC18x */
8+#include <stdarg.h>
9+#include <stdio.h>
10+
11+#include "i2c_io.h"
1012
--- /dev/null
+++ b/i2c_io.h
@@ -0,0 +1,34 @@
1+/*
2+ * OpenI2CRADIO
3+ * I2C Header
4+ * (C) 2013-06-10 K.Ohta <whatisthis.sowhat ai gmail.com>
5+ * License: GPL2
6+ */
7+#include <sdcc-lib.h>
8+#include <pic18fregs.h> /* ONLY FOR PIC18x */
9+
10+#include <i2c.h>
11+
12+#ifndef I2C_IO_H
13+#define I2C_IO_H
14+
15+#ifdef __cplusplus
16+extern "C" {
17+#endif
18+/*
19+ * #1
20+ */
21+#define I2C_CLOCK_PARAM 19 // 8MHz/(4*(1+I2C_CLOCK_PARAM)) -> 100KHz
22+#define I2C_DEFAULT_MODE I2C_MASTER
23+#define I2C_SLEW_DEFAULT I2C_SLEW_ON
24+
25+#define OPENASMASTER() i2c_open(I2C_DEFAULT_MODE, I2C_SLEW_DEFAULT, I2C_CLOCK_PARAM)
26+#define CLOSEASMASTER() i2c_close()
27+
28+
29+#ifdef __cplusplus
30+}
31+#endif
32+
33+#endif /* I2C_IO_H */
34+
--- /dev/null
+++ b/lcd_acm1602.c
@@ -0,0 +1,115 @@
1+/*
2+ * OpenI2CRADIO
3+ * I2C-LCD ACM1602 Handler
4+ * (C) 2013-06-10 K.Ohta <whatisthis.sowhat ai gmail.com>
5+ * License: GPL2
6+ */
7+
8+#include <stdarg.h>
9+#include <stdio.h>
10+#include <delay.h>
11+#include <string.h>
12+
13+#include "i2c_io.h"
14+
15+
16+static void sendcmd(unsigned char addr, unsigned char cmd)
17+{
18+ i2c_idle();
19+ OPENASMASTER();
20+ i2c_writechar(addr);
21+ i2c_writechar(0x00);
22+ i2c_writechar(cmd);
23+ CLOSEASMASTER();
24+ delay1ktcy(1); // 0.1ms
25+}
26+
27+static void delay_lcd(void)
28+{
29+ delay1ktcy(40); // (1000cycle * (8*5) = 5ms
30+}
31+
32+void acm1602_cls(unsigned char addr)
33+{
34+ i2c_idle();
35+ OPENASMASTER();
36+ i2c_writechar(addr);
37+ i2c_writechar(0x00); // CMD
38+ i2c_writechar(0x01); // CLS
39+ CLOSEASMASTER();
40+ delay_lcd();
41+}
42+
43+void acm1602_putchar(unsigned char addr, unsigned char c)
44+{
45+ i2c_idle();
46+ OPENASMASTER();
47+ i2c_writechar(addr);
48+ i2c_writechar(0x80); //Data
49+ i2c_writechar(c); // Putchar
50+ CLOSEASMASTER();
51+ delay1ktcy(1); //0.1ms
52+}
53+
54+void acm1602_locate(unsigned char addr, char x, char y)
55+{
56+ unsigned char ramaddr;
57+ if((x < 0) || (x > 15)) return;
58+ if((y < 0) || (y > 1)) return;
59+ if(y == 0){
60+ ramaddr = 0x80 | (x & 0x0f);
61+ } else {
62+ ramaddr = 0xc0 | (x & 0x0f);
63+ }
64+ sendcmd(addr, ramaddr);
65+}
66+
67+void acm1602_home(unsigned char addr)
68+{
69+ i2c_idle();
70+ OPENASMASTER();
71+ i2c_writechar(addr);
72+ i2c_writechar(0x00); // CMD
73+ i2c_writechar(0x02); // HOME
74+ CLOSEASMASTER();
75+ delay_lcd();
76+}
77+
78+void acm1602_printf(unsigned char addr, const char *fmt, ...)
79+{
80+ char strbuf[32]; // Max 32 bytes.
81+ va_list args;
82+ int i;
83+ int l;
84+
85+ strbuf[0] = '\0';
86+ va_start(args, fmt );
87+ sprintf(strbuf, args);
88+ l = strlen(strbuf);
89+ if((l >= 32) || (l <= 0))return;
90+ for(i = 0; i < l; i++) {
91+ acm1602_putchar(addr, strbuf[i]);
92+ }
93+}
94+
95+void acm1602_cursordir(unsigned char addr, unsigned char right)
96+{
97+ unsigned char cmd;
98+ if(right == 0) {
99+ cmd = 0x18;
100+ } else {
101+ cmd=0x1c;
102+ }
103+ sendcmd(addr, cmd);
104+}
105+
106+void acm1602_init(unsigned char addr, unsigned char cls)
107+{
108+ sendcmd(addr, 0x38); // 2lines, 8x10dot fonts.
109+ sendcmd(addr, 0x0f); // Display ON.
110+ if(cls == 0){
111+ acm1602_home(addr);
112+ } else {
113+ acm1602_cls(addr);
114+ }
115+}
\ No newline at end of file
--- a/nbproject/Makefile-default.mk
+++ b/nbproject/Makefile-default.mk
@@ -45,11 +45,11 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
4545 DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
4646
4747 # Object Files Quoted if spaced
48-OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/ui.o ${OBJECTDIR}/i2c_io.o ${OBJECTDIR}/main.o ${OBJECTDIR}/idle.o
49-POSSIBLE_DEPFILES=${OBJECTDIR}/ui.o.d ${OBJECTDIR}/i2c_io.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/idle.o.d
48+OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/ui.o ${OBJECTDIR}/i2c_io.o ${OBJECTDIR}/main.o ${OBJECTDIR}/idle.o ${OBJECTDIR}/lcd_acm1602.o ${OBJECTDIR}/akc6955.o
49+POSSIBLE_DEPFILES=${OBJECTDIR}/ui.o.d ${OBJECTDIR}/i2c_io.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/idle.o.d ${OBJECTDIR}/lcd_acm1602.o.d ${OBJECTDIR}/akc6955.o.d
5050
5151 # Object Files
52-OBJECTFILES=${OBJECTDIR}/ui.o ${OBJECTDIR}/i2c_io.o ${OBJECTDIR}/main.o ${OBJECTDIR}/idle.o
52+OBJECTFILES=${OBJECTDIR}/ui.o ${OBJECTDIR}/i2c_io.o ${OBJECTDIR}/main.o ${OBJECTDIR}/idle.o ${OBJECTDIR}/lcd_acm1602.o ${OBJECTDIR}/akc6955.o
5353
5454
5555 CFLAGS=
@@ -74,56 +74,76 @@ ifeq ($(TYPE_IMAGE), DEBUG_RUN)
7474 ${OBJECTDIR}/ui.o: ui.c nbproject/Makefile-${CND_CONF}.mk
7575 ${MKDIR} ${OBJECTDIR}
7676 ${RM} ${OBJECTDIR}/ui.o
77- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 ui.c -o${OBJECTDIR}/ui.o
77+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 ui.c -o${OBJECTDIR}/ui.o
7878
7979 ${OBJECTDIR}/i2c_io.o: i2c_io.c nbproject/Makefile-${CND_CONF}.mk
8080 ${MKDIR} ${OBJECTDIR}
8181 ${RM} ${OBJECTDIR}/i2c_io.o
82- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 i2c_io.c -o${OBJECTDIR}/i2c_io.o
82+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 i2c_io.c -o${OBJECTDIR}/i2c_io.o
8383
8484 ${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
8585 ${MKDIR} ${OBJECTDIR}
8686 ${RM} ${OBJECTDIR}/main.o
87- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 main.c -o${OBJECTDIR}/main.o
87+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 main.c -o${OBJECTDIR}/main.o
8888
8989 ${OBJECTDIR}/idle.o: idle.c nbproject/Makefile-${CND_CONF}.mk
9090 ${MKDIR} ${OBJECTDIR}
9191 ${RM} ${OBJECTDIR}/idle.o
92- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 idle.c -o${OBJECTDIR}/idle.o
92+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 idle.c -o${OBJECTDIR}/idle.o
93+
94+${OBJECTDIR}/lcd_acm1602.o: lcd_acm1602.c nbproject/Makefile-${CND_CONF}.mk
95+ ${MKDIR} ${OBJECTDIR}
96+ ${RM} ${OBJECTDIR}/lcd_acm1602.o
97+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 lcd_acm1602.c -o${OBJECTDIR}/lcd_acm1602.o
98+
99+${OBJECTDIR}/akc6955.o: akc6955.c nbproject/Makefile-${CND_CONF}.mk
100+ ${MKDIR} ${OBJECTDIR}
101+ ${RM} ${OBJECTDIR}/akc6955.o
102+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 akc6955.c -o${OBJECTDIR}/akc6955.o
93103
94104 else
95105 ${OBJECTDIR}/ui.o: ui.c nbproject/Makefile-${CND_CONF}.mk
96106 ${MKDIR} ${OBJECTDIR}
97107 ${RM} ${OBJECTDIR}/ui.o
98- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 ui.c -o${OBJECTDIR}/ui.o
108+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 ui.c -o${OBJECTDIR}/ui.o
99109
100110 ${OBJECTDIR}/i2c_io.o: i2c_io.c nbproject/Makefile-${CND_CONF}.mk
101111 ${MKDIR} ${OBJECTDIR}
102112 ${RM} ${OBJECTDIR}/i2c_io.o
103- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 i2c_io.c -o${OBJECTDIR}/i2c_io.o
113+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 i2c_io.c -o${OBJECTDIR}/i2c_io.o
104114
105115 ${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk
106116 ${MKDIR} ${OBJECTDIR}
107117 ${RM} ${OBJECTDIR}/main.o
108- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 main.c -o${OBJECTDIR}/main.o
118+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 main.c -o${OBJECTDIR}/main.o
109119
110120 ${OBJECTDIR}/idle.o: idle.c nbproject/Makefile-${CND_CONF}.mk
111121 ${MKDIR} ${OBJECTDIR}
112122 ${RM} ${OBJECTDIR}/idle.o
113- ${MP_CC} --debug-ralloc --use-non-free --pstack-model=small -c -mpic16 -p18f25k22 idle.c -o${OBJECTDIR}/idle.o
123+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 idle.c -o${OBJECTDIR}/idle.o
124+
125+${OBJECTDIR}/lcd_acm1602.o: lcd_acm1602.c nbproject/Makefile-${CND_CONF}.mk
126+ ${MKDIR} ${OBJECTDIR}
127+ ${RM} ${OBJECTDIR}/lcd_acm1602.o
128+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 lcd_acm1602.c -o${OBJECTDIR}/lcd_acm1602.o
129+
130+${OBJECTDIR}/akc6955.o: akc6955.c nbproject/Makefile-${CND_CONF}.mk
131+ ${MKDIR} ${OBJECTDIR}
132+ ${RM} ${OBJECTDIR}/akc6955.o
133+ ${MP_CC} --debug-ralloc --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -c -mpic16 -p18f25k22 akc6955.c -o${OBJECTDIR}/akc6955.o
114134
115135 endif
116136
117137 # ------------------------------------------------------------------------------------
118138 # Rules for buildStep: link
119139 ifeq ($(TYPE_IMAGE), DEBUG_RUN)
120-dist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
140+dist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk /usr/local/share/sdcc/lib/pic16/libc18f.lib
121141 ${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
122- ${MP_CC} --debug-ralloc -Wl-c -Wl-m --use-non-free --pstack-model=small -mpic16 -p18f25k22 ${OBJECTFILES} -odist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
142+ ${MP_CC} --debug-ralloc -Wl-c -Wl-m --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -mpic16 -p18f25k22 ${OBJECTFILES} -odist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
123143 else
124-dist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
144+dist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk /usr/local/share/sdcc/lib/pic16/libc18f.lib
125145 ${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE}
126- ${MP_CC} --debug-ralloc -Wl-c -Wl-m --use-non-free --pstack-model=small -mpic16 -p18f25k22 ${OBJECTFILES} -odist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}
146+ ${MP_CC} --debug-ralloc -Wl-c -Wl-m --use-non-free -V --pstack-model=small libc18f.lib libio18f25k22.lib -mpic16 -p18f25k22 ${OBJECTFILES} -odist/${CND_CONF}/${IMAGE_TYPE}/OPENI2CRADIO_6955.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}
127147 endif
128148
129149
--- a/nbproject/Makefile-genesis.properties
+++ b/nbproject/Makefile-genesis.properties
@@ -1,5 +1,5 @@
11 #
2-#Tue Jun 11 05:10:14 JST 2013
2+#Tue Jun 11 10:35:42 JST 2013
33 default.languagetoolchain.dir=/usr/local/bin
44 default.br-unifei-rmaalmeida-toolchainSDCC-SDCCtoolchain.md5=b67cce1ad75b450308d7806e430931b3
55 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=8fe1589514540343a5279c082104bce0
--- a/nbproject/configurations.xml
+++ b/nbproject/configurations.xml
@@ -32,7 +32,14 @@
3232 <itemPath>main.c</itemPath>
3333 <itemPath>idle.c</itemPath>
3434 <itemPath>idle.h</itemPath>
35+ <itemPath>i2c_io.h</itemPath>
36+ <itemPath>lcd_acm1602.c</itemPath>
37+ <itemPath>akc6955.c</itemPath>
38+ <itemPath>akc6955.h</itemPath>
3539 </logicalFolder>
40+ <sourceRootList>
41+ <Elem>/usr/local/share/sdcc/lib/src/pic16/libc</Elem>
42+ </sourceRootList>
3643 <projectmakefile>Makefile</projectmakefile>
3744 <confs>
3845 <conf name="default" type="2">
@@ -49,6 +56,7 @@
4956 <compileType>
5057 <linkerTool>
5158 <linkerLibItems>
59+ <linkerLibFileItem>/usr/local/share/sdcc/lib/pic16/libc18f.lib</linkerLibFileItem>
5260 </linkerLibItems>
5361 </linkerTool>
5462 <loading>
@@ -66,8 +74,32 @@
6674 <makeCustomizationNormalizeHexFile>false</makeCustomizationNormalizeHexFile>
6775 </makeCustomizationType>
6876 <PICkit2PlatformTool>
77+ <property key="pk2settings.3state" value="false"/>
78+ <property key="pk2settings.preserveee" value="false"/>
79+ <property key="pk2settings.setvddvoltage" value=""/>
80+ <property key="pk2settings.userpgmexec" value="true"/>
81+ <property key="pk2settings.usetargetpower" value="false"/>
6982 </PICkit2PlatformTool>
83+ <SDCCToolchain>
84+ </SDCCToolchain>
7085 <sdcc>
86+ <property key="V-show-commands-compiler" value="true"/>
87+ <property key="Werror" value="false"/>
88+ <property key="debug-xtra14" value="false"/>
89+ <property key="debug-xtra16" value="false"/>
90+ <property key="extended" value="false"/>
91+ <property key="no-c-code-in-asm" value="false"/>
92+ <property key="no-optimize-goto" value="false"/>
93+ <property key="no-pcode-opt" value="false"/>
94+ <property key="obanksel" value="0"/>
95+ <property key="optimize-cmp" value="false"/>
96+ <property key="optimize-df" value="false"/>
97+ <property key="pcode-verbose" value="false"/>
98+ <property key="pno-banksel" value="false"/>
99+ <property key="pstack-model" value="small"/>
100+ <property key="use-non-free" value="true"/>
101+ <property key="verbose" value="false"/>
102+ <appendMe value="libc18f.lib libio18f25k22.lib"/>
71103 </sdcc>
72104 </conf>
73105 </confs>