Skip to content

Commit b69242b

Browse files
committed
application:HUST_iRhythm
1 parent fb022df commit b69242b

File tree

8 files changed

+72
-132
lines changed

8 files changed

+72
-132
lines changed

arc_design_contest/2018/HUST_iRhythm/Readme.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ This appilcation is a prototype of **Internet Radio** designed on ARC EM Starter
66

77
* [Introduction](#Introduction)
88
- [Function](#function)
9-
- [System Architecture](#system-architecture)
109
- [Appearance](#appearance)
1110
- [Video](#video)
1211
* [Hardware and Software Setup](#hardware-and-software-setup)
@@ -32,9 +31,6 @@ Through an amplifier outside,the online music can be play out from two big speak
3231
* Power Amplification
3332
* Performance data display
3433

35-
### System Architecture
36-
![System Architecture][1]
37-
3834
### Appearance
3935
* **System Top View -- Control Part**
4036
![Control Part][2]
@@ -225,7 +221,6 @@ Placing the HEADER source file.
225221
| Dsp_assembly.h | optimize code for Arc Dsp |
226222

227223

228-
[1]: ./doc/pic/sysarch.png
229224
[2]: ./doc/pic/top.jpg
230225
[3]: ./doc/pic/mid.jpg
231226
[4]: ./doc/pic/mid2.jpg
76 KB
Loading
-73.8 KB
Binary file not shown.
103 KB
Loading

arc_design_contest/2018/HUST_iRhythm/src/GUI/oled.c

Lines changed: 24 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,9 @@ void OLED_CLS(void)
110110
}
111111

112112

113-
//==============================================================
114-
//函数名: void LCD_PutPixel(uint8 x,uint8 y)
115-
//功能描述:绘制一个点(x,y)
116-
//参数:真实坐标值(x,y),x的范围0~127,y的范围0~64
117-
//返回:无
118-
//==============================================================
119113
void OLED_PutPixel(uint8_t x, uint8_t y)
120114
{
121-
uint8_t data1; //data1当前点的数据
115+
uint8_t data1;
122116

123117
OLED_Set_Pos(x, y);
124118
data1 = 0x01 << (y % 8);
@@ -127,14 +121,7 @@ void OLED_PutPixel(uint8_t x, uint8_t y)
127121
Write_IIC_Command((x & 0x0f) | 0x00);
128122
Write_IIC_Data(data1);
129123
}
130-
//==============================================================
131-
//函数名: void LCD_Rectangle(uint8 x1,uint8 y1,
132-
// uint8 x2,uint8 y2,uint8 color,uint8 gif)
133-
//功能描述:绘制一个实心矩形
134-
//参数:左上角坐标(x1,y1),右下角坐标(x2,y2)
135-
// 其中x1、x2的范围0~127,y1,y2的范围0~63,即真实坐标值
136-
//返回:无
137-
//==============================================================
124+
138125
void OLED_Rectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t gif)
139126
{
140127
uint8_t n;
@@ -143,28 +130,17 @@ void OLED_Rectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t gif)
143130

144131
for (n = x1; n <= x2; n++) {
145132
Write_IIC_Data(0x01 << (y1 % 8));
146-
147-
// if (gif == 1) { OLED_DLY_ms(50); }
148133
}
149134

150135
OLED_Set_Pos(x1, y2 >> 3);
151136

152137
for (n = x1; n <= x2; n++) {
153138
Write_IIC_Data(0x01 << (y2 % 8));
154-
// if(gif == 1)
155-
// OLED_DLY_ms(5);
156139
}
157140

158141
}
159-
/**==============================================================
160-
函 数 名: LED_P6x8Char
161-
功能描述: 显示一个6x8标志ASCII字符串
162-
输入数据: uint8 ucIdxX 显示横坐标0~122
163-
uint8 ucIdxY 页范围0~7
164-
uint8 ucData 显示的字符串
165-
输出数据: NONE
166-
返 回 值: NONE
167-
==============================================================**/
142+
143+
168144
void OLED_P6x8Char(uint8_t ucIdxX, uint8_t ucIdxY, uint8_t ucData)
169145
{
170146
uint8_t i, ucDataTmp;
@@ -209,12 +185,8 @@ void OLED_P8x16Char(uint8_t x, uint8_t y, uint8_t ch)
209185

210186
}
211187

212-
//==============================================================
213-
//函数名:LCD_P6x8Str(uint8 x,uint8 y,uint8 *p)
214-
//功能描述:写入一组标准ASCII字符串
215-
//参数:显示的位置(x,y),y为页范围0~7,要显示的字符串
216-
//返回:无
217-
//==============================================================
188+
189+
218190
void OLED_P6x8Str(uint8_t x, uint8_t y, uint8_t ch[])
219191
{
220192
uint8_t c = 0, i = 0, j = 0;
@@ -234,12 +206,9 @@ void OLED_P6x8Str(uint8_t x, uint8_t y, uint8_t ch[])
234206
j++;
235207
}
236208
}
237-
//==============================================================
238-
//函数名:LCD_P8x16Str(uint8 x,uint8 y,uint8 *p)
239-
//功能描述:写入一组标准ASCII字符串
240-
//参数:显示的位置(x,y),y为页范围0~7,要显示的字符串
241-
//返回:无
242-
//==============================================================
209+
210+
211+
243212
void OLED_P8x16Str(uint8_t x, uint8_t y, uint8_t ch[])
244213
{
245214
uint8_t c = 0, i = 0, j = 0;
@@ -265,7 +234,9 @@ void OLED_P8x16Str(uint8_t x, uint8_t y, uint8_t ch[])
265234
j++;
266235
}
267236
}
268-
//输出汉字字符串
237+
238+
239+
269240
void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
270241
{
271242
uint8_t wm = 0, ii = 0;
@@ -290,7 +261,7 @@ void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
290261

291262
OLED_Set_Pos(x , y);
292263

293-
if (adder != 1) { // 显示汉字
264+
if (adder != 1) {
294265
OLED_Set_Pos(x , y);
295266

296267
for (wm = 0; wm < 14; wm++) {
@@ -304,7 +275,7 @@ void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
304275
Write_IIC_Data(F14x16[adder]);
305276
adder += 1;
306277
}
307-
} else { //显示空白字符
278+
} else {
308279
ii += 1;
309280
OLED_Set_Pos(x, y);
310281

@@ -323,7 +294,9 @@ void OLED_P14x16Str(uint8_t x, uint8_t y, uint8_t ch[])
323294
ii += 2;
324295
}
325296
}
326-
//输出汉字和字符混合字符串
297+
298+
299+
327300
void OLED_Print(uint8_t x, uint8_t y, uint8_t ch[])
328301
{
329302
uint8_t ch2[3];
@@ -333,26 +306,22 @@ void OLED_Print(uint8_t x, uint8_t y, uint8_t ch[])
333306
if (ch[ii] > 127) {
334307
ch2[0] = ch[ii];
335308
ch2[1] = ch[ii + 1];
336-
ch2[2] = '\0'; //汉字为两个字节
337-
OLED_P14x16Str(x , y, ch2); //显示汉字
309+
ch2[2] = '\0';
310+
OLED_P14x16Str(x , y, ch2);
338311
x += 14;
339312
ii += 2;
340313
} else {
341314
ch2[0] = ch[ii];
342-
ch2[1] = '\0'; //字母占一个字节
343-
OLED_P8x16Str(x , y , ch2); //显示字母
315+
ch2[1] = '\0';
316+
OLED_P8x16Str(x , y , ch2);
344317
x += 8;
345318
ii += 1;
346319
}
347320
}
348321
}
349322

350-
//==============================================================
351-
//函数名: void Draw_BMP(uint8 x,uint8 y)
352-
//功能描述:显示BMP图片128×64
353-
//参数:起始点坐标(x,y),x的范围0~127,y为页的范围0~7
354-
//返回:无
355-
//==============================================================
323+
324+
356325
void Draw_BMP(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t bmp[])
357326
{
358327
uint16_t ii = 0;
@@ -384,22 +353,15 @@ void OLED_PrintInt16(uint8_t ucIdxX, uint8_t ucIdxY, int16_t sData)
384353
j = (uint16_t)(sData / 10) % 10;
385354
k = (uint16_t) sData % 10;
386355

387-
388-
//十位
389356
OLED_P6x8Char(ucIdxX , ucIdxY, (uint8_t)0 + 48);
390357
OLED_P6x8Char(ucIdxX + 6, ucIdxY, (uint8_t)j + 48);
391358

392-
393-
//个位
394359
OLED_P6x8Char(ucIdxX + 12, ucIdxY, (uint8_t)k + 48);
395360

396361

397362
return;
398363
}
399364

400-
/**
401-
* 画7个频谱条 0-128
402-
*/
403365

404366
void draw_fft()
405367
{
@@ -411,7 +373,7 @@ void draw_fft()
411373

412374
for ( i = 0; i < 4; i++ ) {
413375

414-
if ( gui_info.fft[i] < gui_info.fft_show[i] ) { //下降条
376+
if ( gui_info.fft[i] < gui_info.fft_show[i] ) {
415377

416378
if ( gui_info.fft_show[i] >= 3 ) {
417379
gui_info.fft_show[i] -= 3;

0 commit comments

Comments
 (0)