Exemplo n.º 1
0
void OSD::hw_init() {
    max7456_on();

    //read black level register
    byte osdbl_r = MAX_read(MAX7456_OSDBL_reg_read);//black level read register

    MAX_write(MAX7456_VM0_reg, MAX7456_RESET | video_mode);
    delay_150();

    //set black level
    MAX_write(MAX7456_OSDBL_reg, (osdbl_r & 0xef)); //black level write register - Set bit 4 to zero 11101111 - Enable automatic OSD black level control

// set position - may be EEPROM.read(OSD_SHIFT_X)
    MAX_write(MAX7456_HOS_reg, 0x20); // 0x20 default
    MAX_write(MAX7456_VOS_reg, 0x10); // 0x10 default


    MAX_write(MAX7456_OSDM_reg, 0b00010010); // 0x00011011 default

    setBrightness();

    // define sync (auto,int,ext)
//      MAX_write(MAX7456_VM0_reg, MAX7456_DISABLE_display | video_mode);
    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_internal);

    delay_150();

    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_autosync);

    max7456_off();

}
Exemplo n.º 2
0
void OSD::hw_init(){
    max7456_on();

    //read black level register
    byte osdbl_r = MAX_read(MAX7456_OSDBL_reg_read); //black level read register
  
    MAX_write(MAX7456_VM0_reg, MAX7456_RESET | video_mode);
    delay_150();

    //set black level
    MAX_write(MAX7456_OSDBL_reg, (osdbl_r & 0xef)); //black level write register - Set bit 4 to zero 11101111 - Enable automatic OSD black level control

    MAX_write(MAX7456_OSDM_reg, 0b00010010); // 0x00011011 default

  // define sync (auto,int,ext)
    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_internal);  // first time on internal sync

    delay_150();

    MAX_write(MAX7456_VM0_reg, (MAX7456_ENABLE_display_vert | video_mode) | MAX7456_SYNC_autosync);  // and then switch to auto mode

 // max7456_off();

    adjust();
}