├── .gitattributes ├── .gitignore ├── LoRa-Duino.jpg ├── LoRa-Radio-Node.jpg ├── README.md └── avr ├── avrdude.conf ├── boards.txt ├── bootloaders ├── atmega │ └── ATmegaBOOT_168_atmega328_pro_8MHz.hex ├── mega1284p │ ├── Fuses.jpg │ ├── Lock.jpg │ ├── optiboot_flash_atmega1284p_8000000L_1000000Bps.hex │ └── optiboot_flash_atmega1284p_8000000L_250000Bps.hex └── minilora │ ├── fuses.jpg │ ├── lockbit.jpg │ ├── optiboot_flash_atmega328p_1000000Bps_16000000L.hex │ ├── optiboot_flash_atmega328p_1000000Bps_8000000L.hex │ ├── optiboot_flash_atmega328p_115200Bps_16000000L.hex │ ├── optiboot_flash_atmega328p_115200Bps_8000000L.hex │ ├── optiboot_flash_atmega328p_250000Bps_16000000L.hex │ ├── optiboot_flash_atmega328p_250000Bps_8000000L.hex │ └── optiboot_flash_atmega328p_57600Bps_8000000L.hex ├── platform.txt └── variants ├── loraduino └── pins_arduino.h ├── loraradionode └── pins_arduino.h ├── mega1284p └── pins_arduino.h └── minilora └── pins_arduino.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gitignore 2 | *.elf 3 | 4 | stm32l0/ 5 | 6 | # ========================= 7 | # Operating System Files 8 | # ========================= 9 | 10 | # Windows 11 | # ========================= 12 | 13 | # Windows thumbnail cache files 14 | Thumbs.db 15 | ehthumbs.db 16 | ehthumbs_vista.db 17 | 18 | # Folder config file 19 | Desktop.ini 20 | 21 | # Recycle Bin used on file shares 22 | $RECYCLE.BIN/ 23 | 24 | # Windows Installer files 25 | *.cab 26 | *.msi 27 | *.msm 28 | *.msp 29 | 30 | # Windows shortcuts 31 | *.lnk 32 | -------------------------------------------------------------------------------- /LoRa-Duino.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/LoRa-Duino.jpg -------------------------------------------------------------------------------- /LoRa-Radio-Node.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/LoRa-Radio-Node.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CH2i Arduino Custom Boards Definition 2 | 3 | An Arduino core for some of my custom boards such has [Mini-Lora](https://github.com/hallard/Mini-LoRa) that have been optimized with optiboot bootloader and different serial speed to increase and improve uploading. 4 | This requires at least Arduino IDE v1.6.2, where v1.8.6+ is recommended. 5 | 6 | Also some of the boards have RFM95 LoRa module build in so constants pins are defined so you won't bother looking are the connection when coding. See section Pre defined boards 7 | 8 | 9 | ## Bootloader 10 | Your board should have the bootloader already flashed, it's not the scope of this repo. Everything to burn bootloader is explained [here](https://github.com/hallard/Pro-Mini-ICSP-FTDI) 11 | 12 | ## How to install 13 | 14 | Click on the "Download ZIP" button in the upper right corner. Exctract the ZIP file, and move the extracted folder to the location "**~/Documents/Arduino/hardware**". Create the "hardware" folder if it doesn't exist. 15 | 16 | This folder should match the one you setup into Arduino IDE preference, for example, setup in my IDE for Sketchbook Location is `D:\devt\Arduino` so I need to extract zip in `D:\devt\Arduino\hardware` 17 | 18 | After extraction, you should have something like `D:\devt\Arduino\hardware\ch2i-arduino-boards-master`, of course you can rename folder to `D:\devt\Arduino\hardware\CH2i` 19 | 20 | Then, open Arduino IDE, and a new category in the boards menu called "CH2i Boards" will show up. 21 | 22 | ## Getting started 23 | 24 | Ok, so you're downloaded and installed, ready to upload but how to get started? Here's a quick guide: 25 | 26 | * Open the **Tools > Board** menu item, and select a CH2i Boards compatible microcontroller, example `Mini Lora` 27 | * Select your prefered clock frequency. **16 MHz** is standard on most Arduino boards but 3.3V Boards shoudl be 8MHz. 28 | * Select uploading serial speed depending on which bootloader speed you flashed into your Arduino board. 29 | 30 | For example, if you flashed bootloader `optiboot_flash_atmega328p_250000_8MHZ.hex` 31 | 32 | * select 8MHz for Clock 33 | * select 250KBps for serial speed 34 | 35 | ## Pre defined boards 36 | 37 | Some boards with LoRa RFM95 module have the pin definition so you can use it in your sketch. If you select the correct board in Arduino IDE you don't need to take care of the values, just use the defined constants, for example LMIC stack 38 | 39 | 40 | ```cpp 41 | lmic_pinmap lmic_pins = { 42 | .nss = LORA_CS, 43 | .rxtx = LMIC_UNUSED_PIN, 44 | .rst = LORA_RESET, 45 | .dio = {LORA_DIO0, LORA_DIO1, LORA_DIO2}, 46 | }; 47 | ``` 48 | 49 | Also you can check at compile time the board used (selected in Arduino IDE) 50 | 51 | ```cpp 52 | #if defined (AVR_MINILORA) 53 | // Blah Blah 54 | #elif defined (AVR_LORADUINO) 55 | // Blah Blah 56 | #elif defined (AVR_LORARADIONODE) 57 | // Blah Blah 58 | #else 59 | #error "Unknown board selected" 60 | #endif 61 | ``` 62 | 63 | 64 | Like that, you don't need to change sketch whatever board you use for LoRa pinout. Here are below the pins definition made for each board 65 | 66 | ### Mini LoRa 67 | 68 | Mini LoRa 69 | 70 | ```cpp 71 | #define LED_BUILTIN 13 72 | #define LED_RED 9 73 | #define LED_GRN 6 74 | #define LED_BLU 5 75 | #define LED_PWM 76 | 77 | #define BTN_ACTION 3 78 | 79 | #define LORA_DIO0 2 80 | #define LORA_DIO1 7 81 | #define LORA_DIO2 8 82 | #define LORA_RESET 9 83 | #define LORA_CS SS 84 | ``` 85 | 86 | ### LoRa Radio Node 87 | 88 | LoRa Radio Node 89 | 90 | ```cpp 91 | #define LED_BUILTIN 13 92 | // Take care DIO pins are not connected to Digital Pin 93 | // by default, you need to solder the one needed on connector 94 | #define LORA_DIO0 2 95 | #define LORA_DIO1 5 96 | #define LORA_DIO2 6 97 | #define LORA_DIO3 7 98 | #define LORA_DIO5 8 99 | #define LORA_RESET 9 100 | #define LORA_CS SS 101 | ``` 102 | 103 | ### LoRaDuino from electrodragon 104 | 105 | LoRaDuino 106 | 107 | ```cpp 108 | #define LED_BUILTIN 7 109 | #define BAT_ANALOG A7 110 | #define BTN_ACTION 5 111 | #define FLASH_CS 8 112 | #define LORA_DIO0 2 113 | #define LORA_DIO1 4 114 | #define LORA_RESET 9 115 | #define LORA_CS SS 116 | ``` 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /avr/boards.txt: -------------------------------------------------------------------------------- 1 | 2 | menu.cpu=Processor 3 | menu.clock=Clock 4 | menu.upload=Upload Speed 5 | menu.tpldone=TPL511x DONE Pin 6 | menu.tpldrv=TPL511x DRV Pin 7 | menu.mcp24aa=Microchip 24AA02E64 8 | 9 | ###################################################### 10 | # Optiboot 8MHz/16Mhz 250Kb/1Mb # 11 | # bootloader for ATMega1284p running up 1MBPS # 12 | ###################################################### 13 | 14 | atmega1284p.name=Arduino Mega (ATmega1284p) 15 | 16 | atmega1284p.menu.clock.8MHz=8 MHz 17 | atmega1284p.menu.clock.8MHz.build.f_cpu=8000000L 18 | atmega1284p.menu.clock.16MHz=16 MHz 19 | atmega1284p.menu.clock.16MHz.build.f_cpu=16000000L 20 | 21 | atmega1284p.menu.upload.250K=250 KBps 22 | atmega1284p.menu.upload.250K.upload.speed=250000 23 | atmega1284p.menu.upload.1M=1 MBps 24 | atmega1284p.menu.upload.1M.upload.speed=1000000 25 | 26 | atmega1284p.upload.tool=arduino:avrdude 27 | atmega1284p.upload.protocol=arduino 28 | atmega1284p.upload.maximum_size=130048 29 | atmega1284p.upload.maximum_data_size=16384 30 | 31 | atmega1284p.build.mcu=atmega1284p 32 | atmega1284p.build.core=arduino:arduino 33 | atmega1284p.build.board=AVR_MEGA_1284P 34 | atmega1284p.build.variant=mega1284p 35 | 36 | atmega1284p.bootloader.low_fuses=0xFF 37 | atmega1284p.bootloader.high_fuses=0xD6 38 | atmega1284p.bootloader.extended_fuses=0xFF 39 | atmega1284p.bootloader.path=optiboot 40 | atmega1284p.bootloader.unlock_bits=0x3F 41 | atmega1284p.bootloader.lock_bits=0x0F 42 | atmega1284p.bootloader.tool=arduino:avrdude 43 | atmega1284p.bootloader.file=mega1284p/optiboot_flash_{build.mcu}_{build.f_cpu}_{upload.speed}Bps.hex 44 | 45 | ##################################################### 46 | # Optiboot 8MHz/16Mhz 250Kb/1Mb # 47 | # bootloader for ATMega328p running up 1MBPS # 48 | # https://github.com/hallard/Mini-LoRa # 49 | ##################################################### 50 | 51 | atmega328p_minilora.name=Mini Lora (ATmega328p) 52 | 53 | atmega328p_minilora.menu.clock.8MHz=8 MHz 54 | atmega328p_minilora.menu.clock.8MHz.build.f_cpu=8000000L 55 | atmega328p_minilora.menu.clock.16MHz=16 MHz 56 | atmega328p_minilora.menu.clock.16MHz.build.f_cpu=16000000L 57 | atmega328p_minilora.menu.clock.16MHzAt8MHz=8MHz (Crystal 16MHz) 58 | atmega328p_minilora.menu.clock.16MHzAt8MHz.build.f_cpu=8000000L 59 | atmega328p_minilora.menu.clock.16MHzAt8MHz.build.extra_flags=-DCLOCK_DIV_2 60 | 61 | atmega328p_minilora.menu.upload.250K=250 KBps 62 | atmega328p_minilora.menu.upload.250K.upload.speed=250000 63 | atmega328p_minilora.menu.upload.1M=1 MBps 64 | atmega328p_minilora.menu.upload.1M.upload.speed=1000000 65 | atmega328p_minilora.menu.upload.115K=115200 Bps 66 | atmega328p_minilora.menu.upload.115K.upload.speed=115200 67 | atmega328p_minilora.menu.upload.57K=57600 Bps 68 | atmega328p_minilora.menu.upload.57K.upload.speed=57600 69 | 70 | 71 | atmega328p_minilora.menu.mcp24aa.nomcp=No 72 | atmega328p_minilora.menu.mcp24aa.nomcp.build.extra_flags= 73 | atmega328p_minilora.menu.mcp24aa.hasmcp=Yes 74 | atmega328p_minilora.menu.mcp24aa.hasmcp.build.extra_flags=-DMCP_24AA02E64 75 | 76 | atmega328p_minilora.menu.tpldone.none=None 77 | atmega328p_minilora.menu.tpldone.none.build.extra_flags= 78 | atmega328p_minilora.menu.tpldone.pina1=A1 79 | atmega328p_minilora.menu.tpldone.pina1.build.extra_flags=-DTPL_DONE=A1 80 | atmega328p_minilora.menu.tpldone.pina2=A2 81 | atmega328p_minilora.menu.tpldone.pina2.build.extra_flags=-DTPL_DONE=A2 82 | atmega328p_minilora.menu.tpldone.pina3=A3 83 | atmega328p_minilora.menu.tpldone.pina3.build.extra_flags=-DTPL_DONE=A3 84 | atmega328p_minilora.menu.tpldone.pind4=D4 85 | atmega328p_minilora.menu.tpldone.pind4.build.extra_flags=-DTPL_DONE=D4 86 | 87 | atmega328p_minilora.menu.tpldrv.none=None 88 | atmega328p_minilora.menu.tpldrv.none.build.extra_flags= 89 | atmega328p_minilora.menu.tpldrv.pina1=A1 90 | atmega328p_minilora.menu.tpldrv.pina1.build.extra_flags=-DTPL_DONE=A1 91 | atmega328p_minilora.menu.tpldrv.pina2=A2 92 | atmega328p_minilora.menu.tpldrv.pina2.build.extra_flags=-DTPL_DONE=A2 93 | atmega328p_minilora.menu.tpldrv.pina3=A3 94 | atmega328p_minilora.menu.tpldrv.pina3.build.extra_flags=-DTPL_DONE=A3 95 | atmega328p_minilora.menu.tpldrv.pind4=D4 96 | atmega328p_minilora.menu.tpldrv.pind4.build.extra_flags=-DTPL_DONE=D4 97 | 98 | 99 | atmega328p_minilora.upload.tool=arduino:avrdude 100 | atmega328p_minilora.upload.protocol=arduino 101 | atmega328p_minilora.upload.maximum_size=32256 102 | atmega328p_minilora.upload.maximum_data_size=2048 103 | 104 | atmega328p_minilora.build.mcu=atmega328p 105 | atmega328p_minilora.build.core=arduino:arduino 106 | atmega328p_minilora.build.board=AVR_MINILORA 107 | atmega328p_minilora.build.variant=minilora 108 | 109 | atmega328p_minilora.bootloader.low_fuses=0xFF 110 | atmega328p_minilora.bootloader.high_fuses=0xde 111 | atmega328p_minilora.bootloader.extended_fuses=0x06 112 | atmega328p_minilora.bootloader.path=optiboot 113 | atmega328p_minilora.bootloader.unlock_bits=0x3F 114 | atmega328p_minilora.bootloader.lock_bits=0xcF 115 | atmega328p_minilora.bootloader.tool=arduino:avrdude 116 | atmega328p_minilora.bootloader.file=minilora/optiboot_flash_{build.mcu}_{upload.speed}Bps_{build.f_cpu}.hex 117 | 118 | 119 | ##################################################### 120 | # loraduino 3V3 8MHz 57600 # 121 | # bootloader arduino pro mini running up 57600 # 122 | # from http://www.electrodragon.com # 123 | ##################################################### 124 | 125 | atmega328p_loraduino.name=Loraduino (ATmega328p) 126 | 127 | atmega328p_loraduino.menu.clock.8MHz=8 MHz 128 | atmega328p_loraduino.menu.clock.8MHz.build.f_cpu=8000000L 129 | 130 | atmega328p_loraduino.menu.upload.115K=115200 Bps 131 | atmega328p_loraduino.menu.upload.115K.upload.speed=115200 132 | atmega328p_loraduino.menu.upload.57K=57600 Bps 133 | atmega328p_loraduino.menu.upload.57K.upload.speed=57600 134 | 135 | atmega328p_loraduino.upload.tool=arduino:avrdude 136 | atmega328p_loraduino.upload.protocol=arduino 137 | atmega328p_loraduino.upload.maximum_size=30720 138 | atmega328p_loraduino.upload.maximum_data_size=2048 139 | 140 | atmega328p_loraduino.build.mcu=atmega328p 141 | atmega328p_loraduino.build.core=arduino:arduino 142 | atmega328p_loraduino.build.board=AVR_LORADUINO 143 | atmega328p_loraduino.build.variant=loraduino 144 | 145 | atmega328p_loraduino.bootloader.low_fuses=0xFF 146 | atmega328p_loraduino.bootloader.high_fuses=0xDA 147 | atmega328p_loraduino.bootloader.extended_fuses=0xFD 148 | atmega328p_loraduino.bootloader.path=optiboot 149 | atmega328p_loraduino.bootloader.unlock_bits=0x3F 150 | atmega328p_loraduino.bootloader.lock_bits=0xcF 151 | atmega328p_loraduino.bootloader.tool=arduino:avrdude 152 | atmega328p_loraduino.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex 153 | 154 | ##################################################### 155 | # Optiboot 8MHz/16Mhz 250Kb/1Mb # 156 | # bootloader for ATMega328p running up 1MBPS # 157 | # ebay for 'LoRa Radio Node' (blue with bat holder) # 158 | ##################################################### 159 | 160 | atmega328p_loraradionode.name=LoRa Radio Node (ATmega328p) 161 | 162 | atmega328p_loraradionode.menu.clock.8MHz=8 MHz 163 | atmega328p_loraradionode.menu.clock.8MHz.build.f_cpu=8000000L 164 | atmega328p_loraradionode.menu.clock.16MHz=16 MHz 165 | atmega328p_loraradionode.menu.clock.16MHz.build.f_cpu=16000000L 166 | atmega328p_loraradionode.menu.clock.16MHzAt8MHz=8MHz (Crystal 16MHz) 167 | atmega328p_loraradionode.menu.clock.16MHzAt8MHz.build.f_cpu=8000000L 168 | atmega328p_loraradionode.menu.clock.16MHzAt8MHz.build.extra_flags=-DCLOCK_DIV_2 169 | 170 | atmega328p_loraradionode.menu.upload.250K=250 KBps 171 | atmega328p_loraradionode.menu.upload.250K.upload.speed=250000 172 | atmega328p_loraradionode.menu.upload.1M=1 MBps 173 | atmega328p_loraradionode.menu.upload.1M.upload.speed=1000000 174 | atmega328p_loraradionode.menu.upload.115K=115200 Bps 175 | atmega328p_loraradionode.menu.upload.115K.upload.speed=115200 176 | atmega328p_loraradionode.menu.upload.57K=57600 Bps 177 | atmega328p_loraradionode.menu.upload.57K.upload.speed=57600 178 | 179 | atmega328p_loraradionode.upload.tool=arduino:avrdude 180 | atmega328p_loraradionode.upload.protocol=arduino 181 | atmega328p_loraradionode.upload.maximum_size=32256 182 | atmega328p_loraradionode.upload.maximum_data_size=2048 183 | 184 | atmega328p_loraradionode.build.mcu=atmega328p 185 | atmega328p_loraradionode.build.core=arduino:arduino 186 | atmega328p_loraradionode.build.board=AVR_LORARADIONODE 187 | atmega328p_loraradionode.build.variant=loraradionode 188 | 189 | atmega328p_loraradionode.bootloader.low_fuses=0xFF 190 | atmega328p_loraradionode.bootloader.high_fuses=0xde 191 | atmega328p_loraradionode.bootloader.extended_fuses=0x06 192 | atmega328p_loraradionode.bootloader.path=optiboot 193 | atmega328p_loraradionode.bootloader.unlock_bits=0x3F 194 | atmega328p_loraradionode.bootloader.lock_bits=0xcF 195 | atmega328p_loraradionode.bootloader.tool=arduino:avrdude 196 | atmega328p_loraradionode.bootloader.file=minilora/optiboot_flash_{build.mcu}_{upload.speed}Bps_{build.f_cpu}.hex -------------------------------------------------------------------------------- /avr/bootloaders/atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex: -------------------------------------------------------------------------------- 1 | :107800000C94343C0C94513C0C94513C0C94513CE1 2 | :107810000C94513C0C94513C0C94513C0C94513CB4 3 | :107820000C94513C0C94513C0C94513C0C94513CA4 4 | :107830000C94513C0C94513C0C94513C0C94513C94 5 | :107840000C94513C0C94513C0C94513C0C94513C84 6 | :107850000C94513C0C94513C0C94513C0C94513C74 7 | :107860000C94513C0C94513C11241FBECFEFD8E036 8 | :10787000DEBFCDBF11E0A0E0B1E0EAE8FFE702C063 9 | :1078800005900D92A230B107D9F712E0A2E0B1E065 10 | :1078900001C01D92AD30B107E1F70E942D3D0C945F 11 | :1078A000C33F0C94003C982F95959595959595958B 12 | :1078B000905D8F708A307CF0282F295A8091C0000B 13 | :1078C00085FFFCCF9093C6008091C00085FFFCCF60 14 | :1078D0002093C6000895282F205DF0CF982F809127 15 | :1078E000C00085FFFCCF9093C6000895EF92FF92F1 16 | :1078F0000F931F93EE24FF2487018091C00087FD22 17 | :1079000017C00894E11CF11C011D111D81E2E8164D 18 | :1079100081EAF80687E0080780E0180770F3E09135 19 | :107920000401F091050109958091C00087FFE9CF1E 20 | :107930008091C6001F910F91FF90EF9008950E94D3 21 | :10794000763C982F8091C00085FFFCCF9093C600B5 22 | :1079500091362CF490330CF09053892F089597555D 23 | :10796000892F08951F930E949F3C182F0E949F3CCF 24 | :107970001295107F810F1F9108951F93182F882350 25 | :1079800021F00E94763C1150E1F71F9108951F935A 26 | :10799000182F0E94763C803249F0809103018F5F5E 27 | :1079A000809303018530C1F01F9108958091C0003C 28 | :1079B00085FFFCCF84E18093C6008091C00085FFE5 29 | :1079C000FCCF1093C6008091C00085FFFCCF80E102 30 | :1079D0008093C6001F910895E0910401F091050184 31 | :1079E00009951F9108950E94763C803241F0809164 32 | :1079F00003018F5F80930301853081F008958091AA 33 | :107A0000C00085FFFCCF84E18093C6008091C00058 34 | :107A100085FFFCCF80E18093C6000895E0910401CA 35 | :107A2000F09105010995089548EC50E08823A1F0F4 36 | :107A30002D9A28EE33E0FA013197F1F721503040CA 37 | :107A4000D1F72D9828EE33E0FA013197F1F7215064 38 | :107A50003040D1F7815061F708953F924F925F9285 39 | :107A60006F927F928F929F92AF92BF92CF92DF924E 40 | :107A7000EF92FF920F931F93CF93DF93000082E06A 41 | :107A80008093C00080E18093C4001092C50088E11B 42 | :107A90008093C10086E08093C2005098589A259A3E 43 | :107AA00081E00E94143D24E1F22E9EE1E92E85E959 44 | :107AB000D82E0FE0C02E10E1B12EAA24A394B1E479 45 | :107AC0009B2EA6E58A2EF2E57F2EE0E26E2E79E46B 46 | :107AD000572E63E5462E50E5352E0E94763C8033C6 47 | :107AE000B1F18133B9F1803409F46FC0813409F404 48 | :107AF00076C0823409F485C0853409F488C08035A5 49 | :107B000031F1823521F1813511F1853509F485C0D6 50 | :107B1000863509F48DC0843609F496C0843709F49B 51 | :107B200003C1853709F472C1863709F466C08091B4 52 | :107B300003018F5F80930301853079F6E0910401A2 53 | :107B4000F091050109950E94763C803351F60E9420 54 | :107B5000F33CC3CF0E94763C803249F78091C0004D 55 | :107B600085FFFCCFF092C6008091C00085FFFCCF5E 56 | :107B70009092C6008091C00085FFFCCF8092C60025 57 | :107B80008091C00085FFFCCF7092C6008091C0003C 58 | :107B900085FFFCCF6092C6008091C00085FFFCCFBE 59 | :107BA0005092C6008091C00085FFFCCF4092C60075 60 | :107BB0008091C00085FFFCCF3092C6008091C0004C 61 | :107BC00085FFFCCFB092C60088CF0E94763C8638F5 62 | :107BD00008F4BDCF0E94763C0E94F33C7ECF0E9409 63 | :107BE000763C803809F49CC0813809F40BC1823896 64 | :107BF00009F430C1883909F48FC080E00E94C73C85 65 | :107C00006CCF84E10E94BD3C0E94F33C66CF85E0CE 66 | :107C10000E94BD3C0E94F33C60CF0E94763C809362 67 | :107C200006010E94763C809307010E94F33C55CFE9 68 | :107C30000E94763C803309F411C183E00E94BD3C70 69 | :107C400080E00E94C73C49CF0E94763C80930902A5 70 | :107C50000E94763C8093080280910C028E7F809374 71 | :107C60000C020E94763C853409F409C18091080217 72 | :107C700090910902892B89F000E010E00E94763C87 73 | :107C8000F801E85FFE4F80830F5F1F4F809108026D 74 | :107C9000909109020817190788F30E94763C8032F8 75 | :107CA00009F045CF80910C0280FFF5C0609106017C 76 | :107CB00070910701660F771F7093070160930601AB 77 | :107CC000A0910802B09109021097C9F0E8E0F1E034 78 | :107CD0009B01AD014E0F5F1FF999FECF32BD21BD53 79 | :107CE000819180BDFA9AF99A2F5F3F4FE417F5070B 80 | :107CF00099F76A0F7B1F70930701609306018091CB 81 | :107D0000C00085FFFCCFF092C6008091C00085FFC7 82 | :107D1000FCCFB092C600E1CE83E00E94C73CDDCE2E 83 | :107D200082E00E94C73CD9CE0E94763C8093090233 84 | :107D30000E94763C80930802809106019091070191 85 | :107D4000880F991F90930701809306010E94763C4B 86 | :107D5000853409F49AC080910C028E7F80930C02C6 87 | :107D60000E94763C803209F0B8CE8091C00085FF39 88 | :107D7000FCCFF092C600A0910802B09109021097C2 89 | :107D8000C1F180910C02082F0170182F1695117007 90 | :107D9000E0910601F0910701AF014F5F5F4FBA011B 91 | :107DA00020E030E00023B1F4112339F49491809164 92 | :107DB000C00085FFFCCF9093C6002F5F3F4FCB01E3 93 | :107DC0000196FA012A173B0780F4BC014F5F5F4F11 94 | :107DD000002351F3F999FECFF2BDE1BDF89A90B5B9 95 | :107DE0008091C00085FFFCCFE6CF709307016093C0 96 | :107DF00006018091C00085FDE5CE8091C00085FF21 97 | :107E0000F8CFE0CE81E00E94C73C67CE0E94763C6E 98 | :107E1000803209F08CCE8091C00085FFFCCFF092BB 99 | :107E2000C6008091C00085FFFCCFE092C600809123 100 | :107E3000C00085FFFCCFD092C6008091C00085FFB6 101 | :107E4000FCCFC092C6008091C00085FFFCCFB092ED 102 | :107E5000C60043CE80E10E94C73C3FCE0E94763CE4 103 | :107E60000E94763C182F0E94763C112309F483C0AF 104 | :107E7000113009F484C08FE00E94C73C2ECE80915F 105 | :107E80000C02816080930C02F1CE80910C02816023 106 | :107E900080930C0265CF809107018823880F880B9F 107 | :107EA0008A2180930B028091060190910701880F2F 108 | :107EB000991F90930701809306018091080280FF2B 109 | :107EC00009C08091080290910902019690930902DD 110 | :107ED00080930802F894F999FECF1127E0910601EA 111 | :107EE000F0910701C8E0D1E0809108029091090269 112 | :107EF000103091F40091570001700130D9F303E084 113 | :107F000000935700E8950091570001700130D9F3B4 114 | :107F100001E100935700E8950990199000915700EE 115 | :107F200001700130D9F301E000935700E8951395F3 116 | :107F3000103498F011270091570001700130D9F3E7 117 | :107F400005E000935700E89500915700017001305B 118 | :107F5000D9F301E100935700E8953296029709F0B2 119 | :107F6000C7CF103011F00296E5CF11248091C000E8 120 | :107F700085FFC5CEC8CE8EE10E94C73CAECD85E957 121 | :0A7F80000E94C73CAACDF894FFCF81 122 | :027F8A00800075 123 | :040000030000780081 124 | :00000001FF 125 | -------------------------------------------------------------------------------- /avr/bootloaders/mega1284p/Fuses.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/avr/bootloaders/mega1284p/Fuses.jpg -------------------------------------------------------------------------------- /avr/bootloaders/mega1284p/Lock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/avr/bootloaders/mega1284p/Lock.jpg -------------------------------------------------------------------------------- /avr/bootloaders/mega1284p/optiboot_flash_atmega1284p_8000000L_1000000Bps.hex: -------------------------------------------------------------------------------- 1 | :020000021000EC 2 | :10FC000001C0F4C01F92CDB7DEB7112484B788239A 3 | :10FC100049F0982F9A70923029F081FF02C097EF37 4 | :10FC200094BF1CD185E08093810082E08093C00066 5 | :10FC300088E18093C10086E08093C2001092C400E6 6 | :10FC40008EE0F7D0579A4F9A84E028E13EEF91E09A 7 | :10FC5000309385002093840096BBB09BFECF4F9AD3 8 | :10FC6000A8958150A9F7812C912CD7D0813479F4B3 9 | :10FC7000D4D08983E4D08981823811F482E005C030 10 | :10FC8000813811F486E001C083E0C0D0ACC082347A 11 | :10FC900011F484E103C0853419F485E0D8D0A3C001 12 | :10FCA000853581F4BAD0182FB8D0812E912C982A9E 13 | :10FCB0008BB797FE02C0816001C08E7F8BBF880C1E 14 | :10FCC000991C90C0863581F4A8D08D3449F4A5D014 15 | :10FCD0001BB7A3D0880F1170812B8BBF81E001C0AF 16 | :10FCE00083E0B5D080E0D1CF843609F04AC095D00A 17 | :10FCF000082F10E0102F002790D0082B8ED0B82EA0 18 | :10FD00007801C12CDD24D39488D0F60181936F0152 19 | :10FD1000F1E0EF1AF108C1F792D085E4B81212C0F1 20 | :10FD20006801D394740100E011E00C151D0509F47D 21 | :10FD30005AC0F80161918F01C7019ED0FFEFEF1A01 22 | :10FD4000FF0AF3CF40E050E063E0C4014FD0E12C64 23 | :10FD5000F12CF701F39540813196808150E0582BCA 24 | :10FD600061E0C701880D991D41D082E0E80EF11CC9 25 | :10FD70000E151F0571F740E050E065E0C40136D074 26 | :10FD800032C0843711F549D0082F10E0102F00271A 27 | :10FD900044D0082B42D0898352D0898174018534A4 28 | :10FDA00061F4C70161D032D001501109EFEFEE1AB2 29 | :10FDB000FE0A01151105A9F716C0F70187917F0109 30 | :10FDC00025D001501109C9F70EC0853739F437D055 31 | :10FDD0008EE11CD087E91AD085E057CF813511F428 32 | :10FDE00088E027D02CD080E111D03FCFFC010A0160 33 | :10FDF00067BFE895112407B600FCFDCF667029F0B7 34 | :10FE0000452B19F481E187BFE89508959091C000D2 35 | :10FE100095FFFCCF8093C60008958091C00087FFB6 36 | :10FE2000FCCF8091C00084FD01C0A8958091C600E0 37 | :10FE30000895E0E6F0E098E1908380830895EDDF97 38 | :10FE4000803219F088E0F5DFFFCF84E1DFCFCF9378 39 | :10FE5000C82FE3DFC150E9F7CF91F1CF282E80E022 40 | :10FE6000E8DFE0E0FF270994F999FECF92BD81BD5C 41 | :10FE7000F89A992780B50895262FF999FECF1FBAD1 42 | :10FE800092BD81BD20BD0FB6F894FA9AF99A0FBEC3 43 | :04FE9000019608953A 44 | :02FFFE000206F9 45 | :040000031000FC00ED 46 | :00000001FF 47 | -------------------------------------------------------------------------------- /avr/bootloaders/mega1284p/optiboot_flash_atmega1284p_8000000L_250000Bps.hex: -------------------------------------------------------------------------------- 1 | :020000021000EC 2 | :10FC000001C0F5C01F92CDB7DEB7112484B7882399 3 | :10FC100049F0982F9A70923029F081FF02C097EF37 4 | :10FC200094BF1DD185E08093810082E08093C00065 5 | :10FC300088E18093C10086E08093C20083E08093D6 6 | :10FC4000C4008EE0F7D0579A4F9A84E028E13EEF47 7 | :10FC500091E0309385002093840096BBB09BFECF4B 8 | :10FC60004F9AA8958150A9F7812C912CD7D0813437 9 | :10FC700079F4D4D08983E4D08981823811F482E088 10 | :10FC800005C0813811F486E001C083E0C0D0ACC06B 11 | :10FC9000823411F484E103C0853419F485E0D8D0AE 12 | :10FCA000A3C0853581F4BAD0182FB8D0812E912CFD 13 | :10FCB000982A8BB797FE02C0816001C08E7F8BBFF0 14 | :10FCC000880C991C90C0863581F4A8D08D3449F4F5 15 | :10FCD000A5D01BB7A3D0880F1170812B8BBF81E0FB 16 | :10FCE00001C083E0B5D080E0D1CF843609F04AC0AE 17 | :10FCF00095D0082F10E0102F002790D0082B8ED021 18 | :10FD0000B82E7801C12CDD24D39488D0F6018193DC 19 | :10FD10006F01F1E0EF1AF108C1F792D085E4B81253 20 | :10FD200012C06801D394740100E011E00C151D05A8 21 | :10FD300009F45AC0F80161918F01C7019ED0FFEF0D 22 | :10FD4000EF1AFF0AF3CF40E050E063E0C4014FD068 23 | :10FD5000E12CF12CF701F39540813196808150E040 24 | :10FD6000582B61E0C701880D991D41D082E0E80E53 25 | :10FD7000F11C0E151F0571F740E050E065E0C4016D 26 | :10FD800036D032C0843711F549D0082F10E0102F3B 27 | :10FD9000002744D0082B42D0898352D08981740136 28 | :10FDA000853461F4C70161D032D001501109EFEF01 29 | :10FDB000EE1AFE0A01151105A9F716C0F701879181 30 | :10FDC0007F0125D001501109C9F70EC0853739F4DC 31 | :10FDD00037D08EE11CD087E91AD085E057CF813526 32 | :10FDE00011F488E027D02CD080E111D03FCFFC0166 33 | :10FDF0000A0167BFE895112407B600FCFDCF6670C5 34 | :10FE000029F0452B19F481E187BFE8950895909179 35 | :10FE1000C00095FFFCCF8093C60008958091C0007C 36 | :10FE200087FFFCCF8091C00084FD01C0A895809120 37 | :10FE3000C6000895E0E6F0E098E19083808308959D 38 | :10FE4000EDDF803219F088E0F5DFFFCF84E1DFCF0E 39 | :10FE5000CF93C82FE3DFC150E9F7CF91F1CF282E20 40 | :10FE600080E0E8DFE0E0FF270994F999FECF92BD3A 41 | :10FE700081BDF89A992780B50895262FF999FECF6C 42 | :10FE80001FBA92BD81BD20BD0FB6F894FA9AF99AB7 43 | :06FE90000FBE019608956B 44 | :02FFFE000206F9 45 | :040000031000FC00ED 46 | :00000001FF 47 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/fuses.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/avr/bootloaders/minilora/fuses.jpg -------------------------------------------------------------------------------- /avr/bootloaders/minilora/lockbit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ch2i/ch2i-arduino-boards/3c10453eed0049bb86cbfaadbfa8b9b423659598/avr/bootloaders/minilora/lockbit.jpg -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_1000000Bps_16000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20081E08093C4008FE0B2D0DE 5 | :107E4000259A86E020E33CEF91E030938500209373 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_1000000Bps_8000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ACC0112484B7882349F0982F9A7020 2 | :107E1000923029F081FF02C097EF94BFD7D085E060 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C2001092C4008FE0B2D0259AF1 5 | :107E400086E028E13EEF91E03093850020938400A6 6 | :107E500096BBB09BFECF1D9AA8958150A9F7C0E0B4 7 | :107E6000D0E093D0813481F490D0182FA0D0123874 8 | :107E700029F482E083D080E181D0F3CF113811F46E 9 | :107E800086E0F8CF83E0F6CF823419F484E197D00E 10 | :107E9000F2CF853411F485E0FACF853549F475D0F9 11 | :107EA000C82FD0E072D0D82BCC0FDD1F80D0E3CF0D 12 | :107EB000863521F484E083D080E0DCCF843679F508 13 | :107EC00064D063D0D82E61D0F82E00E011E05DD0F0 14 | :107ED000F80181938F01DE12FACF69D0F5E4FF1229 15 | :107EE00001C0FFCF40E050E063E0CE0137D07E011B 16 | :107EF00000E011E0F8014081818150E0582B61E001 17 | :107F0000C7012CD0F2E0EF0EF11C0E5F1F4FD01214 18 | :107F1000F1CF40E050E065E0CE0120D0ACCF843717 19 | :107F200071F433D032D0F82E30D041D08E01F80128 20 | :107F300085918F0123D0FA94F110F9CF9CCF85372A 21 | :107F400039F435D08EE11AD085E918D08FE092CF80 22 | :107F5000813509F0ABCF88E024D0A8CFFC010A011D 23 | :107F600067BFE895112407B600FCFDCF667029F0C5 24 | :107F7000452B19F481E187BFE89508959091C000E1 25 | :107F800095FFFCCF8093C60008958091C00087FFC5 26 | :107F9000FCCF8091C00084FD01C0A8958091C600EF 27 | :107FA0000895E0E6F0E098E1908380830895EDDFA6 28 | :107FB000803219F088E0F5DFFFCF84E1DFCFCF9387 29 | :107FC000C82FE3DFC150E9F7CF91F1CF282E80E031 30 | :087FD000E8DFE0E0FF2709945F 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_115200Bps_16000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20080E18093C4008FE0B2D0DE 5 | :107E4000259A84E020E33CEF91E030938500209375 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_115200Bps_8000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20088E08093C4008FE0B2D0D7 5 | :107E4000259A84E028E13EEF91E03093850020936D 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_250000Bps_16000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20087E08093C4008FE0B2D0D8 5 | :107E4000259A86E020E33CEF91E030938500209373 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_250000Bps_8000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20083E08093C4008FE0B2D0DC 5 | :107E4000259A86E028E13EEF91E03093850020936B 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/bootloaders/minilora/optiboot_flash_atmega328p_57600Bps_8000000L.hex: -------------------------------------------------------------------------------- 1 | :107E000001C0ADC0112484B7882349F0982F9A701F 2 | :107E1000923029F081FF02C097EF94BFD8D085E05F 3 | :107E20008093810082E08093C00088E18093C1004C 4 | :107E300086E08093C20080E18093C4008FE0B2D0DE 5 | :107E4000259A84E028E13EEF91E03093850020936D 6 | :107E5000840096BBB09BFECF1D9AA8958150A9F7D0 7 | :107E6000C0E0D0E093D0813481F490D0182FA0D01E 8 | :107E7000123829F482E083D080E181D0F3CF113829 9 | :107E800011F486E0F8CF83E0F6CF823419F484E170 10 | :107E900097D0F2CF853411F485E0FACF853549F4D7 11 | :107EA00075D0C82FD0E072D0D82BCC0FDD1F80D07A 12 | :107EB000E3CF863521F484E083D080E0DCCF8436C4 13 | :107EC00079F564D063D0D82E61D0F82E00E011E0AF 14 | :107ED0005DD0F80181938F01DE12FACF69D0F5E40D 15 | :107EE000FF1201C0FFCF40E050E063E0CE0137D089 16 | :107EF0007E0100E011E0F8014081818150E0582BC3 17 | :107F000061E0C7012CD0F2E0EF0EF11C0E5F1F4FB5 18 | :107F1000D012F1CF40E050E065E0CE0120D0ACCFF0 19 | :107F2000843771F433D032D0F82E30D041D08E0166 20 | :107F3000F80185918F0123D0FA94F110F9CF9CCFED 21 | :107F4000853739F435D08EE11AD085E918D08FE025 22 | :107F500092CF813509F0ABCF88E024D0A8CFFC01C7 23 | :107F60000A0167BFE895112407B600FCFDCF6670D3 24 | :107F700029F0452B19F481E187BFE8950895909188 25 | :107F8000C00095FFFCCF8093C60008958091C0008B 26 | :107F900087FFFCCF8091C00084FD01C0A89580912F 27 | :107FA000C6000895E0E6F0E098E1908380830895AC 28 | :107FB000EDDF803219F088E0F5DFFFCF84E1DFCF1D 29 | :107FC000CF93C82FE3DFC150E9F7CF91F1CF282E2F 30 | :0A7FD00080E0E8DFE0E0FF270994FD 31 | :027FFE00020679 32 | :0400000300007E007B 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /avr/platform.txt: -------------------------------------------------------------------------------- 1 | # Arduino AVR Core and platform. 2 | # ------------------------------ 3 | # 4 | # For more info: 5 | # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification 6 | 7 | name=CH2i Boards 8 | version=1.0.0 9 | 10 | # AVR compile variables 11 | # --------------------- 12 | 13 | compiler.warning_flags=-w 14 | compiler.warning_flags.none=-w 15 | compiler.warning_flags.default= 16 | compiler.warning_flags.more=-Wall 17 | compiler.warning_flags.all=-Wall -Wextra 18 | 19 | # Default "compiler.path" is correct, change only if you want to override the initial value 20 | compiler.path={runtime.tools.avr-gcc.path}/bin/ 21 | compiler.c.cmd=avr-gcc 22 | compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects 23 | compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections 24 | compiler.c.elf.cmd=avr-gcc 25 | compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD 26 | compiler.cpp.cmd=avr-g++ 27 | compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto 28 | compiler.ar.cmd=avr-gcc-ar 29 | compiler.ar.flags=rcs 30 | compiler.objcopy.cmd=avr-objcopy 31 | compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 32 | compiler.elf2hex.flags=-O ihex -R .eeprom 33 | compiler.elf2hex.cmd=avr-objcopy 34 | compiler.ldflags= 35 | compiler.size.cmd=avr-size 36 | 37 | # This can be overridden in boards.txt 38 | build.extra_flags= 39 | 40 | # These can be overridden in platform.local.txt 41 | compiler.c.extra_flags= 42 | compiler.c.elf.extra_flags= 43 | compiler.S.extra_flags= 44 | compiler.cpp.extra_flags= 45 | compiler.ar.extra_flags= 46 | compiler.objcopy.eep.extra_flags= 47 | compiler.elf2hex.extra_flags= 48 | 49 | # AVR compile patterns 50 | # -------------------- 51 | 52 | ## Compile c files 53 | recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 54 | 55 | ## Compile c++ files 56 | recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 57 | 58 | ## Compile S files 59 | recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 60 | 61 | ## Create archives 62 | # archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value 63 | archive_file_path={build.path}/{archive_file} 64 | recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" 65 | 66 | ## Combine gc-sections, archives, and objects 67 | recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm 68 | 69 | ## Create output files (.eep and .hex) 70 | recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" 71 | recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" 72 | 73 | ## Save hex 74 | recipe.output.tmp_file={build.project_name}.hex 75 | recipe.output.save_file={build.project_name}.{build.variant}.hex 76 | 77 | ## Compute size 78 | recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" 79 | recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* 80 | recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* 81 | recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* 82 | 83 | ## Preprocessor 84 | preproc.includes.flags=-w -x c++ -M -MG -MP 85 | recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" 86 | 87 | preproc.macros.flags=-w -x c++ -E -CC 88 | recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" 89 | 90 | # AVR Uploader/Programmers tools 91 | # ------------------------------ 92 | 93 | tools.avrdude.path={runtime.tools.avrdude.path} 94 | tools.avrdude.cmd.path={path}/bin/avrdude 95 | tools.avrdude.config.path={path}/etc/avrdude.conf 96 | 97 | tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA 98 | 99 | tools.avrdude.upload.params.verbose=-v 100 | tools.avrdude.upload.params.quiet=-q -q 101 | # tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value 102 | tools.avrdude.upload.verify= 103 | tools.avrdude.upload.params.noverify=-V 104 | tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} "-P{serial.port}" -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" 105 | 106 | tools.avrdude.program.params.verbose=-v 107 | tools.avrdude.program.params.quiet=-q -q 108 | # tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value 109 | tools.avrdude.program.verify= 110 | tools.avrdude.program.params.noverify=-V 111 | tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" 112 | 113 | tools.avrdude.erase.params.verbose=-v 114 | tools.avrdude.erase.params.quiet=-q -q 115 | tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m 116 | 117 | tools.avrdude.bootloader.params.verbose=-v 118 | tools.avrdude.bootloader.params.quiet=-q -q 119 | tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m 120 | 121 | tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} 122 | 123 | tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} 124 | 125 | # USB Default Flags 126 | # Default blank usb manufacturer will be filled in at compile time 127 | # - from numeric vendor ID, set to Unknown otherwise 128 | build.usb_manufacturer="Unknown" 129 | build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' 130 | -------------------------------------------------------------------------------- /avr/variants/loraduino/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef Pins_Arduino_h 24 | #define Pins_Arduino_h 25 | 26 | #include 27 | 28 | #define NUM_DIGITAL_PINS 20 29 | #define NUM_ANALOG_INPUTS 6 30 | #define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1) 31 | 32 | #if defined(__AVR_ATmega8__) 33 | #define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11) 34 | #else 35 | #define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11) 36 | #endif 37 | 38 | #define PIN_SPI_SS (10) 39 | #define PIN_SPI_MOSI (11) 40 | #define PIN_SPI_MISO (12) 41 | #define PIN_SPI_SCK (13) 42 | 43 | static const uint8_t SS = PIN_SPI_SS; 44 | static const uint8_t MOSI = PIN_SPI_MOSI; 45 | static const uint8_t MISO = PIN_SPI_MISO; 46 | static const uint8_t SCK = PIN_SPI_SCK; 47 | 48 | #define PIN_WIRE_SDA (18) 49 | #define PIN_WIRE_SCL (19) 50 | 51 | static const uint8_t SDA = PIN_WIRE_SDA; 52 | static const uint8_t SCL = PIN_WIRE_SCL; 53 | 54 | #define LED_BUILTIN 13 55 | 56 | #define PIN_A0 (14) 57 | #define PIN_A1 (15) 58 | #define PIN_A2 (16) 59 | #define PIN_A3 (17) 60 | #define PIN_A4 (18) 61 | #define PIN_A5 (19) 62 | #define PIN_A6 (20) 63 | #define PIN_A7 (21) 64 | 65 | static const uint8_t A0 = PIN_A0; 66 | static const uint8_t A1 = PIN_A1; 67 | static const uint8_t A2 = PIN_A2; 68 | static const uint8_t A3 = PIN_A3; 69 | static const uint8_t A4 = PIN_A4; 70 | static const uint8_t A5 = PIN_A5; 71 | static const uint8_t A6 = PIN_A6; 72 | static const uint8_t A7 = PIN_A7; 73 | 74 | #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) 75 | #define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) 76 | #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) 77 | #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) 78 | 79 | #define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT)) 80 | 81 | #ifdef ARDUINO_MAIN 82 | 83 | // On the Arduino board, digital pins are also used 84 | // for the analog output (software PWM). Analog input 85 | // pins are a separate set. 86 | 87 | // ATMEL ATMEGA8 & 168 / ARDUINO 88 | // 89 | // +-\/-+ 90 | // PC6 1| |28 PC5 (AI 5) 91 | // (D 0) PD0 2| |27 PC4 (AI 4) 92 | // (D 1) PD1 3| |26 PC3 (AI 3) 93 | // (D 2) PD2 4| |25 PC2 (AI 2) 94 | // PWM+ (D 3) PD3 5| |24 PC1 (AI 1) 95 | // (D 4) PD4 6| |23 PC0 (AI 0) 96 | // VCC 7| |22 GND 97 | // GND 8| |21 AREF 98 | // PB6 9| |20 AVCC 99 | // PB7 10| |19 PB5 (D 13) 100 | // PWM+ (D 5) PD5 11| |18 PB4 (D 12) 101 | // PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM 102 | // (D 7) PD7 13| |16 PB2 (D 10) PWM 103 | // (D 8) PB0 14| |15 PB1 (D 9) PWM 104 | // +----+ 105 | // 106 | // (PWM+ indicates the additional PWM pins on the ATmega168.) 107 | 108 | // ATMEL ATMEGA1280 / ARDUINO 109 | // 110 | // 0-7 PE0-PE7 works 111 | // 8-13 PB0-PB5 works 112 | // 14-21 PA0-PA7 works 113 | // 22-29 PH0-PH7 works 114 | // 30-35 PG5-PG0 works 115 | // 36-43 PC7-PC0 works 116 | // 44-51 PJ7-PJ0 works 117 | // 52-59 PL7-PL0 works 118 | // 60-67 PD7-PD0 works 119 | // A0-A7 PF0-PF7 120 | // A8-A15 PK0-PK7 121 | 122 | 123 | // these arrays map port names (e.g. port B) to the 124 | // appropriate addresses for various functions (e.g. reading 125 | // and writing) 126 | const uint16_t PROGMEM port_to_mode_PGM[] = { 127 | NOT_A_PORT, 128 | NOT_A_PORT, 129 | (uint16_t) &DDRB, 130 | (uint16_t) &DDRC, 131 | (uint16_t) &DDRD, 132 | }; 133 | 134 | const uint16_t PROGMEM port_to_output_PGM[] = { 135 | NOT_A_PORT, 136 | NOT_A_PORT, 137 | (uint16_t) &PORTB, 138 | (uint16_t) &PORTC, 139 | (uint16_t) &PORTD, 140 | }; 141 | 142 | const uint16_t PROGMEM port_to_input_PGM[] = { 143 | NOT_A_PORT, 144 | NOT_A_PORT, 145 | (uint16_t) &PINB, 146 | (uint16_t) &PINC, 147 | (uint16_t) &PIND, 148 | }; 149 | 150 | const uint8_t PROGMEM digital_pin_to_port_PGM[] = { 151 | PD, /* 0 */ 152 | PD, 153 | PD, 154 | PD, 155 | PD, 156 | PD, 157 | PD, 158 | PD, 159 | PB, /* 8 */ 160 | PB, 161 | PB, 162 | PB, 163 | PB, 164 | PB, 165 | PC, /* 14 */ 166 | PC, 167 | PC, 168 | PC, 169 | PC, 170 | PC, 171 | }; 172 | 173 | const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { 174 | _BV(0), /* 0, port D */ 175 | _BV(1), 176 | _BV(2), 177 | _BV(3), 178 | _BV(4), 179 | _BV(5), 180 | _BV(6), 181 | _BV(7), 182 | _BV(0), /* 8, port B */ 183 | _BV(1), 184 | _BV(2), 185 | _BV(3), 186 | _BV(4), 187 | _BV(5), 188 | _BV(0), /* 14, port C */ 189 | _BV(1), 190 | _BV(2), 191 | _BV(3), 192 | _BV(4), 193 | _BV(5), 194 | }; 195 | 196 | const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { 197 | NOT_ON_TIMER, /* 0 - port D */ 198 | NOT_ON_TIMER, 199 | NOT_ON_TIMER, 200 | // on the ATmega168, digital pin 3 has hardware pwm 201 | #if defined(__AVR_ATmega8__) 202 | NOT_ON_TIMER, 203 | #else 204 | TIMER2B, 205 | #endif 206 | NOT_ON_TIMER, 207 | // on the ATmega168, digital pins 5 and 6 have hardware pwm 208 | #if defined(__AVR_ATmega8__) 209 | NOT_ON_TIMER, 210 | NOT_ON_TIMER, 211 | #else 212 | TIMER0B, 213 | TIMER0A, 214 | #endif 215 | NOT_ON_TIMER, 216 | NOT_ON_TIMER, /* 8 - port B */ 217 | TIMER1A, 218 | TIMER1B, 219 | #if defined(__AVR_ATmega8__) 220 | TIMER2, 221 | #else 222 | TIMER2A, 223 | #endif 224 | NOT_ON_TIMER, 225 | NOT_ON_TIMER, 226 | NOT_ON_TIMER, 227 | NOT_ON_TIMER, /* 14 - port C */ 228 | NOT_ON_TIMER, 229 | NOT_ON_TIMER, 230 | NOT_ON_TIMER, 231 | NOT_ON_TIMER, 232 | }; 233 | 234 | #endif 235 | 236 | // These serial port names are intended to allow libraries and architecture-neutral 237 | // sketches to automatically default to the correct port name for a particular type 238 | // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, 239 | // the first hardware serial port whose RX/TX pins are not dedicated to another use. 240 | // 241 | // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor 242 | // 243 | // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial 244 | // 245 | // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library 246 | // 247 | // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. 248 | // 249 | // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX 250 | // pins are NOT connected to anything by default. 251 | #define SERIAL_PORT_MONITOR Serial 252 | #define SERIAL_PORT_HARDWARE Serial 253 | 254 | 255 | // Specific LoraDuino 256 | #ifdef LED_BUILTIN 257 | #undef LED_BUILTIN 258 | #endif 259 | #define LED_BUILTIN 7 260 | #define LED_RED LED_BUILTIN 261 | #define LED_GRN LED_BUILTIN 262 | #define LED_BLU LED_BUILTIN 263 | 264 | //#define BAT_ENABLE A3 265 | #define BAT_ANALOG A7 266 | 267 | #define BTN_ACTION 5 268 | #define FLASH_CS 8 269 | 270 | #define LORA_DIO0 2 271 | #define LORA_DIO1 4 272 | #define LORA_RESET 9 273 | #define LORA_CS SS 274 | 275 | #endif 276 | 277 | -------------------------------------------------------------------------------- /avr/variants/loraradionode/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef Pins_Arduino_h 24 | #define Pins_Arduino_h 25 | 26 | #include 27 | 28 | #define NUM_DIGITAL_PINS 20 29 | #define NUM_ANALOG_INPUTS 6 30 | #define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1) 31 | 32 | #if defined(__AVR_ATmega8__) 33 | #define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11) 34 | #else 35 | #define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11) 36 | #endif 37 | 38 | #define PIN_SPI_SS (10) 39 | #define PIN_SPI_MOSI (11) 40 | #define PIN_SPI_MISO (12) 41 | #define PIN_SPI_SCK (13) 42 | 43 | static const uint8_t SS = PIN_SPI_SS; 44 | static const uint8_t MOSI = PIN_SPI_MOSI; 45 | static const uint8_t MISO = PIN_SPI_MISO; 46 | static const uint8_t SCK = PIN_SPI_SCK; 47 | 48 | #define PIN_WIRE_SDA (18) 49 | #define PIN_WIRE_SCL (19) 50 | 51 | static const uint8_t SDA = PIN_WIRE_SDA; 52 | static const uint8_t SCL = PIN_WIRE_SCL; 53 | 54 | #define LED_BUILTIN 13 55 | 56 | #define PIN_A0 (14) 57 | #define PIN_A1 (15) 58 | #define PIN_A2 (16) 59 | #define PIN_A3 (17) 60 | #define PIN_A4 (18) 61 | #define PIN_A5 (19) 62 | #define PIN_A6 (20) 63 | #define PIN_A7 (21) 64 | 65 | static const uint8_t A0 = PIN_A0; 66 | static const uint8_t A1 = PIN_A1; 67 | static const uint8_t A2 = PIN_A2; 68 | static const uint8_t A3 = PIN_A3; 69 | static const uint8_t A4 = PIN_A4; 70 | static const uint8_t A5 = PIN_A5; 71 | static const uint8_t A6 = PIN_A6; 72 | static const uint8_t A7 = PIN_A7; 73 | 74 | #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) 75 | #define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) 76 | #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) 77 | #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) 78 | 79 | #define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT)) 80 | 81 | #ifdef ARDUINO_MAIN 82 | 83 | // On the Arduino board, digital pins are also used 84 | // for the analog output (software PWM). Analog input 85 | // pins are a separate set. 86 | 87 | // ATMEL ATMEGA8 & 168 / ARDUINO 88 | // 89 | // +-\/-+ 90 | // PC6 1| |28 PC5 (AI 5) 91 | // (D 0) PD0 2| |27 PC4 (AI 4) 92 | // (D 1) PD1 3| |26 PC3 (AI 3) 93 | // (D 2) PD2 4| |25 PC2 (AI 2) 94 | // PWM+ (D 3) PD3 5| |24 PC1 (AI 1) 95 | // (D 4) PD4 6| |23 PC0 (AI 0) 96 | // VCC 7| |22 GND 97 | // GND 8| |21 AREF 98 | // PB6 9| |20 AVCC 99 | // PB7 10| |19 PB5 (D 13) 100 | // PWM+ (D 5) PD5 11| |18 PB4 (D 12) 101 | // PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM 102 | // (D 7) PD7 13| |16 PB2 (D 10) PWM 103 | // (D 8) PB0 14| |15 PB1 (D 9) PWM 104 | // +----+ 105 | // 106 | // (PWM+ indicates the additional PWM pins on the ATmega168.) 107 | 108 | // ATMEL ATMEGA1280 / ARDUINO 109 | // 110 | // 0-7 PE0-PE7 works 111 | // 8-13 PB0-PB5 works 112 | // 14-21 PA0-PA7 works 113 | // 22-29 PH0-PH7 works 114 | // 30-35 PG5-PG0 works 115 | // 36-43 PC7-PC0 works 116 | // 44-51 PJ7-PJ0 works 117 | // 52-59 PL7-PL0 works 118 | // 60-67 PD7-PD0 works 119 | // A0-A7 PF0-PF7 120 | // A8-A15 PK0-PK7 121 | 122 | 123 | // these arrays map port names (e.g. port B) to the 124 | // appropriate addresses for various functions (e.g. reading 125 | // and writing) 126 | const uint16_t PROGMEM port_to_mode_PGM[] = { 127 | NOT_A_PORT, 128 | NOT_A_PORT, 129 | (uint16_t) &DDRB, 130 | (uint16_t) &DDRC, 131 | (uint16_t) &DDRD, 132 | }; 133 | 134 | const uint16_t PROGMEM port_to_output_PGM[] = { 135 | NOT_A_PORT, 136 | NOT_A_PORT, 137 | (uint16_t) &PORTB, 138 | (uint16_t) &PORTC, 139 | (uint16_t) &PORTD, 140 | }; 141 | 142 | const uint16_t PROGMEM port_to_input_PGM[] = { 143 | NOT_A_PORT, 144 | NOT_A_PORT, 145 | (uint16_t) &PINB, 146 | (uint16_t) &PINC, 147 | (uint16_t) &PIND, 148 | }; 149 | 150 | const uint8_t PROGMEM digital_pin_to_port_PGM[] = { 151 | PD, /* 0 */ 152 | PD, 153 | PD, 154 | PD, 155 | PD, 156 | PD, 157 | PD, 158 | PD, 159 | PB, /* 8 */ 160 | PB, 161 | PB, 162 | PB, 163 | PB, 164 | PB, 165 | PC, /* 14 */ 166 | PC, 167 | PC, 168 | PC, 169 | PC, 170 | PC, 171 | }; 172 | 173 | const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { 174 | _BV(0), /* 0, port D */ 175 | _BV(1), 176 | _BV(2), 177 | _BV(3), 178 | _BV(4), 179 | _BV(5), 180 | _BV(6), 181 | _BV(7), 182 | _BV(0), /* 8, port B */ 183 | _BV(1), 184 | _BV(2), 185 | _BV(3), 186 | _BV(4), 187 | _BV(5), 188 | _BV(0), /* 14, port C */ 189 | _BV(1), 190 | _BV(2), 191 | _BV(3), 192 | _BV(4), 193 | _BV(5), 194 | }; 195 | 196 | const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { 197 | NOT_ON_TIMER, /* 0 - port D */ 198 | NOT_ON_TIMER, 199 | NOT_ON_TIMER, 200 | // on the ATmega168, digital pin 3 has hardware pwm 201 | #if defined(__AVR_ATmega8__) 202 | NOT_ON_TIMER, 203 | #else 204 | TIMER2B, 205 | #endif 206 | NOT_ON_TIMER, 207 | // on the ATmega168, digital pins 5 and 6 have hardware pwm 208 | #if defined(__AVR_ATmega8__) 209 | NOT_ON_TIMER, 210 | NOT_ON_TIMER, 211 | #else 212 | TIMER0B, 213 | TIMER0A, 214 | #endif 215 | NOT_ON_TIMER, 216 | NOT_ON_TIMER, /* 8 - port B */ 217 | TIMER1A, 218 | TIMER1B, 219 | #if defined(__AVR_ATmega8__) 220 | TIMER2, 221 | #else 222 | TIMER2A, 223 | #endif 224 | NOT_ON_TIMER, 225 | NOT_ON_TIMER, 226 | NOT_ON_TIMER, 227 | NOT_ON_TIMER, /* 14 - port C */ 228 | NOT_ON_TIMER, 229 | NOT_ON_TIMER, 230 | NOT_ON_TIMER, 231 | NOT_ON_TIMER, 232 | }; 233 | 234 | #endif 235 | 236 | // These serial port names are intended to allow libraries and architecture-neutral 237 | // sketches to automatically default to the correct port name for a particular type 238 | // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, 239 | // the first hardware serial port whose RX/TX pins are not dedicated to another use. 240 | // 241 | // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor 242 | // 243 | // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial 244 | // 245 | // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library 246 | // 247 | // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. 248 | // 249 | // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX 250 | // pins are NOT connected to anything by default. 251 | #define SERIAL_PORT_MONITOR Serial 252 | #define SERIAL_PORT_HARDWARE Serial 253 | 254 | 255 | // Specific LoRa Radio Node 256 | #define LED_RED 13 257 | #define LED_GRN 13 258 | #define LED_BLU 13 259 | 260 | #define LORA_DIO0 2 261 | #define LORA_DIO1 5 262 | #define LORA_DIO2 6 263 | #define LORA_DIO3 7 264 | #define LORA_DIO5 8 265 | #define LORA_RESET 9 266 | #define LORA_CS SS 267 | 268 | #endif 269 | -------------------------------------------------------------------------------- /avr/variants/mega1284p/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | Changelog 23 | ----------- 24 | 11/25/11 - ryan@ryanmsutton.com - Add pins for Sanguino 644P and 1284P 25 | 07/15/12 - ryan@ryanmsutton.com - Updated for arduino0101 26 | 12/24/16 - bob.kuhn@att.net - add 1284 PWMs 27 | 28 | Improvements by Kristian Sloth Lauszus, lauszus@gmail.com 29 | */ 30 | 31 | #ifndef Pins_Arduino_h 32 | #define Pins_Arduino_h 33 | 34 | #include 35 | 36 | #define PIN_SPI_SS (4) 37 | #define PIN_SPI_MOSI (5) 38 | #define PIN_SPI_MISO (6) 39 | #define PIN_SPI_SCK (7) 40 | 41 | static const uint8_t SS = PIN_SPI_SS; 42 | static const uint8_t MOSI = PIN_SPI_MOSI; 43 | static const uint8_t MISO = PIN_SPI_MISO; 44 | static const uint8_t SCK = PIN_SPI_SCK; 45 | 46 | #define PIN_WIRE_SDA (17) 47 | #define PIN_WIRE_SCL (16) 48 | 49 | static const uint8_t SDA = PIN_WIRE_SDA; 50 | static const uint8_t SCL = PIN_WIRE_SCL; 51 | 52 | #define PIN_A0 (31) 53 | #define PIN_A1 (30) 54 | #define PIN_A2 (29) 55 | #define PIN_A3 (28) 56 | #define PIN_A4 (27) 57 | #define PIN_A5 (26) 58 | #define PIN_A6 (25) 59 | #define PIN_A7 (24) 60 | 61 | static const uint8_t A0 = PIN_A0; 62 | static const uint8_t A1 = PIN_A1; 63 | static const uint8_t A2 = PIN_A2; 64 | static const uint8_t A3 = PIN_A3; 65 | static const uint8_t A4 = PIN_A4; 66 | static const uint8_t A5 = PIN_A5; 67 | static const uint8_t A6 = PIN_A6; 68 | static const uint8_t A7 = PIN_A7; 69 | 70 | // ATMEL ATMEGA1284P / ISYBOX 71 | // 72 | // +---\/---+ 73 | // (D 0) PB0 1| |40 PA0 (AI 0 / D31) 74 | // (D 1) PB1 2| |39 PA1 (AI 1 / D30) 75 | // INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D29) 76 | // PWM (D 3) PB3 4| |37 PA3 (AI 3 / D28) 77 | // SS PWM (D 4) PB4 5| |36 PA4 (AI 4 / D27) 78 | // MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D26) 79 | // MISO (D 6) PB6 7| |34 PA6 (AI 6 / D25) 80 | // SCK (D 7) PB7 8| |33 PA7 (AI 7 / D24) 81 | // RST 9| |32 AREF 82 | // VCC 10| |31 GND 83 | // GND 11| |30 AVCC 84 | // XTAL2 12| |29 PC7 (D 23) 85 | // XTAL1 13| |28 PC6 (D 22) 86 | // RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI 87 | // TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO 88 | // INT0 RX1 (D 10) PD2 16| |25 PC3 (D 19) TMS 89 | // INT1 TX1 (D 11) PD3 17| |24 PC2 (D 18) TCK 90 | // PWM (D 12) PD4 18| |23 PC1 (D 17) SDA 91 | // PWM (D 13) PD5 19| |22 PC0 (D 16) SCL 92 | // PWM (D 14) PD6 20| |21 PD7 (D 15) PWM 93 | // +--------+ 94 | // 95 | #define NUM_DIGITAL_PINS 32 96 | #define NUM_ANALOG_INPUTS 8 97 | 98 | #define analogInputToDigitalPin(p) ((p < 8) ? 31 - (p): -1) 99 | #define analogPinToChannel(p) ((p) < 8 ? (p) : (p) >= 24 ? 31 - (p) : -1) 100 | 101 | #if defined(TCCR3A) 102 | #define digitalPinHasPWM(p) ((p) == 3 || (p) == 4 || (p) == 6 || (p) == 7 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15) 103 | #else 104 | #define digitalPinHasPWM(p) ((p) == 3 || (p) == 4 || (p) == 12 || (p) == 13 || (p) == 14 || (p) == 15) 105 | #endif 106 | 107 | #define digitalPinToPCICR(p) ( (((p) >= 0) && ((p) <= 31)) ? (&PCICR) : ((uint8_t *)0) ) 108 | 109 | #define digitalPinToPCICRbit(p) ( (((p) >= 24) && ((p) <= 31)) ? 0 : \ 110 | ( (((p) >= 0) && ((p) <= 7)) ? 1 : \ 111 | ( (((p) >= 16) && ((p) <= 23)) ? 2 : \ 112 | ( (((p) >= 8) && ((p) <= 15)) ? 3 : \ 113 | 0 ) ) ) ) 114 | 115 | #define digitalPinToPCMSK(p) ( (((p) >= 24) && ((p) <= 31)) ? (&PCMSK0) : \ 116 | ( (((p) >= 0) && ((p) <= 7)) ? (&PCMSK1) : \ 117 | ( (((p) >= 16) && ((p) <= 23)) ? (&PCMSK2) : \ 118 | ( (((p) >= 8) && ((p) <= 15)) ? (&PCMSK3) : \ 119 | ((uint8_t *)0) ) ) ) ) 120 | 121 | 122 | #define digitalPinToPCMSKbit(p) ( (((p) >= 24) && ((p) <= 31)) ? (31 - (p)) : \ 123 | ( (((p) >= 0) && ((p) <= 7)) ? (p) : \ 124 | ( (((p) >= 16) && ((p) <= 23)) ? ((p) - 16) : \ 125 | ( (((p) >= 8) && ((p) <= 15)) ? ((p) - 8) : \ 126 | 0 ) ) ) ) 127 | 128 | #define digitalPinToInterrupt(p) ((p) == 10 ? 0 : ((p) == 11 ? 1 : ((p) == 2 ? 2 : NOT_AN_INTERRUPT))) 129 | 130 | #ifdef ARDUINO_MAIN 131 | // these arrays map port names (e.g. port B) to the 132 | // appropriate addresses for various functions (e.g. reading 133 | // and writing) 134 | const uint16_t PROGMEM port_to_mode_PGM[] = 135 | { 136 | NOT_A_PORT, 137 | (uint16_t) &DDRA, 138 | (uint16_t) &DDRB, 139 | (uint16_t) &DDRC, 140 | (uint16_t) &DDRD, 141 | }; 142 | 143 | const uint16_t PROGMEM port_to_output_PGM[] = 144 | { 145 | NOT_A_PORT, 146 | (uint16_t) &PORTA, 147 | (uint16_t) &PORTB, 148 | (uint16_t) &PORTC, 149 | (uint16_t) &PORTD, 150 | }; 151 | const uint16_t PROGMEM port_to_input_PGM[] = 152 | { 153 | NOT_A_PORT, 154 | (uint16_t) &PINA, 155 | (uint16_t) &PINB, 156 | (uint16_t) &PINC, 157 | (uint16_t) &PIND, 158 | }; 159 | const uint8_t PROGMEM digital_pin_to_port_PGM[] = 160 | { 161 | PB, /* 0 */ 162 | PB, 163 | PB, 164 | PB, 165 | PB, 166 | PB, 167 | PB, 168 | PB, 169 | PD, /* 8 */ 170 | PD, 171 | PD, 172 | PD, 173 | PD, 174 | PD, 175 | PD, 176 | PD, 177 | PC, /* 16 */ 178 | PC, 179 | PC, 180 | PC, 181 | PC, 182 | PC, 183 | PC, 184 | PC, 185 | PA, /* 24 */ 186 | PA, 187 | PA, 188 | PA, 189 | PA, 190 | PA, 191 | PA, 192 | PA /* 31 */ 193 | }; 194 | const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = 195 | { 196 | _BV(0), /* 0, port B */ 197 | _BV(1), 198 | _BV(2), 199 | _BV(3), 200 | _BV(4), 201 | _BV(5), 202 | _BV(6), 203 | _BV(7), 204 | _BV(0), /* 8, port D */ 205 | _BV(1), 206 | _BV(2), 207 | _BV(3), 208 | _BV(4), 209 | _BV(5), 210 | _BV(6), 211 | _BV(7), 212 | _BV(0), /* 16, port C */ 213 | _BV(1), 214 | _BV(2), 215 | _BV(3), 216 | _BV(4), 217 | _BV(5), 218 | _BV(6), 219 | _BV(7), 220 | _BV(7), /* 24, port A */ 221 | _BV(6), 222 | _BV(5), 223 | _BV(4), 224 | _BV(3), 225 | _BV(2), 226 | _BV(1), 227 | _BV(0) 228 | }; 229 | const uint8_t PROGMEM digital_pin_to_timer_PGM[] = 230 | { 231 | NOT_ON_TIMER, /* 0 - PB0 */ 232 | NOT_ON_TIMER, /* 1 - PB1 */ 233 | NOT_ON_TIMER, /* 2 - PB2 */ 234 | TIMER0A, /* 3 - PB3 */ 235 | TIMER0B, /* 4 - PB4 */ 236 | NOT_ON_TIMER, /* 5 - PB5 */ 237 | #if defined(TCCR3A) 238 | TIMER3A, /* 6 - PB6 */ 239 | TIMER3B, /* 7 - PB7 */ 240 | #else 241 | NOT_ON_TIMER, /* 6 - PB6 */ 242 | NOT_ON_TIMER, /* 7 - PB7 */ 243 | #endif 244 | NOT_ON_TIMER, /* 8 - PD0 */ 245 | NOT_ON_TIMER, /* 9 - PD1 */ 246 | NOT_ON_TIMER, /* 10 - PD2 */ 247 | NOT_ON_TIMER, /* 11 - PD3 */ 248 | TIMER1B, /* 12 - PD4 */ 249 | TIMER1A, /* 13 - PD5 */ 250 | TIMER2B, /* 14 - PD6 */ 251 | TIMER2A, /* 15 - PD7 */ 252 | NOT_ON_TIMER, /* 16 - PC0 */ 253 | NOT_ON_TIMER, /* 17 - PC1 */ 254 | NOT_ON_TIMER, /* 18 - PC2 */ 255 | NOT_ON_TIMER, /* 19 - PC3 */ 256 | NOT_ON_TIMER, /* 20 - PC4 */ 257 | NOT_ON_TIMER, /* 21 - PC5 */ 258 | NOT_ON_TIMER, /* 22 - PC6 */ 259 | NOT_ON_TIMER, /* 23 - PC7 */ 260 | NOT_ON_TIMER, /* 24 - PA0 */ 261 | NOT_ON_TIMER, /* 25 - PA1 */ 262 | NOT_ON_TIMER, /* 26 - PA2 */ 263 | NOT_ON_TIMER, /* 27 - PA3 */ 264 | NOT_ON_TIMER, /* 28 - PA4 */ 265 | NOT_ON_TIMER, /* 29 - PA5 */ 266 | NOT_ON_TIMER, /* 30 - PA6 */ 267 | NOT_ON_TIMER /* 31 - PA7 */ 268 | }; 269 | #endif 270 | 271 | // These serial port names are intended to allow libraries and architecture-neutral 272 | // sketches to automatically default to the correct port name for a particular type 273 | // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, 274 | // the first hardware serial port whose RX/TX pins are not dedicated to another use. 275 | // 276 | // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor 277 | // 278 | // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial 279 | // 280 | // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library 281 | // 282 | // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. 283 | // 284 | // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX 285 | // pins are NOT connected to anything by default. 286 | 287 | #define SERIAL_PORT_MONITOR Serial 288 | #define SERIAL_PORT_HARDWARE Serial 289 | 290 | #if defined(UBRR1H) 291 | #define SERIAL_PORT_HARDWARE1 Serial1 292 | #define SERIAL_PORT_HARDWARE_OPEN Serial1 293 | #endif 294 | 295 | #endif 296 | -------------------------------------------------------------------------------- /avr/variants/minilora/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | pins_arduino.h - Pin definition functions for Arduino 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2007 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef Pins_Arduino_h 24 | #define Pins_Arduino_h 25 | 26 | #include 27 | 28 | #define NUM_DIGITAL_PINS 20 29 | #define NUM_ANALOG_INPUTS 6 30 | #define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1) 31 | 32 | #if defined(__AVR_ATmega8__) 33 | #define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11) 34 | #else 35 | #define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11) 36 | #endif 37 | 38 | #define PIN_SPI_SS (10) 39 | #define PIN_SPI_MOSI (11) 40 | #define PIN_SPI_MISO (12) 41 | #define PIN_SPI_SCK (13) 42 | 43 | static const uint8_t SS = PIN_SPI_SS; 44 | static const uint8_t MOSI = PIN_SPI_MOSI; 45 | static const uint8_t MISO = PIN_SPI_MISO; 46 | static const uint8_t SCK = PIN_SPI_SCK; 47 | 48 | #define PIN_WIRE_SDA (18) 49 | #define PIN_WIRE_SCL (19) 50 | 51 | static const uint8_t SDA = PIN_WIRE_SDA; 52 | static const uint8_t SCL = PIN_WIRE_SCL; 53 | 54 | #define LED_BUILTIN 13 55 | 56 | #define PIN_A0 (14) 57 | #define PIN_A1 (15) 58 | #define PIN_A2 (16) 59 | #define PIN_A3 (17) 60 | #define PIN_A4 (18) 61 | #define PIN_A5 (19) 62 | #define PIN_A6 (20) 63 | #define PIN_A7 (21) 64 | 65 | static const uint8_t A0 = PIN_A0; 66 | static const uint8_t A1 = PIN_A1; 67 | static const uint8_t A2 = PIN_A2; 68 | static const uint8_t A3 = PIN_A3; 69 | static const uint8_t A4 = PIN_A4; 70 | static const uint8_t A5 = PIN_A5; 71 | static const uint8_t A6 = PIN_A6; 72 | static const uint8_t A7 = PIN_A7; 73 | 74 | #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) 75 | #define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) 76 | #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) 77 | #define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) 78 | 79 | #define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT)) 80 | 81 | #ifdef ARDUINO_MAIN 82 | 83 | // On the Arduino board, digital pins are also used 84 | // for the analog output (software PWM). Analog input 85 | // pins are a separate set. 86 | 87 | // ATMEL ATMEGA8 & 168 / ARDUINO 88 | // 89 | // +-\/-+ 90 | // PC6 1| |28 PC5 (AI 5) 91 | // (D 0) PD0 2| |27 PC4 (AI 4) 92 | // (D 1) PD1 3| |26 PC3 (AI 3) 93 | // (D 2) PD2 4| |25 PC2 (AI 2) 94 | // PWM+ (D 3) PD3 5| |24 PC1 (AI 1) 95 | // (D 4) PD4 6| |23 PC0 (AI 0) 96 | // VCC 7| |22 GND 97 | // GND 8| |21 AREF 98 | // PB6 9| |20 AVCC 99 | // PB7 10| |19 PB5 (D 13) 100 | // PWM+ (D 5) PD5 11| |18 PB4 (D 12) 101 | // PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM 102 | // (D 7) PD7 13| |16 PB2 (D 10) PWM 103 | // (D 8) PB0 14| |15 PB1 (D 9) PWM 104 | // +----+ 105 | // 106 | // (PWM+ indicates the additional PWM pins on the ATmega168.) 107 | 108 | // ATMEL ATMEGA1280 / ARDUINO 109 | // 110 | // 0-7 PE0-PE7 works 111 | // 8-13 PB0-PB5 works 112 | // 14-21 PA0-PA7 works 113 | // 22-29 PH0-PH7 works 114 | // 30-35 PG5-PG0 works 115 | // 36-43 PC7-PC0 works 116 | // 44-51 PJ7-PJ0 works 117 | // 52-59 PL7-PL0 works 118 | // 60-67 PD7-PD0 works 119 | // A0-A7 PF0-PF7 120 | // A8-A15 PK0-PK7 121 | 122 | 123 | // these arrays map port names (e.g. port B) to the 124 | // appropriate addresses for various functions (e.g. reading 125 | // and writing) 126 | const uint16_t PROGMEM port_to_mode_PGM[] = { 127 | NOT_A_PORT, 128 | NOT_A_PORT, 129 | (uint16_t) &DDRB, 130 | (uint16_t) &DDRC, 131 | (uint16_t) &DDRD, 132 | }; 133 | 134 | const uint16_t PROGMEM port_to_output_PGM[] = { 135 | NOT_A_PORT, 136 | NOT_A_PORT, 137 | (uint16_t) &PORTB, 138 | (uint16_t) &PORTC, 139 | (uint16_t) &PORTD, 140 | }; 141 | 142 | const uint16_t PROGMEM port_to_input_PGM[] = { 143 | NOT_A_PORT, 144 | NOT_A_PORT, 145 | (uint16_t) &PINB, 146 | (uint16_t) &PINC, 147 | (uint16_t) &PIND, 148 | }; 149 | 150 | const uint8_t PROGMEM digital_pin_to_port_PGM[] = { 151 | PD, /* 0 */ 152 | PD, 153 | PD, 154 | PD, 155 | PD, 156 | PD, 157 | PD, 158 | PD, 159 | PB, /* 8 */ 160 | PB, 161 | PB, 162 | PB, 163 | PB, 164 | PB, 165 | PC, /* 14 */ 166 | PC, 167 | PC, 168 | PC, 169 | PC, 170 | PC, 171 | }; 172 | 173 | const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { 174 | _BV(0), /* 0, port D */ 175 | _BV(1), 176 | _BV(2), 177 | _BV(3), 178 | _BV(4), 179 | _BV(5), 180 | _BV(6), 181 | _BV(7), 182 | _BV(0), /* 8, port B */ 183 | _BV(1), 184 | _BV(2), 185 | _BV(3), 186 | _BV(4), 187 | _BV(5), 188 | _BV(0), /* 14, port C */ 189 | _BV(1), 190 | _BV(2), 191 | _BV(3), 192 | _BV(4), 193 | _BV(5), 194 | }; 195 | 196 | const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { 197 | NOT_ON_TIMER, /* 0 - port D */ 198 | NOT_ON_TIMER, 199 | NOT_ON_TIMER, 200 | // on the ATmega168, digital pin 3 has hardware pwm 201 | #if defined(__AVR_ATmega8__) 202 | NOT_ON_TIMER, 203 | #else 204 | TIMER2B, 205 | #endif 206 | NOT_ON_TIMER, 207 | // on the ATmega168, digital pins 5 and 6 have hardware pwm 208 | #if defined(__AVR_ATmega8__) 209 | NOT_ON_TIMER, 210 | NOT_ON_TIMER, 211 | #else 212 | TIMER0B, 213 | TIMER0A, 214 | #endif 215 | NOT_ON_TIMER, 216 | NOT_ON_TIMER, /* 8 - port B */ 217 | TIMER1A, 218 | TIMER1B, 219 | #if defined(__AVR_ATmega8__) 220 | TIMER2, 221 | #else 222 | TIMER2A, 223 | #endif 224 | NOT_ON_TIMER, 225 | NOT_ON_TIMER, 226 | NOT_ON_TIMER, 227 | NOT_ON_TIMER, /* 14 - port C */ 228 | NOT_ON_TIMER, 229 | NOT_ON_TIMER, 230 | NOT_ON_TIMER, 231 | NOT_ON_TIMER, 232 | }; 233 | 234 | #endif 235 | 236 | // These serial port names are intended to allow libraries and architecture-neutral 237 | // sketches to automatically default to the correct port name for a particular type 238 | // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, 239 | // the first hardware serial port whose RX/TX pins are not dedicated to another use. 240 | // 241 | // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor 242 | // 243 | // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial 244 | // 245 | // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library 246 | // 247 | // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. 248 | // 249 | // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX 250 | // pins are NOT connected to anything by default. 251 | #define SERIAL_PORT_MONITOR Serial 252 | #define SERIAL_PORT_HARDWARE Serial 253 | 254 | 255 | // Specific Mini Lora 256 | #ifdef LED_BUILTIN 257 | #define LED_ON_BOARD LED_BUILTIN 258 | #endif 259 | 260 | #define LED_RED 9 261 | #define LED_GRN 6 262 | #define LED_BLU 5 263 | #define LED_PWM 264 | 265 | #define BTN_ACTION 3 266 | 267 | #define LORA_DIO0 2 268 | #define LORA_DIO1 7 269 | #define LORA_DIO2 8 270 | #define LORA_RESET 9 271 | #define LORA_CS SS 272 | 273 | #endif 274 | --------------------------------------------------------------------------------