From 7f6dbe125e6cda8661c80dc4ed466907dfa0af70 Mon Sep 17 00:00:00 2001 From: dalpil <47555+dalpil@users.noreply.github.com> Date: Wed, 6 Jul 2022 16:13:09 +0200 Subject: [PATCH] Adds patch for the timers on attiny167 --- patch/attiny167.yaml | 4 +--- patch/timer/attiny167.yaml | 14 ++++++++++++++ patch/timer/dev/8bit-tiny167.yaml | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 patch/timer/attiny167.yaml create mode 100644 patch/timer/dev/8bit-tiny167.yaml diff --git a/patch/attiny167.yaml b/patch/attiny167.yaml index 3311574..1255ac5 100644 --- a/patch/attiny167.yaml +++ b/patch/attiny167.yaml @@ -7,9 +7,7 @@ _include: # - "common/twi.yaml" - "common/wdt.yaml" - "common/tiny/usi.yaml" - - -# - "timer/attiny88.yaml" + - "timer/attiny167.yaml" ADC: ADMUX: diff --git a/patch/timer/attiny167.yaml b/patch/timer/attiny167.yaml new file mode 100644 index 0000000..0bc2966 --- /dev/null +++ b/patch/timer/attiny167.yaml @@ -0,0 +1,14 @@ +# This intermediate file is needed because peripheral-level includes are not +# supported in top-level files. + +_modify: + TC1: + description: "Timer/Counter1, 16-bit, PWM" + +TC0: + _include: + - "dev/8bit-tiny167.yaml" + +TC1: + _include: + - "dev/16bit.yaml" diff --git a/patch/timer/dev/8bit-tiny167.yaml b/patch/timer/dev/8bit-tiny167.yaml new file mode 100644 index 0000000..afe32cd --- /dev/null +++ b/patch/timer/dev/8bit-tiny167.yaml @@ -0,0 +1,15 @@ +TCCR?B: + _modify: + CS?: + _write_constraint: enum + + CS?: + _replace_enum: + NO_CLOCK: [0, "No clock source (Timer/Counter stopped)"] + DIRECT: [1, "Running, No Prescaling"] + PRESCALE_8: [2, "Running, CLK/8"] + PRESCALE_32: [3, "Running, CLK/32"] + PRESCALE_64: [4, "Running, CLK/64"] + PRESCALE_128: [5, "Running, CLK/128"] + PRESCALE_256: [6, "Running, CLK/256"] + PRESCALE_1024: [7, "Running, CLK/1024"] -- 2.49.0