aboutsummaryrefslogtreecommitdiff
path: root/kernel/tasks.h
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2011-03-13 23:50:49 +0000
committerDimitri Sokolyuk <demon@dim13.org>2011-03-13 23:50:49 +0000
commit577488e08517172c1e926b6f3fb15a4ca9f6633f (patch)
tree66b3c07488fb3b69d8088b5d9a2856582e5501a5 /kernel/tasks.h
parentb4f72c586c36539fab69a6613ff40858b501a16d (diff)
admux
Diffstat (limited to 'kernel/tasks.h')
-rw-r--r--kernel/tasks.h34
1 files changed, 29 insertions, 5 deletions
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 *);