aboutsummaryrefslogtreecommitdiff
path: root/docs/hardware_avr.md
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-10-10 16:32:38 -0700
committerJack Humbert <jack.humb@gmail.com>2018-10-10 21:35:26 -0400
commit0e4374042c5aef32762637f6fefd4662106bd5af (patch)
treecd3d997ab7beca0dcf736fd5d64b0b85db3ada33 /docs/hardware_avr.md
parent6c55e8cab5a1cc43c0c024344727ceb243d98f5a (diff)
downloadqmk_firmware-0e4374042c5aef32762637f6fefd4662106bd5af.tar.gz
qmk_firmware-0e4374042c5aef32762637f6fefd4662106bd5af.zip
Update and cleanup AVR Hardware docs
Diffstat (limited to 'docs/hardware_avr.md')
-rw-r--r--docs/hardware_avr.md42
1 files changed, 20 insertions, 22 deletions
diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md
index be6932406..4d81a23d7 100644
--- a/docs/hardware_avr.md
+++ b/docs/hardware_avr.md
@@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
8 8
9QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: 9QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
10 10
11``` 11```bash
12$ util/new_project.sh my_awesome_keyboard 12$ util/new_project.sh my_awesome_keyboard
13###################################################### 13######################################################
14# /keyboards/my_awesome_keyboard project created. To start 14# /keyboards/my_awesome_keyboard project created. To start
@@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not
30 30
31This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this: 31This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this:
32 32
33``` 33```c
34#define LAYOUT( \ 34#define LAYOUT( \
35 k00, k01, k02, \ 35 k00, k01, k02, \
36 k10, k11 \ 36 k10, k11 \
@@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how
57 57
58Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard. 58Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard.
59 59
60``` 60```c
61#define VENDOR_ID 0xFEED 61#define VENDOR_ID 0xFEED
62#define PRODUCT_ID 0x6060 62#define PRODUCT_ID 0x6060
63#define DEVICE_VER 0x0001 63#define DEVICE_VER 0x0001
@@ -72,14 +72,14 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
72 72
73The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement. 73The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement.
74 74
75``` 75```c
76#define MATRIX_ROWS 2 76#define MATRIX_ROWS 2
77#define MATRIX_COLS 3 77#define MATRIX_COLS 3
78``` 78```
79 79
80Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins: 80Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins:
81 81
82``` 82```c
83#define MATRIX_ROW_PINS { D0, D5 } 83#define MATRIX_ROW_PINS { D0, D5 }
84#define MATRIX_COL_PINS { F1, F0, B0 } 84#define MATRIX_COL_PINS { F1, F0, B0 }
85#define UNUSED_PINS 85#define UNUSED_PINS
@@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig
89 89
90Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`. 90Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`.
91 91
92``` 92```c
93#define DIODE_DIRECTION COL2ROW 93#define DIODE_DIRECTION COL2ROW
94``` 94```
95 95
@@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`,
97 97
98By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md). 98By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
99 99
100``` 100```c
101#define BACKLIGHT_PIN B7 101#define BACKLIGHT_PIN B7
102#define BACKLIGHT_LEVELS 3 102#define BACKLIGHT_LEVELS 3
103#define BACKLIGHT_BREATHING 103#define BACKLIGHT_BREATHING
104#define BREATHING_PERIOD 6 104#define BREATHING_PERIOD 6
105``` 105```
106 106
107{% hint style='info' %} 107?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
108You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
109{% endhint %}
110 108
111### Other Configuration Options 109### Other Configuration Options
112 110
@@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to
120 118
121These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable. 119These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable.
122 120
123``` 121```make
124MCU = atmega32u4 122MCU = atmega32u4
125F_CPU = 16000000 123F_CPU = 16000000
126ARCH = AVR8 124ARCH = AVR8
@@ -128,26 +126,26 @@ F_USB = $(F_CPU)
128OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 126OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
129``` 127```
130 128
131### Bootloader Size 129### Bootloaders
132 130
133The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter. 131The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard.
134 132
135#### Teensy 2.0 Bootloader Example 133#### Teensy Bootloader Example
136 134
137``` 135```make
138OPT_DEFS += -DBOOTLOADER_SIZE=512 136BOOTLOADER = halfkay
139``` 137```
140 138
141#### Teensy 2.0++ Bootloader Example 139#### Atmel DFU Loader Example
142 140
143``` 141```make
144OPT_DEFS += -DBOOTLOADER_SIZE=1024 142BOOTLOADER = atmel-dfu
145``` 143```
146 144
147#### Atmel DFU Loader Example 145#### Pro Micro Bootloader Example
148 146
149``` 147```make
150OPT_DEFS += -DBOOTLOADER_SIZE=4096 148BOOTLOADER = caterina
151``` 149```
152 150
153### Build Options 151### Build Options