Commit fa93d619 authored by Snorre Nilssen Vestli's avatar Snorre Nilssen Vestli

update pin/timer defs

parent 500293a5
......@@ -12,14 +12,15 @@
#include <avr/io.h>
#include "tesladefs.h"
// ASSUMES TC0_struct Binary compatible with TC1_struct given no illegal register access.
// Verify this repeatedly when reviewing
// ASSUMES TC0_t Binary compatible with TC1_t given no illegal register access. (OC1C/OC1D)
// /\/\ Verify this repeatedly when reviewing /\/\
TC0_t* teslatimers[TESLA_TOTAL_CHANNELS] = {
&TESLA_O0_TIMER,
&TESLA_O1_TIMER,
&TESLA_O2_TIMER,
&TESLA_O3_TIMER
(TC0_t*)&TESLA_O0_TIMER,
(TC0_t*)&TESLA_O1_TIMER,
(TC0_t*)&TESLA_O2_TIMER,
(TC0_t*)&TESLA_O3_TIMER
};
volatile uint16_t* teslacc[TESLA_TOTAL_CHANNELS] = {
......
......@@ -23,7 +23,7 @@
#define TESLA_O0_PORT PORTC
#define TESLA_O0_PIN 0
#define TESLA_O0_PIN_bm (1 << TESLA_O0_PIN)
#define TESLA_O0_TIMER TCC0
#define TESLA_O0_TIMER TCC1
#define TESLA_O0_OCR (&((&TESLA_O0_TIMER)->CCA))
#define TESLA_O0_CC_bm TC0_CCAEN_bm
......@@ -31,28 +31,28 @@
#define TESLA_O1_PIN 0
#define TESLA_O1_PIN_bm (1 << TESLA_O1_PIN)
#define TESLA_O1_TIMER TCC0
#define TESLA_O1_OCR (&((&TESLA_O0_TIMER)->CCA))
#define TESLA_O1_OCR (&((&TESLA_O1_TIMER)->CCA))
#define TESLA_O1_CC_bm TC0_CCAEN_bm
#define TESLA_O2_PORT PORTC
#define TESLA_O2_PORT PORTE
#define TESLA_O2_PIN 0
#define TESLA_O2_PIN_bm (1 << TESLA_O2_PIN)
#define TESLA_O2_TIMER TCC0
#define TESLA_O2_OCR (&((&TESLA_O0_TIMER)->CCA))
#define TESLA_O2_TIMER TCE0
#define TESLA_O2_OCR (&((&TESLA_O2_TIMER)->CCA))
#define TESLA_O2_CC_bm TC0_CCAEN_bm
#define TESLA_O3_PORT PORTC
#define TESLA_O3_PORT PORTD
#define TESLA_O3_PIN 0
#define TESLA_O3_PIN_bm (1 << TESLA_O3_PIN)
#define TESLA_O3_TIMER TCC0
#define TESLA_O3_OCR (&((&TESLA_O0_TIMER)->CCA))
#define TESLA_O3_TIMER TCD0
#define TESLA_O3_OCR (&((&TESLA_O3_TIMER)->CCA))
#define TESLA_O3_CC_bm TC0_CCAEN_bm
#define TESLA_C_PORT PORTC
#define TESLA_C_PORT PORTD
#define TESLA_C_PIN 0
#define TESLA_C_PIN_bm (1 << TESLA_C_PIN)
#define TESLA_C_TIMER TCC1
#define TESLA_C_OCR (&((&TESLA_O0_TIMER)->CCA))
#define TESLA_C_TIMER TCD1
#define TESLA_C_OCR (&((&TESLA_C_TIMER)->CCA))
#define TESLA_C_CC_bm TC0_CCAEN_bm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment