From 577488e08517172c1e926b6f3fb15a4ca9f6633f Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 13 Mar 2011 23:50:49 +0000 Subject: admux --- kernel/tasks.h | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'kernel/tasks.h') diff --git a/kernel/tasks.h b/kernel/tasks.h index 4137402..cf386c7 100644 --- a/kernel/tasks.h +++ b/kernel/tasks.h @@ -18,6 +18,29 @@ #ifndef __TASKS_H #define __TASKS_H +#define ADCCHANNELS 6 +#define ADCPRESCALE 32 + +#if (ADCPRESCALE == 1) +#define ADC_FLAGS 0 +#elif (ADCPRESCALE == 2) +#define ADC_FLAGS _BV(ADPS0) +#elif (ADCPRESCALE == 4) +#define ADC_FLAGS _BV(ADPS1) +#elif (ADCPRESCALE == 8) +#define ADC_FLAGS (_BV(ADPS1) | _BV(ADPS0)) +#elif (ADCPRESCALE == 16) +#define ADC_FLAGS _BV(ADPS2) +#elif (ADCPRESCALE == 32) +#define ADC_FLAGS (_BV(ADPS2) | _BV(ADPS0)) +#elif (ADCPRESCALE == 64) +#define ADC_FLAGS (_BV(ADPS2) | _BV(ADPS1)) +#elif (ADCPRESCALE == 128) +#define ADC_FLAGS (_BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0)) +#else +#warning "invalid ADCPRESCALE value" +#endif + struct rgbarg { uint8_t *r, *g, *b; }; @@ -25,17 +48,18 @@ struct rgbarg { struct pwmarg { uint8_t *value; uint8_t pin; - uint32_t d; - uint32_t r; }; struct adcarg { - uint32_t d; - uint32_t r; - uint8_t channel; uint16_t *value; }; +struct lcdarg { + char *first; + char *second; + uint16_t *adc; +}; + void init_uart(void); void heartbeat(void *); -- cgit v1.2.3