Code formatting.
This commit is contained in:
@ -1416,8 +1416,8 @@ void setup() {
|
|||||||
Serial.print(number);
|
Serial.print(number);
|
||||||
Serial.println(F(" of 255"));
|
Serial.println(F(" of 255"));
|
||||||
MAX7456::getCARACFromProgMem(tableOfAllCharacters, i, currentChar); //Because the table is too big for ram memory
|
MAX7456::getCARACFromProgMem(tableOfAllCharacters, i, currentChar); //Because the table is too big for ram memory
|
||||||
|
MAX7456::printCharacterToSerial(tableOfAllCharacters[i], true);
|
||||||
osd->sendCharacter(currentChar, i & 0xF0, i & 0xF0); //We send currentChar at address i.
|
osd->sendCharacter(currentChar, i); //We send currentChar at address i.
|
||||||
}
|
}
|
||||||
Serial.println(F("---------- DONE! ----------"));
|
Serial.println(F("---------- DONE! ----------"));
|
||||||
Serial.println(F("please unplug your arduino."));
|
Serial.println(F("please unplug your arduino."));
|
||||||
|
@ -74,7 +74,7 @@ void setup()
|
|||||||
{
|
{
|
||||||
byte spi_junk;
|
byte spi_junk;
|
||||||
int x;
|
int x;
|
||||||
Serial.begin(38400);
|
Serial.begin(115200);
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
|
|
||||||
digitalWrite(USBSELECT,HIGH); //disable USB chip
|
digitalWrite(USBSELECT,HIGH); //disable USB chip
|
||||||
|
192
src/max7456.cpp
192
src/max7456.cpp
@ -2,7 +2,6 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::MAX7456
|
// Implements MAX7456::MAX7456
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -18,13 +17,12 @@ void MAX7456::setBlinkParams(byte blinkBase, byte blinkDC)
|
|||||||
{
|
{
|
||||||
_regVm1.bits.blinkingTime = blinkBase;
|
_regVm1.bits.blinkingTime = blinkBase;
|
||||||
_regVm1.bits.blinkingDutyCycle = blinkDC;
|
_regVm1.bits.blinkingDutyCycle = blinkDC;
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(VM1_ADDRESS_WRITE);
|
SPI.transfer(VM1_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regVm1.whole);
|
SPI.transfer(_regVm1.whole);
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::setDisplayOffsets
|
// Implements MAX7456::setDisplayOffsets
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
@ -37,14 +35,14 @@ void MAX7456::setDisplayOffsets(byte horizontal, byte vertical)
|
|||||||
_regHos.bits.horizontalPositionOffset = horizontal;
|
_regHos.bits.horizontalPositionOffset = horizontal;
|
||||||
_regVos.bits.verticalPositionOffset = vertical;
|
_regVos.bits.verticalPositionOffset = vertical;
|
||||||
|
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(HOS_ADDRESS_WRITE);
|
SPI.transfer(HOS_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regHos.whole);
|
SPI.transfer(_regHos.whole);
|
||||||
|
|
||||||
SPI.transfer(VOS_ADDRESS_WRITE);
|
SPI.transfer(VOS_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regVos.whole);
|
SPI.transfer(_regVos.whole);
|
||||||
|
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -54,24 +52,18 @@ MAX7456::MAX7456()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::sendCharacter
|
// Implements MAX7456::sendCharacter
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::sendCharacter(const charact chara, byte x, byte y)
|
void MAX7456::sendCharacter(const charact chara, char address)
|
||||||
{
|
{
|
||||||
byte charAddress;
|
|
||||||
if(y<0)
|
|
||||||
charAddress = x;
|
|
||||||
else
|
|
||||||
charAddress = x + (y<<4);
|
|
||||||
activateOSD(false);
|
activateOSD(false);
|
||||||
//datasheet p38
|
//datasheet p38
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(CMAH_ADDRESS_WRITE);
|
SPI.transfer(CMAH_ADDRESS_WRITE);
|
||||||
SPI.transfer(charAddress);
|
SPI.transfer(address);
|
||||||
|
|
||||||
for(byte i = 0 ; i < 54 ; i++)
|
for (byte i = 0; i < 54; i++)
|
||||||
{
|
{
|
||||||
SPI.transfer(CMAL_ADDRESS_WRITE);
|
SPI.transfer(CMAL_ADDRESS_WRITE);
|
||||||
SPI.transfer(i);
|
SPI.transfer(i);
|
||||||
@ -84,17 +76,15 @@ void MAX7456::sendCharacter(const charact chara, byte x, byte y)
|
|||||||
SPI.transfer(_regCmm);
|
SPI.transfer(_regCmm);
|
||||||
//while STAT[5] is not good, we wait.
|
//while STAT[5] is not good, we wait.
|
||||||
_regStat.bits.characterMemoryStatus = 1;
|
_regStat.bits.characterMemoryStatus = 1;
|
||||||
while( _regStat.bits.characterMemoryStatus ==1)
|
while (_regStat.bits.characterMemoryStatus == 1)
|
||||||
{
|
{
|
||||||
SPI.transfer(STAT_ADDRESS_READ);
|
SPI.transfer(STAT_ADDRESS_READ);
|
||||||
_regStat.whole = SPI.transfer(0x00);
|
_regStat.whole = SPI.transfer(0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
digitalWrite(_pinCS, HIGH);
|
||||||
digitalWrite(_pinCS,HIGH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::getCharacter
|
// Implements MAX7456::getCharacter
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -102,16 +92,14 @@ void MAX7456::getCharacter(charact chara, byte x, byte y)
|
|||||||
{
|
{
|
||||||
byte charAddress;
|
byte charAddress;
|
||||||
|
|
||||||
|
if (y <= 0)
|
||||||
if(y<=0)
|
|
||||||
charAddress = x;
|
charAddress = x;
|
||||||
else
|
else
|
||||||
charAddress = x + y*16;
|
charAddress = x + y * 16;
|
||||||
|
|
||||||
activateOSD(false);
|
activateOSD(false);
|
||||||
//datasheet p38
|
//datasheet p38
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
|
|
||||||
|
|
||||||
SPI.transfer(CMAH_ADDRESS_WRITE);
|
SPI.transfer(CMAH_ADDRESS_WRITE);
|
||||||
SPI.transfer(charAddress);
|
SPI.transfer(charAddress);
|
||||||
@ -120,8 +108,7 @@ void MAX7456::getCharacter(charact chara, byte x, byte y)
|
|||||||
SPI.transfer(CMM_ADDRESS_WRITE);
|
SPI.transfer(CMM_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regCmm);
|
SPI.transfer(_regCmm);
|
||||||
|
|
||||||
|
for (byte i = 0; i < 54; i++)
|
||||||
for(byte i = 0 ; i < 54 ; i++)
|
|
||||||
{
|
{
|
||||||
SPI.transfer(CMAL_ADDRESS_WRITE);
|
SPI.transfer(CMAL_ADDRESS_WRITE);
|
||||||
SPI.transfer(i);
|
SPI.transfer(i);
|
||||||
@ -130,24 +117,22 @@ void MAX7456::getCharacter(charact chara, byte x, byte y)
|
|||||||
chara[i] = SPI.transfer(0x00);
|
chara[i] = SPI.transfer(0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
|
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements Max7456::printCharacterToSerial
|
// Implements Max7456::printCharacterToSerial
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::printCharacterToSerial(const charact array, bool img)
|
void MAX7456::printCharacterToSerial(const charact array, bool img)
|
||||||
{
|
{
|
||||||
|
if (img)
|
||||||
if(img)
|
|
||||||
{
|
{
|
||||||
CARACT car ;
|
CARACT car;
|
||||||
car = MAX7456::byteArray2CARACT(array);
|
car = MAX7456::byteArray2CARACT(array);
|
||||||
|
|
||||||
Serial.println("------------");
|
Serial.println("------------");
|
||||||
for(int i = 0 ; i < 18 ; i++)
|
for (int i = 0; i < 18; i++)
|
||||||
{
|
{
|
||||||
for(int j = 0 ; j < 3 ; j++)
|
for (int j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
printPixel(car.line[i].pixels[j].pix0);
|
printPixel(car.line[i].pixels[j].pix0);
|
||||||
printPixel(car.line[i].pixels[j].pix1);
|
printPixel(car.line[i].pixels[j].pix1);
|
||||||
@ -163,26 +148,26 @@ void MAX7456::printCharacterToSerial(const charact array, bool img)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Serial.print("{");
|
Serial.print("{");
|
||||||
for(unsigned int i = 0 ; i < 53 ; i++)
|
for (unsigned int i = 0; i < 53; i++)
|
||||||
{
|
{
|
||||||
Serial.print("0x");
|
Serial.print("0x");
|
||||||
Serial.print(String(array[i],HEX));
|
Serial.print(String(array[i], HEX));
|
||||||
Serial.print(", ");
|
Serial.print(", ");
|
||||||
}
|
}
|
||||||
Serial.print("0x");
|
Serial.print("0x");
|
||||||
Serial.print(String(array[53],HEX));
|
Serial.print(String(array[53], HEX));
|
||||||
Serial.println("};");
|
Serial.println("};");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MAX7456::printPixel(byte value)
|
void MAX7456::printPixel(byte value)
|
||||||
{
|
{
|
||||||
switch(value )
|
switch (value)
|
||||||
{
|
{
|
||||||
case COLOR_BLACK :
|
case COLOR_BLACK:
|
||||||
Serial.print("#");
|
Serial.print("#");
|
||||||
return;
|
return;
|
||||||
case COLOR_WHITE :
|
case COLOR_WHITE:
|
||||||
Serial.print("*");
|
Serial.print("*");
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
@ -191,55 +176,54 @@ void MAX7456::printPixel(byte value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::print
|
// Implements MAX7456::print
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::print(const char string[], byte x, byte y, byte blink,byte inv)
|
void MAX7456::print(const char string[], byte x, byte y, byte blink, byte inv)
|
||||||
{
|
{
|
||||||
char currentChar;
|
char currentChar;
|
||||||
byte size;
|
byte size;
|
||||||
byte *chars = NULL;
|
byte *chars = NULL;
|
||||||
|
|
||||||
if(!string) return;
|
if (!string)
|
||||||
|
return;
|
||||||
|
|
||||||
size = 0;
|
size = 0;
|
||||||
currentChar = string[0];
|
currentChar = string[0];
|
||||||
|
|
||||||
while(currentChar != '\0')
|
while (currentChar != '\0')
|
||||||
{
|
{
|
||||||
currentChar = string[++size];
|
currentChar = string[++size];
|
||||||
}
|
}
|
||||||
|
|
||||||
chars = (byte*) malloc(size * sizeof(byte));
|
chars = (byte *)malloc(size * sizeof(byte));
|
||||||
|
|
||||||
for(byte i = 0 ; i < size ; i++)
|
for (byte i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
chars[i] = MAX7456::giveMAX7456CharFromAsciiChar(string[i]);
|
chars[i] = MAX7456::giveMAX7456CharFromAsciiChar(string[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printMAX7456Chars(chars, size, x, y, blink , inv );
|
printMAX7456Chars(chars, size, x, y, blink, inv);
|
||||||
free(chars);
|
free(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MAX7456::printMAX7456Char(const byte address, byte x, byte y, byte blink, byte inv)
|
void MAX7456::printMAX7456Char(const byte address, byte x, byte y, byte blink, byte inv)
|
||||||
{
|
{
|
||||||
byte ad = address;
|
byte ad = address;
|
||||||
printMAX7456Chars(&ad,1,x,y,blink,inv);
|
printMAX7456Chars(&ad, 1, x, y, blink, inv);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::printMAX7456Chars
|
// Implements MAX7456::printMAX7456Chars
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::printMAX7456Chars(byte chars[],byte size,byte x, byte y, byte blink ,byte inv )
|
void MAX7456::printMAX7456Chars(byte chars[], byte size, byte x, byte y, byte blink, byte inv)
|
||||||
{
|
{
|
||||||
byte currentChar;
|
byte currentChar;
|
||||||
byte posAddressLO;
|
byte posAddressLO;
|
||||||
byte posAddressHI;
|
byte posAddressHI;
|
||||||
unsigned int posAddress;
|
unsigned int posAddress;
|
||||||
|
|
||||||
posAddress = 30*y+x;
|
posAddress = 30 * y + x;
|
||||||
|
|
||||||
posAddressHI = posAddress >> 8;
|
posAddressHI = posAddress >> 8;
|
||||||
posAddressLO = posAddress;
|
posAddressLO = posAddress;
|
||||||
@ -249,77 +233,63 @@ void MAX7456::printMAX7456Chars(byte chars[],byte size,byte x, byte y, byte blin
|
|||||||
_regDmm.bits.INV = inv;
|
_regDmm.bits.INV = inv;
|
||||||
_regDmm.bits.BLK = blink;
|
_regDmm.bits.BLK = blink;
|
||||||
|
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(DMM_ADDRESS_WRITE);
|
SPI.transfer(DMM_ADDRESS_WRITE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SPI.transfer(_regDmm.whole);
|
SPI.transfer(_regDmm.whole);
|
||||||
|
|
||||||
|
|
||||||
SPI.transfer(DMAH_ADDRESS_WRITE); // set start address high
|
SPI.transfer(DMAH_ADDRESS_WRITE); // set start address high
|
||||||
SPI.transfer(posAddressHI);
|
SPI.transfer(posAddressHI);
|
||||||
|
|
||||||
SPI.transfer(DMAL_ADDRESS_WRITE); // set start address low
|
SPI.transfer(DMAL_ADDRESS_WRITE); // set start address low
|
||||||
SPI.transfer(posAddressLO);
|
SPI.transfer(posAddressLO);
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
for(int i = 0; i < size ; i++)
|
|
||||||
{
|
{
|
||||||
currentChar = chars[i];
|
currentChar = chars[i];
|
||||||
SPI.transfer(DMDI_ADDRESS_WRITE);
|
SPI.transfer(DMDI_ADDRESS_WRITE);
|
||||||
SPI.transfer(currentChar);
|
SPI.transfer(currentChar);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//end character (we're done).
|
//end character (we're done).
|
||||||
SPI.transfer(DMDI_ADDRESS_WRITE);
|
SPI.transfer(DMDI_ADDRESS_WRITE);
|
||||||
SPI.transfer(0xff);
|
SPI.transfer(0xff);
|
||||||
|
|
||||||
/*
|
digitalWrite(_pinCS, HIGH);
|
||||||
_regVm0.bits.
|
|
||||||
SPI.transfer(VM0_ADDRESS_WRITE);
|
|
||||||
SPI.transfer(0x4c);*/
|
|
||||||
|
|
||||||
|
|
||||||
digitalWrite(_pinCS,HIGH);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::print
|
// Implements MAX7456::print
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void MAX7456::print(double value, byte x, byte y, byte before, byte after, byte blink,byte inv)
|
void MAX7456::print(double value, byte x, byte y, byte before, byte after, byte blink, byte inv)
|
||||||
{
|
{
|
||||||
char *strValue = NULL;
|
char *strValue = NULL;
|
||||||
|
|
||||||
strValue = (char*) malloc((before+after+2)* sizeof(char));
|
strValue = (char *)malloc((before + after + 2) * sizeof(char));
|
||||||
|
|
||||||
|
if (after == 0)
|
||||||
if(after==0)
|
dtostrf(value, before + after, after, strValue);
|
||||||
dtostrf(value,before+after,after,strValue);
|
|
||||||
else
|
else
|
||||||
dtostrf(value,before+after+1,after,strValue);
|
dtostrf(value, before + after + 1, after, strValue);
|
||||||
|
|
||||||
for(int i = 0 ; i < before+after+1;i++)
|
for (int i = 0; i < before + after + 1; i++)
|
||||||
{
|
{
|
||||||
if(strValue[i] == ' ' || strValue[i] == '-')
|
if (strValue[i] == ' ' || strValue[i] == '-')
|
||||||
strValue[i]='0';
|
strValue[i] = '0';
|
||||||
}
|
}
|
||||||
if(value < 0)
|
if (value < 0)
|
||||||
strValue[0]='-';
|
strValue[0] = '-';
|
||||||
if(after==0) //If the result is bigger, we truncate it so the OSD won't be falsed.
|
if (after == 0) //If the result is bigger, we truncate it so the OSD won't be falsed.
|
||||||
strValue[before]='\0';
|
strValue[before] = '\0';
|
||||||
else
|
else
|
||||||
strValue[before+after+1]='\0';
|
strValue[before + after + 1] = '\0';
|
||||||
|
|
||||||
print(strValue,x,y,blink,inv);
|
print(strValue, x, y, blink, inv);
|
||||||
|
|
||||||
free(strValue);
|
free(strValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::giveMAX7456CharFromAsciiChar
|
// Implements MAX7456::giveMAX7456CharFromAsciiChar
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -327,8 +297,8 @@ byte MAX7456::giveMAX7456CharFromAsciiChar(char ascii)
|
|||||||
{
|
{
|
||||||
#ifdef MAX7456_TABLE_ASCII
|
#ifdef MAX7456_TABLE_ASCII
|
||||||
#error Do not be here
|
#error Do not be here
|
||||||
if(ascii >= ' ' && ascii <= 'z')
|
if (ascii >= ' ' && ascii <= 'z')
|
||||||
return ascii-' ';
|
return ascii - ' ';
|
||||||
else
|
else
|
||||||
return ascii;
|
return ascii;
|
||||||
#else
|
#else
|
||||||
@ -336,13 +306,12 @@ byte MAX7456::giveMAX7456CharFromAsciiChar(char ascii)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::clearScreen
|
// Implements MAX7456::clearScreen
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::clearScreen()
|
void MAX7456::clearScreen()
|
||||||
{
|
{
|
||||||
_regDmm.bits.clearDisplayMemory = 1 ;
|
_regDmm.bits.clearDisplayMemory = 1;
|
||||||
|
|
||||||
digitalWrite(_pinCS, LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
|
|
||||||
@ -350,7 +319,7 @@ void MAX7456::clearScreen()
|
|||||||
SPI.transfer(_regDmm.whole);
|
SPI.transfer(_regDmm.whole);
|
||||||
|
|
||||||
//wait for operation to be complete.
|
//wait for operation to be complete.
|
||||||
while(_regDmm.bits.clearDisplayMemory == 1 )
|
while (_regDmm.bits.clearDisplayMemory == 1)
|
||||||
{
|
{
|
||||||
SPI.transfer(DMM_ADDRESS_READ);
|
SPI.transfer(DMM_ADDRESS_READ);
|
||||||
_regDmm.whole = SPI.transfer(0x00);
|
_regDmm.whole = SPI.transfer(0x00);
|
||||||
@ -358,7 +327,6 @@ void MAX7456::clearScreen()
|
|||||||
digitalWrite(_pinCS, HIGH); //disable device
|
digitalWrite(_pinCS, HIGH); //disable device
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::init
|
// Implements MAX7456::init
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -372,23 +340,22 @@ void MAX7456::init(byte iPinCS)
|
|||||||
digitalWrite(iPinCS, HIGH); //disable device
|
digitalWrite(iPinCS, HIGH); //disable device
|
||||||
delay(100); //power up time
|
delay(100); //power up time
|
||||||
|
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(VM0_ADDRESS_WRITE);
|
SPI.transfer(VM0_ADDRESS_WRITE);
|
||||||
|
|
||||||
_regVm0.whole = 0x00;
|
_regVm0.whole = 0x00;
|
||||||
_regVm0.bits.videoSelect=1; //PAL
|
_regVm0.bits.videoSelect = 1; //PAL
|
||||||
_regVm0.bits.softwareResetBit = 1;
|
_regVm0.bits.softwareResetBit = 1;
|
||||||
SPI.transfer(_regVm0.whole);
|
SPI.transfer(_regVm0.whole);
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
||||||
|
digitalWrite(_pinCS, LOW);
|
||||||
digitalWrite(_pinCS,LOW);
|
for (int x = 0; x < 16; x++)
|
||||||
for(int x = 0 ; x < 16 ; x++)
|
|
||||||
{
|
{
|
||||||
_regRb[x].whole = 0x00;
|
_regRb[x].whole = 0x00;
|
||||||
_regRb[x].bits.characterWhiteLevel = 2;
|
_regRb[x].bits.characterWhiteLevel = 2;
|
||||||
SPI.transfer(x+RB0_ADDRESS_WRITE);
|
SPI.transfer(x + RB0_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regRb[x].whole);
|
SPI.transfer(_regRb[x].whole);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,77 +367,72 @@ void MAX7456::init(byte iPinCS)
|
|||||||
|
|
||||||
SPI.transfer(_regVm0.whole);
|
SPI.transfer(_regVm0.whole);
|
||||||
|
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::activateOSD
|
// Implements MAX7456::activateOSD
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::activateOSD(bool act)
|
void MAX7456::activateOSD(bool act)
|
||||||
{
|
{
|
||||||
if(_isActivatedOsd != act)
|
if (_isActivatedOsd != act)
|
||||||
{
|
{
|
||||||
|
|
||||||
_regVm0.bits.videoSelect = 1;
|
_regVm0.bits.videoSelect = 1;
|
||||||
if(act)
|
if (act)
|
||||||
_regVm0.bits.enableOSD = 1;
|
_regVm0.bits.enableOSD = 1;
|
||||||
else
|
else
|
||||||
_regVm0.bits.enableOSD = 0;
|
_regVm0.bits.enableOSD = 0;
|
||||||
|
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(VM0_ADDRESS_WRITE);
|
SPI.transfer(VM0_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regVm0.whole);
|
SPI.transfer(_regVm0.whole);
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
_isActivatedOsd = act;
|
_isActivatedOsd = act;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::activateExternalVideo
|
// Implements MAX7456::activateExternalVideo
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void MAX7456::activateExternalVideo(bool activExtVid)
|
void MAX7456::activateExternalVideo(bool activExtVid)
|
||||||
{
|
{
|
||||||
if(!activExtVid)
|
if (!activExtVid)
|
||||||
_regVm0.bits.synchSelect = 3; //11
|
_regVm0.bits.synchSelect = 3; //11
|
||||||
else
|
else
|
||||||
_regVm0.bits.synchSelect = 0; //0
|
_regVm0.bits.synchSelect = 0; //0
|
||||||
|
|
||||||
digitalWrite(_pinCS,LOW);
|
digitalWrite(_pinCS, LOW);
|
||||||
SPI.transfer(VM0_ADDRESS_WRITE);
|
SPI.transfer(VM0_ADDRESS_WRITE);
|
||||||
SPI.transfer(_regVm0.whole);
|
SPI.transfer(_regVm0.whole);
|
||||||
digitalWrite(_pinCS,HIGH);
|
digitalWrite(_pinCS, HIGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::CARACT2ByteArray
|
// Implements MAX7456::CARACT2ByteArray
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
byte* MAX7456::CARACT2ByteArray(const CARACT car)
|
byte *MAX7456::CARACT2ByteArray(const CARACT car)
|
||||||
{
|
{
|
||||||
byte *array = NULL;
|
byte *array = NULL;
|
||||||
array = new charact;
|
array = new charact;
|
||||||
for(int i = 0 ; i < 54 ; i++)
|
for (int i = 0; i < 54; i++)
|
||||||
array[i]= car.whole[i];
|
array[i] = car.whole[i];
|
||||||
|
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::byteArray2CARACT
|
// Implements MAX7456::byteArray2CARACT
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
CARACT MAX7456::byteArray2CARACT(const charact array)
|
CARACT MAX7456::byteArray2CARACT(const charact array)
|
||||||
{
|
{
|
||||||
CARACT car;
|
CARACT car;
|
||||||
for(int i = 0 ; i < 54 ; i++)
|
for (int i = 0; i < 54; i++)
|
||||||
car.whole[i] = array[i];
|
car.whole[i] = array[i];
|
||||||
|
|
||||||
return car;
|
return car;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Implements MAX7456::getCARACFromProgMem
|
// Implements MAX7456::getCARACFromProgMem
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -478,10 +440,10 @@ void MAX7456::getCARACFromProgMem(const char *table, byte i, charact car)
|
|||||||
{
|
{
|
||||||
unsigned long index;
|
unsigned long index;
|
||||||
byte read;
|
byte read;
|
||||||
index = i*54;
|
index = i * 54;
|
||||||
for(unsigned long j = 0 ; j < 54 ; j++)
|
for (unsigned long j = 0; j < 54; j++)
|
||||||
{
|
{
|
||||||
read = pgm_read_byte_near(table +index+j );
|
read = pgm_read_byte_near(table + index + j);
|
||||||
car[j] = read;
|
car[j] = read;
|
||||||
if (car[j] == 0x55)
|
if (car[j] == 0x55)
|
||||||
car[j] = 0xff;
|
car[j] = 0xff;
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#ifndef MAX7456_H
|
#ifndef MAX7456_H
|
||||||
#define MAX7456_H
|
#define MAX7456_H
|
||||||
|
|
||||||
|
|
||||||
//def next only if you changed your table for an ascii one
|
//def next only if you changed your table for an ascii one
|
||||||
//i.e address 0x00 -> ' '
|
//i.e address 0x00 -> ' '
|
||||||
//....
|
//....
|
||||||
@ -19,13 +18,10 @@
|
|||||||
|
|
||||||
#include "MAX7456Registers.h"
|
#include "MAX7456Registers.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @mainpage MAX7456 Arduino library
|
* @mainpage MAX7456 Arduino library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class MAX7456
|
* @class MAX7456
|
||||||
* @brief Represents a MAX7456 device communicating through SPI port
|
* @brief Represents a MAX7456 device communicating through SPI port
|
||||||
@ -33,14 +29,11 @@
|
|||||||
class MAX7456
|
class MAX7456
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*/
|
*/
|
||||||
MAX7456();
|
MAX7456();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* Initialize communications and device
|
* Initialize communications and device
|
||||||
@ -48,7 +41,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
MAX7456(byte pinCS);
|
MAX7456(byte pinCS);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize communications and device
|
* Initialize communications and device
|
||||||
* @param pinCS : pin ~CS of the arduino where MAX7456 is plugged.
|
* @param pinCS : pin ~CS of the arduino where MAX7456 is plugged.
|
||||||
@ -66,7 +58,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setBlinkParams(byte blinkBase, byte blinkDC);
|
void setBlinkParams(byte blinkBase, byte blinkDC);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Horizontal and Vertical display offset
|
* Set Horizontal and Vertical display offset
|
||||||
* @param horizontal : the horizontal offset in pixels (between 0 and 63).
|
* @param horizontal : the horizontal offset in pixels (between 0 and 63).
|
||||||
@ -74,13 +65,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setDisplayOffsets(byte horizontal, byte vertical);
|
void setDisplayOffsets(byte horizontal, byte vertical);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Erase Display Memory.
|
* Erase Display Memory.
|
||||||
*/
|
*/
|
||||||
void clearScreen();
|
void clearScreen();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate osd on screen
|
* Activate osd on screen
|
||||||
* @param act :
|
* @param act :
|
||||||
@ -89,7 +78,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void activateOSD(bool act = true);
|
void activateOSD(bool act = true);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate input video as a background
|
* Activate input video as a background
|
||||||
* @param activExtVid :
|
* @param activExtVid :
|
||||||
@ -98,20 +86,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
void activateExternalVideo(bool activExtVid = true);
|
void activateExternalVideo(bool activExtVid = true);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put a character in the memory character of max7456
|
* Put a character in the memory character of MAX7456
|
||||||
* @param array : the byte array representing the character (54 bytes long)
|
* @param array : the byte array representing the character (54 bytes long)
|
||||||
* @param x : the horizontal position of character in memory
|
* @param adress : the address of character in memory
|
||||||
* @param y : the vertical position of character in memory.
|
|
||||||
* @code
|
* @code
|
||||||
* charact c={0x44,....} //Whatever charact here
|
* charact c={0x44,....} //Whatever charact here
|
||||||
* max.sendCharacter(c,4,5); //put c at 4th line 5th column ie. address 54.
|
* max.sendCharacter(c,0x54); //put c at 4th line 5th column ie. address 54.
|
||||||
* max.sendCharacter(c,0x43); //put c in mem at address 43.
|
* max.sendCharacter(c,0x43); //put c in mem at address 43.
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
void sendCharacter(const charact array, byte x, byte y);
|
void sendCharacter(const charact array, char address);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a character from the character memory of max7456
|
* Get a character from the character memory of max7456
|
||||||
@ -121,7 +106,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void getCharacter(charact array, byte x, byte y);
|
void getCharacter(charact array, byte x, byte y);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put a string in the display memory of max7456
|
* Put a string in the display memory of max7456
|
||||||
* @param string : The string to be displayed
|
* @param string : The string to be displayed
|
||||||
@ -134,9 +118,7 @@ public:
|
|||||||
* characters the ascii characters between ' ' and 'z'
|
* characters the ascii characters between ' ' and 'z'
|
||||||
* (' ' being at address 0x00, z being at address 'z'-' ').
|
* (' ' being at address 0x00, z being at address 'z'-' ').
|
||||||
*/
|
*/
|
||||||
void print(const char string[], byte x, byte y, byte blink = 0,byte inv = 0);
|
void print(const char string[], byte x, byte y, byte blink = 0, byte inv = 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put a float in the display memory of max7456
|
* Put a float in the display memory of max7456
|
||||||
@ -156,8 +138,7 @@ public:
|
|||||||
* //Will print "003.1400" on screen
|
* //Will print "003.1400" on screen
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
void print(double value, byte x, byte y, byte before, byte after, byte blink=0,byte inv=0);
|
void print(double value, byte x, byte y, byte before, byte after, byte blink = 0, byte inv = 0);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put some characters in the display memory of MAX7456.
|
* Put some characters in the display memory of MAX7456.
|
||||||
@ -174,8 +155,7 @@ public:
|
|||||||
* max.printMAX7456Chars(chars,3,x,y);
|
* max.printMAX7456Chars(chars,3,x,y);
|
||||||
* @endcode
|
* @endcode
|
||||||
*/
|
*/
|
||||||
void printMAX7456Chars(byte chars[],byte size,byte x, byte y, byte blink = 0,byte inv = 0);
|
void printMAX7456Chars(byte chars[], byte size, byte x, byte y, byte blink = 0, byte inv = 0);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put one character from the character memory in the display memory of MAX7456
|
* Put one character from the character memory in the display memory of MAX7456
|
||||||
@ -185,7 +165,7 @@ public:
|
|||||||
* @param blink : if 1 then character will blink
|
* @param blink : if 1 then character will blink
|
||||||
* @param inv : if 1 then color character will be inverted
|
* @param inv : if 1 then color character will be inverted
|
||||||
*/
|
*/
|
||||||
void printMAX7456Char(const byte address, byte x, byte y, byte blink=0, byte inv=0);
|
void printMAX7456Char(const byte address, byte x, byte y, byte blink = 0, byte inv = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a character to Serial port
|
* Print a character to Serial port
|
||||||
@ -196,14 +176,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void printCharacterToSerial(const charact array, bool img = true);
|
static void printCharacterToSerial(const charact array, bool img = true);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a CARACT character to a byte array representation.
|
* Converts a CARACT character to a byte array representation.
|
||||||
* @param car : the CARACT character
|
* @param car : the CARACT character
|
||||||
* @return : the byte array representing the character (54 bytes long)
|
* @return : the byte array representing the character (54 bytes long)
|
||||||
*/
|
*/
|
||||||
static byte* CARACT2ByteArray(const CARACT car);
|
static byte *CARACT2ByteArray(const CARACT car);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a byte array to a CARACT character.
|
* Converts a byte array to a CARACT character.
|
||||||
@ -212,7 +190,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
static CARACT byteArray2CARACT(const charact array);
|
static CARACT byteArray2CARACT(const charact array);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ith character from program memory
|
* Get the ith character from program memory
|
||||||
* @param table the address of the array in prog memory
|
* @param table the address of the array in prog memory
|
||||||
@ -222,10 +199,9 @@ public:
|
|||||||
* @note When accessing this array, 0x55 are interpreted as 0xFF (you can't have 0xFF in program memory.
|
* @note When accessing this array, 0x55 are interpreted as 0xFF (you can't have 0xFF in program memory.
|
||||||
* @note See file example for more informations.
|
* @note See file example for more informations.
|
||||||
*/
|
*/
|
||||||
static void getCARACFromProgMem(const char *table, byte i,charact c);
|
static void getCARACFromProgMem(const char *table, byte i, charact c);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
byte giveMAX7456CharFromAsciiChar(char ascii);
|
byte giveMAX7456CharFromAsciiChar(char ascii);
|
||||||
static void printPixel(byte value);
|
static void printPixel(byte value);
|
||||||
|
|
||||||
@ -252,6 +228,4 @@ private:
|
|||||||
REG_CMDO _regCmdo; // not used yet
|
REG_CMDO _regCmdo; // not used yet
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* MAX7456_H_ */
|
#endif /* MAX7456_H_ */
|
||||||
|
|
||||||
|
@ -8,10 +8,8 @@
|
|||||||
#ifndef MAX7456REGISTERS_H_
|
#ifndef MAX7456REGISTERS_H_
|
||||||
#define MAX7456REGISTERS_H_
|
#define MAX7456REGISTERS_H_
|
||||||
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef charact
|
* @typedef charact
|
||||||
* @brief Represents a character as stored in MAX7456 character memory.
|
* @brief Represents a character as stored in MAX7456 character memory.
|
||||||
@ -28,7 +26,7 @@ typedef byte charact[54];
|
|||||||
union REG_VM0
|
union REG_VM0
|
||||||
{
|
{
|
||||||
/**@brief The whole value*/
|
/**@brief The whole value*/
|
||||||
unsigned char whole ;
|
unsigned char whole;
|
||||||
/**
|
/**
|
||||||
* @var bits
|
* @var bits
|
||||||
* @brief access to individual bits*/
|
* @brief access to individual bits*/
|
||||||
@ -38,7 +36,7 @@ union REG_VM0
|
|||||||
* @li 0 = Enable
|
* @li 0 = Enable
|
||||||
* @li 1 = Disable(VOUT is high impedance)
|
* @li 1 = Disable(VOUT is high impedance)
|
||||||
*/
|
*/
|
||||||
unsigned char videoBuffer :1;
|
unsigned char videoBuffer : 1;
|
||||||
|
|
||||||
/**@brief Software Reset Bit
|
/**@brief Software Reset Bit
|
||||||
* @li When bit set all register are set to default.
|
* @li When bit set all register are set to default.
|
||||||
@ -68,7 +66,7 @@ union REG_VM0
|
|||||||
* @li 0 = NTSC
|
* @li 0 = NTSC
|
||||||
* @li 1 = PAL
|
* @li 1 = PAL
|
||||||
*/
|
*/
|
||||||
unsigned char videoSelect :1;
|
unsigned char videoSelect : 1;
|
||||||
|
|
||||||
/**@brief don't care*/
|
/**@brief don't care*/
|
||||||
unsigned char unused : 1;
|
unsigned char unused : 1;
|
||||||
@ -76,7 +74,6 @@ union REG_VM0
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define VM1_ADDRESS_WRITE 0x01
|
#define VM1_ADDRESS_WRITE 0x01
|
||||||
#define VM1_ADDRESS_READ 0x81
|
#define VM1_ADDRESS_READ 0x81
|
||||||
|
|
||||||
@ -101,7 +98,6 @@ union REG_VM1
|
|||||||
*/
|
*/
|
||||||
unsigned char blinkingDutyCycle : 2;
|
unsigned char blinkingDutyCycle : 2;
|
||||||
|
|
||||||
|
|
||||||
/**@brief Blinking Time (BT)
|
/**@brief Blinking Time (BT)
|
||||||
* @li b00 (0) = 2 fields (NTSC = 33ms ; PAL = 40ms)
|
* @li b00 (0) = 2 fields (NTSC = 33ms ; PAL = 40ms)
|
||||||
* @li b01 (1) = 4 fields (NTSC = 67ms ; PAL = 80ms)
|
* @li b01 (1) = 4 fields (NTSC = 67ms ; PAL = 80ms)
|
||||||
@ -110,7 +106,6 @@ union REG_VM1
|
|||||||
*/
|
*/
|
||||||
unsigned char blinkingTime : 2;
|
unsigned char blinkingTime : 2;
|
||||||
|
|
||||||
|
|
||||||
/**@brief Background Mode Brightness
|
/**@brief Background Mode Brightness
|
||||||
* @li b000 (0) = 0%
|
* @li b000 (0) = 0%
|
||||||
* @li b001 (1) = 7%
|
* @li b001 (1) = 7%
|
||||||
@ -163,7 +158,6 @@ union REG_HOS
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define VOS_ADDRESS_WRITE 0x03
|
#define VOS_ADDRESS_WRITE 0x03
|
||||||
#define VOS_ADDRESS_READ 0x83
|
#define VOS_ADDRESS_READ 0x83
|
||||||
|
|
||||||
@ -264,12 +258,9 @@ union REG_DMM
|
|||||||
/**@brief Don't care*/
|
/**@brief Don't care*/
|
||||||
unsigned char unsused : 1;
|
unsigned char unsused : 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define DMAH_ADDRESS_WRITE 0x05
|
#define DMAH_ADDRESS_WRITE 0x05
|
||||||
#define DMAH_ADDRESS_READ 0x85
|
#define DMAH_ADDRESS_READ 0x85
|
||||||
/**@union REG_DMAH
|
/**@union REG_DMAH
|
||||||
@ -293,12 +284,10 @@ union REG_DMAH
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define DMAL_ADDRESS_WRITE 0x06
|
#define DMAL_ADDRESS_WRITE 0x06
|
||||||
#define DMAL_ADDRESS_READ 0x86
|
#define DMAL_ADDRESS_READ 0x86
|
||||||
typedef unsigned char REG_DMAL;
|
typedef unsigned char REG_DMAL;
|
||||||
|
|
||||||
|
|
||||||
#define DMDI_ADDRESS_WRITE 0x07
|
#define DMDI_ADDRESS_WRITE 0x07
|
||||||
#define DMDI_ADDRESS_READ 0x87
|
#define DMDI_ADDRESS_READ 0x87
|
||||||
typedef unsigned char REG_DMDI;
|
typedef unsigned char REG_DMDI;
|
||||||
@ -353,7 +342,6 @@ union REG_CMDI
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define OSDM_ADDRESS_WRITE 0x0C
|
#define OSDM_ADDRESS_WRITE 0x0C
|
||||||
#define OSDM_ADDRESS_READ 0x8C
|
#define OSDM_ADDRESS_READ 0x8C
|
||||||
|
|
||||||
@ -380,7 +368,6 @@ union REG_OSDM
|
|||||||
*/
|
*/
|
||||||
unsigned char osdInsertionMuxSwitchingTime : 3;
|
unsigned char osdInsertionMuxSwitchingTime : 3;
|
||||||
|
|
||||||
|
|
||||||
/**@brief OSD Rise And Fall Time
|
/**@brief OSD Rise And Fall Time
|
||||||
* @li b000 (0) : 20ns (maximum sharpness/maximum crosscolor artifacts )
|
* @li b000 (0) : 20ns (maximum sharpness/maximum crosscolor artifacts )
|
||||||
* @li b001 (1) : 30ns
|
* @li b001 (1) : 30ns
|
||||||
@ -391,14 +378,12 @@ union REG_OSDM
|
|||||||
*/
|
*/
|
||||||
unsigned char osdRiseAndFallTime : 3;
|
unsigned char osdRiseAndFallTime : 3;
|
||||||
|
|
||||||
|
|
||||||
/**@brief don't care*/
|
/**@brief don't care*/
|
||||||
unsigned char unused : 2;
|
unsigned char unused : 2;
|
||||||
|
|
||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define RB0_ADDRESS_WRITE 0x10
|
#define RB0_ADDRESS_WRITE 0x10
|
||||||
#define RB0_ADDRESS_READ 0x90
|
#define RB0_ADDRESS_READ 0x90
|
||||||
|
|
||||||
@ -562,7 +547,6 @@ union REG_STAT
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define DMDO_ADDRESS_READ 0xB0
|
#define DMDO_ADDRESS_READ 0xB0
|
||||||
|
|
||||||
/**@typedef DMDO
|
/**@typedef DMDO
|
||||||
@ -595,33 +579,26 @@ union REG_CMDO
|
|||||||
} bits;
|
} bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**\def COLOR_BLACK
|
/**\def COLOR_BLACK
|
||||||
* \brief Black value for a pixel (2bits)
|
* \brief Black value for a pixel (2bits)
|
||||||
*/
|
*/
|
||||||
#define COLOR_BLACK 0
|
#define COLOR_BLACK 0
|
||||||
|
|
||||||
|
|
||||||
/**\def COLOR_WHITE
|
/**\def COLOR_WHITE
|
||||||
* \brief White value for a pixel (2bits)
|
* \brief White value for a pixel (2bits)
|
||||||
*/
|
*/
|
||||||
#define COLOR_WHITE 2
|
#define COLOR_WHITE 2
|
||||||
|
|
||||||
|
|
||||||
/**\def COLOR_TRANSPARENT
|
/**\def COLOR_TRANSPARENT
|
||||||
* \brief Transparent value for a pixel (2bits)
|
* \brief Transparent value for a pixel (2bits)
|
||||||
*/
|
*/
|
||||||
#define COLOR_TRANSPARENT 1
|
#define COLOR_TRANSPARENT 1
|
||||||
|
|
||||||
|
|
||||||
/**\def COLOR_GREY
|
/**\def COLOR_GREY
|
||||||
* \brief Grey value for a pixel (2bits)
|
* \brief Grey value for a pixel (2bits)
|
||||||
*/
|
*/
|
||||||
#define COLOR_GREY COLOR_TRANSPARENT
|
#define COLOR_GREY COLOR_TRANSPARENT
|
||||||
|
|
||||||
|
|
||||||
/**@struct PIXEL
|
/**@struct PIXEL
|
||||||
* @brief represent a 4-pixels value
|
* @brief represent a 4-pixels value
|
||||||
*/
|
*/
|
||||||
@ -634,10 +611,8 @@ struct PIXEL
|
|||||||
/**@brief 2nd pixel*/
|
/**@brief 2nd pixel*/
|
||||||
byte pix1 : 2;
|
byte pix1 : 2;
|
||||||
|
|
||||||
|
|
||||||
/**@brief 1st pixel*/
|
/**@brief 1st pixel*/
|
||||||
byte pix0 : 2;
|
byte pix0 : 2;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**@union LINE
|
/**@union LINE
|
||||||
@ -651,7 +626,6 @@ union LINE
|
|||||||
struct PIXEL pixels[3];
|
struct PIXEL pixels[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @union CARACT
|
* @union CARACT
|
||||||
* @brief Represents a character with lines and pixels.
|
* @brief Represents a character with lines and pixels.
|
||||||
@ -665,20 +639,20 @@ union CARACT
|
|||||||
union LINE line[18];
|
union LINE line[18];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum
|
||||||
enum{
|
{
|
||||||
_BT_BT=0,
|
_BT_BT = 0,
|
||||||
_BT_2BT,
|
_BT_2BT,
|
||||||
_BT_3BT,
|
_BT_3BT,
|
||||||
_3BT_BT
|
_3BT_BT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum{
|
enum
|
||||||
_2fields=0,
|
{
|
||||||
_4fields,
|
_2fields = 0,
|
||||||
_6fields,
|
_4fields,
|
||||||
_8fields
|
_6fields,
|
||||||
|
_8fields
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* MAX7456REGISTERS_H_ */
|
#endif /* MAX7456REGISTERS_H_ */
|
||||||
|
Reference in New Issue
Block a user