Max7456
Class representing a max7456
 All Classes Files Functions Variables Typedefs Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
Max7456 Class Reference

Represents a max7456 device communicating through SPI port. More...

#include <max7456.h>

Public Member Functions

 Max7456 ()
 
 Max7456 (byte pinCS)
 
void init (byte pinCS)
 
void setBlinkParams (byte blinkBase, byte blinkDC)
 
void setDisplayOffsets (byte horizontal, byte vertical)
 
void clearScreen ()
 
void activateOSD (bool act=true)
 
void activateExternalVideo (bool activExtVid=true)
 
void sendCharacter (const charact array, byte x, byte y)
 
void getCharacter (charact array, byte x, byte y)
 
void print (const char string[], byte x, byte y, byte blink=0, byte inv=0)
 
void print (double value, byte x, byte y, byte before, byte after, byte blink=0, byte inv=0)
 
void printMax7456Chars (byte chars[], byte size, 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)
 

Static Public Member Functions

static void printCharacterToSerial (const charact array, bool img=true)
 
static byte * CARACT2ByteArray (const CARACT car)
 
static CARACT byteArray2CARACT (const charact array)
 
static void getCARACFromProgMem (const prog_uchar *table, byte i, charact c)
 

Detailed Description

Represents a max7456 device communicating through SPI port.

Examples:
Max7456WriteTable.cpp.

Constructor & Destructor Documentation

Max7456::Max7456 ( )

Default constructor

Max7456::Max7456 ( byte  pinCS)

Constructor Initialize communications and device

Parameters
pinCS: pin ~CS of the arduino where max7456 is plugged.

Member Function Documentation

void Max7456::activateExternalVideo ( bool  activExtVid = true)

Activate input video as a background

Parameters
activExtVid:
  • if true external video is displayed
  • if false external video is not displayed (bakground = grey)
void Max7456::activateOSD ( bool  act = true)

Activate osd on screen

Parameters
act:
  • if true OSD is activated
  • if false OSD is deactivated
CARACT Max7456::byteArray2CARACT ( const charact  array)
static

Converts a byte array to a CARACT character.

Parameters
array: the byte array representing the character (54 bytes long)
Returns
: the CARACT character
byte * Max7456::CARACT2ByteArray ( const CARACT  car)
static

Converts a CARACT character to a byte array representation.

Parameters
car: the CARACT character
Returns
: the byte array representing the character (54 bytes long)
void Max7456::clearScreen ( )

Erase Display Memory.

void Max7456::getCARACFromProgMem ( const prog_uchar *  table,
byte  i,
charact  c 
)
static

Get the ith character from program memory

Parameters
tablethe address of the array in prog memory
ithe index of character.
cthe returned character.
Note
The table must be in program memory as an array of bytes (a multiple of 54).
When accessing this array, 0x55 are interpreted as 0xFF (you can't have 0xFF in program memory.
See file example for more informations.
Examples:
Max7456WriteTable.cpp.
void Max7456::getCharacter ( charact  array,
byte  x,
byte  y 
)

Get a character from the character memory of max7456

Parameters
array: the byte array representing the character (54 bytes long)
x: the horizontal position of character in character memory
y: the vertical position of character in character memory
void Max7456::init ( byte  pinCS)

Initialize communications and device

Parameters
pinCS: pin ~CS of the arduino where max7456 is plugged.
Max7456 osd;
osd.init(9); //Note it's that it's the same than usinge constructor Max7456(byte pinCS).
void Max7456::print ( const char  string[],
byte  x,
byte  y,
byte  blink = 0,
byte  inv = 0 
)

Put a string in the display memory of max7456

Parameters
string: The string to be displayed
x: the horizontal position of the string on screen
y: the vertical position of the string on screen
blink: if 1 then character will blink
inv: if 1 then color character will be inverted
Note
: In order to have this function working, you must rewrite your Max7456 Eeprom memory and make the first characters the ascii characters between ' ' and 'z' (' ' being at address 0x00, z being at address 'z'-' ').
void Max7456::print ( double  value,
byte  x,
byte  y,
byte  before,
byte  after,
byte  blink = 0,
byte  inv = 0 
)

Put a float in the display memory of max7456

Parameters
value: The value to be displayed
x: the horizontal position of the value on screen
y: the vertical position of the value on screen
before: number of digits before comma
after: number of digits after comma
blink: if 1 then character will blink
inv: if 1 then color character will be inverted
Note
The number of printed characters will be : before + after + 1.
Be aware of having a coherence between the number of digits you enter in the function and the max. value of your double. If not may result in unpredictable printed string.
max.print(3.14,x,y,3,4);
//Will print "003.1400" on screen
void Max7456::printCharacterToSerial ( const charact  array,
bool  img = true 
)
static

Print a character to Serial port

Parameters
array: the byte array representing the character (54 bytes long)
img:
  • true : the character will be displayed as a picture
  • false : the character will be displayed as a byte array
void Max7456::printMax7456Char ( const byte  address,
byte  x,
byte  y,
byte  blink = 0,
byte  inv = 0 
)

Put one character from the character memory in the display memory of max7456

Parameters
address: The address in character memory of the character to be displayed
x: the horizontal position of the string on screen
y: the vertical position of the string on screen
blink: if 1 then character will blink
inv: if 1 then color character will be inverted
void Max7456::printMax7456Chars ( byte  chars[],
byte  size,
byte  x,
byte  y,
byte  blink = 0,
byte  inv = 0 
)

Put some characters in the display memory of max7456. The characters are given by their address in the character memory of the max7456.

Parameters
chars: The characters address array to display
size: the array size
x: the horizontal position of the value on screen
y: the vertical position of the value on screen
blink: if 1 then character will blink
inv: if 1 then color character will be inverted
char chars[0x04,0x45,0x54]; //the chars addresses array to be send to function.
max.printMax7456Chars(chars,3,x,y);
void Max7456::sendCharacter ( const charact  array,
byte  x,
byte  y 
)

Put a character in the memory character of max7456

Parameters
array: the byte array representing the character (54 bytes long)
x: the horizontal position of character in memory
y: the vertical position of character in memory.
charact c={0x44,....} //Whatever charact here
max.sendCharacter(c,4,5); //put c at 4th line 5th column ie. address 54.
max.sendCharacter(c,0x43); //put c in mem at address 43.
void Max7456::setBlinkParams ( byte  blinkBase,
byte  blinkDC 
)

Set the base time for blink.

Parameters
blinkBase: the base time (see datasheet)
blinkDC: blink Duty cycle (see datasheet).
void Max7456::setDisplayOffsets ( byte  horizontal,
byte  vertical 
)

Set Horizontal and Vertical display offset

Parameters
horizontal: the horizontal offset in pixels (between 0 and 63).
vertical: the vertical offset in pixels (between 0 and 31).

The documentation for this class was generated from the following files: