Rainbow-electronics ATmega3290P_V Bedienungsanleitung Seite 229

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 375
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 228
229
ATmega329/3290/649/6490
2552H–AVR–11/06
Note: 1. See “About Code Examples” on page 8.
Assembly Code Example
(1)
LCD_disable:
; Wait until a new frame is started.
Wait_1:
lds r16, LCDCRA
sbrs r16, LCDIF
rjmp Wait_1
; Set LCD Blanking and clear interrupt flag
; by writing a logical one to the flag.
ldi r16, (1<<LCDEN)|(1<<LCDIF)|(1<<LCDBL)
sts LCDCRA, r16
; Wait until LCD Blanking is effective.
Wait_2:
lds r16, LCDCRA
sbrs r16, LCDIF
rjmp Wait_2
; Disable LCD.
ldi r16, (0<<LCDEN)
sts LCDCRA, r16
ret
C Code Example
(1)
Void LCD_disable(void);
{
/* Wait until a new frame is started. */
while ( !(LCDCRA & (1<<LCDIF)) )
;
/* Set LCD Blanking and clear interrupt flag */
/* by writing a logical one to the flag. */
LCDCRA = (1<<LCDEN)|(1<<LCDIF)|(1<<LCDBL);
/* Wait until LCD Blanking is effective. */
while ( !(LCDCRA & (1<<LCDIF)) )
;
/* Disable LCD */
LCDCRA = (0<<LCDEN);
}
Seitenansicht 228
1 2 ... 224 225 226 227 228 229 230 231 232 233 234 ... 374 375

Kommentare zu diesen Handbüchern

Keine Kommentare