Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MAX7456.cpp
- Revision:
- 1:ba08ad32bb88
- Parent:
- 0:869f2c6f960d
- Child:
- 2:46adf929a2ba
diff -r 869f2c6f960d -r ba08ad32bb88 MAX7456.cpp
--- a/MAX7456.cpp Mon Aug 23 10:39:40 2010 +0000
+++ b/MAX7456.cpp Mon Aug 23 13:27:15 2010 +0000
@@ -39,7 +39,7 @@
}
-void MAX7456::locate(int x, int y) { //not sure if I understand the last line
+void MAX7456::locate(int x, int y) {
if ( (x<30) && (y<16) ) {
int add = y*30+x; //formula for converting coordinates into denary location
_write(DMAL,add);
@@ -50,10 +50,21 @@
int MAX7456::_getc() {
-
+
return(0);
}
+void MAX7456::test(){
+ for (int i = 0 ; i < 255 ; i++) {
+ printf("Writing 0x%x to VM1\n",i);
+ _write(VM1,i);
+ wait (0.01);
+ int a = _read(VM1);
+ printf("Read 0x%x from VM1\n",a);
+ }
+ int b = _read(VM1);
+ printf("Read 0x%x from VM1\n",b);
+ }
int MAX7456::_putc(int c) {
@@ -72,16 +83,16 @@
return(c);
}
-void MAX7456::setdarkness(){
+void MAX7456::setdarkness() {
_write(VM1,0xC7);
- }
+}
-void MAX7456::initaddress(){
- int d = _read(DMAH);
- d= d&0xFC;
- _write(DMAH,d); // setting DMAH[1]=0
- // to module to read/write character address byte
- }
+void MAX7456::initaddress() {
+ int d = _read(DMAH);
+ d= d&0xFC;
+ _write(DMAH,d); // setting DMAH[1]=0
+ // to module to read/write character address byte
+}
@@ -93,6 +104,7 @@
}
+
void MAX7456::format (char mode) {
if (mode == 'P') {
@@ -100,7 +112,7 @@
} else if (mode == 'N') {
_write(VM0,0x78); // NTSC
}
-
+
}
int MAX7456::_read(int address) {