Testé pour projet BTS SN

Dependencies:   MODMAX7456 mbed

Fork of MAX7456_HelloWorld by Christian Dupaty

main.cpp

Committer:
cdupaty
Date:
2016-05-12
Revision:
2:e25ed18fa668
Parent:
0:11828abc1244
Child:
3:39577e90b8a2

File content as of revision 2:e25ed18fa668:

#include "mbed.h"
#include "OSD7456.h"
#include "stdio.h"

#define PCBAUD 9600
#define MAX7456_MOSI  SPI_MOSI
#define MAX7456_MISO  SPI_MISO
#define MAX7456_SCLK  SPI_SCK
#define MAX7456_CS    SPI_CS
#define MAX7456_RST   PA_0
#define MAX7456_VSYNC PA_1 

// with SPI1 activated don't use LED1
DigitalOut led1(PA_2);
 
OSD7456 *osd;
 
int main() {
    
   
    printf("Test MAX7456 avec OSB click\r\n");
    
    osd = new OSD7456(MAX7456_MOSI, MAX7456_MISO, MAX7456_SCLK, MAX7456_CS, MAX7456_RST, MAX7456_VSYNC);
    
    // Set the character "local background" to 42%
    osd->max7456->backGround(MAX7456::Percent_42);
    
    // Set the blink rate to 133ms with a duty cycle of 3:1
    osd->max7456->blinkRate(MAX7456::ms_133, MAX7456::BT3_BT);
    
    osd->print(1,1,"Incrustation sur STM32");
    osd->print(1,2,"----------------------");
    osd->print(7, 4,  "Texte en 7-4");
    osd->print(7, 5,  "Texte fond gris", MAX7456::LocalBG);
    osd->print(2, 7,  "clignotant fond gris", MAX7456::Blink | MAX7456::LocalBG);
    osd->print(4, 9,  "Texte Noir", MAX7456::Inverse);
    osd->print(1, 10, "Noir-fond gris-clignotant", MAX7456::Inverse|MAX7456::LocalBG|MAX7456::Blink);
    
    printf("Fin du test\r\n");
    while(1);   
}