Example #1
0
void PCF8583_hold_off(void)
{
  PCF8583_get_status();
  PCF8583_status&=0xbf;
  PCF8583_write(0,PCF8583_status);
}
Example #2
0
void PCF8583_stop(void)
{
  PCF8583_get_status();
  PCF8583_status|=0x80;
  PCF8583_write(0,PCF8583_status);
}
Example #3
0
void PCF8583_hold_on(void)
{
  PCF8583_get_status();
  PCF8583_status|=0x40;
  PCF8583_write(0,PCF8583_status);
}
Example #4
0
File: main.c Project: altanis/AVR
/**
 * Main program loop
 */
int main(void)
{        
	DDRD = 0xff;
	PORTD = 0xf0;	
	PORTD |= _BV(3);
	
	UART_init(16000000, 19200);			
	LCD_init();
	PCF8583_init();
		
	PCF8583_set_time(12,00,0,0);
	PCF8583_set_date(24,1,2013);
	
	//set the alarm off
	PCF8583_get_status();
	PCF8583_status|=4;
	PCF8583_write(0,PCF8583_status);
	
	cbi(PORTD, 6);
	
	u16 code;
	
	LCD_clear();
	
	get_temperatureSilent();
	power_on();	
	while(1)
	{		
		if(m_requiresSettings == SETTING_ALL)
		{
			updateTime();
			updateTemperature();
			dayNightDecision();	
		}
		
		
			power_on();	
			
			code = decode_rc5();
			if ( code != 0 )
			{
				remote_switch(code);
				while ( UART_unread_data() ) UART_getc();
			}			
		
		//if uart recieved something
		if ( (PC_get_msg() == PC_CONNECT) & bit_is_clear(PORTD, 6) )
		{
			PC_connecting_show();
			do
			{		
				show_PC_menu();		
				code = PC_get_msg();				
				PC_switch( code );				
			}
			while( code != PC_DISCONNECT );
			PC_disconnecting_show();
		}		
	}	
	return 0;
}
Example #5
0
void PCF8583_alarm_off(void)
{
  PCF8583_get_status();
  PCF8583_status&=0xfb;
  PCF8583_write(0,PCF8583_status);
}