You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

/* Anschlüsse sind:
* B0 - 1wire
* B1 - Kontrast-PWM
* B2 - Backlight-PWM
* B3-B5 - ISP
* C0-C1 - 2farb-LED
* C2 - LED
* C3-C4 - Knopf-drehung
* C5 - Knopf-taster
* C6 - ISP
* D0-6 - LCD (DB4-7, RS, R/W, EN)
* D7 - LED
*/
#ifndef __MAIN_H
#define __MAIN_H
#include <stdint.h>
#define LED1PORT PORTC
#define LED1APIN 0
#define LED1BPIN 1
#define LED2PORT PORTC
#define LED2PIN 2
#define LED3PORT PORTD
#define LED3PIN 7
#define BACKLIGHTPORT PORTB
#define BACKLIGHTPIN 2
// button handling
#define BUTTPIN PINC
#define BUTTLPIN 5
#define BUTTRPIN 4
#define BUTTTPIN 3
#define BUTTEV_PUSH 1
#define BUTT_BOUNCE 25 //approx ms debounce time
extern uint8_t buttonevent;
extern int8_t buttoninc; // how much the button turned.
// you might want to subtract turns you consumed since the variable
// is updated in an interrupt
//uint8_t volatile timer1_acc;
#define FLOWTEMP_MAX 100
#define FLOWTEMP_MIN 5
#define FLOWTEMP_DEFAULT 70
#define FLOWTEMP_ALARM_MIN 50
#define FLOWTEMP_ALARM_MAX 100
#define FLOWTEMP_ALARM_DEFAULT 87
#define FLOWTEMP_RANGE_MAX 40
#define FLOWTEMP_RANGE_DEFAULT 15
extern uint8_t flowtemp_alarm;
extern uint8_t flowtemp_range;
extern uint8_t flowtemp;
void set_display_brightness(uint8_t display_brightness);
void store_display_brightness(uint8_t new_brightness);
uint8_t load_display_brightness();
void set_display_contrast(uint8_t display_contrast);
void store_display_contrast(uint8_t new_contrast);
uint8_t load_display_contrast();
void set_flowtemp(uint8_t new_flowtemp);
void store_flowtemp(uint8_t new_flowtemp);
uint8_t load_flowtemp();
void set_flowtemp_range(uint8_t new_flowtemp_range);
void store_flowtemp_range(uint8_t new_flowtemp_range);
uint8_t load_flowtemp_range();
void set_flowtemp_alarm(uint8_t new_flowtemp_alarm);
void store_flowtemp_alarm(uint8_t new_flowtemp_alarm);
uint8_t load_flowtemp_alarm();
// clock
extern struct clockfmt {
uint8_t hour;
uint8_t minute;
uint8_t second;
} clock;
#endif //__MAIN_H