├── hardware
├── wattuino.fzpz
├── Wattuino-RC_v10.jpg
├── Wattuino-RC_v10.pdf
├── Wattuino-Uno_v10.jpg
├── Wattuino-Uno_v10.pdf
├── Wattuino-Uno_v11.jpg
├── Wattuino-Uno_v11.pdf
├── Wattuino-Nanite85_v10.jpg
├── Wattuino-Nanite85_v10.pdf
├── Wattuino-Nanite85_v11.jpg
├── Wattuino-Nanite85_v11.pdf
├── Wattuino-Pro-Mini_ISP.jpg
├── Wattuino-Pro-Mini_v10.jpg
├── Wattuino-Pro-Mini_v10.pdf
├── Wattuino-Pro-Mini_v10.zip
├── Wattuino-Nanite841_v10.jpg
├── Wattuino-Nanite841_v10.pdf
├── Wattuino-Nanite841_v11.jpg
├── Wattuino-Nanite841_v11.pdf
├── Wattuino-Pro-Mini-PB_v10.jpg
├── Wattuino-Pro-Mini-PB_v10.pdf
└── Wattuino-Pro-Mini_Pins.jpg
├── software
├── Optiboot
│ ├── Makefile
│ ├── blink
│ │ ├── Makefile
│ │ ├── blink.pnproj
│ │ ├── blink.hex
│ │ └── blink.c
│ ├── optiboot.pnproj
│ ├── OptiLoader
│ │ ├── Readme.txt
│ │ └── OptiLoader.h
│ ├── README.md
│ ├── optiboot_m328p.hex
│ ├── optiboot_m328pb.hex
│ ├── optiboot_m328p_wdt250ms.hex
│ ├── optiboot_m328p_wdt500ms.hex
│ ├── optiboot_m328pb_wdt250ms.hex
│ ├── optiboot_m328pb_wdt500ms.hex
│ ├── stk500.h
│ ├── optiboot_m328p_blink.hex
│ └── optiboot_m328pb_blink.hex
├── SAM-BAR
│ ├── driver.zip
│ ├── src
│ │ ├── ASF
│ │ │ ├── thirdparty
│ │ │ │ └── CMSIS
│ │ │ │ │ ├── Lib
│ │ │ │ │ ├── GCC
│ │ │ │ │ │ └── libarm_cortexM0l_math.a
│ │ │ │ │ └── license.txt
│ │ │ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf
│ │ │ │ │ ├── ATMEL-disclaimer.txt
│ │ │ │ │ └── README.txt
│ │ │ ├── common
│ │ │ │ ├── services
│ │ │ │ │ └── usb
│ │ │ │ │ │ ├── class
│ │ │ │ │ │ ├── composite
│ │ │ │ │ │ │ └── device
│ │ │ │ │ │ │ │ └── udi_composite_conf.h
│ │ │ │ │ │ └── msc
│ │ │ │ │ │ │ └── usb_protocol_msc.h
│ │ │ │ │ │ └── udc
│ │ │ │ │ │ ├── udi.h
│ │ │ │ │ │ └── udc_desc.h
│ │ │ │ └── utils
│ │ │ │ │ ├── interrupt
│ │ │ │ │ └── interrupt_sam_nvic.c
│ │ │ │ │ └── interrupt.h
│ │ │ └── sam0
│ │ │ │ ├── drivers
│ │ │ │ ├── system
│ │ │ │ │ ├── clock
│ │ │ │ │ │ └── clock.h
│ │ │ │ │ └── system.c
│ │ │ │ └── usb
│ │ │ │ │ └── stack_interface
│ │ │ │ │ ├── usb_dual.h
│ │ │ │ │ └── usb_dual.c
│ │ │ │ └── utils
│ │ │ │ ├── preprocessor
│ │ │ │ ├── preprocessor.h
│ │ │ │ ├── stringz.h
│ │ │ │ └── tpaste.h
│ │ │ │ ├── cmsis
│ │ │ │ └── samd21
│ │ │ │ │ ├── source
│ │ │ │ │ ├── system_samd21.h
│ │ │ │ │ └── system_samd21.c
│ │ │ │ │ └── include
│ │ │ │ │ ├── instance
│ │ │ │ │ ├── pac0.h
│ │ │ │ │ ├── pac1.h
│ │ │ │ │ ├── pac2.h
│ │ │ │ │ ├── wdt.h
│ │ │ │ │ ├── dac.h
│ │ │ │ │ ├── gclk.h
│ │ │ │ │ ├── eic.h
│ │ │ │ │ ├── ac1.h
│ │ │ │ │ ├── ac.h
│ │ │ │ │ ├── nvmctrl.h
│ │ │ │ │ ├── i2s.h
│ │ │ │ │ └── pm.h
│ │ │ │ │ ├── samd21.h
│ │ │ │ │ └── component
│ │ │ │ │ └── pac.h
│ │ │ │ ├── header_files
│ │ │ │ └── io.h
│ │ │ │ ├── syscalls
│ │ │ │ └── gcc
│ │ │ │ │ └── syscalls.c
│ │ │ │ └── linker_scripts
│ │ │ │ └── samd21
│ │ │ │ └── gcc
│ │ │ │ └── samd21j18a_flash.ld
│ │ ├── config
│ │ │ ├── conf_virtual_flash_mem.h
│ │ │ ├── conf_board.h
│ │ │ └── conf_access.h
│ │ ├── sam_ba_monitor.h
│ │ ├── virtual_flash_mem.h
│ │ ├── main.h
│ │ └── asf.h
│ ├── sam-bar.componentinfo.xml
│ ├── sam-bar.atsln
│ └── README.md
├── Caterina
│ ├── driver.zip
│ ├── usb-devices.png
│ └── README.md
├── Micronucleus
│ ├── driver.zip
│ ├── commandline.zip
│ ├── README.md
│ ├── micronucleus-t85_always.hex
│ ├── micronucleus-t85_ext_reset.hex
│ ├── micronucleus-t841_always.hex
│ └── micronucleus-t841_ext_reset.hex
├── Arduino
│ ├── README.md
│ └── package_watterott_index.json
└── README.md
└── README.md
/hardware/wattuino.fzpz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/wattuino.fzpz
--------------------------------------------------------------------------------
/software/Optiboot/Makefile:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Optiboot/Makefile
--------------------------------------------------------------------------------
/software/SAM-BAR/driver.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/SAM-BAR/driver.zip
--------------------------------------------------------------------------------
/hardware/Wattuino-RC_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-RC_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-RC_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-RC_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Uno_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Uno_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Uno_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Uno_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Uno_v11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Uno_v11.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Uno_v11.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Uno_v11.pdf
--------------------------------------------------------------------------------
/software/Caterina/driver.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Caterina/driver.zip
--------------------------------------------------------------------------------
/software/Micronucleus/driver.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Micronucleus/driver.zip
--------------------------------------------------------------------------------
/software/Optiboot/blink/Makefile:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Optiboot/blink/Makefile
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite85_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite85_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite85_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite85_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite85_v11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite85_v11.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite85_v11.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite85_v11.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini_ISP.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini_ISP.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini_v10.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini_v10.zip
--------------------------------------------------------------------------------
/software/Caterina/usb-devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Caterina/usb-devices.png
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite841_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite841_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite841_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite841_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite841_v11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite841_v11.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Nanite841_v11.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Nanite841_v11.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini-PB_v10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini-PB_v10.jpg
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini-PB_v10.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini-PB_v10.pdf
--------------------------------------------------------------------------------
/hardware/Wattuino-Pro-Mini_Pins.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/hardware/Wattuino-Pro-Mini_Pins.jpg
--------------------------------------------------------------------------------
/software/Micronucleus/commandline.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/Micronucleus/commandline.zip
--------------------------------------------------------------------------------
/software/Optiboot/blink/blink.pnproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/SAM-BAR/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/watterott/Wattuino/HEAD/software/SAM-BAR/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf
--------------------------------------------------------------------------------
/software/SAM-BAR/sam-bar.componentinfo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot.pnproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/software/Arduino/README.md:
--------------------------------------------------------------------------------
1 | # Watterott Board Support Package
2 |
3 | Boards Package moved to (uninstall the old package before installing the new one):
4 |
5 | ```
6 | https://github.com/watterott/Arduino-Boards/raw/master/package_watterott_index.json
7 | ```
8 |
9 | Further infos:
10 | https://learn.watterott.com/arduino/watterott-boards/
11 |
--------------------------------------------------------------------------------
/software/Optiboot/OptiLoader/Readme.txt:
--------------------------------------------------------------------------------
1 | OptiLoader is a sketch designed for bulk programming bootloaders.
2 |
3 | Copyright (c) 2011 by Bill Westfield ("WestfW")
4 | Distributed under the terms of the "MIT OSSW License."
5 | https://github.com/WestfW/OptiLoader
6 |
7 | This project is a modified OptiLoader for ATmega328P and ATmega328PB microcontrollers.
8 |
--------------------------------------------------------------------------------
/software/README.md:
--------------------------------------------------------------------------------
1 | [Optiboot](https://github.com/watterott/Wattuino/tree/master/software/Optiboot) - ATmega328 Serial/UART Bootloader
2 |
3 | [Caterina](https://github.com/watterott/Wattuino/tree/master/software/Caterina) - ATmega32u4 USB Bootloader
4 |
5 | [Micronucleus](https://github.com/watterott/Wattuino/tree/master/software/Micronucleus) - ATtiny USB Bootloader
6 |
7 | [SAM-BAR](https://github.com/watterott/Wattuino/tree/master/software/SAM-BAR) - SAMD21 USB Bootloader
8 |
--------------------------------------------------------------------------------
/software/Optiboot/blink/blink.hex:
--------------------------------------------------------------------------------
1 | :1000000033C0000039C0000037C0000035C0000018
2 | :1000100033C0000031C000002FC000002DC0000020
3 | :100020002BC0000029C0000027C0000025C0000030
4 | :1000300023C0000021C000001FC000001DC0000040
5 | :100040001BC0000019C0000017C0000015C0000050
6 | :1000500013C0000011C000000FC000000DC0000060
7 | :100060000BC0000009C0000011241FBECFEFD8E074
8 | :10007000DEBFCDBF0DD019C0C3CF009741F0EFE96F
9 | :10008000FFE03197F1F700C000000197F6CF089527
10 | :1000900080E284B917B81AB82D9A80E991E0EDDFB3
11 | :0E00A0002D9880E991E0E9DFF7CFF894FFCFCB
12 | :00000001FF
13 |
--------------------------------------------------------------------------------
/software/Optiboot/blink/blink.c:
--------------------------------------------------------------------------------
1 | /*
2 | * blink.c - simple LED blinking for ATmega328 on PB5 (Arduino Pin 13)
3 | */
4 |
5 | #include
6 | #include
7 | #if !defined(_AVR_IOXXX_H_)
8 | # if defined(__AVR_ATmega328P__)
9 | # include
10 | # elif defined(__AVR_ATmega328PB__)
11 | # include
12 | # endif
13 | #endif
14 | #include
15 |
16 | void delay(int ms)
17 | {
18 | for(; ms!=0; ms--)
19 | {
20 | _delay_ms(1);
21 | }
22 | }
23 |
24 | int main(void)
25 | {
26 | DDRB = (1<<5); //bit 5 output, all others inputs
27 | DDRC = 0; //all inputs
28 | DDRD = 0; //all inputs
29 |
30 | while(1)
31 | {
32 | PORTB |= (1<<5); //high
33 | delay(400); //delay
34 | PORTB &= ~(1<<5); //low
35 | delay(400); //delay
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/software/SAM-BAR/sam-bar.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "sam-bar", "sam-bar.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Release|ARM = Release|ARM
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/software/Optiboot/OptiLoader/OptiLoader.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | typedef struct image {
4 | char image_name[30]; /* Ie "optiboot_diecimila.hex" */
5 | char image_chipname[12]; /* ie "atmega168" */
6 | uint16_t image_chipsig; /* Low two bytes of signature */
7 | uint8_t image_progfuses[4]; /* fuses to set during programming */
8 | uint8_t image_normfuses[4]; /* fuses to set after programming */
9 | uint8_t image_pagesize; /* page size for flash programming */
10 | char image_hexcode[1500]; /* intel hex format image (text) */
11 | } image_t;
12 |
13 | typedef struct alias {
14 | char alias_chipname[12]; /* Name of chip. ie Atmega168PA */
15 | uint16_t real_chipsig; /* Low 16 bits actual chip sig. */
16 | uint16_t alias_chipsig; /* "is the same as " */
17 | } alias_t;
18 |
19 | #define FUSE_PROT 0 /* memory protection */
20 | #define FUSE_LOW 1 /* Low fuse */
21 | #define FUSE_HIGH 2 /* High fuse */
22 | #define FUSE_EXT 3 /* Extended fuse */
23 |
24 | // Forward decl
25 | //extern const image_t PROGMEM image_328p, image_328pb;
26 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/thirdparty/CMSIS/ATMEL-disclaimer.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Only the CMSIS required parts for ASF are included here, go to the below
3 | * address for the full package:
4 | * http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php
5 | *
6 | * The library file thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a was generated by ATMEL, which
7 | * is support -mfloat-abi=softfp compiler flag, and this is also the default selection for device that
8 | * have FPU module and enabled.
9 | * If customer want to use -mfloat-abi=hard compiler flag, the project compile/link flag and link library
10 | * should be manual modified. The library thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a is used for
11 | * -mfloat-abi=hard configration.
12 | *
13 | * __CORTEX_SC is not defined for cortex-m0+, and may cause compiler warning, so the include file
14 | * thirdparty/CMSIS/Include/core_cmInstr.h was modified to void such warning.
15 | * Modified from:
16 | * #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
17 | * to:
18 | * #if (__CORTEX_M >= 0x03) || ((defined(__CORTEX_SC)) && (__CORTEX_SC >= 300))
19 | *
20 | */
21 |
--------------------------------------------------------------------------------
/software/Caterina/README.md:
--------------------------------------------------------------------------------
1 | # Caterina
2 |
3 | [Caterina](https://github.com/arduino/Arduino/tree/master/hardware/arduino/avr/bootloaders/caterina) is a small USB bootloader designed for Atmel AVR microcontrollers with USB interface (ATmega32u4).
4 | It is based on the [LUFA library](http://www.lufa-lib.org).
5 |
6 | The Caterina project is released under MIT license.
7 | Code uploaded via the bootloader is not subject to any license issues.
8 |
9 | **Credits**
10 | ```
11 | * Arduino.cc Team
12 | * LUFA (c) Dean Camera (dean [at] fourwalledcubicle [dot] com), www.lufa-lib.org
13 | ```
14 |
15 | ## USB Vendor and Product ID
16 | * VID: 0x1D50 - [Openmoko](http://wiki.openmoko.org/wiki/USB_Product_IDs) + PID: 0x60B0 - [Watterott](http://wiki.openmoko.org/wiki/USB_Product_IDs)
17 |
18 | ## ISP Pins of ATmega32U4
19 | ```
20 | MOSI: PB2
21 | MISO: PB3
22 | SCK: PB1
23 | RST: Reset
24 | ```
25 |
26 | ## Fuse Settings for ATmega32U4
27 | ```
28 | Extended: 0xCB
29 | High: 0xD8
30 | Low: 0xFF
31 | Lockbits: 0xCF (LPM and SPM prohibited in Boot Section)
32 | ```
33 |
34 | ## AVRdude Parameters for ATmega32U4
35 | ```
36 | avrdude -c avrisp2 -B 10 -p atmega32u4 -e -U flash:w:caterina_16mhz.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xCB:m -U lock:w:0xCF:m
37 | ```
38 |
--------------------------------------------------------------------------------
/software/Optiboot/README.md:
--------------------------------------------------------------------------------
1 | # Optiboot
2 |
3 | [Optiboot](https://github.com/Optiboot/optiboot) is a small serial bootloader designed for Atmel AVR microcontrollers.
4 |
5 | This project is a modified Optiboot with auto baud rate detection specially for ATmega328 microcontrollers.
6 |
7 | The Optiboot project is released under GPL license.
8 | Code uploaded via the bootloader is not subject to any license issues.
9 |
10 | **Credits**
11 | ```
12 | Although it has evolved considerably, Optiboot builds on the original work of Jason P. Kyle (stk500boot.c), Arduino group (bootloader), Spiff (1K bootloader), AVR-Libc group and Ladyada (Adaboot).
13 |
14 | Optiboot is the work of Peter Knight (aka Cathedrow). Despite some misattributions, it is not sponsored or supported by any organisation or company including Tinker London, Tinker.it! and Arduino.
15 | Maintenance of Optiboot was taken over by Bill Westfield (aka WestfW) in 2011.
16 | ```
17 |
18 | ## ISP Pins of ATmega328
19 | ```
20 | MOSI: PB3 / D11
21 | MISO: PB4 / D12
22 | SCK: PB5 / D13
23 | RST: PC6 / Reset
24 | ```
25 |
26 | ## Fuse Settings for ATmega328
27 | ```
28 | Extended: 0xFD
29 | High: 0xD6
30 | Low: 0xFF
31 | Lockbits: 0xCF (LPM and SPM prohibited in Boot Section)
32 | ```
33 |
34 | ## AVRdude Parameters for ATmega328
35 | ```
36 | avrdude -c avrisp2 -B 10 -p atmega328p -e -U flash:w:optiboot_m328p.hex:i -U lfuse:w:0xFF:m -U hfuse:w:0xD6:m -U efuse:w:0xFD:m -U lock:w:0xCF:m
37 | ```
38 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328p.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008EE0C3D0DE
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD08FE092CF7A
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328pb.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008EE0C3D0DE
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD086E192CF82
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328p_wdt250ms.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008CE0C3D0E0
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD08FE092CF7A
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328p_wdt500ms.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008DE0C3D0DF
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD08FE092CF7A
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328pb_wdt250ms.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008CE0C3D0E0
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD086E192CF82
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328pb_wdt500ms.hex:
--------------------------------------------------------------------------------
1 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
2 | :107E100009F0E6D082E08093C00088E18093C10041
3 | :107E200086E08093C20080E18093C4008DE0C3D0DF
4 | :107E300010928500109284004899FECF489BFECF97
5 | :107E400081E0809381004899FECF109281002091BB
6 | :107E50008400822F20918500922F089644E0969509
7 | :107E600087954A95E1F701978093C40098D08033B5
8 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
9 | :107E800031E1E32E8CD0813479F489D0898399D083
10 | :107E90008981823811F482E005C0813811F486E0CE
11 | :107EA00001C083E075D071C0823411F484E103C055
12 | :107EB000853419F485E08DD068C0853549F46FD0DC
13 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
14 | :107ED000863521F484E07DD080E0E4CF843609F05B
15 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
16 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
17 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
18 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
19 | :107F20000197FC01808130E0382BFA01090107BF7D
20 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
21 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
22 | :107F500071F425D024D0D82E22D033D05401F5018D
23 | :107F600085915F0115D0DA94D110F9CF0EC0853715
24 | :107F700039F427D08EE10CD085E90AD086E192CF82
25 | :107F8000813511F488E017D01CD080E101D07ACF80
26 | :107F90009091C00095FFFCCF8093C600089580911A
27 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
28 | :107FB0008091C6000895E0E6F0E098E19083808328
29 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
30 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
31 | :0C7FE000282E80E0E8DFE0E0FF27099495
32 | :0400000300007E007B
33 | :00000001FF
34 |
--------------------------------------------------------------------------------
/software/Arduino/package_watterott_index.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": [
3 | {
4 | "name": "watterott_old",
5 | "maintainer": "Watterott electronic",
6 | "websiteURL": "http://www.watterott.com",
7 | "email": "",
8 | "help": {"online": "https://github.com/watterott/Arduino-Boards"},
9 |
10 | "platforms": [
11 | {
12 | "name": "Watterott SAMD Boards (old)",
13 | "architecture": "samd",
14 | "version": "1.0.0",
15 | "category": "contributed",
16 | "help": {"online": "https://github.com/watterott/Arduino-Boards"},
17 | "url": "https://github.com/watterott/Arduino-Boards/watterott-samd.zip",
18 | "archiveFileName": "watterott-samd.zip",
19 | "size": "0",
20 | "boards": [
21 | {"name": "Moved to: https://github.com/watterott/Arduino-Boards/raw/master/package_watterott_index.json - uninstall old package before installing the new one"}
22 | ]
23 | },
24 |
25 | {
26 | "name": "Watterott AVR Boards (old)",
27 | "architecture": "avr",
28 | "version": "1.0.0",
29 | "category": "contributed",
30 | "help": {"online": "https://github.com/watterott/Arduino-Boards"},
31 | "url": "https://github.com/watterott/Arduino-Boards/watterott-avr.zip",
32 | "archiveFileName": "watterott-avr.zip",
33 | "size": "0",
34 | "boards": [
35 | {"name": "Moved to: https://github.com/watterott/Arduino-Boards/raw/master/package_watterott_index.json - uninstall old package before installing the new one"}
36 | ]
37 | }
38 | ],
39 |
40 | "tools": [
41 | ]
42 | }
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/thirdparty/CMSIS/Lib/license.txt:
--------------------------------------------------------------------------------
1 | All pre-build libraries contained in the folders "ARM" and "GCC"
2 | are guided by the following license:
3 |
4 | Copyright (C) 2009-2014 ARM Limited.
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 | - Neither the name of ARM nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without
16 | specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 | POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/thirdparty/CMSIS/README.txt:
--------------------------------------------------------------------------------
1 | * -------------------------------------------------------------------
2 | * Copyright (C) 2011-2014 ARM Limited. All rights reserved.
3 | *
4 | * Date: 17 February 2014
5 | * Revision: V4.00
6 | *
7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS)
8 | * Title: Release Note for CMSIS
9 | *
10 | * -------------------------------------------------------------------
11 |
12 |
13 | NOTE - Open the index.html file to access CMSIS documentation
14 |
15 |
16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
18 | and reduces time-to-market for new embedded applications.
19 |
20 | CMSIS is released under the terms of the end user license agreement ("CMSIS_END_USER_LICENCE_AGREEMENT.pdf").
21 | Any user of the software package is bound to the terms and conditions of the end user license agreement.
22 |
23 |
24 | You will find the following sub-directories:
25 |
26 | Documentation - Contains CMSIS documentation.
27 |
28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the
29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
30 |
31 | Include - CMSIS Core Support and CMSIS DSP Include Files.
32 |
33 | Lib - CMSIS DSP Libraries.
34 |
35 | RTOS - CMSIS RTOS API template header file.
36 |
37 | Driver - CMSIS Peripheral Driver Interface.
38 |
39 | Pack - CMSIS Software Packs.
40 | Mechanism to install software, device support, APIs, and example projects.
41 |
42 | SVD - CMSIS SVD Schema files and Conversion Utility.
43 |
--------------------------------------------------------------------------------
/software/Optiboot/stk500.h:
--------------------------------------------------------------------------------
1 | /* STK500 constants list, from AVRDUDE
2 | *
3 | * Trivial set of constants derived from Atmel App Note AVR061
4 | * Not copyrighted. Released to the public domain.
5 | */
6 |
7 | #define STK_OK 0x10
8 | #define STK_FAILED 0x11 // Not used
9 | #define STK_UNKNOWN 0x12 // Not used
10 | #define STK_NODEVICE 0x13 // Not used
11 | #define STK_INSYNC 0x14 // ' '
12 | #define STK_NOSYNC 0x15 // Not used
13 | #define ADC_CHANNEL_ERROR 0x16 // Not used
14 | #define ADC_MEASURE_OK 0x17 // Not used
15 | #define PWM_CHANNEL_ERROR 0x18 // Not used
16 | #define PWM_ADJUST_OK 0x19 // Not used
17 | #define CRC_EOP 0x20 // 'SPACE'
18 | #define STK_GET_SYNC 0x30 // '0'
19 | #define STK_GET_SIGN_ON 0x31 // '1'
20 | #define STK_SET_PARAMETER 0x40 // '@'
21 | #define STK_GET_PARAMETER 0x41 // 'A'
22 | #define STK_SET_DEVICE 0x42 // 'B'
23 | #define STK_SET_DEVICE_EXT 0x45 // 'E'
24 | #define STK_ENTER_PROGMODE 0x50 // 'P'
25 | #define STK_LEAVE_PROGMODE 0x51 // 'Q'
26 | #define STK_CHIP_ERASE 0x52 // 'R'
27 | #define STK_CHECK_AUTOINC 0x53 // 'S'
28 | #define STK_LOAD_ADDRESS 0x55 // 'U'
29 | #define STK_UNIVERSAL 0x56 // 'V'
30 | #define STK_PROG_FLASH 0x60 // '`'
31 | #define STK_PROG_DATA 0x61 // 'a'
32 | #define STK_PROG_FUSE 0x62 // 'b'
33 | #define STK_PROG_LOCK 0x63 // 'c'
34 | #define STK_PROG_PAGE 0x64 // 'd'
35 | #define STK_PROG_FUSE_EXT 0x65 // 'e'
36 | #define STK_READ_FLASH 0x70 // 'p'
37 | #define STK_READ_DATA 0x71 // 'q'
38 | #define STK_READ_FUSE 0x72 // 'r'
39 | #define STK_READ_LOCK 0x73 // 's'
40 | #define STK_READ_PAGE 0x74 // 't'
41 | #define STK_READ_SIGN 0x75 // 'u'
42 | #define STK_READ_OSCCAL 0x76 // 'v'
43 | #define STK_READ_FUSE_EXT 0x77 // 'w'
44 | #define STK_READ_OSCCAL_EXT 0x78 // 'x'
45 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328p_blink.hex:
--------------------------------------------------------------------------------
1 | :1000000033C0000039C0000037C0000035C0000018
2 | :1000100033C0000031C000002FC000002DC0000020
3 | :100020002BC0000029C0000027C0000025C0000030
4 | :1000300023C0000021C000001FC000001DC0000040
5 | :100040001BC0000019C0000017C0000015C0000050
6 | :1000500013C0000011C000000FC000000DC0000060
7 | :100060000BC0000009C0000011241FBECFEFD8E074
8 | :10007000DEBFCDBF0DD019C0C3CF009741F0EFE96F
9 | :10008000FFE03197F1F700C000000197F6CF089527
10 | :1000900080E284B917B81AB82D9A80E991E0EDDFB3
11 | :0E00A0002D9880E991E0E9DFF7CFF894FFCFCB
12 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
13 | :107E100009F0E6D082E08093C00088E18093C10041
14 | :107E200086E08093C20080E18093C4008EE0C3D0DE
15 | :107E300010928500109284004899FECF489BFECF97
16 | :107E400081E0809381004899FECF109281002091BB
17 | :107E50008400822F20918500922F089644E0969509
18 | :107E600087954A95E1F701978093C40098D08033B5
19 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
20 | :107E800031E1E32E8CD0813479F489D0898399D083
21 | :107E90008981823811F482E005C0813811F486E0CE
22 | :107EA00001C083E075D071C0823411F484E103C055
23 | :107EB000853419F485E08DD068C0853549F46FD0DC
24 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
25 | :107ED000863521F484E07DD080E0E4CF843609F05B
26 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
27 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
28 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
29 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
30 | :107F20000197FC01808130E0382BFA01090107BF7D
31 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
32 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
33 | :107F500071F425D024D0D82E22D033D05401F5018D
34 | :107F600085915F0115D0DA94D110F9CF0EC0853715
35 | :107F700039F427D08EE10CD085E90AD08FE092CF7A
36 | :107F8000813511F488E017D01CD080E101D07ACF80
37 | :107F90009091C00095FFFCCF8093C600089580911A
38 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
39 | :107FB0008091C6000895E0E6F0E098E19083808328
40 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
41 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
42 | :0C7FE000282E80E0E8DFE0E0FF27099495
43 | :0400000300007E007B
44 | :00000001FF
45 |
--------------------------------------------------------------------------------
/software/Optiboot/optiboot_m328pb_blink.hex:
--------------------------------------------------------------------------------
1 | :1000000033C0000039C0000037C0000035C0000018
2 | :1000100033C0000031C000002FC000002DC0000020
3 | :100020002BC0000029C0000027C0000025C0000030
4 | :1000300023C0000021C000001FC000001DC0000040
5 | :100040001BC0000019C0000017C0000015C0000050
6 | :1000500013C0000011C000000FC000000DC0000060
7 | :100060000BC0000009C0000011241FBECFEFD8E074
8 | :10007000DEBFCDBF0DD019C0C3CF009741F0EFE96F
9 | :10008000FFE03197F1F700C000000197F6CF089527
10 | :1000900080E284B917B81AB82D9A80E991E0EDDFB3
11 | :0E00A0002D9880E991E0E9DFF7CFF894FFCFCB
12 | :107E00001F92CDB7DEB7112484B714BE982F9D7092
13 | :107E100009F0E6D082E08093C00088E18093C10041
14 | :107E200086E08093C20080E18093C4008EE0C3D0DE
15 | :107E300010928500109284004899FECF489BFECF97
16 | :107E400081E0809381004899FECF109281002091BB
17 | :107E50008400822F20918500922F089644E0969509
18 | :107E600087954A95E1F701978093C40098D08033B5
19 | :107E7000E9F7A7D0812C912C13E001E025E0F22E48
20 | :107E800031E1E32E8CD0813479F489D0898399D083
21 | :107E90008981823811F482E005C0813811F486E0CE
22 | :107EA00001C083E075D071C0823411F484E103C055
23 | :107EB000853419F485E08DD068C0853549F46FD0DC
24 | :107EC000D82E6DD08D2C912C982A880C991C5CC0D2
25 | :107ED000863521F484E07DD080E0E4CF843609F05B
26 | :107EE00036C05DD05CD0D82E5AD0C82EA12CBB2471
27 | :107EF000B39455D0F50181935F01DE12FACF61D0C2
28 | :107F0000F5E4CF1201C0FFCFF40117BFE89507B623
29 | :107F100000FCFDCFA401A0E0B1E02C911296CD01B0
30 | :107F20000197FC01808130E0382BFA01090107BF7D
31 | :107F3000E89511244E5F5F4FDA12EFCFF401F7BEE0
32 | :107F4000E89507B600FCFDCFE7BEE8951EC0843774
33 | :107F500071F425D024D0D82E22D033D05401F5018D
34 | :107F600085915F0115D0DA94D110F9CF0EC0853715
35 | :107F700039F427D08EE10CD085E90AD086E192CF82
36 | :107F8000813511F488E017D01CD080E101D07ACF80
37 | :107F90009091C00095FFFCCF8093C600089580911A
38 | :107FA000C00087FFFCCF8091C00084FD01C0A89570
39 | :107FB0008091C6000895E0E6F0E098E19083808328
40 | :107FC0000895EDDF803219F088E0F5DFFFCF84E11E
41 | :107FD000DFCFCF93C82FE3DFC150E9F7CF91F1CFC7
42 | :0C7FE000282E80E0E8DFE0E0FF27099495
43 | :0400000300007E007B
44 | :00000001FF
45 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/services/usb/class/composite/device/udi_composite_conf.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Descriptors for an USB Composite Device MSC and HID mouse
5 | *
6 | * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _UDI_COMPOSITE_CONF_H_
48 | #define _UDI_COMPOSITE_CONF_H_
49 |
50 | #endif // _UDI_COMPOSITE_CONF_H_
51 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/drivers/system/clock/clock.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Clock Driver
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 | #ifndef SYSTEM_CLOCK_H_INCLUDED
47 | #define SYSTEM_CLOCK_H_INCLUDED
48 |
49 | #include
50 | #include
51 | #include
52 |
53 | #endif /* SYSTEM_CLOCK_H_INCLUDED */
54 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/preprocessor/preprocessor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Preprocessor utils.
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _PREPROCESSOR_H_
48 | #define _PREPROCESSOR_H_
49 |
50 | #include "tpaste.h"
51 | #include "stringz.h"
52 | #include "mrepeat.h"
53 | #include "mrecursion.h"
54 |
55 | #endif // _PREPROCESSOR_H_
56 |
--------------------------------------------------------------------------------
/software/Micronucleus/README.md:
--------------------------------------------------------------------------------
1 | # Micronucleus
2 |
3 | [Micronucleus](https://github.com/micronucleus/micronucleus) is a small USB bootloader designed for Atmel AVR ATtiny microcontrollers.
4 |
5 | The Micronucleus project is released under GPL license.
6 | Code uploaded via the bootloader is not subject to any license issues.
7 |
8 | **Credits**
9 | ```
10 | Firmware:
11 | * Micronucleus V2.x (c) 2016 T. Boescke
12 | (c) 2014 Shay Green
13 | * Original Micronucleus (c) 2012 Jenna Fox
14 | * Based on USBaspLoader-tiny85 (c) 2012 Louis Beaudoin
15 | * Based on USBaspLoader (c) 2007 OBJECTIVE DEVELOPMENT Software GmbH
16 |
17 | Commandline tool:
18 | * Original commandline tool (c) 2012 ihsan Kehribar
19 | (c) 2012 Jenna Fox
20 | * Updates for V2.x (c) 2014 T. Boescke
21 |
22 | Special Thanks:
23 | * Aaron Stone/@sodabrew for building the OS X command line tool and various fixes.
24 | * Objective Development's great V-USB bitbanging usb driver
25 | * Embedded Creations' pioneering and inspiring USBaspLoader-tiny85
26 | * Digistump for motivation and contributing the VID/PID pair
27 | * Numerous supporters for smaller bug fixes and improvements.
28 | ```
29 |
30 | ## Bootloader Activation
31 | ```
32 | ...always -> run Bootloader on every start
33 | ...ext_reset -> run Bootloader only after the reset switch is pressed
34 | ```
35 |
36 | ## ISP Pins of ATtiny85
37 | ```
38 | MOSI: PB0 / D0
39 | MISO: PB1 / D1
40 | SCK: PB2 / D2
41 | RST: PB5 / D5
42 | ```
43 |
44 | ## Fuse Settings for ATtiny85
45 | ```
46 | Extended: 0xFE
47 | High: 0xDD
48 | Low: 0xE1
49 | Lockbits: 0xFF (no memory lock)
50 | ```
51 |
52 | ## AVRdude Parameters for ATtiny85
53 | ```
54 | avrdude -c avrisp2 -B 10 -p attiny85 -e -U flash:w:micronucleus-t85_ext_reset.hex:i -U lfuse:w:0xE1:m -U hfuse:w:0xDD:m -U efuse:w:0xFE:m
55 | ```
56 |
57 | ## ISP Pins of ATtiny841
58 | ```
59 | MOSI: PA6 / D6
60 | MISO: PA5 / D5
61 | SCK: PA4 / D4
62 | RST: PB3 / D11
63 | ```
64 |
65 | ## Fuse Settings for ATtiny841
66 | ```
67 | Extended: 0xF4
68 | High: 0xDD
69 | Low: 0xE2
70 | Lockbits: 0xFF (no memory lock)
71 | ```
72 |
73 | ## AVRdude Parameters for ATtiny841
74 | ```
75 | avrdude -c avrisp2 -B 10 -p attiny841 -e -U flash:w:micronucleus-t841_ext_reset.hex:i -U lfuse:w:0xE2:m -U hfuse:w:0xDD:m -U efuse:w:0xF4:m
76 | ```
77 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/config/conf_virtual_flash_mem.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Virtual memory configuration file.
5 | *
6 | * This file contains the possible external configuration of the AT45DBX.
7 | *
8 | * Copyright (c) 2009 Atmel Corporation. All rights reserved.
9 | *
10 | * \asf_license_start
11 | *
12 | * \page License
13 | *
14 | * Redistribution and use in source and binary forms, with or without
15 | * modification, are permitted provided that the following conditions are met:
16 | *
17 | * 1. Redistributions of source code must retain the above copyright notice,
18 | * this list of conditions and the following disclaimer.
19 | *
20 | * 2. Redistributions in binary form must reproduce the above copyright notice,
21 | * this list of conditions and the following disclaimer in the documentation
22 | * and/or other materials provided with the distribution.
23 | *
24 | * 3. The name of Atmel may not be used to endorse or promote products derived
25 | * from this software without specific prior written permission.
26 | *
27 | * 4. This software may only be redistributed and used in connection with an
28 | * Atmel microcontroller product.
29 | *
30 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
31 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
33 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
34 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
38 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 | * POSSIBILITY OF SUCH DAMAGE.
41 | *
42 | * \asf_license_stop
43 | *
44 | */
45 |
46 |
47 | #ifndef _CONF_VIRTUAL_MEM_H_
48 | #define _CONF_VIRTUAL_MEM_H_
49 |
50 | #ifndef VMEM_NB_SECTOR
51 | //#warning Enter the size of Virtual Memory on internal RAM (unit 512B), using default value 4KB
52 | //! Size of Virtual Memory on internal RAM (unit 512B)
53 | #define VMEM_NB_SECTOR ((FLASH_SIZE - APP_START_ADDRESS) / 512) + 4
54 | #endif
55 |
56 | //! Choose which interface to set up, USB or RAM
57 | #define ACCESS_USB true
58 |
59 | #endif // _CONF_VIRTUAL_MEM_H_
60 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/source/system_samd21.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SYSTEM_SAMD21_H_INCLUDED_
48 | #define _SYSTEM_SAMD21_H_INCLUDED_
49 |
50 | #ifdef __cplusplus
51 | extern "C" {
52 | #endif
53 |
54 | #include
55 |
56 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
57 |
58 | void SystemInit(void);
59 | void SystemCoreClockUpdate(void);
60 |
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 |
65 | #endif /* SYSTEM_SAMD21_H_INCLUDED */
66 |
--------------------------------------------------------------------------------
/software/SAM-BAR/README.md:
--------------------------------------------------------------------------------
1 | # SAM-BAR
2 | SAM-BAR (**S**mart **A**tmel **M**icrocontroller **B**oot **A**ssistant **R**eloaded) is a Combo USB CDC+MSD Bootloader for Atmel/Microchip SAM D21 devices (ARM Cortex-M0+).
3 | It is based on the following bootloaders:
4 | * [SAM-BA (AppNote AT07175) by Atmel/Microchip (www.atmel.com)](http://www.atmel.com/images/Atmel-42366-SAM-BA-Bootloader-for-SAM-D21_ApplicationNote_AT07175.zip)
5 | * [Arduino Zero Bootloader by Arduino LLC (www.arduino.cc)](https://github.com/arduino/ArduinoCore-samd/tree/master/bootloaders/zero)
6 | * [SAMD-MSD-Bootloader by Justin Mattair (www.mattairtech.com)](https://github.com/mattairtech/SAMD-MSD-Bootloader)
7 |
8 |
9 | ## Features
10 | * SAM-BA and Arduino Zero compatible Bootloader (USB CDC/VCP)
11 | * Mass-Storage-Device Bootloader (USB MSD/MSC)
12 | * Fits in 16KB (user program start at 0x4000)
13 |
14 |
15 | ## Programming
16 | The bootloader can be flashed with an ARM SWD (Serial Wire Debug) programmer.
17 | To protect the bootloader flash section the fuse ```NVMCTRL_BOOTPROT``` has to be set to ```0x01```.
18 |
19 |
20 | ## Activation
21 | The bootloader will be activated if no user program exists or by doing two reset in 0.5s (double pressing reset switch).
22 | It can also be activated via an Arduino Sketch, when opening the serial port with 1200bps. This will erase the user program and start the bootloader.
23 |
24 |
25 | ## Usage
26 | When the bootloader is active then a new program can be loaded via the serial port (SAM-BA protocol) or via the mass storage device.
27 | For the mass storage device delete the file ```FLASH.BIN``` and then copy a new binary file ```FLASH.BIN``` to the drive.
28 | After the copy process is finished, do a reset to start the new program.
29 |
30 | On Linux/Mac the dd command can be used to write the firmware: ```dd if=NEW.BIN of=/media/BOOTLOADER/FLASH.BIN conv=notrunc```
31 |
32 | A binary file can be generated and exported in the Arduino IDE with *Sketch->Export compiled Binary* command.
33 |
34 |
35 | ## Known Issues
36 |
37 | ### Windows
38 | Sometimes the driver for the USB Bootloader is not loaded correctly.
39 | Check the driver state in the Device Manager, when the Bootloader is active (double press reset).
40 |
41 | ### Linux
42 | The Modem Manager can cause problems, because it detects Serial Ports (e.g. of the USB Bootloader) as a modem.
43 | So we recommend to uninstall/remove the Modem Manager:
44 | ```
45 | sudo apt-get uninstall modemmanager
46 | ```
47 | As alternative it is also possible to add a backlist rule for the USB device to the file ```77-mm-usb-device-blacklist.rules```.
48 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/sam_ba_monitor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Monitor functions for SAM-BA on SAM0
5 | *
6 | * Copyright (c) 2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 |
44 | #ifndef _SAM_BA_MONITOR_H_
45 | #define _SAM_BA_MONITOR_H_
46 |
47 | #define SAM_BA_VERSION "2.0 [Arduino:XYZ]"
48 |
49 | /* Selects USB as the communication interface of the monitor */
50 | #define SIZEBUFMAX 64
51 |
52 | /**
53 | * \brief Initialize the monitor
54 | *
55 | */
56 | void sam_ba_monitor_init(void);
57 |
58 | /**
59 | * Write to flash
60 | * size in bytes. Must be a multiple of 4
61 | */
62 | void flash_write_to(uint32_t *dst_addr, uint32_t *src_addr, uint32_t size);
63 |
64 | /**
65 | * Erase flash
66 | * size in bytes. should be a multiple of the row size
67 | */
68 | void flash_erase(uint32_t dst_addr, int32_t size);
69 |
70 | /**
71 | * \brief Main function of the SAM-BA Monitor
72 | *
73 | */
74 | void sam_ba_monitor_run(void);
75 |
76 | /**
77 | * \brief
78 | */
79 | void sam_ba_putdata_term(uint8_t* data, uint32_t length);
80 |
81 | /**
82 | * \brief
83 | */
84 | void call_applet(uint32_t address);
85 |
86 |
87 | #endif // _SAM_BA_MONITOR_H_
88 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac0.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC0
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_PAC0_INSTANCE_
48 | #define _SAMD21_PAC0_INSTANCE_
49 |
50 | /* ========== Register definition for PAC0 peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_PAC0_WPCLR (0x40000000U) /**< \brief (PAC0) Write Protection Clear */
53 | #define REG_PAC0_WPSET (0x40000004U) /**< \brief (PAC0) Write Protection Set */
54 | #else
55 | #define REG_PAC0_WPCLR (*(RwReg *)0x40000000U) /**< \brief (PAC0) Write Protection Clear */
56 | #define REG_PAC0_WPSET (*(RwReg *)0x40000004U) /**< \brief (PAC0) Write Protection Set */
57 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
58 |
59 | /* ========== Instance parameters for PAC0 peripheral ========== */
60 | #define PAC0_WPROT_DEFAULT_VAL 0x00000000 // PAC protection mask at reset
61 |
62 | #endif /* _SAMD21_PAC0_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac1.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC1
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_PAC1_INSTANCE_
48 | #define _SAMD21_PAC1_INSTANCE_
49 |
50 | /* ========== Register definition for PAC1 peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_PAC1_WPCLR (0x41000000U) /**< \brief (PAC1) Write Protection Clear */
53 | #define REG_PAC1_WPSET (0x41000004U) /**< \brief (PAC1) Write Protection Set */
54 | #else
55 | #define REG_PAC1_WPCLR (*(RwReg *)0x41000000U) /**< \brief (PAC1) Write Protection Clear */
56 | #define REG_PAC1_WPSET (*(RwReg *)0x41000004U) /**< \brief (PAC1) Write Protection Set */
57 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
58 |
59 | /* ========== Instance parameters for PAC1 peripheral ========== */
60 | #define PAC1_WPROT_DEFAULT_VAL 0x00000002 // PAC protection mask at reset
61 |
62 | #endif /* _SAMD21_PAC1_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC2
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_PAC2_INSTANCE_
48 | #define _SAMD21_PAC2_INSTANCE_
49 |
50 | /* ========== Register definition for PAC2 peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_PAC2_WPCLR (0x42000000U) /**< \brief (PAC2) Write Protection Clear */
53 | #define REG_PAC2_WPSET (0x42000004U) /**< \brief (PAC2) Write Protection Set */
54 | #else
55 | #define REG_PAC2_WPCLR (*(RwReg *)0x42000000U) /**< \brief (PAC2) Write Protection Clear */
56 | #define REG_PAC2_WPSET (*(RwReg *)0x42000004U) /**< \brief (PAC2) Write Protection Set */
57 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
58 |
59 | /* ========== Instance parameters for PAC2 peripheral ========== */
60 | #define PAC2_WPROT_DEFAULT_VAL 0x00800000 // PAC protection mask at reset
61 |
62 | #endif /* _SAMD21_PAC2_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/source/system_samd21.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup.
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #include "samd21.h"
48 |
49 | /**
50 | * Initial system clock frequency. The System RC Oscillator (RCSYS) provides
51 | * the source for the main clock at chip startup.
52 | */
53 | #define __SYSTEM_CLOCK (1000000)
54 |
55 | uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/
56 |
57 | /**
58 | * Initialize the system
59 | *
60 | * @brief Setup the microcontroller system.
61 | * Initialize the System and update the SystemCoreClock variable.
62 | */
63 | void SystemInit(void)
64 | {
65 | // Keep the default device state after reset
66 | SystemCoreClock = __SYSTEM_CLOCK;
67 | return;
68 | }
69 |
70 | /**
71 | * Update SystemCoreClock variable
72 | *
73 | * @brief Updates the SystemCoreClock with current core Clock
74 | * retrieved from cpu registers.
75 | */
76 | void SystemCoreClockUpdate(void)
77 | {
78 | // Not implemented
79 | SystemCoreClock = __SYSTEM_CLOCK;
80 | return;
81 | }
82 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/virtual_flash_mem.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Management of the virtual memory.
5 | * This file manages the virtual memory.
6 | *
7 | * Copyright (c) 2009 - 2013 Atmel Corporation. All rights reserved.
8 | *
9 | * \asf_license_start
10 | *
11 | * \page License
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions are met:
15 | *
16 | * 1. Redistributions of source code must retain the above copyright notice,
17 | * this list of conditions and the following disclaimer.
18 | *
19 | * 2. Redistributions in binary form must reproduce the above copyright notice,
20 | * this list of conditions and the following disclaimer in the documentation
21 | * and/or other materials provided with the distribution.
22 | *
23 | * 3. The name of Atmel may not be used to endorse or promote products derived
24 | * from this software without specific prior written permission.
25 | *
26 | * 4. This software may only be redistributed and used in connection with an
27 | * Atmel microcontroller product.
28 | *
29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 | * POSSIBILITY OF SUCH DAMAGE.
40 | *
41 | * \asf_license_stop
42 | *
43 | */
44 |
45 | #ifndef _VIRTUAL_FLASH_MEM_H_
46 | #define _VIRTUAL_FLASH_MEM_H_
47 |
48 |
49 | #include "conf_access.h"
50 |
51 | #if VIRTUAL_FLASH_MEM == ENABLE
52 |
53 | #include "ctrl_access.h"
54 |
55 | #include "VirtualFAT.h"
56 |
57 |
58 | #ifdef __cplusplus
59 | extern "C" {
60 | #endif
61 |
62 | //_____ D E F I N I T I O N S ______________________________________________
63 |
64 | #define VMEM_SECTOR_SIZE 512
65 |
66 |
67 | //---- CONTROL FUNCTIONS ----
68 |
69 | extern Ctrl_status virtual_test_unit_ready(void);
70 | extern Ctrl_status virtual_read_capacity(uint32_t *u32_nb_sector);
71 | extern bool virtual_wr_protect(void);
72 | extern bool virtual_removal(void);
73 | extern bool virtual_unload(bool unload);
74 |
75 |
76 | //---- ACCESS DATA FUNCTIONS ----
77 |
78 | // USB interface
79 | #if ACCESS_USB == true
80 | extern Ctrl_status virtual_usb_read_10 (uint32_t addr, uint16_t nb_sector);
81 | extern Ctrl_status virtual_usb_write_10(uint32_t addr, uint16_t nb_sector);
82 | #endif
83 |
84 | #ifdef __cplusplus
85 | }
86 | #endif
87 |
88 | #endif
89 |
90 |
91 | #endif // _VIRTUAL_FLASH_MEM_H_
92 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/header_files/io.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Arch file for SAM0.
5 | *
6 | * This file defines common SAM0 series.
7 | *
8 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
9 | *
10 | * \asf_license_start
11 | *
12 | * \page License
13 | *
14 | * Redistribution and use in source and binary forms, with or without
15 | * modification, are permitted provided that the following conditions are met:
16 | *
17 | * 1. Redistributions of source code must retain the above copyright notice,
18 | * this list of conditions and the following disclaimer.
19 | *
20 | * 2. Redistributions in binary form must reproduce the above copyright notice,
21 | * this list of conditions and the following disclaimer in the documentation
22 | * and/or other materials provided with the distribution.
23 | *
24 | * 3. The name of Atmel may not be used to endorse or promote products derived
25 | * from this software without specific prior written permission.
26 | *
27 | * 4. This software may only be redistributed and used in connection with an
28 | * Atmel microcontroller product.
29 | *
30 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
31 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
33 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
34 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
38 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 | * POSSIBILITY OF SUCH DAMAGE.
41 | *
42 | * \asf_license_stop
43 | *
44 | */
45 | /*
46 | * Support and FAQ: visit Atmel Support
47 | */
48 |
49 | #ifndef _SAM_IO_
50 | #define _SAM_IO_
51 |
52 | #include
53 | #include
54 | #include
55 |
56 | /* SAM D20 family */
57 | #if (SAMD20)
58 | # include "samd20.h"
59 | #endif
60 |
61 | #if (SAMD21)
62 | # include "samd21.h"
63 | #endif
64 |
65 | #if (SAMR21)
66 | # include "samr21.h"
67 | #endif
68 |
69 | #if (SAMD09)
70 | # include "samd09.h"
71 | #endif
72 |
73 | #if (SAMD10)
74 | # include "samd10.h"
75 | #endif
76 |
77 | #if (SAMD11)
78 | # include "samd11.h"
79 | #endif
80 |
81 | #if (SAML21)
82 | # include "saml21.h"
83 | #endif
84 |
85 | #if (SAML22)
86 | # include "saml22.h"
87 | #endif
88 |
89 | #if (SAMDA1)
90 | # include "samda1.h"
91 | #endif
92 |
93 | #if (SAMC20)
94 | # include "samc20.h"
95 | #endif
96 |
97 | #if (SAMC21)
98 | # include "samc21.h"
99 | #endif
100 |
101 | #if (SAMB11)
102 | # include "samb11.h"
103 | #endif
104 |
105 | #endif /* _SAM_IO_ */
106 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Wattuino
2 | Arduino compatible Boards and Modules.
3 |
4 | * [Wattuino Board Support Package](https://learn.watterott.com/arduino/watterott-boards) for Arduino IDE.
5 | * [Documentation on learn.watterott.com](https://learn.watterott.com)
6 | * Open-Source and released under the [Creative Commons Attribution Share-Alike License](https://creativecommons.org/licenses/by-sa/4.0/).
7 |
8 |
9 | ## Wattuino RC
10 | 
11 | * Microchip **SAMW25** Module (SAMD21 ARM Cortex-M0+ and WINC1500 WiFi/WLAN SoC)
12 | * USB CDC+MSC Bootloader (Arduino compatible)
13 | * 5V tolerant IOs
14 | * Dual Full-Bridge Motor Drivers (Allegro Micro A3909)
15 | * MicroUSB connector for programming/communication
16 | * PCB Size: 70mm x 50mm
17 |
18 |
19 | ## Wattuino Uno
20 | 
21 | * Microchip AVR **ATmega328P** @ 16 MHz (external resonator)
22 | * OptiBoot Bootloader with auto baud rate detection (Arduino compatible)
23 | * FTDI FT231X USB-UART-Bridge
24 | * USB-B or MicroUSB connector for programming/communication
25 | * PCB Size: 68.58mm x 53.34mm
26 |
27 |
28 | ## Wattuino Pro Mini
29 | 
30 | * Microchip AVR **ATmega328P** @ 16 MHz or 8 MHz (external resonator)
31 | * OptiBoot Bootloader with auto baud rate detection (Arduino compatible)
32 | * All pins of the AVR are available (also ADC6, ADC7)
33 | * FTDI connector for programming/communication
34 | * PCB Size: 33.02mm x 17.78mm
35 |
36 |
37 | ## Wattuino Pro Mini PB
38 | 
39 | * Microchip AVR **ATmega328PB** @ 16 MHz or 8 MHz (external resonator)
40 | * OptiBoot Bootloader with auto baud rate detection (Arduino compatible)
41 | * All pins of the AVR are available (also PE0/SDA1, PE1/SCL1, PE2/ADC6, PE3/ADC7)
42 | * FTDI connector for programming/communication
43 | * PCB Size: 33.02mm x 17.78mm
44 |
45 |
46 | ## Wattuino Nanite 841
47 | 
48 | * Microchip AVR **ATtiny841** @ 8 MHz (internal clock) with USART, SPI, I2C Slave, ADC, EEPROM
49 | * Micronucleus USB Bootloader (Arduino compatible)
50 | * Designed by [cpldcpu](https://github.com/cpldcpu)
51 | * 14-Pin DIP and pin-compatible with 14-Pin SOIC ATtiny841
52 | * MicroUSB connector for programming/communication
53 | * PCB Size: 24.13mm x 10.16mm
54 |
55 |
56 | ## Wattuino Nanite 85
57 | 
58 | * Microchip AVR **ATtiny85** @ 16.5 MHz (internal clock) with USI, ADC, EEPROM
59 | * Micronucleus USB Bootloader (Arduino compatible)
60 | * Based on the original [Nanite 85](https://github.com/cpldcpu/Nanite) design by [cpldcpu](https://github.com/cpldcpu)
61 | * Pin-compatible with 8-Pin DIP ATtiny85
62 | * MicroUSB connector for programming/communication
63 | * PCB Size: 17.46mm x 10.16mm
64 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/main.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Main functions for SAM-BAR
5 | *
6 | * Portitions of this code are:
7 | * Copyright (c) 2016-2017 Watterott electronic (www.watterott.com)
8 | * Copyright (c) 2014-2016 Justin Mattair (www.mattairtech.com)
9 | * Copyright (c) 2015 Arduino LLC (www.arduino.cc)
10 | * Copyright (c) 2011-2015 Atmel Corporation (www.atmel.com)
11 | *
12 | * \asf_license_start
13 | *
14 | * \page License
15 | *
16 | * Redistribution and use in source and binary forms, with or without modification,
17 | * are permitted provided that the following conditions are met:
18 | *
19 | * - Redistributions of source code must retain the above copyright notice, this
20 | * list of conditions and the following disclaimer.
21 | *
22 | * - Redistributions in binary form must reproduce the above copyright notice, this
23 | * list of conditions and the following disclaimer in the documentation and/or
24 | * other materials provided with the distribution.
25 | *
26 | * - Neither the name of the copyright holders nor the names of its contributors
27 | * may be used to endorse or promote products derived from this software without
28 | * specific prior written permission.
29 | *
30 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR
31 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
33 | * SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
35 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
36 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
37 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 | * POSSIBILITY OF SUCH DAMAGE.
40 | *
41 | * \asf_license_stop
42 | *
43 | */
44 |
45 | #ifndef _MAIN_H_
46 | #define _MAIN_H_
47 |
48 | #define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul)
49 | #define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS))
50 |
51 |
52 | /*! \brief Called by MSC interface
53 | * Callback running when USB Host enable MSC interface
54 | *
55 | * \retval true if MSC startup is ok
56 | */
57 | bool main_msc_enable(void);
58 |
59 | /*! \brief Called by MSC interface
60 | * Callback running when USB Host disable MSC interface
61 | */
62 | void main_msc_disable(void);
63 |
64 | /*! \brief Opens the communication port
65 | * This is called by CDC interface when USB Host enable it.
66 | *
67 | * \retval true if cdc startup is successfully done
68 | */
69 | bool main_cdc_enable(uint8_t port);
70 |
71 | /*! \brief Closes the communication port
72 | * This is called by CDC interface when USB Host disable it.
73 | */
74 | void main_cdc_disable(uint8_t port);
75 |
76 | /*! \brief USB start of frame functions
77 | * This is called on every USB frame start.
78 | */
79 | void main_sof_action(void);
80 |
81 |
82 | #endif // _MAIN_H_
83 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/preprocessor/stringz.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Preprocessor stringizing utils.
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _STRINGZ_H_
48 | #define _STRINGZ_H_
49 |
50 | /**
51 | * \defgroup group_sam0_utils_stringz Preprocessor - Stringize
52 | *
53 | * \ingroup group_sam0_utils
54 | *
55 | * @{
56 | */
57 |
58 | /** \brief Stringize.
59 | *
60 | * Stringize a preprocessing token, this token being allowed to be \#defined.
61 | *
62 | * May be used only within macros with the token passed as an argument if the
63 | * token is \#defined.
64 | *
65 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN)
66 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to
67 | * writing "A0".
68 | */
69 | #define STRINGZ(x) #x
70 |
71 | /** \brief Absolute stringize.
72 | *
73 | * Stringize a preprocessing token, this token being allowed to be \#defined.
74 | *
75 | * No restriction of use if the token is \#defined.
76 | *
77 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is
78 | * equivalent to writing "A0".
79 | */
80 | #define ASTRINGZ(x) STRINGZ(x)
81 |
82 | /** @} */
83 |
84 | #endif // _STRINGZ_H_
85 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/utils/interrupt/interrupt_sam_nvic.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Global interrupt management for SAM D20, SAM3 and SAM4 (NVIC based)
5 | *
6 | * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #include "interrupt_sam_nvic.h"
48 |
49 | #if !defined(__DOXYGEN__)
50 | /* Deprecated - global flag to determine the global interrupt state. Required by
51 | * QTouch library, however new applications should use cpu_irq_is_enabled()
52 | * which probes the true global interrupt state from the CPU special registers.
53 | */
54 | volatile bool g_interrupt_enabled = true;
55 | #endif
56 |
57 | void cpu_irq_enter_critical(void)
58 | {
59 | if (cpu_irq_critical_section_counter == 0) {
60 | if (cpu_irq_is_enabled()) {
61 | cpu_irq_disable();
62 | cpu_irq_prev_interrupt_state = true;
63 | } else {
64 | /* Make sure the to save the prev state as false */
65 | cpu_irq_prev_interrupt_state = false;
66 | }
67 |
68 | }
69 |
70 | cpu_irq_critical_section_counter++;
71 | }
72 |
73 | void cpu_irq_leave_critical(void)
74 | {
75 | /* Check if the user is trying to leave a critical section when not in a critical section */
76 | Assert(cpu_irq_critical_section_counter > 0);
77 |
78 | cpu_irq_critical_section_counter--;
79 |
80 | /* Only enable global interrupts when the counter reaches 0 and the state of the global interrupt flag
81 | was enabled when entering critical state */
82 | if ((cpu_irq_critical_section_counter == 0) && (cpu_irq_prev_interrupt_state)) {
83 | cpu_irq_enable();
84 | }
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/syscalls/gcc/syscalls.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Syscalls for SAM0 (GCC).
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #include
48 | #include
49 | #include
50 | #include
51 |
52 | #ifdef __cplusplus
53 | extern "C" {
54 | #endif
55 |
56 | #undef errno
57 | extern int errno;
58 | extern int _end;
59 |
60 | extern caddr_t _sbrk(int incr);
61 | extern int link(char *old, char *new);
62 | extern int _close(int file);
63 | extern int _fstat(int file, struct stat *st);
64 | extern int _isatty(int file);
65 | extern int _lseek(int file, int ptr, int dir);
66 | extern void _exit(int status);
67 | extern void _kill(int pid, int sig);
68 | extern int _getpid(void);
69 |
70 | extern caddr_t _sbrk(int incr)
71 | {
72 | static unsigned char *heap = NULL;
73 | unsigned char *prev_heap;
74 |
75 | if (heap == NULL) {
76 | heap = (unsigned char *)&_end;
77 | }
78 | prev_heap = heap;
79 |
80 | heap += incr;
81 |
82 | return (caddr_t) prev_heap;
83 | }
84 |
85 | extern int link(char *old, char *new)
86 | {
87 | return -1;
88 | }
89 |
90 | extern int _close(int file)
91 | {
92 | return -1;
93 | }
94 |
95 | extern int _fstat(int file, struct stat *st)
96 | {
97 | st->st_mode = S_IFCHR;
98 |
99 | return 0;
100 | }
101 |
102 | extern int _isatty(int file)
103 | {
104 | return 1;
105 | }
106 |
107 | extern int _lseek(int file, int ptr, int dir)
108 | {
109 | return 0;
110 | }
111 |
112 | extern void _exit(int status)
113 | {
114 | printf("Exiting with status %d.\n", status);
115 |
116 | for (;;);
117 | }
118 |
119 | extern void _kill(int pid, int sig)
120 | {
121 | return;
122 | }
123 |
124 | extern int _getpid(void)
125 | {
126 | return -1;
127 | }
128 |
129 | #ifdef __cplusplus
130 | }
131 | #endif
132 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/drivers/usb/stack_interface/usb_dual.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM USB Dual Role driver header file.
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _USB_DUAL_H_
48 | #define _USB_DUAL_H_
49 |
50 | #include "compiler.h"
51 | #include "preprocessor.h"
52 |
53 | /* Get USB pads pins configuration in board configuration */
54 | #include "conf_board.h"
55 |
56 | #ifdef __cplusplus
57 | extern "C" {
58 | #endif
59 |
60 | /**
61 | * \ingroup usb_group
62 | * \defgroup usb_dual_group USB dual role driver
63 | * USB low-level driver for dual role features
64 | *
65 | * @{
66 | */
67 |
68 | bool usb_dual_enable(void);
69 | void usb_dual_disable(void);
70 |
71 | /**
72 | * @name USB ID pin management
73 | *
74 | * The ID pin come from the USB connector (A and B receptable) and
75 | * allows to select the USB mode between host or device.
76 | * The ID pin can be managed through EIC pin.
77 | * This feature is optional, and it is enabled if USB_ID_PIN
78 | * is defined in board.h and CONF_BOARD_USB_ID_DETECT defined in
79 | * conf_board.h.
80 | *
81 | * @{
82 | */
83 | #define USB_ID_DETECT (defined(CONF_BOARD_USB_ID_DETECT))
84 | #define USB_ID_EIC (defined(USB_ID_PIN) && USB_ID_DETECT)
85 | /** @} */
86 |
87 | /**
88 | * @name USB Vbus management
89 | *
90 | * The VBus line can be monitored through a EIC pin and
91 | * a basic resistor voltage divider.
92 | * This feature is optional, and it is enabled if USB_VBUS_PIN
93 | * is defined in board.h and CONF_BOARD_USB_VBUS_DETECT defined in
94 | * conf_board.h.
95 | *
96 | * @{
97 | */
98 | #define USB_VBUS_DETECT (defined(CONF_BOARD_USB_VBUS_DETECT))
99 | #define USB_VBUS_EIC (defined(USB_VBUS_PIN) && USB_VBUS_DETECT)
100 | /** @} */
101 |
102 | /** @} */
103 |
104 | #ifdef __cplusplus
105 | }
106 | #endif
107 |
108 | #endif // _USB_DUAL_H_
109 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/wdt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for WDT
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_WDT_INSTANCE_
48 | #define _SAMD21_WDT_INSTANCE_
49 |
50 | /* ========== Register definition for WDT peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_WDT_CTRL (0x40001000U) /**< \brief (WDT) Control */
53 | #define REG_WDT_CONFIG (0x40001001U) /**< \brief (WDT) Configuration */
54 | #define REG_WDT_EWCTRL (0x40001002U) /**< \brief (WDT) Early Warning Interrupt Control */
55 | #define REG_WDT_INTENCLR (0x40001004U) /**< \brief (WDT) Interrupt Enable Clear */
56 | #define REG_WDT_INTENSET (0x40001005U) /**< \brief (WDT) Interrupt Enable Set */
57 | #define REG_WDT_INTFLAG (0x40001006U) /**< \brief (WDT) Interrupt Flag Status and Clear */
58 | #define REG_WDT_STATUS (0x40001007U) /**< \brief (WDT) Status */
59 | #define REG_WDT_CLEAR (0x40001008U) /**< \brief (WDT) Clear */
60 | #else
61 | #define REG_WDT_CTRL (*(RwReg8 *)0x40001000U) /**< \brief (WDT) Control */
62 | #define REG_WDT_CONFIG (*(RwReg8 *)0x40001001U) /**< \brief (WDT) Configuration */
63 | #define REG_WDT_EWCTRL (*(RwReg8 *)0x40001002U) /**< \brief (WDT) Early Warning Interrupt Control */
64 | #define REG_WDT_INTENCLR (*(RwReg8 *)0x40001004U) /**< \brief (WDT) Interrupt Enable Clear */
65 | #define REG_WDT_INTENSET (*(RwReg8 *)0x40001005U) /**< \brief (WDT) Interrupt Enable Set */
66 | #define REG_WDT_INTFLAG (*(RwReg8 *)0x40001006U) /**< \brief (WDT) Interrupt Flag Status and Clear */
67 | #define REG_WDT_STATUS (*(RoReg8 *)0x40001007U) /**< \brief (WDT) Status */
68 | #define REG_WDT_CLEAR (*(WoReg8 *)0x40001008U) /**< \brief (WDT) Clear */
69 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
70 |
71 | /* ========== Instance parameters for WDT peripheral ========== */
72 | #define WDT_GCLK_ID 3 // Index of Generic Clock
73 |
74 | #endif /* _SAMD21_WDT_INSTANCE_ */
75 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/dac.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for DAC
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_DAC_INSTANCE_
48 | #define _SAMD21_DAC_INSTANCE_
49 |
50 | /* ========== Register definition for DAC peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_DAC_CTRLA (0x42004800U) /**< \brief (DAC) Control A */
53 | #define REG_DAC_CTRLB (0x42004801U) /**< \brief (DAC) Control B */
54 | #define REG_DAC_EVCTRL (0x42004802U) /**< \brief (DAC) Event Control */
55 | #define REG_DAC_INTENCLR (0x42004804U) /**< \brief (DAC) Interrupt Enable Clear */
56 | #define REG_DAC_INTENSET (0x42004805U) /**< \brief (DAC) Interrupt Enable Set */
57 | #define REG_DAC_INTFLAG (0x42004806U) /**< \brief (DAC) Interrupt Flag Status and Clear */
58 | #define REG_DAC_STATUS (0x42004807U) /**< \brief (DAC) Status */
59 | #define REG_DAC_DATA (0x42004808U) /**< \brief (DAC) Data */
60 | #define REG_DAC_DATABUF (0x4200480CU) /**< \brief (DAC) Data Buffer */
61 | #else
62 | #define REG_DAC_CTRLA (*(RwReg8 *)0x42004800U) /**< \brief (DAC) Control A */
63 | #define REG_DAC_CTRLB (*(RwReg8 *)0x42004801U) /**< \brief (DAC) Control B */
64 | #define REG_DAC_EVCTRL (*(RwReg8 *)0x42004802U) /**< \brief (DAC) Event Control */
65 | #define REG_DAC_INTENCLR (*(RwReg8 *)0x42004804U) /**< \brief (DAC) Interrupt Enable Clear */
66 | #define REG_DAC_INTENSET (*(RwReg8 *)0x42004805U) /**< \brief (DAC) Interrupt Enable Set */
67 | #define REG_DAC_INTFLAG (*(RwReg8 *)0x42004806U) /**< \brief (DAC) Interrupt Flag Status and Clear */
68 | #define REG_DAC_STATUS (*(RoReg8 *)0x42004807U) /**< \brief (DAC) Status */
69 | #define REG_DAC_DATA (*(RwReg16*)0x42004808U) /**< \brief (DAC) Data */
70 | #define REG_DAC_DATABUF (*(RwReg16*)0x4200480CU) /**< \brief (DAC) Data Buffer */
71 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
72 |
73 | /* ========== Instance parameters for DAC peripheral ========== */
74 | #define DAC_DMAC_ID_EMPTY 40 // Index of DMAC EMPTY trigger
75 | #define DAC_GCLK_ID 33 // Index of Generic Clock
76 |
77 | #endif /* _SAMD21_DAC_INSTANCE_ */
78 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/asf.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Autogenerated API include file for the Atmel Software Framework (ASF)
5 | *
6 | * Copyright (c) 2012 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 |
44 | #ifndef _ASF_H_
45 | #define _ASF_H_
46 |
47 | /*
48 | * This file includes all API header files for the selected drivers from ASF.
49 | * Note: There might be duplicate includes required by more than one driver.
50 | *
51 | * The file is automatically generated and will be re-written when
52 | * running the ASF driver selector tool. Any changes will be discarded.
53 | */
54 |
55 | // From module: Common SAM0 compiler driver
56 | #include
57 | #include
58 |
59 | // From module: EXTINT - External Interrupt (Callback APIs)
60 | //#include
61 | //#include
62 |
63 | // From module: Interrupt management - SAM implementation
64 | #include
65 |
66 | // From module: Memory Control Access Interface
67 | #include
68 |
69 | // From module: NVM - Non-Volatile Memory
70 | //#include
71 |
72 | // From module: PORT - GPIO Pin Control
73 | //#include
74 |
75 | // From module: Part identification macros
76 | //#include
77 |
78 | // From module: SAM D21/R21/D11/L21/DA1/L22 USB Dual role interface
79 | //#include
80 |
81 | // From module: SYSTEM - Clock Management for SAMD21/R21/DAx
82 | #include
83 | #include
84 |
85 | // From module: SYSTEM - Core System Driver
86 | #include
87 |
88 | // From module: SYSTEM - I/O Pin Multiplexer
89 | #include
90 |
91 | // From module: SYSTEM - Interrupt Driver
92 | #include
93 |
94 | // From module: SYSTEM - Power Management for SAM D20/D21/R21/D09/D10/D11/DA0/DA1
95 | //#include
96 |
97 | // From module: SYSTEM - Reset Management for SAM D20/D21/R21/D09/D10/D11/DA0/DA1
98 | //#include
99 |
100 | // From module: Sleep manager - SAMD implementation
101 | //#include
102 | //#include
103 |
104 | // From module: USB - Universal Serial Bus
105 | #include
106 |
107 | // From module: USB CDC Protocol
108 | #include
109 |
110 | // From module: USB MSC Protocol
111 | #include
112 |
113 | // From module: USB Device CDC (Composite Device)
114 | #include
115 |
116 | // From module: USB Device MSC (Composite Device)
117 | #include
118 |
119 | // From module: USB Device Stack Core (Common API)
120 | #include
121 | #include
122 |
123 |
124 | #endif // _ASF_H_
125 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/drivers/system/system.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM System related functionality
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #include
48 |
49 | /**
50 | * \internal
51 | * Dummy initialization function, used as a weak alias target for the various
52 | * init functions called by \ref system_init().
53 | */
54 | void _system_dummy_init(void);
55 | void _system_dummy_init(void)
56 | {
57 | return;
58 | }
59 |
60 | #if !defined(__DOXYGEN__)
61 | # if defined(__GNUC__)
62 | void system_clock_init(void) WEAK __attribute__((alias("_system_dummy_init")));
63 | void system_board_init(void) WEAK __attribute__((alias("_system_dummy_init")));
64 | void _system_events_init(void) WEAK __attribute__((alias("_system_dummy_init")));
65 | void _system_extint_init(void) WEAK __attribute__((alias("_system_dummy_init")));
66 | void _system_divas_init(void) WEAK __attribute__((alias("_system_dummy_init")));
67 | # elif defined(__ICCARM__)
68 | void system_clock_init(void);
69 | void system_board_init(void);
70 | void _system_events_init(void);
71 | void _system_extint_init(void);
72 | void _system_divas_init(void);
73 | # pragma weak system_clock_init=_system_dummy_init
74 | # pragma weak system_board_init=_system_dummy_init
75 | # pragma weak _system_events_init=_system_dummy_init
76 | # pragma weak _system_extint_init=_system_dummy_init
77 | # pragma weak _system_divas_init=_system_dummy_init
78 | # endif
79 | #endif
80 |
81 | /**
82 | * \brief Initialize system
83 | *
84 | * This function will call the various initialization functions within the
85 | * system namespace. If a given optional system module is not available, the
86 | * associated call will effectively be a NOP (No Operation).
87 | *
88 | * Currently the following initialization functions are supported:
89 | * - System clock initialization (via the SYSTEM CLOCK sub-module)
90 | * - Board hardware initialization (via the Board module)
91 | * - Event system driver initialization (via the EVSYS module)
92 | * - External Interrupt driver initialization (via the EXTINT module)
93 | */
94 | void system_init(void)
95 | {
96 | /* Configure GCLK and clock sources according to conf_clocks.h */
97 | system_clock_init();
98 |
99 | /* Initialize board hardware */
100 | system_board_init();
101 |
102 | /* Initialize EVSYS hardware */
103 | _system_events_init();
104 |
105 | /* Initialize External hardware */
106 | _system_extint_init();
107 |
108 | /* Initialize DIVAS hardware */
109 | _system_divas_init();
110 | }
111 |
112 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/preprocessor/tpaste.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Preprocessor token pasting utils.
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _TPASTE_H_
48 | #define _TPASTE_H_
49 |
50 | /**
51 | * \defgroup group_sam0_utils_tpaste Preprocessor - Token Paste
52 | *
53 | * \ingroup group_sam0_utils
54 | *
55 | * @{
56 | */
57 |
58 | /** \name Token Paste
59 | *
60 | * Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
61 | *
62 | * May be used only within macros with the tokens passed as arguments if the tokens are \#defined.
63 | *
64 | * For example, writing TPASTE2(U, WIDTH) within a macro \#defined by
65 | * UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH \#defined as 32 is
66 | * equivalent to writing U32.
67 | *
68 | * @{ */
69 | #define TPASTE2( a, b) a##b
70 | #define TPASTE3( a, b, c) a##b##c
71 | #define TPASTE4( a, b, c, d) a##b##c##d
72 | #define TPASTE5( a, b, c, d, e) a##b##c##d##e
73 | #define TPASTE6( a, b, c, d, e, f) a##b##c##d##e##f
74 | #define TPASTE7( a, b, c, d, e, f, g) a##b##c##d##e##f##g
75 | #define TPASTE8( a, b, c, d, e, f, g, h) a##b##c##d##e##f##g##h
76 | #define TPASTE9( a, b, c, d, e, f, g, h, i) a##b##c##d##e##f##g##h##i
77 | #define TPASTE10(a, b, c, d, e, f, g, h, i, j) a##b##c##d##e##f##g##h##i##j
78 | /** @} */
79 |
80 | /** \name Absolute Token Paste
81 | *
82 | * Paste N preprocessing tokens together, these tokens being allowed to be \#defined.
83 | *
84 | * No restriction of use if the tokens are \#defined.
85 | *
86 | * For example, writing ATPASTE2(U, UL_WIDTH) anywhere with UL_WIDTH \#defined
87 | * as 32 is equivalent to writing U32.
88 | *
89 | * @{ */
90 | #define ATPASTE2( a, b) TPASTE2( a, b)
91 | #define ATPASTE3( a, b, c) TPASTE3( a, b, c)
92 | #define ATPASTE4( a, b, c, d) TPASTE4( a, b, c, d)
93 | #define ATPASTE5( a, b, c, d, e) TPASTE5( a, b, c, d, e)
94 | #define ATPASTE6( a, b, c, d, e, f) TPASTE6( a, b, c, d, e, f)
95 | #define ATPASTE7( a, b, c, d, e, f, g) TPASTE7( a, b, c, d, e, f, g)
96 | #define ATPASTE8( a, b, c, d, e, f, g, h) TPASTE8( a, b, c, d, e, f, g, h)
97 | #define ATPASTE9( a, b, c, d, e, f, g, h, i) TPASTE9( a, b, c, d, e, f, g, h, i)
98 | #define ATPASTE10(a, b, c, d, e, f, g, h, i, j) TPASTE10(a, b, c, d, e, f, g, h, i, j)
99 | /** @} */
100 |
101 | /** @} */
102 |
103 | #endif // _TPASTE_H_
104 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/gclk.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for GCLK
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_GCLK_INSTANCE_
48 | #define _SAMD21_GCLK_INSTANCE_
49 |
50 | /* ========== Register definition for GCLK peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_GCLK_CTRL (0x40000C00U) /**< \brief (GCLK) Control */
53 | #define REG_GCLK_STATUS (0x40000C01U) /**< \brief (GCLK) Status */
54 | #define REG_GCLK_CLKCTRL (0x40000C02U) /**< \brief (GCLK) Generic Clock Control */
55 | #define REG_GCLK_GENCTRL (0x40000C04U) /**< \brief (GCLK) Generic Clock Generator Control */
56 | #define REG_GCLK_GENDIV (0x40000C08U) /**< \brief (GCLK) Generic Clock Generator Division */
57 | #else
58 | #define REG_GCLK_CTRL (*(RwReg8 *)0x40000C00U) /**< \brief (GCLK) Control */
59 | #define REG_GCLK_STATUS (*(RoReg8 *)0x40000C01U) /**< \brief (GCLK) Status */
60 | #define REG_GCLK_CLKCTRL (*(RwReg16*)0x40000C02U) /**< \brief (GCLK) Generic Clock Control */
61 | #define REG_GCLK_GENCTRL (*(RwReg *)0x40000C04U) /**< \brief (GCLK) Generic Clock Generator Control */
62 | #define REG_GCLK_GENDIV (*(RwReg *)0x40000C08U) /**< \brief (GCLK) Generic Clock Generator Division */
63 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
64 |
65 | /* ========== Instance parameters for GCLK peripheral ========== */
66 | #define GCLK_GENDIV_BITS 16
67 | #define GCLK_GEN_NUM 9 // Number of Generic Clock Generators
68 | #define GCLK_GEN_NUM_MSB 8 // Number of Generic Clock Generators - 1
69 | #define GCLK_GEN_SOURCE_NUM_MSB 8 // Number of Generic Clock Sources - 1
70 | #define GCLK_NUM 37 // Number of Generic Clock Users
71 | #define GCLK_SOURCE_DFLL48M 7 // DFLL48M output
72 | #define GCLK_SOURCE_FDPLL 8 // FDPLL output
73 | #define GCLK_SOURCE_GCLKGEN1 2 // Generic clock generator 1 output
74 | #define GCLK_SOURCE_GCLKIN 1 // Generator input pad
75 | #define GCLK_SOURCE_NUM 9 // Number of Generic Clock Sources
76 | #define GCLK_SOURCE_OSCULP32K 3 // OSCULP32K oscillator output
77 | #define GCLK_SOURCE_OSC8M 6 // OSC8M oscillator output
78 | #define GCLK_SOURCE_OSC32K 4 // OSC32K oscillator outpur
79 | #define GCLK_SOURCE_XOSC 0 // XOSC oscillator output
80 | #define GCLK_SOURCE_XOSC32K 5 // XOSC32K oscillator output
81 |
82 | #endif /* _SAMD21_GCLK_INSTANCE_ */
83 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/utils/interrupt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Global interrupt management for 8- and 32-bit AVR
5 | *
6 | * Copyright (c) 2010-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 | #ifndef UTILS_INTERRUPT_H
47 | #define UTILS_INTERRUPT_H
48 |
49 | #include
50 |
51 | #if XMEGA || MEGA || TINY
52 | # include "interrupt/interrupt_avr8.h"
53 | #elif UC3
54 | # include "interrupt/interrupt_avr32.h"
55 | #elif SAM || SAMB
56 | # include "interrupt/interrupt_sam_nvic.h"
57 | #else
58 | # error Unsupported device.
59 | #endif
60 |
61 | /**
62 | * \defgroup interrupt_group Global interrupt management
63 | *
64 | * This is a driver for global enabling and disabling of interrupts.
65 | *
66 | * @{
67 | */
68 |
69 | #if defined(__DOXYGEN__)
70 | /**
71 | * \def CONFIG_INTERRUPT_FORCE_INTC
72 | * \brief Force usage of the ASF INTC driver
73 | *
74 | * Predefine this symbol when preprocessing to force the use of the ASF INTC driver.
75 | * This is useful to ensure compatibility across compilers and shall be used only when required
76 | * by the application needs.
77 | */
78 | # define CONFIG_INTERRUPT_FORCE_INTC
79 | #endif
80 |
81 | //! \name Global interrupt flags
82 | //@{
83 | /**
84 | * \typedef irqflags_t
85 | * \brief Type used for holding state of interrupt flag
86 | */
87 |
88 | /**
89 | * \def cpu_irq_enable
90 | * \brief Enable interrupts globally
91 | */
92 |
93 | /**
94 | * \def cpu_irq_disable
95 | * \brief Disable interrupts globally
96 | */
97 |
98 | /**
99 | * \fn irqflags_t cpu_irq_save(void)
100 | * \brief Get and clear the global interrupt flags
101 | *
102 | * Use in conjunction with \ref cpu_irq_restore.
103 | *
104 | * \return Current state of interrupt flags.
105 | *
106 | * \note This function leaves interrupts disabled.
107 | */
108 |
109 | /**
110 | * \fn void cpu_irq_restore(irqflags_t flags)
111 | * \brief Restore global interrupt flags
112 | *
113 | * Use in conjunction with \ref cpu_irq_save.
114 | *
115 | * \param flags State to set interrupt flag to.
116 | */
117 |
118 | /**
119 | * \fn bool cpu_irq_is_enabled_flags(irqflags_t flags)
120 | * \brief Check if interrupts are globally enabled in supplied flags
121 | *
122 | * \param flags Currents state of interrupt flags.
123 | *
124 | * \return True if interrupts are enabled.
125 | */
126 |
127 | /**
128 | * \def cpu_irq_is_enabled
129 | * \brief Check if interrupts are globally enabled
130 | *
131 | * \return True if interrupts are enabled.
132 | */
133 | //@}
134 |
135 | //! @}
136 |
137 | /**
138 | * \ingroup interrupt_group
139 | * \defgroup interrupt_deprecated_group Deprecated interrupt definitions
140 | */
141 |
142 | #endif /* UTILS_INTERRUPT_H */
143 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/services/usb/udc/udi.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Common API for USB Device Interface
5 | *
6 | * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _UDI_H_
48 | #define _UDI_H_
49 |
50 | #include "conf_usb.h"
51 | #include "usb_protocol.h"
52 |
53 | #ifdef __cplusplus
54 | extern "C" {
55 | #endif
56 |
57 | /**
58 | * \ingroup usb_device_group
59 | * \defgroup udi_group USB Device Interface (UDI)
60 | * The UDI provides a common API for all classes,
61 | * and this is used by UDC for the main control of USB Device interface.
62 | * @{
63 | */
64 |
65 | /**
66 | * \brief UDI API.
67 | *
68 | * The callbacks within this structure are called only by
69 | * USB Device Controller (UDC)
70 | *
71 | * The udc_get_interface_desc() can be use by UDI to know the interface descriptor
72 | * selected by UDC.
73 | */
74 | typedef struct {
75 | /**
76 | * \brief Enable the interface.
77 | *
78 | * This function is called when the host selects a configuration
79 | * to which this interface belongs through a Set Configuration
80 | * request, and when the host selects an alternate setting of
81 | * this interface through a Set Interface request.
82 | *
83 | * \return \c 1 if function was successfully done, otherwise \c 0.
84 | */
85 | bool(*enable) (void);
86 |
87 | /**
88 | * \brief Disable the interface.
89 | *
90 | * This function is called when this interface is currently
91 | * active, and
92 | * - the host selects any configuration through a Set
93 | * Configuration request, or
94 | * - the host issues a USB reset, or
95 | * - the device is detached from the host (i.e. Vbus is no
96 | * longer present)
97 | */
98 | void (*disable) (void);
99 |
100 | /**
101 | * \brief Handle a control request directed at an interface.
102 | *
103 | * This function is called when this interface is currently
104 | * active and the host sends a SETUP request
105 | * with this interface as the recipient.
106 | *
107 | * Use udd_g_ctrlreq to decode and response to SETUP request.
108 | *
109 | * \return \c 1 if this interface supports the SETUP request, otherwise \c 0.
110 | */
111 | bool(*setup) (void);
112 |
113 | /**
114 | * \brief Returns the current setting of the selected interface.
115 | *
116 | * This function is called when UDC when know alternate setting of selected interface.
117 | *
118 | * \return alternate setting of selected interface
119 | */
120 | uint8_t(*getsetting) (void);
121 |
122 | /**
123 | * \brief To signal that a SOF is occurred
124 | */
125 | void(*sof_notify) (void);
126 | } udi_api_t;
127 |
128 | //@}
129 |
130 | #ifdef __cplusplus
131 | }
132 | #endif
133 | #endif // _UDI_H_
134 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/eic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for EIC
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_EIC_INSTANCE_
48 | #define _SAMD21_EIC_INSTANCE_
49 |
50 | /* ========== Register definition for EIC peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_EIC_CTRL (0x40001800U) /**< \brief (EIC) Control */
53 | #define REG_EIC_STATUS (0x40001801U) /**< \brief (EIC) Status */
54 | #define REG_EIC_NMICTRL (0x40001802U) /**< \brief (EIC) Non-Maskable Interrupt Control */
55 | #define REG_EIC_NMIFLAG (0x40001803U) /**< \brief (EIC) Non-Maskable Interrupt Flag Status and Clear */
56 | #define REG_EIC_EVCTRL (0x40001804U) /**< \brief (EIC) Event Control */
57 | #define REG_EIC_INTENCLR (0x40001808U) /**< \brief (EIC) Interrupt Enable Clear */
58 | #define REG_EIC_INTENSET (0x4000180CU) /**< \brief (EIC) Interrupt Enable Set */
59 | #define REG_EIC_INTFLAG (0x40001810U) /**< \brief (EIC) Interrupt Flag Status and Clear */
60 | #define REG_EIC_WAKEUP (0x40001814U) /**< \brief (EIC) Wake-Up Enable */
61 | #define REG_EIC_CONFIG0 (0x40001818U) /**< \brief (EIC) Configuration 0 */
62 | #define REG_EIC_CONFIG1 (0x4000181CU) /**< \brief (EIC) Configuration 1 */
63 | #else
64 | #define REG_EIC_CTRL (*(RwReg8 *)0x40001800U) /**< \brief (EIC) Control */
65 | #define REG_EIC_STATUS (*(RoReg8 *)0x40001801U) /**< \brief (EIC) Status */
66 | #define REG_EIC_NMICTRL (*(RwReg8 *)0x40001802U) /**< \brief (EIC) Non-Maskable Interrupt Control */
67 | #define REG_EIC_NMIFLAG (*(RwReg8 *)0x40001803U) /**< \brief (EIC) Non-Maskable Interrupt Flag Status and Clear */
68 | #define REG_EIC_EVCTRL (*(RwReg *)0x40001804U) /**< \brief (EIC) Event Control */
69 | #define REG_EIC_INTENCLR (*(RwReg *)0x40001808U) /**< \brief (EIC) Interrupt Enable Clear */
70 | #define REG_EIC_INTENSET (*(RwReg *)0x4000180CU) /**< \brief (EIC) Interrupt Enable Set */
71 | #define REG_EIC_INTFLAG (*(RwReg *)0x40001810U) /**< \brief (EIC) Interrupt Flag Status and Clear */
72 | #define REG_EIC_WAKEUP (*(RwReg *)0x40001814U) /**< \brief (EIC) Wake-Up Enable */
73 | #define REG_EIC_CONFIG0 (*(RwReg *)0x40001818U) /**< \brief (EIC) Configuration 0 */
74 | #define REG_EIC_CONFIG1 (*(RwReg *)0x4000181CU) /**< \brief (EIC) Configuration 1 */
75 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
76 |
77 | /* ========== Instance parameters for EIC peripheral ========== */
78 | #define EIC_CONFIG_NUM 2 // Number of CONFIG registers
79 | #define EIC_GCLK_ID 5 // Index of Generic Clock
80 |
81 | #endif /* _SAMD21_EIC_INSTANCE_ */
82 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/samd21.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Top header file for SAMD21
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_
48 | #define _SAMD21_
49 |
50 | /**
51 | * \defgroup SAMD21_definitions SAMD21 Device Definitions
52 | * \brief SAMD21 CMSIS Definitions.
53 | */
54 |
55 | #if defined(__SAMD21E15A__) || defined(__ATSAMD21E15A__)
56 | #include "samd21e15a.h"
57 | #elif defined(__SAMD21E16A__) || defined(__ATSAMD21E16A__)
58 | #include "samd21e16a.h"
59 | #elif defined(__SAMD21E17A__) || defined(__ATSAMD21E17A__)
60 | #include "samd21e17a.h"
61 | #elif defined(__SAMD21E18A__) || defined(__ATSAMD21E18A__)
62 | #include "samd21e18a.h"
63 | #elif defined(__SAMD21G15A__) || defined(__ATSAMD21G15A__)
64 | #include "samd21g15a.h"
65 | #elif defined(__SAMD21G16A__) || defined(__ATSAMD21G16A__)
66 | #include "samd21g16a.h"
67 | #elif defined(__SAMD21G17A__) || defined(__ATSAMD21G17A__)
68 | #include "samd21g17a.h"
69 | #elif defined(__SAMD21G17AU__) || defined(__ATSAMD21G17AU__)
70 | #include "samd21g17au.h"
71 | #elif defined(__SAMD21G18A__) || defined(__ATSAMD21G18A__)
72 | #include "samd21g18a.h"
73 | #elif defined (__SAMD21G18AU__) || defined(__ATSAMD21G18AU__)
74 | #include "samd21g18au.h"
75 | #elif defined(__SAMD21J15A__) || defined(__ATSAMD21J15A__)
76 | #include "samd21j15a.h"
77 | #elif defined(__SAMD21J16A__) || defined(__ATSAMD21J16A__)
78 | #include "samd21j16a.h"
79 | #elif defined(__SAMD21J17A__) || defined(__ATSAMD21J17A__)
80 | #include "samd21j17a.h"
81 | #elif defined(__SAMD21J18A__) || defined(__ATSAMD21J18A__)
82 | #include "samd21j18a.h"
83 | #elif defined(__SAMD21E15B__) || defined(__ATSAMD21E15B__)
84 | #include "samd21e15b.h"
85 | #elif defined(__SAMD21E15BU__) || defined(__ATSAMD21E15BU__)
86 | #include "samd21e15bu.h"
87 | #elif defined(__SAMD21E15L__) || defined(__ATSAMD21E15L__)
88 | #include "samd21e15l.h"
89 | #elif defined(__SAMD21E16B__) || defined(__ATSAMD21E16B__)
90 | #include "samd21e16b.h"
91 | #elif defined(__SAMD21E16BU__) || defined(__ATSAMD21E16BU__)
92 | #include "samd21e16bu.h"
93 | #elif defined(__SAMD21E16L__) || defined(__ATSAMD21E16L__)
94 | #include "samd21e16l.h"
95 | #elif defined(__SAMD21G15B__) || defined(__ATSAMD21G15B__)
96 | #include "samd21g15b.h"
97 | #elif defined(__SAMD21G15L__) || defined(__ATSAMD21G15L__)
98 | #include "samd21g15l.h"
99 | #elif defined(__SAMD21G16B__) || defined(__ATSAMD21G16B__)
100 | #include "samd21g16b.h"
101 | #elif defined(__SAMD21G16L__) || defined(__ATSAMD21G16L__)
102 | #include "samd21g16l.h"
103 | #elif defined(__SAMD21J15B__) || defined(__ATSAMD21J15B__)
104 | #include "samd21j15b.h"
105 | #elif defined(__SAMD21J16B__) || defined(__ATSAMD21J16B__)
106 | #include "samd21j16b.h"
107 | #else
108 | #error Library does not support the specified device.
109 | #endif
110 |
111 | #endif /* _SAMD21_ */
112 |
--------------------------------------------------------------------------------
/software/Micronucleus/micronucleus-t85_always.hex:
--------------------------------------------------------------------------------
1 | :1019800017C0197A4005930B09021200010100806B
2 | :101990003209040000000000000012011001FF00E5
3 | :1019A0000008D016530703020000000104030904D5
4 | :1019B00011241FBECFE5D2E0CDBFDEBF20E0A0E600
5 | :1019C000B0E001C01D92AC38B207E1F7BFC1A82F4B
6 | :1019D000B92F80E090E041E050EA609530E009C026
7 | :1019E0002D9182279795879510F084279527305E53
8 | :1019F000C8F36F5FA8F30895EADF8D939D93089570
9 | :101A0000CF93CFB7CF93C395B39BE9F7B39B0BC0ED
10 | :101A1000B39B09C0B39B07C0B39B05C0B39B03C076
11 | :101A2000B39B01C0D9C00F92DF93C0916E00DD2738
12 | :101A3000CA58DF4F012EB39B03C0DF910F90E6CF52
13 | :101A40002F930F931F934F932FEF4F6F06B303FB0B
14 | :101A500020F95F933F9350E03BE065C016B3012649
15 | :101A6000502953FDC89556B3012703FB25F92F7361
16 | :101A700006B3B1F05027102713FB26F906B2223027
17 | :101A8000F0F000C016B3012703FB27F90126502907
18 | :101A900006B22430E8F54F77206816B30000F6CF81
19 | :101AA00050274F7D206206B2102F000000C006B301
20 | :101AB00000265029102713FB26F906B2E2CF4F7BF0
21 | :101AC00006B3206400C0DACF01265029187106B28F
22 | :101AD00069F14E7F2160012F16B328C000265029DE
23 | :101AE0004D7F06B22260102F29C0012650294B7F5E
24 | :101AF00006B22460012F2DC016B301265029477F5E
25 | :101B00002860000006B22EC04F7E06B3206130C0B0
26 | :101B1000422706B3499300265029102706B24FEFFB
27 | :101B200013FB20F9297F16B379F2187159F10126B8
28 | :101B3000502906B2012703FB21F9237F06B371F276
29 | :101B4000002650293150D0F006B2102713FB22F99D
30 | :101B5000277E16B351F201265029012703FB06B256
31 | :101B600023F92F7C49F2000006B3102713FB24F958
32 | :101B70000026502906B22F7939F270CF10E21ABF31
33 | :101B800000271DC03B503195C31BD04010E21ABF47
34 | :101B90000881033C29F10B3419F120916C00198163
35 | :101BA000110F1213EDCF093651F10D3211F0013E34
36 | :101BB00039F7CAE01AB715FD02C0CA95D9F70093E4
37 | :101BC00074003F915F914F911F910F912F91DF9181
38 | :101BD0000F90CAB7C5FD17CFCF91CFBFCF91089552
39 | :101BE00020917400222369F3109172001123F1F403
40 | :101BF0003430F2F03093720020936D0019C00091E0
41 | :101C0000720001309CF40AE530916F0034FD11C080
42 | :101C100000936F00C1E6D0E010C0052710E000C0BF
43 | :101C200021C0052710E0C89508BB14C03AE501C0E3
44 | :101C300032ED032EC0E0D0E032E017B31861C39A52
45 | :101C400008B317BB58E120E84FEF20FF052708BB7A
46 | :101C5000279517951C3F28F700004552B0F720FF45
47 | :101C60000527279508BB17951C3FB8F629913A958B
48 | :101C700061F7077E10917300110F08BBC250D0406E
49 | :101C800011F010936C0010E21ABF086017B3177EB2
50 | :101C9000402F477E54E05A95F1F708BB17BB48BB6D
51 | :101CA00090CF2FEFB0E8A0E04AE0B1BF000081EE96
52 | :101CB0009CE0B399FECFB39BFECF0197B399FDCFC4
53 | :101CC00097FF03C0BA1B819501C0BA0FA69539F4DE
54 | :101CD000A0E428F4281710F031B7282FA1E04150D4
55 | :101CE00021F731BF00000895F201309741F02AE753
56 | :101CF000421629E1520629F481B790E002C08FEB29
57 | :101D00009CEC21E00C0120935700E8951124CF01B1
58 | :101D100002962C01089514BE88E181BD87E081BD43
59 | :101D2000BB9A2FE28BE19FE0215080409040E1F789
60 | :101D300000C00000BB988AE580936F008FEF80930E
61 | :101D40006000AC9A8BB780628BBF0895EAE7F9E137
62 | :101D5000E491EF3F11F0E1BF0000DDDF712C312C89
63 | :101D6000412C512CCCE7D5E114E686B3887109F0FB
64 | :101D700014E6115029F41092730010926C0091DF58
65 | :101D80000AB605FE05C03CDE80E28ABF712C04C0A5
66 | :101D9000219759F7C0E0D0E0A89522E032120CC09C
67 | :101DA000E0E8F9E1E054F10983E080935700E89519
68 | :101DB0003097C1F7412C512C832D803459F4F20116
69 | :101DC0003297E03889E1F80750F485E080935700B6
70 | :101DD000E89505C0843019F4CD2B11F4EAC0312CFC
71 | :101DE00080917200835087FD99C090916D009D3263
72 | :101DF00009F092C0883009F08FC083EC80936100B5
73 | :101E00008AE580936F0080917700807690917800CA
74 | :101E1000882379F1911108C082E899E190937100CB
75 | :101E20008093700086E06DC0913069F441145104D4
76 | :101E3000F1F080917B00807C482E50907C0081E105
77 | :101E400087BFE89514C0933081F480917900909118
78 | :101E50007A004ADF80917B0090917C0045DF842DE1
79 | :101E60008F7329F490E4392E4CC09F73392E80E093
80 | :101E700048C08091790010926A00911106C01092BA
81 | :101E80006B002AE630E082E038C0953019F4809388
82 | :101E9000730025C09630E9F490917A00913019F4DE
83 | :101EA0008AE999E104C0923041F488E899E190937D
84 | :101EB00071008093700082E124C09330C1F68111DB
85 | :101EC000D6CF8CEA99E1909371008093700084E002
86 | :101ED00018C0983079F0993031F4809375002AE673
87 | :101EE00030E080E00AC081E09A3009F080E02AE624
88 | :101EF00030E003C025E730E081E0309371002093AB
89 | :101F0000700090917E00911105C090917D0098170E
90 | :101F100008F4892F809360001092720080916F0006
91 | :101F200084FF31C0809160008F3F69F1C82F8930F4
92 | :101F300008F0C8E08C1B809360009091610088E8F5
93 | :101F4000892780936100CC2391F080917000A2E6F4
94 | :101F5000B0E0E82FF091710094919D9331969C2F01
95 | :101F6000980F9E13F9CFF0937100E09370006C2FDF
96 | :101F700082E690E041DDCC5FCC3019F08FEF8093AA
97 | :101F80006000C0936F00C30101963C01803B944008
98 | :101F900029F4EDE7F9E1E491EF3F59F40AB605FEC3
99 | :101FA000E1CE8DE1B39B8DE18150E1F780E28ABF04
100 | :0C1FB000D9CEB1DE1BBE15BAE1CCFFCFCC
101 | :040000030000198060
102 | :00000001FF
103 |
--------------------------------------------------------------------------------
/software/Micronucleus/micronucleus-t85_ext_reset.hex:
--------------------------------------------------------------------------------
1 | :1019800017C0197A4005930B09021200010100806B
2 | :101990003209040000000000000012011001FF00E5
3 | :1019A0000008D016530703020000000104030904D5
4 | :1019B00011241FBECFE5D2E0CDBFDEBF20E0A0E600
5 | :1019C000B0E001C01D92AC38B207E1F7BFC1A82F4B
6 | :1019D000B92F80E090E041E050EA609530E009C026
7 | :1019E0002D9182279795879510F084279527305E53
8 | :1019F000C8F36F5FA8F30895EADF8D939D93089570
9 | :101A0000CF93CFB7CF93C395B39BE9F7B39B0BC0ED
10 | :101A1000B39B09C0B39B07C0B39B05C0B39B03C076
11 | :101A2000B39B01C0D9C00F92DF93C0916E00DD2738
12 | :101A3000CA58DF4F012EB39B03C0DF910F90E6CF52
13 | :101A40002F930F931F934F932FEF4F6F06B303FB0B
14 | :101A500020F95F933F9350E03BE065C016B3012649
15 | :101A6000502953FDC89556B3012703FB25F92F7361
16 | :101A700006B3B1F05027102713FB26F906B2223027
17 | :101A8000F0F000C016B3012703FB27F90126502907
18 | :101A900006B22430E8F54F77206816B30000F6CF81
19 | :101AA00050274F7D206206B2102F000000C006B301
20 | :101AB00000265029102713FB26F906B2E2CF4F7BF0
21 | :101AC00006B3206400C0DACF01265029187106B28F
22 | :101AD00069F14E7F2160012F16B328C000265029DE
23 | :101AE0004D7F06B22260102F29C0012650294B7F5E
24 | :101AF00006B22460012F2DC016B301265029477F5E
25 | :101B00002860000006B22EC04F7E06B3206130C0B0
26 | :101B1000422706B3499300265029102706B24FEFFB
27 | :101B200013FB20F9297F16B379F2187159F10126B8
28 | :101B3000502906B2012703FB21F9237F06B371F276
29 | :101B4000002650293150D0F006B2102713FB22F99D
30 | :101B5000277E16B351F201265029012703FB06B256
31 | :101B600023F92F7C49F2000006B3102713FB24F958
32 | :101B70000026502906B22F7939F270CF10E21ABF31
33 | :101B800000271DC03B503195C31BD04010E21ABF47
34 | :101B90000881033C29F10B3419F120916C00198163
35 | :101BA000110F1213EDCF093651F10D3211F0013E34
36 | :101BB00039F7CAE01AB715FD02C0CA95D9F70093E4
37 | :101BC00074003F915F914F911F910F912F91DF9181
38 | :101BD0000F90CAB7C5FD17CFCF91CFBFCF91089552
39 | :101BE00020917400222369F3109172001123F1F403
40 | :101BF0003430F2F03093720020936D0019C00091E0
41 | :101C0000720001309CF40AE530916F0034FD11C080
42 | :101C100000936F00C1E6D0E010C0052710E000C0BF
43 | :101C200021C0052710E0C89508BB14C03AE501C0E3
44 | :101C300032ED032EC0E0D0E032E017B31861C39A52
45 | :101C400008B317BB58E120E84FEF20FF052708BB7A
46 | :101C5000279517951C3F28F700004552B0F720FF45
47 | :101C60000527279508BB17951C3FB8F629913A958B
48 | :101C700061F7077E10917300110F08BBC250D0406E
49 | :101C800011F010936C0010E21ABF086017B3177EB2
50 | :101C9000402F477E54E05A95F1F708BB17BB48BB6D
51 | :101CA00090CF2FEFB0E8A0E04AE0B1BF000081EE96
52 | :101CB0009CE0B399FECFB39BFECF0197B399FDCFC4
53 | :101CC00097FF03C0BA1B819501C0BA0FA69539F4DE
54 | :101CD000A0E428F4281710F031B7282FA1E04150D4
55 | :101CE00021F731BF00000895F201309741F02AE753
56 | :101CF000421629E1520629F481B790E002C08FEB29
57 | :101D00009CEC21E00C0120935700E8951124CF01B1
58 | :101D100002962C01089514BE88E181BD87E081BD43
59 | :101D2000BB9A2FE28BE19FE0215080409040E1F789
60 | :101D300000C00000BB988AE580936F008FEF80930E
61 | :101D40006000AC9A8BB780628BBF0895EAE7F9E137
62 | :101D5000E491EF3F11F0E1BF000004B601FC06C0C2
63 | :101D6000EDE7F9E1E491EF3F09F02FC1D4DF712CE9
64 | :101D7000312C412C512CCCE7D5E114E686B3887187
65 | :101D800009F014E6115029F41092730010926C00BF
66 | :101D900088DF0AB605FE05C033DE80E28ABF712CFB
67 | :101DA00004C0219759F7C0E0D0E0A89522E0321294
68 | :101DB0000CC0E0E8F9E1E054F10983E080935700BA
69 | :101DC000E8953097C1F7412C512C832D803459F47C
70 | :101DD000F2013297E03889E1F80750F485E080930A
71 | :101DE0005700E89505C0843019F4CD2B11F4EAC0F2
72 | :101DF000312C80917200835087FD99C090916D00C5
73 | :101E00009D3209F092C0883009F08FC083EC809336
74 | :101E100061008AE580936F008091770080769091D1
75 | :101E20007800882379F1911108C082E899E19093B4
76 | :101E300071008093700086E06DC0913069F44114A8
77 | :101E40005104F1F080917B00807C482E50907C0002
78 | :101E500081E187BFE89514C0933081F480917900C7
79 | :101E600090917A0041DF80917B0090917C003CDF73
80 | :101E7000842D8F7329F490E4392E4CC09F73392E32
81 | :101E800080E048C08091790010926A00911106C0EC
82 | :101E900010926B002AE630E082E038C0953019F4E9
83 | :101EA0008093730025C09630E9F490917A009130C8
84 | :101EB00019F48AE999E104C0923041F488E899E183
85 | :101EC000909371008093700082E124C09330C1F63A
86 | :101ED0008111D6CF8CEA99E19093710080937000C4
87 | :101EE00084E018C0983079F0993031F4809375000F
88 | :101EF0002AE630E080E00AC081E09A3009F080E014
89 | :101F00002AE630E003C025E730E081E0309371003D
90 | :101F10002093700090917E00911105C090917D00FA
91 | :101F2000981708F4892F80936000109272008091B6
92 | :101F30006F0084FF31C0809160008F3F69F1C82F2E
93 | :101F4000893008F0C8E08C1B80936000909161009C
94 | :101F500088E8892780936100CC2391F080917000FC
95 | :101F6000A2E6B0E0E82FF091710094919D93319634
96 | :101F70009C2F980F9E13F9CFF0937100E09370009F
97 | :101F80006C2F82E690E038DDCC5FCC3019F08FEF1B
98 | :101F900080936000C0936F00C30101963C01803BB9
99 | :101FA000944029F4EDE7F9E1E491EF3F59F40AB6E2
100 | :101FB00005FEE1CE8DE1B39B8DE18150E1F780E23A
101 | :0E1FC0008ABFD9CEA8DE1BBE15BAD8CCFFCF83
102 | :040000030000198060
103 | :00000001FF
104 |
--------------------------------------------------------------------------------
/software/Micronucleus/micronucleus-t841_always.hex:
--------------------------------------------------------------------------------
1 | :1019800017C0197A10859315090212000101008011
2 | :101990003209040000000000000012011001FF00E5
3 | :1019A0000008D016530703020000000104030904D5
4 | :1019B00011241FBECFEFD2E0CDBFDEBF21E0A0E0FB
5 | :1019C000B1E001C01D92AC32B207E1F7ACC1DC015D
6 | :1019D0008FEF9FEF332715C02D912827722F229567
7 | :1019E0002727822F269526952827239522703217A0
8 | :1019F00077952795822F8927972F76952795972773
9 | :101A00008227615048F7809590950895E0DF8D9387
10 | :101A10009D930895CF93CFB7CF93C395B19BE9F72B
11 | :101A2000B19B09C0B19B07C0B19B05C0B19B03C06E
12 | :101A3000B19B01C0A7C0DF93C0910E01DD27CA5E34
13 | :101A4000DE4FB19B02C0DF91EBCF2F930F931F931B
14 | :101A500006B32FEF01FB20F94F933F9316B34FEFDF
15 | :101A6000012701FB21F93BE031C04E7F012F16B366
16 | :101A7000216028C0102F4D7F2260000006B329C0CE
17 | :101A80004B7F2460012F000016B32BC016B3477F95
18 | :101A900028602AC04F7E06B320612CC04F7D16B34C
19 | :101AA00020622FC04F7B06B3206432C0422706B3AA
20 | :101AB00049934FEF0000102711FB20F916B3137064
21 | :101AC000C9F1297F91F2012701FB21F906B3237F98
22 | :101AD00089F2315058F1102711FB22F916B3277EF5
23 | :101AE00079F2012701FB23F92F7C81F206B310273D
24 | :101AF00011FB24F92F7971F200C016B3012701FB05
25 | :101B000025F92F7359F200C006B3102711FB26F9EF
26 | :101B1000223040F200C016B3012701FB27F9243020
27 | :101B200028F64F77206816B30000F9CF10E21ABFED
28 | :101B300000271DC03B503195C31BD04010E21ABF97
29 | :101B40000881033C19F10B3409F120910C01198132
30 | :101B5000110F1213EDCF093641F10D3211F0013E94
31 | :101B600039F7CAE01AB715FD02C0CA95D9F7009334
32 | :101B700014013F914F911F910F912F91DF91CAB79F
33 | :101B8000C5FD4BCFCF91CFBFCF91089520911401C8
34 | :101B9000222379F3109112011123E1F43430E2F0A1
35 | :101BA0003093120120930D0117C0009112010130F2
36 | :101BB0008CF40AE530910F0134FD10C000930F0141
37 | :101BC000C1E0D1E00FC02795A8F45150A9F4220F2D
38 | :101BD0000000F9CF4AE503C042ED01C0432FC4E144
39 | :101BE000D0E032E017B31360C19A17BB08B320E40A
40 | :101BF00013E05F93012756E008BB279520F451506E
41 | :101C000021F4220FF9CF012756E000003B5A08BB10
42 | :101C1000D0F2279528F4515029F4220F0000F9CF73
43 | :101C2000012756E0279508BB20F4515021F4220FDC
44 | :101C3000F9CF012756E02991332308BB21F60C7F09
45 | :101C400010911301110FC651D04008BB11F0109331
46 | :101C50000C0110E21ABF026017B31C7F402F4C7FAB
47 | :101C60005F9100C000C008BB17BB48BB82CF2FEFFD
48 | :101C7000B0E8A0E04AE0B093740000008EE599E07F
49 | :101C8000B199FECFB19BFECF0197B199FDCF97FFE0
50 | :101C900003C0BA1B819501C0BA0FA69541F4A0E418
51 | :101CA00030F4281718F030917400282FA1E041502B
52 | :101CB00011F73093740000000895F201309749F055
53 | :101CC0002AE7421629E1520631F48091740090E02F
54 | :101CD00002C08FEB9CEC21E00C0120935700E895AB
55 | :101CE0001124CF0102962C01089514BE88ED809333
56 | :101CF000710087E081BDB99A2FE78CEF9AE02150FF
57 | :101D000080409040E1F700C00000B9988AE58093D8
58 | :101D10000F018FEF8093000180B5816080BD8BB78C
59 | :101D200080628BBF089580917400282EEAE7F9E164
60 | :101D3000E491EF3F19F0E0937400000004B601FC59
61 | :101D400006C0EDE7F9E1E491EF3F09F03DC1CDDFD9
62 | :101D5000C298712C312C412C512CC0EADFE014E6E2
63 | :101D600086B3837009F014E6115029F41092130120
64 | :101D700010920C017CDF0AB605FE05C04BDE80E246
65 | :101D80008ABF712C04C0219759F7C0E0D0E0A89514
66 | :101D9000809174002092740022E032120CC0E0E8BE
67 | :101DA000F9E1E054F10993E090935700E8953097FA
68 | :101DB000C1F7412C512C90E439120AC0F20132973C
69 | :101DC000E03829E1F20720F495E090935700E89578
70 | :101DD0008093740084E0381203C0CD2B11F4F0C05E
71 | :101DE000312C80911201835087FD99C090910D0193
72 | :101DF0009D3209F092C0883009F08FC083EC809347
73 | :101E000001018AE580930F018091170180769091FE
74 | :101E10001801882379F1911108C082E899E1909323
75 | :101E200011018093100186E06DC0913069F4411476
76 | :101E30005104F1F080911B01807F482E50901C01CD
77 | :101E400081E187BFE89514C0933081F48091190136
78 | :101E500090911A0132DF80911B0190911C012DDFBE
79 | :101E6000842D8F7029F490E4392E4CC09F73392E45
80 | :101E700080E048C08091190110920A01911106C0BA
81 | :101E800010920B012AE031E082E038C0953019F45D
82 | :101E90008093130125C09630E9F490911A01913096
83 | :101EA00019F48AE999E104C0923041F488E899E193
84 | :101EB000909311018093100182E124C09330C1F608
85 | :101EC0008111D6CF8CEA99E1909311018093100192
86 | :101ED00084E018C0983079F0993031F4809315017E
87 | :101EE0002AE031E080E00AC081E09A3009F080E029
88 | :101EF0002AE031E003C025E131E081E030931101B7
89 | :101F00002093100190911E01911105C090911D0127
90 | :101F1000981708F4892F8093000110921201809184
91 | :101F20000F0184FF31C0809100018F3F69F1C82FFC
92 | :101F3000893008F0C8E08C1B80930001909101016A
93 | :101F400088E8892780930101CC2391F080911001CA
94 | :101F5000A2E0B1E0E82FF091110194919D933196A8
95 | :101F60009C2F980F9E13F9CFF0931101E09310016D
96 | :101F70006C2F82E091E04ADDCC5FCC3019F08FEF1E
97 | :101F800080930001C0930F01C30101963C01803B87
98 | :101F9000944029F4EDE7F9E1E491EF3F89F4862DCF
99 | :101FA0008C7411F0BA9801C0BA9A0AB605FED5CE63
100 | :101FB00085E1B19B85E18150E1F780E28ABFCDCE1A
101 | :101FC000BA9893DE1BBE10BC209274000000D6CCE1
102 | :021FD000FFCF41
103 | :040000030000198060
104 | :00000001FF
105 |
--------------------------------------------------------------------------------
/software/Micronucleus/micronucleus-t841_ext_reset.hex:
--------------------------------------------------------------------------------
1 | :1019800017C0197A10859315090212000101008011
2 | :101990003209040000000000000012011001FF00E5
3 | :1019A0000008D016530703020000000104030904D5
4 | :1019B00011241FBECFEFD2E0CDBFDEBF21E0A0E0FB
5 | :1019C000B1E001C01D92AC32B207E1F7ACC1DC015D
6 | :1019D0008FEF9FEF332715C02D912827722F229567
7 | :1019E0002727822F269526952827239522703217A0
8 | :1019F00077952795822F8927972F76952795972773
9 | :101A00008227615048F7809590950895E0DF8D9387
10 | :101A10009D930895CF93CFB7CF93C395B19BE9F72B
11 | :101A2000B19B09C0B19B07C0B19B05C0B19B03C06E
12 | :101A3000B19B01C0A7C0DF93C0910E01DD27CA5E34
13 | :101A4000DE4FB19B02C0DF91EBCF2F930F931F931B
14 | :101A500006B32FEF01FB20F94F933F9316B34FEFDF
15 | :101A6000012701FB21F93BE031C04E7F012F16B366
16 | :101A7000216028C0102F4D7F2260000006B329C0CE
17 | :101A80004B7F2460012F000016B32BC016B3477F95
18 | :101A900028602AC04F7E06B320612CC04F7D16B34C
19 | :101AA00020622FC04F7B06B3206432C0422706B3AA
20 | :101AB00049934FEF0000102711FB20F916B3137064
21 | :101AC000C9F1297F91F2012701FB21F906B3237F98
22 | :101AD00089F2315058F1102711FB22F916B3277EF5
23 | :101AE00079F2012701FB23F92F7C81F206B310273D
24 | :101AF00011FB24F92F7971F200C016B3012701FB05
25 | :101B000025F92F7359F200C006B3102711FB26F9EF
26 | :101B1000223040F200C016B3012701FB27F9243020
27 | :101B200028F64F77206816B30000F9CF10E21ABFED
28 | :101B300000271DC03B503195C31BD04010E21ABF97
29 | :101B40000881033C19F10B3409F120910C01198132
30 | :101B5000110F1213EDCF093641F10D3211F0013E94
31 | :101B600039F7CAE01AB715FD02C0CA95D9F7009334
32 | :101B700014013F914F911F910F912F91DF91CAB79F
33 | :101B8000C5FD4BCFCF91CFBFCF91089520911401C8
34 | :101B9000222379F3109112011123E1F43430E2F0A1
35 | :101BA0003093120120930D0117C0009112010130F2
36 | :101BB0008CF40AE530910F0134FD10C000930F0141
37 | :101BC000C1E0D1E00FC02795A8F45150A9F4220F2D
38 | :101BD0000000F9CF4AE503C042ED01C0432FC4E144
39 | :101BE000D0E032E017B31360C19A17BB08B320E40A
40 | :101BF00013E05F93012756E008BB279520F451506E
41 | :101C000021F4220FF9CF012756E000003B5A08BB10
42 | :101C1000D0F2279528F4515029F4220F0000F9CF73
43 | :101C2000012756E0279508BB20F4515021F4220FDC
44 | :101C3000F9CF012756E02991332308BB21F60C7F09
45 | :101C400010911301110FC651D04008BB11F0109331
46 | :101C50000C0110E21ABF026017B31C7F402F4C7FAB
47 | :101C60005F9100C000C008BB17BB48BB82CF2FEFFD
48 | :101C7000B0E8A0E04AE0B093740000008EE599E07F
49 | :101C8000B199FECFB19BFECF0197B199FDCF97FFE0
50 | :101C900003C0BA1B819501C0BA0FA69541F4A0E418
51 | :101CA00030F4281718F030917400282FA1E041502B
52 | :101CB00011F73093740000000895F201309749F055
53 | :101CC0002AE7421629E1520631F48091740090E02F
54 | :101CD00002C08FEB9CEC21E00C0120935700E895AB
55 | :101CE0001124CF0102962C01089514BE88ED809333
56 | :101CF000710087E081BDB99A2FE78CEF9AE02150FF
57 | :101D000080409040E1F700C00000B9988AE58093D8
58 | :101D10000F018FEF8093000180B5816080BD8BB78C
59 | :101D200080628BBF089580917400282EEAE7F9E164
60 | :101D3000E491EF3F19F0E0937400000004B601FC59
61 | :101D400006C0EDE7F9E1E491EF3F09F03DC1CDDFD9
62 | :101D5000C298712C312C412C512CC0EADFE014E6E2
63 | :101D600086B3837009F014E6115029F41092130120
64 | :101D700010920C017CDF0AB605FE05C04BDE80E246
65 | :101D80008ABF712C04C0219759F7C0E0D0E0A89514
66 | :101D9000809174002092740022E032120CC0E0E8BE
67 | :101DA000F9E1E054F10993E090935700E8953097FA
68 | :101DB000C1F7412C512C90E439120AC0F20132973C
69 | :101DC000E03829E1F20720F495E090935700E89578
70 | :101DD0008093740084E0381203C0CD2B11F4F0C05E
71 | :101DE000312C80911201835087FD99C090910D0193
72 | :101DF0009D3209F092C0883009F08FC083EC809347
73 | :101E000001018AE580930F018091170180769091FE
74 | :101E10001801882379F1911108C082E899E1909323
75 | :101E200011018093100186E06DC0913069F4411476
76 | :101E30005104F1F080911B01807F482E50901C01CD
77 | :101E400081E187BFE89514C0933081F48091190136
78 | :101E500090911A0132DF80911B0190911C012DDFBE
79 | :101E6000842D8F7029F490E4392E4CC09F73392E45
80 | :101E700080E048C08091190110920A01911106C0BA
81 | :101E800010920B012AE031E082E038C0953019F45D
82 | :101E90008093130125C09630E9F490911A01913096
83 | :101EA00019F48AE999E104C0923041F488E899E193
84 | :101EB000909311018093100182E124C09330C1F608
85 | :101EC0008111D6CF8CEA99E1909311018093100192
86 | :101ED00084E018C0983079F0993031F4809315017E
87 | :101EE0002AE031E080E00AC081E09A3009F080E029
88 | :101EF0002AE031E003C025E131E081E030931101B7
89 | :101F00002093100190911E01911105C090911D0127
90 | :101F1000981708F4892F8093000110921201809184
91 | :101F20000F0184FF31C0809100018F3F69F1C82FFC
92 | :101F3000893008F0C8E08C1B80930001909101016A
93 | :101F400088E8892780930101CC2391F080911001CA
94 | :101F5000A2E0B1E0E82FF091110194919D933196A8
95 | :101F60009C2F980F9E13F9CFF0931101E09310016D
96 | :101F70006C2F82E091E04ADDCC5FCC3019F08FEF1E
97 | :101F800080930001C0930F01C30101963C01803B87
98 | :101F9000944029F4EDE7F9E1E491EF3F89F4862DCF
99 | :101FA0008C7411F0BA9801C0BA9A0AB605FED5CE63
100 | :101FB00085E1B19B85E18150E1F780E28ABFCDCE1A
101 | :101FC000BA9893DE1BBE10BC209274000000D6CCE1
102 | :021FD000FFCF41
103 | :040000030000198060
104 | :00000001FF
105 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/services/usb/udc/udc_desc.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Common API for USB Device Interface
5 | *
6 | * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _UDC_DESC_H_
48 | #define _UDC_DESC_H_
49 |
50 | #include "conf_usb.h"
51 | #include "usb_protocol.h"
52 | #include "udi.h"
53 |
54 | #ifdef __cplusplus
55 | extern "C" {
56 | #endif
57 |
58 | /**
59 | * \ingroup udc_group
60 | * \defgroup udc_desc_group USB Device Descriptor
61 | *
62 | * @{
63 | */
64 |
65 | /**
66 | * \brief Defines the memory's location of USB descriptors
67 | *
68 | * By default the Descriptor is stored in RAM
69 | * (UDC_DESC_STORAGE is defined empty).
70 | *
71 | * If you have need to free RAM space,
72 | * it is possible to put descriptor in flash in following case:
73 | * - USB driver authorize flash transfer (USBB on UC3 and USB on Mega)
74 | * - USB Device is not high speed (UDC no need to change USB descriptors)
75 | *
76 | * For UC3 application used "const".
77 | *
78 | * For Mega application used "code".
79 | */
80 | #define UDC_DESC_STORAGE
81 | // Descriptor storage in internal RAM
82 | #if (defined UDC_DATA_USE_HRAM_SUPPORT)
83 | # if defined(__GNUC__)
84 | # define UDC_DATA(x) COMPILER_WORD_ALIGNED __attribute__((__section__(".data_hram0")))
85 | # define UDC_BSS(x) COMPILER_ALIGNED(x) __attribute__((__section__(".bss_hram0")))
86 | # elif defined(__ICCAVR32__)
87 | # define UDC_DATA(x) COMPILER_ALIGNED(x) __data32
88 | # define UDC_BSS(x) COMPILER_ALIGNED(x) __data32
89 | # endif
90 | #else
91 | # define UDC_DATA(x) COMPILER_ALIGNED(x)
92 | # define UDC_BSS(x) COMPILER_ALIGNED(x)
93 | #endif
94 |
95 |
96 |
97 | /**
98 | * \brief Configuration descriptor and UDI link for one USB speed
99 | */
100 | typedef struct {
101 | //! USB configuration descriptor
102 | usb_conf_desc_t UDC_DESC_STORAGE *desc;
103 | //! Array of UDI API pointer
104 | udi_api_t UDC_DESC_STORAGE *UDC_DESC_STORAGE * udi_apis;
105 | } udc_config_speed_t;
106 |
107 |
108 | /**
109 | * \brief All information about the USB Device
110 | */
111 | typedef struct {
112 | //! USB device descriptor for low or full speed
113 | usb_dev_desc_t UDC_DESC_STORAGE *confdev_lsfs;
114 | //! USB configuration descriptor and UDI API pointers for low or full speed
115 | udc_config_speed_t UDC_DESC_STORAGE *conf_lsfs;
116 | #ifdef USB_DEVICE_HS_SUPPORT
117 | //! USB device descriptor for high speed
118 | usb_dev_desc_t UDC_DESC_STORAGE *confdev_hs;
119 | //! USB device qualifier, only use in high speed mode
120 | usb_dev_qual_desc_t UDC_DESC_STORAGE *qualifier;
121 | //! USB configuration descriptor and UDI API pointers for high speed
122 | udc_config_speed_t UDC_DESC_STORAGE *conf_hs;
123 | #endif
124 | usb_dev_bos_desc_t UDC_DESC_STORAGE *conf_bos;
125 | } udc_config_t;
126 |
127 | //! Global variables of USB Device Descriptor and UDI links
128 | extern UDC_DESC_STORAGE udc_config_t udc_config;
129 |
130 | //@}
131 |
132 | #ifdef __cplusplus
133 | }
134 | #endif
135 | #endif // _UDC_DESC_H_
136 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/config/conf_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Board configuration.
5 | *
6 | */
7 |
8 | #ifndef _CONF_BOARD_H_
9 | #define _CONF_BOARD_H_
10 |
11 |
12 | //#define BOARD_ARDUINO_MKR1000
13 | //#define BOARD_ARDUINO_MKRZERO
14 | //#define BOARD_ARDUINO_ZERO
15 | //#define BOARD_WATTUINO_RC
16 | //#define BOARD_EITECH_ROBOTICS
17 | //#define BOARD_DADAMACHINES_AUTOMAT
18 | //#define BOARD_SENSEBOX_MCU
19 |
20 |
21 | #if defined BOARD_ARDUINO_MKR1000 /* Arduino MKR1000 */
22 |
23 | #define USB_DEVICE_VENDOR_ID 0x1D50 // Arduino = 0x2341
24 | #define USB_DEVICE_PRODUCT_ID 0x6112 // MKR1000 Bootloader = 0x004E
25 | #define USB_DEVICE_MANUFACTURE_NAME "Arduino"
26 | #define USB_DEVICE_PRODUCT_NAME "Arduino MKR1000"
27 | #define LED_BOOT PORT_PA20 // PA20 (digital pin 6)
28 | #define LED_BOOT_GROUP 0 // Port A
29 |
30 |
31 | #elif defined BOARD_ARDUINO_MKRZERO /* Arduino MKRZero */
32 |
33 | #define USB_DEVICE_VENDOR_ID 0x1D50 // Arduino = 0x2341
34 | #define USB_DEVICE_PRODUCT_ID 0x6112 // MKRZero Bootloader = 0x004F
35 | #define USB_DEVICE_MANUFACTURE_NAME "Arduino"
36 | #define USB_DEVICE_PRODUCT_NAME "Arduino MKRZero"
37 | #define LED_BOOT PORT_PB08 // PB08 (digital pin 32)
38 | #define LED_BOOT_GROUP 1 // Port B
39 |
40 |
41 | #elif defined BOARD_ARDUINO_ZERO /* Arduino Zero */
42 |
43 | #define USB_DEVICE_VENDOR_ID 0x1D50 // Arduino = 0x2341
44 | #define USB_DEVICE_PRODUCT_ID 0x6112 // Zero Bootloader = 0x004D
45 | #define USB_DEVICE_MANUFACTURE_NAME "Arduino"
46 | #define USB_DEVICE_PRODUCT_NAME "Arduino Zero"
47 | #define LED_BOOT PORT_PA17 // PA17 (digital pin 13)
48 | #define LED_BOOT_GROUP 0 // Port A
49 |
50 |
51 | #elif defined BOARD_WATTUINO_RC /* Watterott Wattuino RC */
52 |
53 | #define USB_DEVICE_VENDOR_ID 0x1D50 // OpenMoko = 0x1D50
54 | #define USB_DEVICE_PRODUCT_ID 0x6112 // SAM-BAR Bootloader = 0x6112
55 | #define USB_DEVICE_MANUFACTURE_NAME "Watterott"
56 | #define USB_DEVICE_PRODUCT_NAME "Wattuino RC"
57 | #ifdef DEBUG
58 | # define LED_BOOT PORT_PA02 // PA02/J1
59 | #else
60 | # define LED_BOOT PORT_PA30 // PA30/SWCLK
61 | #endif
62 | #define LED_BOOT_GROUP 0 // Port A
63 |
64 |
65 | #elif defined BOARD_EITECH_ROBOTICS /* Eitech Robotics */
66 |
67 | #define USB_DEVICE_VENDOR_ID 0x1D50 // OpenMoko = 0x1D50
68 | #define USB_DEVICE_PRODUCT_ID 0x6110 // Eitech Robotics Bootloader = 0x6110
69 | #define USB_DEVICE_MANUFACTURE_NAME "Eitech"
70 | #define USB_DEVICE_PRODUCT_NAME "Eitech Robotics"
71 | #ifdef DEBUG
72 | # define LED_BOOT PORT_PA02 // PA02/J1
73 | #else
74 | # define LED_BOOT PORT_PA30 // PA30/SWCLK (Dev-Edition: PA31/SWDIO)
75 | #endif
76 | #define LED_BOOT_GROUP 0 // Port A
77 |
78 |
79 | #elif defined BOARD_DADAMACHINES_AUTOMAT /* Dadamachines Automat */
80 |
81 | #define USB_DEVICE_VENDOR_ID 0x16D0 // MCS Electronics = 0x16D0
82 | #define USB_DEVICE_PRODUCT_ID 0x0CDA // Automat Bootloader = 0x0CDA
83 | #define USB_DEVICE_MANUFACTURE_NAME "dadamachines"
84 | #define USB_DEVICE_PRODUCT_NAME "Automat"
85 | #define LED_BOOT PORT_PA17 // PA17
86 | #define LED_BOOT_GROUP 0 // Port A
87 |
88 |
89 | #elif defined BOARD_SENSEBOX_MCU /* senseBox MCU*/
90 |
91 | #define USB_DEVICE_VENDOR_ID 0x04D8 // Microchip = 0x04D8
92 | #define USB_DEVICE_PRODUCT_ID 0xEF66 // senseBox MCU Bootloader = 0xEF66
93 | #define USB_DEVICE_MANUFACTURE_NAME "senseBox"
94 | #define USB_DEVICE_PRODUCT_NAME "senseBox MCU"
95 | #define LED_BOOT PORT_PA27 // PA27 and PA28
96 | #define LED_BOOT_GROUP 0 // Port A
97 |
98 |
99 | #else /* no board defined */
100 |
101 | #define USB_DEVICE_VENDOR_ID 0x1D50 // OpenMoko = 0x1D50
102 | #define USB_DEVICE_PRODUCT_ID 0x6112 // SAM-BAR Bootloader = 0x6112
103 | #define USB_DEVICE_MANUFACTURE_NAME "Watterott"
104 | #define USB_DEVICE_PRODUCT_NAME "SAM-BAR"
105 |
106 | #endif
107 |
108 |
109 | #ifndef USB_DEVICE_SERIAL_NAME
110 | # define USB_DEVICE_SERIAL_NAME "876427839026" // Disk SN for MSC
111 | #endif
112 | #ifndef VOLUMELABEL
113 | # define VOLUMELABEL "BOOTLOADER" // Disk Volume Label
114 | #endif
115 |
116 |
117 | #ifdef LED_BOOT
118 | # define LED_BOOT_INIT() PORT->Group[LED_BOOT_GROUP].DIRSET.reg = LED_BOOT
119 | # define LED_BOOT_ON() PORT->Group[LED_BOOT_GROUP].OUTSET.reg = LED_BOOT
120 | # define LED_BOOT_OFF() PORT->Group[LED_BOOT_GROUP].OUTCLR.reg = LED_BOOT
121 | #endif
122 |
123 |
124 | #ifdef DEBUG
125 | # define APP_START_ADDRESS 0x6000 // Debug
126 | #else
127 | # define APP_START_ADDRESS 0x4000 // Release
128 | #endif
129 |
130 |
131 | #endif // _CONF_BOARD_H_
132 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/ac1.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for AC1
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 |
44 | #ifndef _SAMD21_AC1_INSTANCE_
45 | #define _SAMD21_AC1_INSTANCE_
46 |
47 | /* ========== Register definition for AC1 peripheral ========== */
48 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
49 | #define REG_AC1_CTRLA (0x42005400U) /**< \brief (AC1) Control A */
50 | #define REG_AC1_CTRLB (0x42005401U) /**< \brief (AC1) Control B */
51 | #define REG_AC1_EVCTRL (0x42005402U) /**< \brief (AC1) Event Control */
52 | #define REG_AC1_INTENCLR (0x42005404U) /**< \brief (AC1) Interrupt Enable Clear */
53 | #define REG_AC1_INTENSET (0x42005405U) /**< \brief (AC1) Interrupt Enable Set */
54 | #define REG_AC1_INTFLAG (0x42005406U) /**< \brief (AC1) Interrupt Flag Status and Clear */
55 | #define REG_AC1_STATUSA (0x42005408U) /**< \brief (AC1) Status A */
56 | #define REG_AC1_STATUSB (0x42005409U) /**< \brief (AC1) Status B */
57 | #define REG_AC1_STATUSC (0x4200540AU) /**< \brief (AC1) Status C */
58 | #define REG_AC1_WINCTRL (0x4200540CU) /**< \brief (AC1) Window Control */
59 | #define REG_AC1_COMPCTRL0 (0x42005410U) /**< \brief (AC1) Comparator Control 0 */
60 | #define REG_AC1_COMPCTRL1 (0x42005414U) /**< \brief (AC1) Comparator Control 1 */
61 | #define REG_AC1_SCALER0 (0x42005420U) /**< \brief (AC1) Scaler 0 */
62 | #define REG_AC1_SCALER1 (0x42005421U) /**< \brief (AC1) Scaler 1 */
63 | #else
64 | #define REG_AC1_CTRLA (*(RwReg8 *)0x42005400U) /**< \brief (AC1) Control A */
65 | #define REG_AC1_CTRLB (*(WoReg8 *)0x42005401U) /**< \brief (AC1) Control B */
66 | #define REG_AC1_EVCTRL (*(RwReg16*)0x42005402U) /**< \brief (AC1) Event Control */
67 | #define REG_AC1_INTENCLR (*(RwReg8 *)0x42005404U) /**< \brief (AC1) Interrupt Enable Clear */
68 | #define REG_AC1_INTENSET (*(RwReg8 *)0x42005405U) /**< \brief (AC1) Interrupt Enable Set */
69 | #define REG_AC1_INTFLAG (*(RwReg8 *)0x42005406U) /**< \brief (AC1) Interrupt Flag Status and Clear */
70 | #define REG_AC1_STATUSA (*(RoReg8 *)0x42005408U) /**< \brief (AC1) Status A */
71 | #define REG_AC1_STATUSB (*(RoReg8 *)0x42005409U) /**< \brief (AC1) Status B */
72 | #define REG_AC1_STATUSC (*(RoReg8 *)0x4200540AU) /**< \brief (AC1) Status C */
73 | #define REG_AC1_WINCTRL (*(RwReg8 *)0x4200540CU) /**< \brief (AC1) Window Control */
74 | #define REG_AC1_COMPCTRL0 (*(RwReg *)0x42005410U) /**< \brief (AC1) Comparator Control 0 */
75 | #define REG_AC1_COMPCTRL1 (*(RwReg *)0x42005414U) /**< \brief (AC1) Comparator Control 1 */
76 | #define REG_AC1_SCALER0 (*(RwReg8 *)0x42005420U) /**< \brief (AC1) Scaler 0 */
77 | #define REG_AC1_SCALER1 (*(RwReg8 *)0x42005421U) /**< \brief (AC1) Scaler 1 */
78 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
79 |
80 | /* ========== Instance parameters for AC1 peripheral ========== */
81 | #define AC1_CMP_NUM 2 // Number of comparators
82 | #define AC1_GCLK_ID_ANA 32 // Index of Generic Clock for analog
83 | #define AC1_GCLK_ID_DIG 31 // Index of Generic Clock for digital
84 | #define AC1_NUM_CMP 2
85 | #define AC1_PAIRS 1 // Number of pairs of comparators
86 |
87 | #endif /* _SAMD21_AC1_INSTANCE_ */
88 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/ac.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for AC
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_AC_INSTANCE_
48 | #define _SAMD21_AC_INSTANCE_
49 |
50 | /* ========== Register definition for AC peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_AC_CTRLA (0x42004400U) /**< \brief (AC) Control A */
53 | #define REG_AC_CTRLB (0x42004401U) /**< \brief (AC) Control B */
54 | #define REG_AC_EVCTRL (0x42004402U) /**< \brief (AC) Event Control */
55 | #define REG_AC_INTENCLR (0x42004404U) /**< \brief (AC) Interrupt Enable Clear */
56 | #define REG_AC_INTENSET (0x42004405U) /**< \brief (AC) Interrupt Enable Set */
57 | #define REG_AC_INTFLAG (0x42004406U) /**< \brief (AC) Interrupt Flag Status and Clear */
58 | #define REG_AC_STATUSA (0x42004408U) /**< \brief (AC) Status A */
59 | #define REG_AC_STATUSB (0x42004409U) /**< \brief (AC) Status B */
60 | #define REG_AC_STATUSC (0x4200440AU) /**< \brief (AC) Status C */
61 | #define REG_AC_WINCTRL (0x4200440CU) /**< \brief (AC) Window Control */
62 | #define REG_AC_COMPCTRL0 (0x42004410U) /**< \brief (AC) Comparator Control 0 */
63 | #define REG_AC_COMPCTRL1 (0x42004414U) /**< \brief (AC) Comparator Control 1 */
64 | #define REG_AC_SCALER0 (0x42004420U) /**< \brief (AC) Scaler 0 */
65 | #define REG_AC_SCALER1 (0x42004421U) /**< \brief (AC) Scaler 1 */
66 | #else
67 | #define REG_AC_CTRLA (*(RwReg8 *)0x42004400U) /**< \brief (AC) Control A */
68 | #define REG_AC_CTRLB (*(WoReg8 *)0x42004401U) /**< \brief (AC) Control B */
69 | #define REG_AC_EVCTRL (*(RwReg16*)0x42004402U) /**< \brief (AC) Event Control */
70 | #define REG_AC_INTENCLR (*(RwReg8 *)0x42004404U) /**< \brief (AC) Interrupt Enable Clear */
71 | #define REG_AC_INTENSET (*(RwReg8 *)0x42004405U) /**< \brief (AC) Interrupt Enable Set */
72 | #define REG_AC_INTFLAG (*(RwReg8 *)0x42004406U) /**< \brief (AC) Interrupt Flag Status and Clear */
73 | #define REG_AC_STATUSA (*(RoReg8 *)0x42004408U) /**< \brief (AC) Status A */
74 | #define REG_AC_STATUSB (*(RoReg8 *)0x42004409U) /**< \brief (AC) Status B */
75 | #define REG_AC_STATUSC (*(RoReg8 *)0x4200440AU) /**< \brief (AC) Status C */
76 | #define REG_AC_WINCTRL (*(RwReg8 *)0x4200440CU) /**< \brief (AC) Window Control */
77 | #define REG_AC_COMPCTRL0 (*(RwReg *)0x42004410U) /**< \brief (AC) Comparator Control 0 */
78 | #define REG_AC_COMPCTRL1 (*(RwReg *)0x42004414U) /**< \brief (AC) Comparator Control 1 */
79 | #define REG_AC_SCALER0 (*(RwReg8 *)0x42004420U) /**< \brief (AC) Scaler 0 */
80 | #define REG_AC_SCALER1 (*(RwReg8 *)0x42004421U) /**< \brief (AC) Scaler 1 */
81 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
82 |
83 | /* ========== Instance parameters for AC peripheral ========== */
84 | #define AC_CMP_NUM 2 // Number of comparators
85 | #define AC_GCLK_ID_ANA 32 // Index of Generic Clock for analog
86 | #define AC_GCLK_ID_DIG 31 // Index of Generic Clock for digital
87 | #define AC_NUM_CMP 2
88 | #define AC_PAIRS 1 // Number of pairs of comparators
89 |
90 | #endif /* _SAMD21_AC_INSTANCE_ */
91 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/nvmctrl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for NVMCTRL
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_NVMCTRL_INSTANCE_
48 | #define _SAMD21_NVMCTRL_INSTANCE_
49 |
50 | /* ========== Register definition for NVMCTRL peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_NVMCTRL_CTRLA (0x41004000U) /**< \brief (NVMCTRL) Control A */
53 | #define REG_NVMCTRL_CTRLB (0x41004004U) /**< \brief (NVMCTRL) Control B */
54 | #define REG_NVMCTRL_PARAM (0x41004008U) /**< \brief (NVMCTRL) NVM Parameter */
55 | #define REG_NVMCTRL_INTENCLR (0x4100400CU) /**< \brief (NVMCTRL) Interrupt Enable Clear */
56 | #define REG_NVMCTRL_INTENSET (0x41004010U) /**< \brief (NVMCTRL) Interrupt Enable Set */
57 | #define REG_NVMCTRL_INTFLAG (0x41004014U) /**< \brief (NVMCTRL) Interrupt Flag Status and Clear */
58 | #define REG_NVMCTRL_STATUS (0x41004018U) /**< \brief (NVMCTRL) Status */
59 | #define REG_NVMCTRL_ADDR (0x4100401CU) /**< \brief (NVMCTRL) Address */
60 | #define REG_NVMCTRL_LOCK (0x41004020U) /**< \brief (NVMCTRL) Lock Section */
61 | #else
62 | #define REG_NVMCTRL_CTRLA (*(RwReg16*)0x41004000U) /**< \brief (NVMCTRL) Control A */
63 | #define REG_NVMCTRL_CTRLB (*(RwReg *)0x41004004U) /**< \brief (NVMCTRL) Control B */
64 | #define REG_NVMCTRL_PARAM (*(RwReg *)0x41004008U) /**< \brief (NVMCTRL) NVM Parameter */
65 | #define REG_NVMCTRL_INTENCLR (*(RwReg8 *)0x4100400CU) /**< \brief (NVMCTRL) Interrupt Enable Clear */
66 | #define REG_NVMCTRL_INTENSET (*(RwReg8 *)0x41004010U) /**< \brief (NVMCTRL) Interrupt Enable Set */
67 | #define REG_NVMCTRL_INTFLAG (*(RwReg8 *)0x41004014U) /**< \brief (NVMCTRL) Interrupt Flag Status and Clear */
68 | #define REG_NVMCTRL_STATUS (*(RwReg16*)0x41004018U) /**< \brief (NVMCTRL) Status */
69 | #define REG_NVMCTRL_ADDR (*(RwReg *)0x4100401CU) /**< \brief (NVMCTRL) Address */
70 | #define REG_NVMCTRL_LOCK (*(RwReg16*)0x41004020U) /**< \brief (NVMCTRL) Lock Section */
71 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
72 |
73 | /* ========== Instance parameters for NVMCTRL peripheral ========== */
74 | #define NVMCTRL_AUX0_ADDRESS 0x00804000
75 | #define NVMCTRL_AUX1_ADDRESS 0x00806000
76 | #define NVMCTRL_AUX2_ADDRESS 0x00808000
77 | #define NVMCTRL_AUX3_ADDRESS 0x0080A000
78 | #define NVMCTRL_CLK_AHB_ID 4 // Index of AHB Clock in PM.AHBMASK register
79 | #define NVMCTRL_FACTORY_WORD_IMPLEMENTED_MASK 0xC0000007FFFFFFFF
80 | #define NVMCTRL_FLASH_SIZE 65536
81 | #define NVMCTRL_LOCKBIT_ADDRESS 0x00802000
82 | #define NVMCTRL_PAGES 1024
83 | #define NVMCTRL_PAGE_HW 32
84 | #define NVMCTRL_PAGE_SIZE 64
85 | #define NVMCTRL_PAGE_W 16
86 | #define NVMCTRL_PMSB 3
87 | #define NVMCTRL_PSZ_BITS 6
88 | #define NVMCTRL_ROW_PAGES 4
89 | #define NVMCTRL_ROW_SIZE 256
90 | #define NVMCTRL_USER_PAGE_ADDRESS 0x00800000
91 | #define NVMCTRL_USER_PAGE_OFFSET 0x00800000
92 | #define NVMCTRL_USER_WORD_IMPLEMENTED_MASK 0xC01FFFFFFFFFFFFF
93 | #define NVMCTRL_RWWEE_PAGES 32 // Page size
94 | #define NVMCTRL_RWW_EEPROM_ADDR 0x00400000 // Start address of the RWW EEPROM area
95 |
96 | #endif /* _SAMD21_NVMCTRL_INSTANCE_ */
97 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/linker_scripts/samd21/gcc/samd21j18a_flash.ld:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD21J18A
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 |
44 |
45 | OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
46 | OUTPUT_ARCH(arm)
47 | SEARCH_DIR(.)
48 |
49 | /* Memory Spaces Definitions */
50 | MEMORY
51 | {
52 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
53 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 - 0x0004
54 | }
55 |
56 | /* The stack size used by the application. NOTE: you need to adjust according to your application. */
57 | STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
58 |
59 | /* Section Definitions */
60 | SECTIONS
61 | {
62 | .text :
63 | {
64 | . = ALIGN(4);
65 | _sfixed = .;
66 | KEEP(*(.vectors .vectors.*))
67 | *(.text .text.* .gnu.linkonce.t.*)
68 | *(.glue_7t) *(.glue_7)
69 | *(.rodata .rodata* .gnu.linkonce.r.*)
70 | *(.ARM.extab* .gnu.linkonce.armextab.*)
71 |
72 | /* Support C constructors, and C destructors in both user code
73 | and the C library. This also provides support for C++ code. */
74 | . = ALIGN(4);
75 | KEEP(*(.init))
76 | . = ALIGN(4);
77 | __preinit_array_start = .;
78 | KEEP (*(.preinit_array))
79 | __preinit_array_end = .;
80 |
81 | . = ALIGN(4);
82 | __init_array_start = .;
83 | KEEP (*(SORT(.init_array.*)))
84 | KEEP (*(.init_array))
85 | __init_array_end = .;
86 |
87 | . = ALIGN(4);
88 | KEEP (*crtbegin.o(.ctors))
89 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
90 | KEEP (*(SORT(.ctors.*)))
91 | KEEP (*crtend.o(.ctors))
92 |
93 | . = ALIGN(4);
94 | KEEP(*(.fini))
95 |
96 | . = ALIGN(4);
97 | __fini_array_start = .;
98 | KEEP (*(.fini_array))
99 | KEEP (*(SORT(.fini_array.*)))
100 | __fini_array_end = .;
101 |
102 | KEEP (*crtbegin.o(.dtors))
103 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
104 | KEEP (*(SORT(.dtors.*)))
105 | KEEP (*crtend.o(.dtors))
106 |
107 | . = ALIGN(4);
108 | _efixed = .; /* End of text section */
109 | } > rom
110 |
111 | /* .ARM.exidx is sorted, so has to go in its own output section. */
112 | PROVIDE_HIDDEN (__exidx_start = .);
113 | .ARM.exidx :
114 | {
115 | *(.ARM.exidx* .gnu.linkonce.armexidx.*)
116 | } > rom
117 | PROVIDE_HIDDEN (__exidx_end = .);
118 |
119 | . = ALIGN(4);
120 | _etext = .;
121 |
122 | .relocate : AT (_etext)
123 | {
124 | . = ALIGN(4);
125 | _srelocate = .;
126 | *(.ramfunc .ramfunc.*);
127 | *(.data .data.*);
128 | . = ALIGN(4);
129 | _erelocate = .;
130 | } > ram
131 |
132 | /* .bss section which is used for uninitialized data */
133 | .bss (NOLOAD) :
134 | {
135 | . = ALIGN(4);
136 | _sbss = . ;
137 | _szero = .;
138 | *(.bss .bss.*)
139 | *(COMMON)
140 | . = ALIGN(4);
141 | _ebss = . ;
142 | _ezero = .;
143 | } > ram
144 |
145 | /* stack section */
146 | .stack (NOLOAD):
147 | {
148 | . = ALIGN(8);
149 | _sstack = .;
150 | . = . + STACK_SIZE;
151 | . = ALIGN(8);
152 | _estack = .;
153 | } > ram
154 |
155 | . = ALIGN(4);
156 | _end = . ;
157 | }
158 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/i2s.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for I2S
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_I2S_INSTANCE_
48 | #define _SAMD21_I2S_INSTANCE_
49 |
50 | /* ========== Register definition for I2S peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_I2S_CTRLA (0x42005000U) /**< \brief (I2S) Control A */
53 | #define REG_I2S_CLKCTRL0 (0x42005004U) /**< \brief (I2S) Clock Unit 0 Control */
54 | #define REG_I2S_CLKCTRL1 (0x42005008U) /**< \brief (I2S) Clock Unit 1 Control */
55 | #define REG_I2S_INTENCLR (0x4200500CU) /**< \brief (I2S) Interrupt Enable Clear */
56 | #define REG_I2S_INTENSET (0x42005010U) /**< \brief (I2S) Interrupt Enable Set */
57 | #define REG_I2S_INTFLAG (0x42005014U) /**< \brief (I2S) Interrupt Flag Status and Clear */
58 | #define REG_I2S_SYNCBUSY (0x42005018U) /**< \brief (I2S) Synchronization Status */
59 | #define REG_I2S_SERCTRL0 (0x42005020U) /**< \brief (I2S) Serializer 0 Control */
60 | #define REG_I2S_SERCTRL1 (0x42005024U) /**< \brief (I2S) Serializer 1 Control */
61 | #define REG_I2S_DATA0 (0x42005030U) /**< \brief (I2S) Data 0 */
62 | #define REG_I2S_DATA1 (0x42005034U) /**< \brief (I2S) Data 1 */
63 | #else
64 | #define REG_I2S_CTRLA (*(RwReg8 *)0x42005000U) /**< \brief (I2S) Control A */
65 | #define REG_I2S_CLKCTRL0 (*(RwReg *)0x42005004U) /**< \brief (I2S) Clock Unit 0 Control */
66 | #define REG_I2S_CLKCTRL1 (*(RwReg *)0x42005008U) /**< \brief (I2S) Clock Unit 1 Control */
67 | #define REG_I2S_INTENCLR (*(RwReg16*)0x4200500CU) /**< \brief (I2S) Interrupt Enable Clear */
68 | #define REG_I2S_INTENSET (*(RwReg16*)0x42005010U) /**< \brief (I2S) Interrupt Enable Set */
69 | #define REG_I2S_INTFLAG (*(RwReg16*)0x42005014U) /**< \brief (I2S) Interrupt Flag Status and Clear */
70 | #define REG_I2S_SYNCBUSY (*(RoReg16*)0x42005018U) /**< \brief (I2S) Synchronization Status */
71 | #define REG_I2S_SERCTRL0 (*(RwReg *)0x42005020U) /**< \brief (I2S) Serializer 0 Control */
72 | #define REG_I2S_SERCTRL1 (*(RwReg *)0x42005024U) /**< \brief (I2S) Serializer 1 Control */
73 | #define REG_I2S_DATA0 (*(RwReg *)0x42005030U) /**< \brief (I2S) Data 0 */
74 | #define REG_I2S_DATA1 (*(RwReg *)0x42005034U) /**< \brief (I2S) Data 1 */
75 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
76 |
77 | /* ========== Instance parameters for I2S peripheral ========== */
78 | #define I2S_CLK_NUM 2 // Number of clock units
79 | #define I2S_DMAC_ID_RX_0 41
80 | #define I2S_DMAC_ID_RX_1 42
81 | #define I2S_DMAC_ID_RX_LSB 41
82 | #define I2S_DMAC_ID_RX_MSB 42
83 | #define I2S_DMAC_ID_RX_SIZE 2
84 | #define I2S_DMAC_ID_TX_0 43
85 | #define I2S_DMAC_ID_TX_1 44
86 | #define I2S_DMAC_ID_TX_LSB 43
87 | #define I2S_DMAC_ID_TX_MSB 44
88 | #define I2S_DMAC_ID_TX_SIZE 2
89 | #define I2S_GCLK_ID_0 35
90 | #define I2S_GCLK_ID_1 36
91 | #define I2S_GCLK_ID_LSB 35
92 | #define I2S_GCLK_ID_MSB 36
93 | #define I2S_GCLK_ID_SIZE 2
94 | #define I2S_MAX_SLOTS 8 // Max number of data slots in frame
95 | #define I2S_SER_NUM 2 // Number of serializers
96 |
97 | #endif /* _SAMD21_I2S_INSTANCE_ */
98 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/instance/pm.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PM
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_PM_INSTANCE_
48 | #define _SAMD21_PM_INSTANCE_
49 |
50 | /* ========== Register definition for PM peripheral ========== */
51 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
52 | #define REG_PM_CTRL (0x40000400U) /**< \brief (PM) Control */
53 | #define REG_PM_SLEEP (0x40000401U) /**< \brief (PM) Sleep Mode */
54 | #define REG_PM_EXTCTRL (0x40000402U) /**< \brief (PM) External Reset Controller */
55 | #define REG_PM_CPUSEL (0x40000408U) /**< \brief (PM) CPU Clock Select */
56 | #define REG_PM_APBASEL (0x40000409U) /**< \brief (PM) APBA Clock Select */
57 | #define REG_PM_APBBSEL (0x4000040AU) /**< \brief (PM) APBB Clock Select */
58 | #define REG_PM_APBCSEL (0x4000040BU) /**< \brief (PM) APBC Clock Select */
59 | #define REG_PM_AHBMASK (0x40000414U) /**< \brief (PM) AHB Mask */
60 | #define REG_PM_APBAMASK (0x40000418U) /**< \brief (PM) APBA Mask */
61 | #define REG_PM_APBBMASK (0x4000041CU) /**< \brief (PM) APBB Mask */
62 | #define REG_PM_APBCMASK (0x40000420U) /**< \brief (PM) APBC Mask */
63 | #define REG_PM_INTENCLR (0x40000434U) /**< \brief (PM) Interrupt Enable Clear */
64 | #define REG_PM_INTENSET (0x40000435U) /**< \brief (PM) Interrupt Enable Set */
65 | #define REG_PM_INTFLAG (0x40000436U) /**< \brief (PM) Interrupt Flag Status and Clear */
66 | #define REG_PM_RCAUSE (0x40000438U) /**< \brief (PM) Reset Cause */
67 | #else
68 | #define REG_PM_CTRL (*(RwReg8 *)0x40000400U) /**< \brief (PM) Control */
69 | #define REG_PM_SLEEP (*(RwReg8 *)0x40000401U) /**< \brief (PM) Sleep Mode */
70 | #define REG_PM_EXTCTRL (*(RwReg8 *)0x40000402U) /**< \brief (PM) External Reset Controller */
71 | #define REG_PM_CPUSEL (*(RwReg8 *)0x40000408U) /**< \brief (PM) CPU Clock Select */
72 | #define REG_PM_APBASEL (*(RwReg8 *)0x40000409U) /**< \brief (PM) APBA Clock Select */
73 | #define REG_PM_APBBSEL (*(RwReg8 *)0x4000040AU) /**< \brief (PM) APBB Clock Select */
74 | #define REG_PM_APBCSEL (*(RwReg8 *)0x4000040BU) /**< \brief (PM) APBC Clock Select */
75 | #define REG_PM_AHBMASK (*(RwReg *)0x40000414U) /**< \brief (PM) AHB Mask */
76 | #define REG_PM_APBAMASK (*(RwReg *)0x40000418U) /**< \brief (PM) APBA Mask */
77 | #define REG_PM_APBBMASK (*(RwReg *)0x4000041CU) /**< \brief (PM) APBB Mask */
78 | #define REG_PM_APBCMASK (*(RwReg *)0x40000420U) /**< \brief (PM) APBC Mask */
79 | #define REG_PM_INTENCLR (*(RwReg8 *)0x40000434U) /**< \brief (PM) Interrupt Enable Clear */
80 | #define REG_PM_INTENSET (*(RwReg8 *)0x40000435U) /**< \brief (PM) Interrupt Enable Set */
81 | #define REG_PM_INTFLAG (*(RwReg8 *)0x40000436U) /**< \brief (PM) Interrupt Flag Status and Clear */
82 | #define REG_PM_RCAUSE (*(RoReg8 *)0x40000438U) /**< \brief (PM) Reset Cause */
83 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
84 |
85 | /* ========== Instance parameters for PM peripheral ========== */
86 | #define PM_CTRL_MCSEL_DFLL48M 3
87 | #define PM_CTRL_MCSEL_GCLK 0
88 | #define PM_CTRL_MCSEL_OSC8M 1
89 | #define PM_CTRL_MCSEL_XOSC 2
90 | #define PM_PM_CLK_APB_NUM 2
91 |
92 | #endif /* _SAMD21_PM_INSTANCE_ */
93 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/common/services/usb/class/msc/usb_protocol_msc.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief USB Mass Storage Class (MSC) protocol definitions.
5 | *
6 | * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _USB_PROTOCOL_MSC_H_
48 | #define _USB_PROTOCOL_MSC_H_
49 |
50 |
51 | /**
52 | * \ingroup usb_protocol_group
53 | * \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions
54 | *
55 | * @{
56 | */
57 |
58 | /**
59 | * \name Possible Class value
60 | */
61 | //@{
62 | #define MSC_CLASS 0x08
63 | //@}
64 |
65 | /**
66 | * \name Possible SubClass value
67 | * \note In practise, most devices should use
68 | * #MSC_SUBCLASS_TRANSPARENT and specify the actual command set in
69 | * the standard INQUIRY data block, even if the MSC spec indicates
70 | * otherwise. In particular, RBC is not supported by certain major
71 | * operating systems like Windows XP.
72 | */
73 | //@{
74 | #define MSC_SUBCLASS_RBC 0x01 //!< Reduced Block Commands
75 | #define MSC_SUBCLASS_ATAPI 0x02 //!< CD/DVD devices
76 | #define MSC_SUBCLASS_QIC_157 0x03 //!< Tape devices
77 | #define MSC_SUBCLASS_UFI 0x04 //!< Floppy disk drives
78 | #define MSC_SUBCLASS_SFF_8070I 0x05 //!< Floppy disk drives
79 | #define MSC_SUBCLASS_TRANSPARENT 0x06 //!< Determined by INQUIRY
80 | //@}
81 |
82 | /**
83 | * \name Possible protocol value
84 | * \note Only the BULK protocol should be used in new designs.
85 | */
86 | //@{
87 | #define MSC_PROTOCOL_CBI 0x00 //!< Command/Bulk/Interrupt
88 | #define MSC_PROTOCOL_CBI_ALT 0x01 //!< W/o command completion
89 | #define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only
90 | //@}
91 |
92 |
93 | /**
94 | * \brief MSC USB requests (bRequest)
95 | */
96 | enum usb_reqid_msc {
97 | USB_REQ_MSC_BULK_RESET = 0xFF, //!< Mass Storage Reset
98 | USB_REQ_MSC_GET_MAX_LUN = 0xFE, //!< Get Max LUN
99 | };
100 |
101 |
102 | COMPILER_PACK_SET(1)
103 |
104 | /**
105 | * \name A Command Block Wrapper (CBW).
106 | */
107 | //@{
108 | struct usb_msc_cbw {
109 | le32_t dCBWSignature; //!< Must contain 'USBC'
110 | le32_t dCBWTag; //!< Unique command ID
111 | le32_t dCBWDataTransferLength; //!< Number of bytes to transfer
112 | uint8_t bmCBWFlags; //!< Direction in bit 7
113 | uint8_t bCBWLUN; //!< Logical Unit Number
114 | uint8_t bCBWCBLength; //!< Number of valid CDB bytes
115 | uint8_t CDB[16]; //!< SCSI Command Descriptor Block
116 | };
117 |
118 | #define USB_CBW_SIGNATURE 0x55534243 //!< dCBWSignature value
119 | #define USB_CBW_DIRECTION_IN (1<<7) //!< Data from device to host
120 | #define USB_CBW_DIRECTION_OUT (0<<7) //!< Data from host to device
121 | #define USB_CBW_LUN_MASK 0x0F //!< Valid bits in bCBWLUN
122 | #define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength
123 | //@}
124 |
125 |
126 | /**
127 | * \name A Command Status Wrapper (CSW).
128 | */
129 | //@{
130 | struct usb_msc_csw {
131 | le32_t dCSWSignature; //!< Must contain 'USBS'
132 | le32_t dCSWTag; //!< Same as dCBWTag
133 | le32_t dCSWDataResidue; //!< Number of bytes not transfered
134 | uint8_t bCSWStatus; //!< Status code
135 | };
136 |
137 | #define USB_CSW_SIGNATURE 0x55534253 //!< dCSWSignature value
138 | #define USB_CSW_STATUS_PASS 0x00 //!< Command Passed
139 | #define USB_CSW_STATUS_FAIL 0x01 //!< Command Failed
140 | #define USB_CSW_STATUS_PE 0x02 //!< Phase Error
141 | //@}
142 |
143 | COMPILER_PACK_RESET()
144 |
145 | //@}
146 |
147 | #endif // _USB_PROTOCOL_MSC_H_
148 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/drivers/usb/stack_interface/usb_dual.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM USB Dual Role driver file.
5 | *
6 | * Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 | #include
47 | #include "usb_dual.h"
48 |
49 | #ifndef UDD_ENABLE
50 | # define udc_start()
51 | # define udc_stop()
52 | #else
53 | #include
54 | #endif
55 |
56 | #ifndef UHD_ENABLE
57 | # define uhc_start(void)
58 | # define uhc_stop(b_id_stop)
59 | #else
60 | #include
61 | #endif
62 |
63 | /* State of USB dual role initialization */
64 | static bool _initialized = false;
65 |
66 | #define _usb_is_id_device() port_pin_get_input_level(USB_ID_PIN)
67 |
68 | #if USB_ID_EIC
69 | static void usb_id_handler(void);
70 |
71 | /**
72 | * \name USB ID PAD management
73 | *
74 | * @{
75 | */
76 |
77 | /**
78 | * USB ID pin configuration
79 | */
80 | static void usb_id_config(void)
81 | {
82 | struct extint_chan_conf eint_chan_conf;
83 | extint_chan_get_config_defaults(&eint_chan_conf);
84 |
85 | eint_chan_conf.gpio_pin = USB_ID_PIN;
86 | eint_chan_conf.gpio_pin_mux = USB_ID_EIC_MUX;
87 | eint_chan_conf.detection_criteria = EXTINT_DETECT_BOTH;
88 | eint_chan_conf.filter_input_signal = true;
89 |
90 | extint_chan_disable_callback(USB_ID_EIC_LINE,
91 | EXTINT_CALLBACK_TYPE_DETECT);
92 | extint_chan_set_config(USB_ID_EIC_LINE, &eint_chan_conf);
93 | extint_register_callback(usb_id_handler,
94 | USB_ID_EIC_LINE,
95 | EXTINT_CALLBACK_TYPE_DETECT);
96 | extint_chan_enable_callback(USB_ID_EIC_LINE,
97 | EXTINT_CALLBACK_TYPE_DETECT);
98 | }
99 |
100 | /**
101 | * USB ID pin change handler
102 | */
103 | static void usb_id_handler(void)
104 | {
105 | extint_chan_disable_callback(USB_ID_EIC_LINE,
106 | EXTINT_CALLBACK_TYPE_DETECT);
107 | if (_usb_is_id_device()) {
108 | uhc_stop(false);
109 | UHC_MODE_CHANGE(false);
110 | udc_start();
111 | } else {
112 | udc_stop();
113 | UHC_MODE_CHANGE(true);
114 | uhc_start();
115 | }
116 | extint_chan_enable_callback(USB_ID_EIC_LINE,
117 | EXTINT_CALLBACK_TYPE_DETECT);
118 | }
119 | #endif
120 | /** @} */
121 |
122 | /**
123 | * \brief Initialize the USB peripheral and set right role according to ID pin
124 | *
125 | * \return \c true if the ID pin management has been started, otherwise \c false.
126 | */
127 | bool usb_dual_enable(void)
128 | {
129 | if (_initialized) {
130 | return false; // Dual role already initialized
131 | }
132 |
133 | #if USB_ID_EIC
134 | _initialized = true;
135 |
136 | struct port_config pin_conf;
137 | port_get_config_defaults(&pin_conf);
138 |
139 | /* Set USB ID Pin as inputs */
140 | pin_conf.direction = PORT_PIN_DIR_INPUT;
141 | pin_conf.input_pull = PORT_PIN_PULL_UP;
142 | port_pin_set_config(USB_ID_PIN, &pin_conf);
143 |
144 | usb_id_config();
145 | if (_usb_is_id_device()) {
146 | UHC_MODE_CHANGE(false);
147 | udc_start();
148 | } else {
149 | UHC_MODE_CHANGE(true);
150 | uhc_start();
151 | }
152 |
153 | /**
154 | * End of host or device startup,
155 | * the current mode selected is already started now
156 | */
157 | return true; // ID pin management has been enabled
158 | #else
159 | return false; // ID pin management has not been enabled
160 | #endif
161 | }
162 |
163 | /**
164 | * \brief Deinitialize the dual role driver
165 | */
166 | void usb_dual_disable(void)
167 | {
168 | if (!_initialized) {
169 | return; // Dual role not initialized
170 | }
171 | _initialized = false;
172 |
173 | #if USB_ID_EIC
174 | extint_chan_disable_callback(USB_ID_EIC_LINE,
175 | EXTINT_CALLBACK_TYPE_DETECT);
176 | #endif
177 | }
178 |
179 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/ASF/sam0/utils/cmsis/samd21/include/component/pac.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Component description for PAC
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD21_PAC_COMPONENT_
48 | #define _SAMD21_PAC_COMPONENT_
49 |
50 | /* ========================================================================== */
51 | /** SOFTWARE API DEFINITION FOR PAC */
52 | /* ========================================================================== */
53 | /** \addtogroup SAMD21_PAC Peripheral Access Controller */
54 | /*@{*/
55 |
56 | #define PAC_U2211
57 | #define REV_PAC 0x101
58 |
59 | /* -------- PAC_WPCLR : (PAC Offset: 0x0) (R/W 32) Write Protection Clear -------- */
60 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
61 | typedef union {
62 | struct {
63 | uint32_t :1; /*!< bit: 0 Reserved */
64 | uint32_t WP:31; /*!< bit: 1..31 Write Protection Clear */
65 | } bit; /*!< Structure used for bit access */
66 | uint32_t reg; /*!< Type used for register access */
67 | } PAC_WPCLR_Type;
68 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
69 |
70 | #define PAC_WPCLR_OFFSET 0x0 /**< \brief (PAC_WPCLR offset) Write Protection Clear */
71 | #define PAC_WPCLR_RESETVALUE 0x00000000ul /**< \brief (PAC_WPCLR reset_value) Write Protection Clear */
72 |
73 | #define PAC_WPCLR_WP_Pos 1 /**< \brief (PAC_WPCLR) Write Protection Clear */
74 | #define PAC_WPCLR_WP_Msk (0x7FFFFFFFul << PAC_WPCLR_WP_Pos)
75 | #define PAC_WPCLR_WP(value) ((PAC_WPCLR_WP_Msk & ((value) << PAC_WPCLR_WP_Pos)))
76 | #define PAC_WPCLR_MASK 0xFFFFFFFEul /**< \brief (PAC_WPCLR) MASK Register */
77 |
78 | /* -------- PAC_WPSET : (PAC Offset: 0x4) (R/W 32) Write Protection Set -------- */
79 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
80 | typedef union {
81 | struct {
82 | uint32_t :1; /*!< bit: 0 Reserved */
83 | uint32_t WP:31; /*!< bit: 1..31 Write Protection Set */
84 | } bit; /*!< Structure used for bit access */
85 | uint32_t reg; /*!< Type used for register access */
86 | } PAC_WPSET_Type;
87 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
88 |
89 | #define PAC_WPSET_OFFSET 0x4 /**< \brief (PAC_WPSET offset) Write Protection Set */
90 | #define PAC_WPSET_RESETVALUE 0x00000000ul /**< \brief (PAC_WPSET reset_value) Write Protection Set */
91 |
92 | #define PAC_WPSET_WP_Pos 1 /**< \brief (PAC_WPSET) Write Protection Set */
93 | #define PAC_WPSET_WP_Msk (0x7FFFFFFFul << PAC_WPSET_WP_Pos)
94 | #define PAC_WPSET_WP(value) ((PAC_WPSET_WP_Msk & ((value) << PAC_WPSET_WP_Pos)))
95 | #define PAC_WPSET_MASK 0xFFFFFFFEul /**< \brief (PAC_WPSET) MASK Register */
96 |
97 | /** \brief PAC hardware registers */
98 | #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
99 | typedef struct {
100 | __IO PAC_WPCLR_Type WPCLR; /**< \brief Offset: 0x0 (R/W 32) Write Protection Clear */
101 | __IO PAC_WPSET_Type WPSET; /**< \brief Offset: 0x4 (R/W 32) Write Protection Set */
102 | } Pac;
103 | #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
104 |
105 | /*@}*/
106 |
107 | #endif /* _SAMD21_PAC_COMPONENT_ */
108 |
--------------------------------------------------------------------------------
/software/SAM-BAR/src/config/conf_access.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Memory access control configuration file.
5 | *
6 | * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 |
44 | #ifndef _CONF_ACCESS_H_
45 | #define _CONF_ACCESS_H_
46 |
47 | #include "compiler.h"
48 |
49 |
50 | /*! \name Activation of Logical Unit Numbers
51 | */
52 | //! @{
53 | #define LUN_0 ENABLE //!< On-Chip Virtual Memory.
54 | #define LUN_1 DISABLE //!< AT45DBX Data Flash.
55 | #define LUN_2 DISABLE //!< SD/MMC Card over SPI.
56 | #define LUN_3 DISABLE //!< SD/MMC Card over MCI Slot 0.
57 | #define LUN_4 DISABLE
58 | #define LUN_5 DISABLE
59 | #define LUN_6 DISABLE
60 | #define LUN_7 DISABLE
61 | #define LUN_USB DISABLE //!< Host Mass-Storage Memory.
62 | //! @}
63 |
64 | /*! \name LUN 0 Definitions
65 | */
66 | //! @{
67 | #define VIRTUAL_MEM LUN_0
68 | #define LUN_ID_VIRTUAL_MEM LUN_ID_0
69 | #define LUN_0_INCLUDE "virtual_flash_mem.h"
70 | #define Lun_0_test_unit_ready virtual_test_unit_ready
71 | #define Lun_0_read_capacity virtual_read_capacity
72 | #define Lun_0_unload NULL /* Can not be unloaded */
73 | #define Lun_0_wr_protect virtual_wr_protect
74 | #define Lun_0_removal virtual_removal
75 | #define Lun_0_usb_read_10 virtual_usb_read_10
76 | #define Lun_0_usb_write_10 virtual_usb_write_10
77 | #define Lun_0_mem_2_ram virtual_mem_2_ram
78 | #define Lun_0_ram_2_mem virtual_ram_2_mem
79 | #define LUN_0_NAME "\"On-Chip Virtual Memory\""
80 | //! @}
81 |
82 | /*! \name USB LUNs Definitions
83 | */
84 | //! @{
85 | #define MEM_USB LUN_USB
86 | #define LUN_ID_MEM_USB LUN_ID_USB
87 | #define LUN_USB_INCLUDE "uhi_msc_mem.h"
88 | #define Lun_usb_get_lun() uhi_msc_mem_get_lun()
89 | #define Lun_usb_test_unit_ready(lun) uhi_msc_mem_test_unit_ready(lun)
90 | #define Lun_usb_read_capacity(lun, nb_sect) uhi_msc_mem_read_capacity(lun, nb_sect)
91 | #define Lun_usb_read_sector_size(lun) uhi_msc_mem_read_sector_size(lun)
92 | #define Lun_usb_wr_protect(lun) uhi_msc_mem_wr_protect(lun)
93 | #define Lun_usb_removal() uhi_msc_mem_removal()
94 | #define Lun_usb_mem_2_ram(addr, ram) uhi_msc_mem_read_10_ram(addr, ram)
95 | #define Lun_usb_ram_2_mem(addr, ram) uhi_msc_mem_write_10_ram(addr, ram)
96 | #define LUN_USB_NAME "\"Host Mass-Storage Memory\""
97 | //! @}
98 |
99 | /*! \name Actions Associated with Memory Accesses
100 | *
101 | * Write here the action to associate with each memory access.
102 | *
103 | * \warning Be careful not to waste time in order not to disturb the functions.
104 | */
105 | //! @{
106 | #define memory_start_read_action(nb_sectors) //ui_start_read()
107 | #define memory_stop_read_action() //ui_stop_read()
108 | #define memory_start_write_action(nb_sectors) //ui_start_write()
109 | #define memory_stop_write_action() //ui_stop_write()
110 | //#include "ui.h"
111 | //! @}
112 |
113 | /*! \name Activation of Interface Features
114 | */
115 | //! @{
116 | #define ACCESS_USB true //!< MEM <-> USB interface.
117 | #define ACCESS_MEM_TO_RAM false //!< MEM <-> RAM interface.
118 | #define ACCESS_STREAM false //!< Streaming MEM <-> MEM interface.
119 | #define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode.
120 | #define ACCESS_MEM_TO_MEM false //!< MEM <-> MEM interface.
121 | #define ACCESS_CODEC false //!< Codec interface.
122 | //! @}
123 |
124 | /*! \name Specific Options for Access Control
125 | */
126 | //! @{
127 | #define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
128 | //! @}
129 |
130 |
131 | #endif // _CONF_ACCESS_H_
132 |
--------------------------------------------------------------------------------