Subversion Repositories svnkaklik

Rev

Rev 140 | Blame | Last modification | View Log | Download

#include ".\camerus.h"


void main()
{
   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);

   output_high(PIN_C0);

   i2c_start();      // Reset
   i2c_write(0xC0);
   i2c_write(0x12);
   i2c_write(0x80 | 0x24);
   i2c_stop();

   i2c_start();      // BW
   i2c_write(0xC0);
   i2c_write(0x28);
   i2c_write(0b01000001);
   i2c_stop();

   i2c_start();      // Contrast
   i2c_write(0xC0);
   i2c_write(0x05);
   i2c_write(0xFF);
   i2c_stop();

   i2c_start();      // Brightness
   i2c_write(0xC0);
   i2c_write(0x06);
   i2c_write(0x80);
   i2c_stop();

/*
   i2c_start();      // Band Filter
   i2c_write(0xC0);
   i2c_write(0x2D);
   i2c_write(0x04 | 0x03);
   i2c_stop();

   i2c_start();      // 4-bit, (CLK/4)
   i2c_write(0xC0);
   i2c_write(0x3E);
   i2c_write(0x10 | 0x80);
   i2c_stop();
*/
   i2c_start();      // VSTRT
   i2c_write(0xC0);
   i2c_write(0x19);
   i2c_write(45);
   i2c_stop();

   i2c_start();      // VEND
   i2c_write(0xC0);
   i2c_write(0x1A);
   i2c_write(45);
   i2c_stop();

   output_low(PIN_C0);

   while(true);
}