summaryrefslogtreecommitdiff
path: root/avr/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/gpio.c')
-rw-r--r--avr/gpio.c55
1 files changed, 27 insertions, 28 deletions
diff --git a/avr/gpio.c b/avr/gpio.c
index 3c47247..31dbc21 100644
--- a/avr/gpio.c
+++ b/avr/gpio.c
@@ -7,36 +7,35 @@
/*
-Pin Name Port Timer Mode max div max div min f [Hz]
-----------------------------------------------------------------------------------
-0 PG5 OC0B PWM (2**8)*1024 262144 70.31
-1 PG4
-2 CLK2 PB4 OC2A Toggle (2**8)*1024*2 524288 35.16
-3 ZCLK PB5 OC1A PWM (2**16)*1024 67108864 0.2746
-4 PB6 OC1B PWM (2**16)*1024 67108864 0.2746
-5 PB7 OC0A Toggle (2**8)*1024*2 524288 35.16
-6 PG3
-7 PG2
-8 PG1
-9 PG0
-10 CLKO PE7
-
-
-pre Timer0 Timer1 Timer2
+Pin Name Port Timer Mode max div max div min f [Hz]
+--------------------------------------------------------------------------------
+0 PG5 OC0B PWM (2**8)*1024 262144 70.31
+1 PG4
+2 CLK2 PB4 OC2A Toggle (2**8)*1024*2 524288 35.16
+3 ZCLK PB5 OC1A PWM (2**16)*1024 67108864 0.2746
+4 PB6 OC1B PWM (2**16)*1024 67108864 0.2746
+5 PB7 OC0A Toggle (2**8)*1024*2 524288 35.16
+6 PG3
+7 PG2
+8 PG1
+9 PG0
+10 CLKO PE7
+--------------------------------------------------------------------------------
+
+
+pre Timer0 Timer1 Timer2
--------------------------------------------------
-0 0 0 0
-1 1 1 1
-2 8 x8 8 x8 8 x8
-3 64 x8 64 x8 32 x4
-4 256 x4 256 x4 64 x2
-5 1024 x4 1024 x4 128 x2
-6 256 x2
-7 1024 x4
+0 0 0 0
+1 1 1 1
+2 8 x8 8 x8 8 x8
+3 64 x8 64 x8 32 x4
+4 256 x4 256 x4 64 x2
+5 1024 x4 1024 x4 128 x2
+6 256 x2
+7 1024 x4
--------------------------------------------------
-
*/
-
#define PWMTOGGLE 0b01
#define PWMPOS 0b10
#define PWMNEG 0b11
@@ -312,7 +311,7 @@ int gpio_clockdiv_set(int pin, unsigned long divider)
top = ltop - 1;
- PING |= _BV(0); /* Debug */
+// PING |= _BV(0); /* Debug */
switch (timertype & TIMER) {
case TIMER0:
@@ -363,7 +362,7 @@ int gpio_clockdiv_set(int pin, unsigned long divider)
break;
}
- PING |= _BV(0); /* Debug */
+// PING |= _BV(0); /* Debug */
gpio_config(pin, OUTPUT_TIMER);