📄 thermometer.lss
字号:
44e: 80 91 80 01 lds r24, 0x0180
452: 90 91 81 01 lds r25, 0x0181
456: 0e 94 0a 02 call 0x414 ; 0x414 <lcd_base_addr>
// 5 pixel wide characters and add space
for(unsigned char i=0;i<5;i++) {
lcd_send(pgm_read_byte(&font5x7[chr-32][i]) << 1, LCD_DATA);
45a: 85 e0 ldi r24, 0x05 ; 5
45c: 08 9f mul r16, r24
45e: 80 01 movw r16, r0
460: 11 24 eor r1, r1
462: e8 01 movw r28, r16
464: cc 54 subi r28, 0x4C ; 76
466: d0 40 sbci r29, 0x00 ; 0
void lcd_chr(char chr)
{
lcd_base_addr(lcdCacheIdx);
// 5 pixel wide characters and add space
for(unsigned char i=0;i<5;i++) {
468: 0b 59 subi r16, 0x9B ; 155
46a: 10 40 sbci r17, 0x00 ; 0
46c: 0c 5a subi r16, 0xAC ; 172
46e: 1f 4f sbci r17, 0xFF ; 255
lcd_send(pgm_read_byte(&font5x7[chr-32][i]) << 1, LCD_DATA);
470: fe 01 movw r30, r28
472: 84 91 lpm r24, Z+
474: 61 e0 ldi r22, 0x01 ; 1
476: 88 0f add r24, r24
478: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
47c: 21 96 adiw r28, 0x01 ; 1
void lcd_chr(char chr)
{
lcd_base_addr(lcdCacheIdx);
// 5 pixel wide characters and add space
for(unsigned char i=0;i<5;i++) {
47e: c0 17 cp r28, r16
480: d1 07 cpc r29, r17
482: b1 f7 brne .-20 ; 0x470 <lcd_chr+0x2c>
lcd_send(pgm_read_byte(&font5x7[chr-32][i]) << 1, LCD_DATA);
}
lcd_send(0, LCD_DATA);
484: 61 e0 ldi r22, 0x01 ; 1
486: 80 e0 ldi r24, 0x00 ; 0
488: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcdCacheIdx += 6;
48c: 80 91 80 01 lds r24, 0x0180
490: 90 91 81 01 lds r25, 0x0181
494: 06 96 adiw r24, 0x06 ; 6
496: 90 93 81 01 sts 0x0181, r25
49a: 80 93 80 01 sts 0x0180, r24
}
49e: df 91 pop r29
4a0: cf 91 pop r28
4a2: 1f 91 pop r17
4a4: 0f 91 pop r16
4a6: 08 95 ret
000004a8 <lcd_str>:
/* Displays string at current cursor location and increment cursor location */
void lcd_str(char *str)
{
4a8: cf 93 push r28
4aa: df 93 push r29
4ac: ec 01 movw r28, r24
4ae: 03 c0 rjmp .+6 ; 0x4b6 <lcd_str+0xe>
while(*str) {
lcd_chr(*str++);
4b0: 21 96 adiw r28, 0x01 ; 1
4b2: 0e 94 22 02 call 0x444 ; 0x444 <lcd_chr>
}
/* Displays string at current cursor location and increment cursor location */
void lcd_str(char *str)
{
while(*str) {
4b6: 88 81 ld r24, Y
4b8: 88 23 and r24, r24
4ba: d1 f7 brne .-12 ; 0x4b0 <lcd_str+0x8>
lcd_chr(*str++);
}
}
4bc: df 91 pop r29
4be: cf 91 pop r28
4c0: 08 95 ret
000004c2 <lcd_clear_area>:
}
}
/* Clears an area on a line */
void lcd_clear_area(unsigned char line, unsigned char startX, unsigned char endX)
{
4c2: 0f 93 push r16
4c4: 1f 93 push r17
4c6: cf 93 push r28
4c8: df 93 push r29
// Start and end positions of line
int start = (line-1)*84+(startX-1);
4ca: 94 e5 ldi r25, 0x54 ; 84
4cc: 89 9f mul r24, r25
4ce: c0 01 movw r24, r0
4d0: 11 24 eor r1, r1
4d2: 84 55 subi r24, 0x54 ; 84
4d4: 90 40 sbci r25, 0x00 ; 0
int end = (line-1)*84+(endX-1);
4d6: 8c 01 movw r16, r24
4d8: 04 0f add r16, r20
4da: 11 1d adc r17, r1
4dc: 01 50 subi r16, 0x01 ; 1
4de: 10 40 sbci r17, 0x00 ; 0
lcd_base_addr(start);
4e0: c6 2f mov r28, r22
4e2: d0 e0 ldi r29, 0x00 ; 0
4e4: 21 97 sbiw r28, 0x01 ; 1
4e6: c8 0f add r28, r24
4e8: d9 1f adc r29, r25
4ea: ce 01 movw r24, r28
4ec: 0e 94 0a 02 call 0x414 ; 0x414 <lcd_base_addr>
4f0: 05 c0 rjmp .+10 ; 0x4fc <lcd_clear_area+0x3a>
// Clear all data in range from cache
for(unsigned int i=start;i<end;i++) {
lcd_send(0, LCD_DATA);
4f2: 61 e0 ldi r22, 0x01 ; 1
4f4: 80 e0 ldi r24, 0x00 ; 0
4f6: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
int end = (line-1)*84+(endX-1);
lcd_base_addr(start);
// Clear all data in range from cache
for(unsigned int i=start;i<end;i++) {
4fa: 21 96 adiw r28, 0x01 ; 1
4fc: c0 17 cp r28, r16
4fe: d1 07 cpc r29, r17
500: c0 f3 brcs .-16 ; 0x4f2 <lcd_clear_area+0x30>
lcd_send(0, LCD_DATA);
}
}
502: df 91 pop r29
504: cf 91 pop r28
506: 1f 91 pop r17
508: 0f 91 pop r16
50a: 08 95 ret
0000050c <lcd_clear_line>:
/* Clears an entire text block. (rows of 8 pixels on the lcd) */
void lcd_clear_line(unsigned char line)
{
50c: 44 e5 ldi r20, 0x54 ; 84
50e: 61 e0 ldi r22, 0x01 ; 1
510: 0e 94 61 02 call 0x4c2 ; 0x4c2 <lcd_clear_area>
lcd_clear_area(line, 1, LCD_X_RES);
}
514: 08 95 ret
00000516 <lcd_clear>:
lcd_send(0x20, LCD_CMD); // LCD std cmds, hori addr mode
}
/* Clears the display */
void lcd_clear(void)
{
516: cf 93 push r28
518: df 93 push r29
lcdCacheIdx = 0;
51a: 10 92 81 01 sts 0x0181, r1
51e: 10 92 80 01 sts 0x0180, r1
lcd_base_addr(lcdCacheIdx);
522: 80 e0 ldi r24, 0x00 ; 0
524: 90 e0 ldi r25, 0x00 ; 0
526: 0e 94 0a 02 call 0x414 ; 0x414 <lcd_base_addr>
52a: c0 e0 ldi r28, 0x00 ; 0
52c: d0 e0 ldi r29, 0x00 ; 0
// Set the entire cache to zero and write 0s to lcd
for(int i=0;i<LCD_CACHE_SIZE;i++) {
lcd_send(0, LCD_DATA);
52e: 61 e0 ldi r22, 0x01 ; 1
530: 80 e0 ldi r24, 0x00 ; 0
532: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcdCacheIdx = 0;
lcd_base_addr(lcdCacheIdx);
// Set the entire cache to zero and write 0s to lcd
for(int i=0;i<LCD_CACHE_SIZE;i++) {
536: 21 96 adiw r28, 0x01 ; 1
538: 81 e0 ldi r24, 0x01 ; 1
53a: c8 3f cpi r28, 0xF8 ; 248
53c: d8 07 cpc r29, r24
53e: b9 f7 brne .-18 ; 0x52e <lcd_clear+0x18>
lcd_send(0, LCD_DATA);
}
}
540: df 91 pop r29
542: cf 91 pop r28
544: 08 95 ret
00000546 <lcd_contrast>:
fdevopen(lcd_chr, 0);
}
/* Set display contrast. Note: No change is visible at ambient temperature */
void lcd_contrast(unsigned char contrast)
{
546: 1f 93 push r17
548: 18 2f mov r17, r24
lcd_send(0x21, LCD_CMD); // LCD Extended Commands
54a: 60 e0 ldi r22, 0x00 ; 0
54c: 81 e2 ldi r24, 0x21 ; 33
54e: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x80 | contrast, LCD_CMD); // Set LCD Vop(Contrast)
552: 60 e0 ldi r22, 0x00 ; 0
554: 81 2f mov r24, r17
556: 80 68 ori r24, 0x80 ; 128
558: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x20, LCD_CMD); // LCD std cmds, hori addr mode
55c: 60 e0 ldi r22, 0x00 ; 0
55e: 80 e2 ldi r24, 0x20 ; 32
560: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
}
564: 1f 91 pop r17
566: 08 95 ret
00000568 <lcd_init>:
{ 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z
};
/* Performs IO & LCD controller initialization */
void lcd_init(void)
{
568: c1 9a sbi 0x18, 1 ; 24
// Pull-up on reset pin
LCD_PORT |= LCD_RST_PIN;
// Set output bits on lcd port
LCD_DDR |= LCD_RST_PIN | LCD_CE_PIN | LCD_DC_PIN | LCD_DATA_PIN | LCD_CLK_PIN;
56a: 87 b3 in r24, 0x17 ; 23
56c: 83 6b ori r24, 0xB3 ; 179
56e: 87 bb out 0x17, r24 ; 23
milliseconds can be achieved.
*/
void
_delay_loop_2(uint16_t __count)
{
__asm__ volatile (
570: 86 ea ldi r24, 0xA6 ; 166
572: 9e e0 ldi r25, 0x0E ; 14
574: 01 97 sbiw r24, 0x01 ; 1
576: f1 f7 brne .-4 ; 0x574 <lcd_init+0xc>
// Wait after VCC high for reset (max 30ms)
_delay_ms(15);
// Toggle display reset pin
LCD_PORT &= ~LCD_RST_PIN;
578: c1 98 cbi 0x18, 1 ; 24
lcd_delay();
LCD_PORT |= LCD_RST_PIN;
57a: c1 9a sbi 0x18, 1 ; 24
// Disable LCD controller
LCD_PORT |= LCD_CE_PIN;
57c: c4 9a sbi 0x18, 4 ; 24
lcd_send(0x21, LCD_CMD); // LCD Extended Commands
57e: 60 e0 ldi r22, 0x00 ; 0
580: 81 e2 ldi r24, 0x21 ; 33
582: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0xC8, LCD_CMD); // Set LCD Vop(Contrast)
586: 60 e0 ldi r22, 0x00 ; 0
588: 88 ec ldi r24, 0xC8 ; 200
58a: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x06, LCD_CMD); // Set Temp coefficent
58e: 60 e0 ldi r22, 0x00 ; 0
590: 86 e0 ldi r24, 0x06 ; 6
592: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x13, LCD_CMD); // LCD bias mode 1:48
596: 60 e0 ldi r22, 0x00 ; 0
598: 83 e1 ldi r24, 0x13 ; 19
59a: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x20, LCD_CMD); // Standard Commands, Horizontal addressing
59e: 60 e0 ldi r22, 0x00 ; 0
5a0: 80 e2 ldi r24, 0x20 ; 32
5a2: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
lcd_send(0x0C, LCD_CMD); // LCD in normal mode
5a6: 60 e0 ldi r22, 0x00 ; 0
5a8: 8c e0 ldi r24, 0x0C ; 12
5aa: 0e 94 e0 01 call 0x3c0 ; 0x3c0 <lcd_send>
// Clear lcd
lcd_clear();
5ae: 0e 94 8b 02 call 0x516 ; 0x516 <lcd_clear>
// For using printf
fdevopen(lcd_chr, 0);
5b2: 60 e0 ldi r22, 0x00 ; 0
5b4: 70 e0 ldi r23, 0x00 ; 0
5b6: 82 e2 ldi r24, 0x22 ; 34
5b8: 92 e0 ldi r25, 0x02 ; 2
5ba: 0e 94 2b 09 call 0x1256 ; 0x1256 <fdevopen>
}
5be: 08 95 ret
000005c0 <ShowMe>:
lcd_init();
lcd_contrast(0x4F); //F - the highest constras
}
void ShowMe(void)
{
5c0: 08 95 ret
000005c2 <SB3>:
//lcd_str(char_tempe);
//}
}
void SB3(void)
{
5c2: 0e 94 8b 02 call 0x516 ; 0x516 <lcd_clear>
lcd_clear();
}
5c6: 08 95 ret
000005c8 <SB2>:
lcd_goto_xy(4,3);
lcd_str("ALICJE!!!");
}
void SB2(void)
{
5c8: 0e 94 b6 05 call 0xb6c ; 0xb6c <get_this_stupid_temperature_now>
//TM_Convert_temperature(0,char_tempe,2);
//itoa(int_tempe,char_tempe,2);
//lcd_str(char_tempe);
//}
}
5cc: 08 95 ret
000005ce <SB1>:
//lcd_goto_xy(4,5);
//lcd_str("18:33");
}
void SB1(void)
{
5ce: 62 e0 ldi r22, 0x02 ; 2
5d0: 84 e0 ldi r24, 0x04 ; 4
5d2: 0e 94 c1 01 call 0x382 ; 0x382 <lcd_goto_xy>
lcd_goto_xy(4,2);
lcd_str("KOCHAM");
5d6: 80 e6 ldi r24, 0x60 ; 96
5d8: 90 e0 ldi r25, 0x00 ; 0
5da: 0e 94 54 02 call 0x4a8 ; 0x4a8 <lcd_str>
lcd_goto_xy(4,3);
5de: 63 e0 ldi r22, 0x03 ; 3
5e0: 84 e0 ldi r24, 0x04 ; 4
5e2: 0e 94 c1 01 call 0x382 ; 0x382 <lcd_goto_xy>
lcd_str("ALICJE!!!");
5e6: 87 e6 ldi r24, 0x67 ; 103
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -