Exemplo n.º 1
0
void OSD::init()
{
  pinMode(MAX7456_SELECT,OUTPUT);
  pinMode(MAX7456_VSYNC, INPUT);
  digitalWrite(MAX7456_VSYNC,HIGH); //enabling pull-up resistor

  detectMode();

  digitalWrite(MAX7456_SELECT,LOW);
  //read black level register
  Spi.transfer(MAX7456_OSDBL_reg_read);//black level read register
  byte osdbl_r = Spi.transfer(0xff);
  Spi.transfer(MAX7456_VM0_reg);
  Spi.transfer(MAX7456_RESET | video_mode);
  delay(50);
  //set black level
  byte osdbl_w = (osdbl_r & 0xef); //Set bit 4 to zero 11101111
  Spi.transfer(MAX7456_OSDBL_reg); //black level write register
  Spi.transfer(osdbl_w);

  // set all rows to same charactor white level, 90%
  for (x = 0; x < MAX7456_screen_rows; x++)
  {
    Spi.transfer(x + 0x10);
    Spi.transfer(MAX7456_WHITE_level_120);
  }
  // define sync (auto,int,ext) and
  // making sure the Max7456 is enabled
  control(1);
}
Exemplo n.º 2
0
void OSD::init()
{
  pinMode(MAX7456_SELECT,OUTPUT);
  pinMode(MAX7456_VSYNC, INPUT);
  digitalWrite(MAX7456_VSYNC,HIGH); //enabling pull-up resistor

  detectMode();

  digitalWrite(MAX7456_SELECT,LOW);
  //read black level register
  Spi.transfer(MAX7456_OSDBL_reg_read);//black level read register
  byte osdbl_r = Spi.transfer(0xff);
  Spi.transfer(MAX7456_VM0_reg);
  Spi.transfer(MAX7456_RESET | video_mode);
  delay(50);
  //set black level
  byte osdbl_w = (osdbl_r & 0xef); //Set bit 4 to zero 11101111
  Spi.transfer(MAX7456_OSDBL_reg); //black level write register
  Spi.transfer(osdbl_w);

  setBrightness();
  // define sync (auto,int,ext) and
  // making sure the Max7456 is enabled
  control(1);
}
Exemplo n.º 3
0
void OSD::init()
{
    pinMode(MAX7456_SELECT,OUTPUT);
    pinMode(MAX7456_VSYNC, INPUT_PULLUP);

    detectMode();

    hw_init();
}
Exemplo n.º 4
0
void OSD::init()
{
  pinMode(MAX7456_SELECT,OUTPUT);
  pinMode(MAX7456_VSYNC, INPUT_PULLUP);
//  digitalWrite(MAX7456_VSYNC,HIGH); //enabling pull-up resistor

    detectMode();

    hw_init();
}
Exemplo n.º 5
0
void OSD::init()
{
#ifndef SLAVE_BUILD
    pinMode(MAX7456_SELECT,OUTPUT);
    pinMode(MAX7456_VSYNC, INPUT_PULLUP);
    pinMode(MAX7456_RESET_PIN, OUTPUT);
    digitalWrite(MAX7456_RESET_PIN, HIGH);
#endif
    
    reset();

    detectMode();

    hw_init();
}
Exemplo n.º 6
0
void CompositorLauncher::start()
{
    // Try to detect mode and hardware
    detectHardware();
    detectMode();
    if (m_mode == UnknownMode) {
        qWarning() << "No mode detected, please manually specify one!";
        QCoreApplication::quit();
        return;
    }

    // Detect whether we have libinput
    detectLibInput();

    // Start the process
    startProcess("greenisland", compositorArgs(), compositorEnv());

    // Set environment so that applications will inherit it
    setupEnvironment();
}
Exemplo n.º 7
0
void OSD::init(bool new_cfg)
{
    uint8_t offset;

    PORTD |= _BV(PD6);
    pinMode(MAX7456_SELECT, OUTPUT);
    pinMode(MAX7456_VSYNC, INPUT);
    digitalWrite(MAX7456_VSYNC, HIGH);  //enabling pull-up resistor

    detectMode();

    digitalWrite(MAX7456_SELECT, LOW);
    //read black level register
    Spi.transfer(MAX7456_OSDBL_reg_read);       //black level read register
    byte osdbl_r = Spi.transfer(0xff);
    Spi.transfer(MAX7456_VM0_reg);
    Spi.transfer(MAX7456_RESET | video_mode);
    delay(50);
    //set black level
    byte osdbl_w = (osdbl_r & 0xef);    //Set bit 4 to zero 11101111
    Spi.transfer(MAX7456_OSDBL_reg);    //black level write register
    Spi.transfer(osdbl_w);

    setBrightness();

    // define sync (auto,int,ext) and
    // making sure the Max7456 is enabled
    control(1);

    if (new_cfg) {
        offset = EEPROM.read(VOFFSET_ADDR);
        write_reg(MAX7456_VOS_reg, offset);     // 5 valid bits
        offset = EEPROM.read(HOFFSET_ADDR);
        write_reg(MAX7456_HOS_reg, offset);     // 6 valid bits
    }
    memset(osdbuf, ' ', sizeof(osdbuf) - 1);
    osdbuf[sizeof(osdbuf) - 1] = MAX7456_END_string;
}