~ruther/avr-device

1969ec39ff17327fd220a92987412a4cb6cd3beb — Liam Perlaki 4 years ago 8c207c6
Add patches for ADC peripherals

Add a patch to fixup a few registers in the ADC peripheral
for ATmega328P, ATmega32U4, ATmega1280, and ATmega64.
M patch/atmega1280.yaml => patch/atmega1280.yaml +1 -0
@@ 1,5 1,6 @@
_include:
  - "common/ac.yaml"
  - "common/adc.yaml"
  - "common/spi.yaml"
  - "common/twi.yaml"
  - "common/usart.yaml"

M patch/atmega328p.yaml => patch/atmega328p.yaml +1 -0
@@ 1,5 1,6 @@
_include:
  - "common/ac.yaml"
  - "common/adc.yaml"
  - "common/spi.yaml"
  - "common/timer/tc0.yaml"
  - "common/twi.yaml"

M patch/atmega32u4.yaml => patch/atmega32u4.yaml +1 -0
@@ 1,5 1,6 @@
_include:
  - "common/ac.yaml"
  - "common/adc.yaml"
  - "common/pll.yaml"
  - "common/spi.yaml"
  - "common/timer/tc0.yaml"

M patch/atmega64.yaml => patch/atmega64.yaml +1 -0
@@ 1,4 1,5 @@
_include:
  - "common/ac.yaml"
  - "common/adc.yaml"
  - "common/spi.yaml"
  - "common/usart.yaml"

A patch/common/adc.yaml => patch/common/adc.yaml +23 -0
@@ 0,0 1,23 @@
# Patches for the Analog Digital Converter
#
# - Make the control-register actually writable
ADC:
  _modify:
    ADCSRA:
      access: read-write
  ADCSRA:
    ADPS:
      _replace_enum:
        PRESCALER_2: [1, "Prescaler Value 2"]
        PRESCALER_4: [2, "Prescaler Value 4"]
        PRESCALER_8: [3, "Prescaler Value 8"]
        PRESCALER_16: [4, "Prescaler Value 16"]
        PRESCALER_32: [5, "Prescaler Value 32"]
        PRESCALER_64: [6, "Prescaler Value 64"]
        PRESCALER_128: [7, "Prescaler Value 128"]
  ADMUX:
    REFS:
      _replace_enum:
        AREF: [0, "Aref Internal Vref turned off"]
        AVCC: [1, "AVcc with external capacitor at AREF pin"]
        INTERNAL: [3, "Internal 1.1V Voltage Reference with external capacitor at AREF pin"]
\ No newline at end of file