├── LICENSE
├── AT04189_bootloader
├── arm Linker Misc.txt
└── SAM-BA_Monitor
│ ├── settings
│ ├── samd20_samba_monitor.wspos
│ ├── samd20_samba_monitor.crun
│ ├── samd20_samba_monitor.Debug.general.xcl
│ ├── samd20_samba_monitor.Debug.driver.xcl
│ ├── samd20_samba_monitor_Debug.jlink
│ ├── samd20_samba_monitor.Debug.cspy.bat
│ ├── samd20_samba_monitor.dni
│ └── samd20_samba_monitor.wsdt
│ ├── Debug
│ ├── Obj
│ │ ├── main.o
│ │ ├── main.pbi
│ │ ├── usart_sam_ba.o
│ │ ├── sam_ba_monitor.o
│ │ ├── usart_sam_ba.pbi
│ │ ├── sam_ba_monitor.pbi
│ │ ├── samd20_samba_monitor.pbd
│ │ └── samd20_samba_monitor.pbd.browse
│ └── Exe
│ │ └── samd20_samba_monitor.out
│ ├── samd20_samba_monitor.eww
│ ├── conf_bootloader.h
│ ├── sam_ba_monitor.h
│ └── linker
│ ├── SAMD20E15_flash.icf
│ ├── SAMD20G15_flash.icf
│ ├── SAMD20J15_flash.icf
│ ├── SAMD20E16_flash.icf
│ ├── SAMD20E17_flash.icf
│ ├── SAMD20E18_flash.icf
│ ├── SAMD20G16_flash.icf
│ ├── SAMD20G17_flash.icf
│ ├── SAMD20G18_flash.icf
│ ├── SAMD20J16_flash.icf
│ ├── SAMD20J17_flash.icf
│ └── SAMD20J18_flash.icf
├── images
├── bmf055.jpg
├── schematic.JPG
├── DSC06806_s.jpg
├── DSC06808_s.jpg
├── DSC06812_s.jpg
├── DSC06816_s.jpg
├── DSC06834_s.jpg
├── DSC06835_s.jpg
├── DSC06841_s.jpg
├── motor_layout.JPG
└── shuttle_pins.JPG
├── BMF055FlightController_MW21
├── src
│ ├── bmf055.h
│ ├── serial.c
│ ├── eeprom_emulation.c
│ ├── ASF_Support
│ │ ├── clock_support.c
│ │ ├── clock_support.h
│ │ ├── eeprom_emulator_support.c
│ │ ├── eeprom_emulator_support.h
│ │ ├── spi_support.h
│ │ ├── spi_support.c
│ │ ├── usart_support.h
│ │ └── usart_support.c
│ ├── ASF
│ │ ├── thirdparty
│ │ │ └── CMSIS
│ │ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf
│ │ │ │ ├── ATMEL-disclaimer.txt
│ │ │ │ ├── Lib
│ │ │ │ └── license.txt
│ │ │ │ └── README.txt
│ │ ├── common2
│ │ │ └── boards
│ │ │ │ └── user_board
│ │ │ │ ├── init.c
│ │ │ │ └── user_board.h
│ │ ├── sam0
│ │ │ ├── drivers
│ │ │ │ ├── system
│ │ │ │ │ ├── clock
│ │ │ │ │ │ └── clock.h
│ │ │ │ │ ├── reset
│ │ │ │ │ │ └── reset_sam_d_r
│ │ │ │ │ │ │ └── reset.h
│ │ │ │ │ ├── system.c
│ │ │ │ │ └── pinmux
│ │ │ │ │ │ └── quick_start
│ │ │ │ │ │ └── qs_pinmux_basic.h
│ │ │ │ ├── sercom
│ │ │ │ │ ├── sercom_interrupt.h
│ │ │ │ │ ├── sercom.h
│ │ │ │ │ ├── usart
│ │ │ │ │ │ └── quick_start_lin
│ │ │ │ │ │ │ └── qs_lin.h
│ │ │ │ │ └── sercom_interrupt.c
│ │ │ │ └── port
│ │ │ │ │ ├── port.c
│ │ │ │ │ └── quick_start
│ │ │ │ │ └── qs_port_basic.h
│ │ │ └── utils
│ │ │ │ ├── preprocessor
│ │ │ │ ├── preprocessor.h
│ │ │ │ ├── stringz.h
│ │ │ │ └── tpaste.h
│ │ │ │ ├── cmsis
│ │ │ │ └── samd20
│ │ │ │ │ ├── source
│ │ │ │ │ ├── system_samd20.h
│ │ │ │ │ └── system_samd20.c
│ │ │ │ │ └── include
│ │ │ │ │ ├── instance
│ │ │ │ │ ├── pac0.h
│ │ │ │ │ ├── pac1.h
│ │ │ │ │ ├── pac2.h
│ │ │ │ │ ├── wdt.h
│ │ │ │ │ ├── dac.h
│ │ │ │ │ ├── gclk.h
│ │ │ │ │ └── eic.h
│ │ │ │ │ └── samd20.h
│ │ │ │ ├── header_files
│ │ │ │ └── io.h
│ │ │ │ └── syscalls
│ │ │ │ └── gcc
│ │ │ │ └── syscalls.c
│ │ └── common
│ │ │ └── utils
│ │ │ ├── interrupt
│ │ │ └── interrupt_sam_nvic.c
│ │ │ └── interrupt.h
│ ├── output.h
│ ├── rx.h
│ ├── eeprom_emulation.h
│ ├── sensors.h
│ ├── imu.h
│ ├── config
│ │ ├── conf_board.h
│ │ └── conf_spi.h
│ └── asf.h
├── Make_hwPfDef.mk
├── Makefile_APP.mk
├── jlink.config
├── .project
├── BMF055_flight_controller.atsln
└── Makefile_ASF.mk
└── README.md
/LICENSE:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/AT04189_bootloader/arm Linker Misc.txt:
--------------------------------------------------------------------------------
1 | -Wl,--section-start=.text=0x2000
2 | bootprot 0x02
3 | eeprom 0x04
--------------------------------------------------------------------------------
/images/bmf055.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/bmf055.jpg
--------------------------------------------------------------------------------
/images/schematic.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/schematic.JPG
--------------------------------------------------------------------------------
/images/DSC06806_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06806_s.jpg
--------------------------------------------------------------------------------
/images/DSC06808_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06808_s.jpg
--------------------------------------------------------------------------------
/images/DSC06812_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06812_s.jpg
--------------------------------------------------------------------------------
/images/DSC06816_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06816_s.jpg
--------------------------------------------------------------------------------
/images/DSC06834_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06834_s.jpg
--------------------------------------------------------------------------------
/images/DSC06835_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06835_s.jpg
--------------------------------------------------------------------------------
/images/DSC06841_s.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/DSC06841_s.jpg
--------------------------------------------------------------------------------
/images/motor_layout.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/motor_layout.JPG
--------------------------------------------------------------------------------
/images/shuttle_pins.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/images/shuttle_pins.JPG
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.wspos:
--------------------------------------------------------------------------------
1 | [MainWindow]
2 | WindowPlacement=_ 339 101 1703 827 3
3 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/bmf055.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/bmf055.h
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/serial.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/serial.c
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/main.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/main.o
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/eeprom_emulation.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/eeprom_emulation.c
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/main.pbi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/main.pbi
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/usart_sam_ba.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/usart_sam_ba.o
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/sam_ba_monitor.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/sam_ba_monitor.o
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/usart_sam_ba.pbi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/usart_sam_ba.pbi
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/clock_support.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/ASF_Support/clock_support.c
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/clock_support.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/ASF_Support/clock_support.h
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/sam_ba_monitor.pbi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/sam_ba_monitor.pbi
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Exe/samd20_samba_monitor.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Exe/samd20_samba_monitor.out
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/samd20_samba_monitor.pbd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/samd20_samba_monitor.pbd
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/samd20_samba_monitor.pbd.browse:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/AT04189_bootloader/SAM-BA_Monitor/Debug/Obj/samd20_samba_monitor.pbd.browse
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NightHawk32/BMF055-flight-controller/HEAD/BMF055FlightController_MW21/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/samd20_samba_monitor.eww:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | $WS_DIR$\samd20_samba_monitor.ewp
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/Make_hwPfDef.mk:
--------------------------------------------------------------------------------
1 | ####################################################################
2 | # HW dependent switches #
3 | ####################################################################
4 |
5 | CPU_CORE = M0PLUS
6 | MCU = ATSAMD20J18
7 | MCU_FAMILY = ATMEL
8 | USE_RTOS = 0
9 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.crun:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1
5 |
6 |
7 | *
8 | *
9 | *
10 | 0
11 | 1
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.Debug.general.xcl:
--------------------------------------------------------------------------------
1 | "C:\Program Files\IAR Systems\Embedded Workbench 7.3\arm\bin\armproc.dll"
2 |
3 | "C:\Program Files\IAR Systems\Embedded Workbench 7.3\arm\bin\armjlink2.dll"
4 |
5 | "\\VBOXSVR\Musik\AT04189\SAM-BA_Monitor\Debug\Exe\samd20_samba_monitor.out"
6 |
7 | --plugin "C:\Program Files\IAR Systems\Embedded Workbench 7.3\arm\bin\armbat.dll"
8 |
9 | --device_macro "C:\Program Files\IAR Systems\Embedded Workbench 7.3\arm\config\debugger\Atmel\SAMD20.dmac"
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/Makefile_APP.mk:
--------------------------------------------------------------------------------
1 | ## INCLUDES FOR APPLICATION
2 | APP_INCLUDEPATHS += \
3 | src \
4 | src/config \
5 | src/Sensors \
6 |
7 | ## APPLICATION SOURCES: Sensors
8 | APP_APP_SRC += \
9 | src/Sensors/bma2x2_support.c \
10 | src/Sensors/bma2x2.c \
11 | src/Sensors/bmg160_support.c \
12 | src/Sensors/bmg160.c \
13 | src/Sensors/bmm050_support.c \
14 | src/Sensors/bmm050.c \
15 |
16 | ## APPLICATION SOURCES: MultiWii
17 | APP_APP_SRC += \
18 | src/bmf055.c \
19 | src/eeprom_emulation.c \
20 | src/imu.c \
21 | src/main.c \
22 | src/output.c \
23 | src/rx.c \
24 | src/sensors.c \
25 | src/serial.c \
26 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.Debug.driver.xcl:
--------------------------------------------------------------------------------
1 | "--endian=little"
2 |
3 | "--cpu=Cortex-M0+"
4 |
5 | "--fpu=None"
6 |
7 | "-p"
8 |
9 | "C:\Program Files\IAR Systems\Embedded Workbench 7.3\arm\CONFIG\debugger\Atmel\ATSAMD20J18.ddf"
10 |
11 | "--semihosting"
12 |
13 | "--device=ATSAMD20J18"
14 |
15 | "--drv_communication=USB0"
16 |
17 | "--drv_interface_speed=auto"
18 |
19 | "--jlink_initial_speed=1000"
20 |
21 | "--jlink_reset_strategy=0,0"
22 |
23 | "--drv_interface=SWD"
24 |
25 | "--drv_catch_exceptions=0x000"
26 |
27 | "--drv_swo_clock_setup=72000000,0,2000000"
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/jlink.config:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ForceImpTypeAny = 0
3 | ShowInfoWin = 1
4 | EnableFlashBP = 2
5 | BPDuringExecution = 0
6 | [CFI]
7 | CFISize = 0x00
8 | CFIAddr = 0x00
9 | [CPU]
10 | OverrideMemMap = 0
11 | AllowSimulation = 1
12 | ScriptFile=""
13 | [FLASH]
14 | CacheExcludeSize = 0x00
15 | CacheExcludeAddr = 0x00
16 | MinNumBytesFlashDL = 0
17 | SkipProgOnCRCMatch = 1
18 | VerifyDownload = 1
19 | AllowCaching = 1
20 | EnableFlashDL = 2
21 | Override = 0
22 | Device="UNSPECIFIED"
23 | [GENERAL]
24 | WorkRAMSize = 0x00
25 | WorkRAMAddr = 0x00
26 | RAMUsageLimit = 0x00
27 | [SWO]
28 | SWOLogFile=""
29 | [MEM]
30 | RdOverrideOrMask = 0x00
31 | RdOverrideAndMask = 0xFFFFFFFF
32 | RdOverrideAddr = 0xFFFFFFFF
33 | WrOverrideOrMask = 0x00
34 | WrOverrideAndMask = 0xFFFFFFFF
35 | WrOverrideAddr = 0xFFFFFFFF
36 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor_Debug.jlink:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ShowInfoWin = 1
3 | EnableFlashBP = 2
4 | BPDuringExecution = 0
5 | [CFI]
6 | CFISize = 0x00
7 | CFIAddr = 0x00
8 | [CPU]
9 | OverrideMemMap = 0
10 | AllowSimulation = 1
11 | ScriptFile=""
12 | [FLASH]
13 | CacheExcludeSize = 0x00
14 | CacheExcludeAddr = 0x00
15 | MinNumBytesFlashDL = 0
16 | SkipProgOnCRCMatch = 1
17 | VerifyDownload = 1
18 | AllowCaching = 1
19 | EnableFlashDL = 2
20 | Override = 0
21 | Device="UNSPECIFIED"
22 | [GENERAL]
23 | WorkRAMSize = 0x00
24 | WorkRAMAddr = 0x00
25 | RAMUsageLimit = 0x00
26 | [SWO]
27 | SWOLogFile=""
28 | [MEM]
29 | RdOverrideOrMask = 0x00
30 | RdOverrideAndMask = 0xFFFFFFFF
31 | RdOverrideAddr = 0xFFFFFFFF
32 | WrOverrideOrMask = 0x00
33 | WrOverrideAndMask = 0xFFFFFFFF
34 | WrOverrideAddr = 0xFFFFFFFF
35 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/common2/boards/user_board/init.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board initialization template
5 | *
6 | */
7 | /*
8 | * Support and FAQ: visit Atmel Support
9 | */
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #if defined(__GNUC__)
16 | void board_init(void) WEAK __attribute__((alias("system_board_init")));
17 | #elif defined(__ICCARM__)
18 | void board_init(void);
19 | # pragma weak board_init=system_board_init
20 | #endif
21 |
22 | void system_board_init(void)
23 | {
24 | /* This function is meant to contain board-specific initialization code
25 | * for, e.g., the I/O pins. The initialization can rely on application-
26 | * specific board configuration, found in conf_board.h.
27 | */
28 | }
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | BMF055FlightController_MW21
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 |
14 |
15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
16 | full,incremental,
17 |
18 |
19 |
20 |
21 |
22 | org.eclipse.cdt.core.cnature
23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
25 |
26 |
27 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/output.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 | #ifndef OUTPUT_H_
20 | #define OUTPUT_H_
21 |
22 |
23 | void writeMotors(void);
24 | void initOutput(void);
25 | void mixTable(void);
26 |
27 | #endif
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/common2/boards/user_board/user_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board definition template
5 | *
6 | */
7 |
8 | /* This file is intended to contain definitions and configuration details for
9 | * features and devices that are available on the board, e.g., frequency and
10 | * startup time for an external crystal, external memory devices, LED and USART
11 | * pins.
12 | */
13 | /*
14 | * Support and FAQ: visit Atmel Support
15 | */
16 |
17 | #ifndef USER_BOARD_H
18 | #define USER_BOARD_H
19 |
20 | #include
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | /**
27 | * \ingroup group_common_boards
28 | * \defgroup user_board_group User board
29 | *
30 | * @{
31 | */
32 |
33 | void system_board_init(void);
34 |
35 | /** Name string macro */
36 | #define BOARD_NAME "USER_BOARD"
37 |
38 | /** @} */
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 |
44 | #endif // USER_BOARD_H
45 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/rx.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 | #ifndef RX_H_
20 | #define RX_H_
21 |
22 |
23 | void configureReceiver(void);
24 | void rxInt(void);
25 | void SpektrumISR(void);
26 | uint16_t readRawRC(uint8_t chan);
27 | void computeRC(void);
28 |
29 |
30 | #endif
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/BMF055_flight_controller.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}") = "BMF055_flight_controller", "BMF055_flight_controller.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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/eeprom_emulation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 | #ifndef EEPROM_EMULATION_H_
20 | #define EEPROM_EMULATION_H_
21 |
22 | #include "eeprom_emulator_support.h"
23 |
24 | #define EEPROM_CONF_VERSION 91
25 |
26 | void readEEPROM(void);
27 | void writeParams(uint8_t b);
28 | void checkFirstTime(uint8_t guiReset);
29 |
30 | #endif /* EEPROM_EMULATION_H_ */
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/sensors.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 | #ifndef SENSORS_H_
20 | #define SENSORS_H_
21 |
22 | #include "bma2x2.h"
23 | #include "bmg160.h"
24 |
25 | void GYRO_Common(void);
26 | void ACC_Common(void);
27 |
28 | void Gyro_init(void);
29 | void Gyro_getADC (void);
30 | void ACC_init (void);
31 | void ACC_getADC (void);
32 | void initSensors(void);
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/eeprom_emulator_support.c:
--------------------------------------------------------------------------------
1 | /************************************************************************/
2 | /* Include Own Header */
3 | /************************************************************************/
4 |
5 | #include "eeprom_emulator_support.h"
6 |
7 | /************************************************************************/
8 | /* Function Definitions */
9 | /************************************************************************/
10 |
11 | void eeprom_emulator_initialize(void)
12 | {
13 | eeprom_emulator_configure();
14 | }
15 |
16 |
17 | void eeprom_emulator_configure(void)
18 | {
19 | /* Setup EEPROM emulator service */
20 | enum status_code error_code = eeprom_emulator_init();
21 | if (error_code == STATUS_ERR_NO_MEMORY) {
22 | while (true) {
23 | /* No EEPROM section has been set in the device's fuses */
24 | }
25 | }
26 | else if (error_code != STATUS_OK) {
27 | /* Erase the emulated EEPROM memory (assume it is unformatted or
28 | * irrecoverably corrupt) */
29 | eeprom_emulator_erase_memory();
30 | eeprom_emulator_init();
31 | }
32 | }
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/eeprom_emulator_support.h:
--------------------------------------------------------------------------------
1 | #ifndef EEPROM_EMULATOR_SUPPORT_H_
2 | #define EEPROM_EMULATOR_SUPPORT_H_
3 |
4 | /************************************************************************/
5 | /* Includes */
6 | /************************************************************************/
7 |
8 | #include "eeprom.h"
9 |
10 | /************************************************************************/
11 | /* Macro Definitions */
12 | /************************************************************************/
13 |
14 | /************************************************************************/
15 | /* Global Variables */
16 | /************************************************************************/
17 |
18 |
19 | /************************************************************************/
20 | /* Function Declarations */
21 | /************************************************************************/
22 |
23 | void eeprom_emulator_initialize(void);
24 | void eeprom_emulator_configure(void);
25 |
26 |
27 |
28 | #endif /* EEPROM_EMULATOR_SUPPORT_H_ */
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/imu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 | #ifndef IMU_H_
20 | #define IMU_H_
21 |
22 |
23 | void computeIMU (void);
24 |
25 |
26 | typedef struct {
27 | float X;
28 | float Y;
29 | float Z;
30 | } t_fp_vector_def,fp_vector;
31 |
32 | typedef union {
33 | float A[3];
34 | t_fp_vector_def V;
35 | } t_fp_vector;
36 |
37 | int16_t _atan2(float y, float x);
38 | void rotateV(fp_vector *v,float* delta);
39 | void getEstimatedAttitude(void);
40 | float InvSqrt (float x);
41 | float fsq(float x);
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.Debug.cspy.bat:
--------------------------------------------------------------------------------
1 | @REM This batch file has been generated by the IAR Embedded Workbench
2 | @REM C-SPY Debugger, as an aid to preparing a command line for running
3 | @REM the cspybat command line utility using the appropriate settings.
4 | @REM
5 | @REM Note that this file is generated every time a new debug session
6 | @REM is initialized, so you may want to move or rename the file before
7 | @REM making changes.
8 | @REM
9 | @REM You can launch cspybat by typing the name of this batch file followed
10 | @REM by the name of the debug file (usually an ELF/DWARF or UBROF file).
11 | @REM
12 | @REM Read about available command line parameters in the C-SPY Debugging
13 | @REM Guide. Hints about additional command line parameters that may be
14 | @REM useful in specific cases:
15 | @REM --download_only Downloads a code image without starting a debug
16 | @REM session afterwards.
17 | @REM --silent Omits the sign-on message.
18 | @REM --timeout Limits the maximum allowed execution time.
19 | @REM
20 |
21 |
22 | @echo off
23 |
24 | if not "%~1" == "" goto debugFile
25 |
26 | @echo on
27 |
28 | "C:\Program Files\IAR Systems\Embedded Workbench 7.3\common\bin\cspybat" -f "\\VBOXSVR\Musik\AT04189\SAM-BA_Monitor\settings\samd20_samba_monitor.Debug.general.xcl" --backend -f "\\VBOXSVR\Musik\AT04189\SAM-BA_Monitor\settings\samd20_samba_monitor.Debug.driver.xcl"
29 |
30 | @echo off
31 | goto end
32 |
33 | :debugFile
34 |
35 | @echo on
36 |
37 | "C:\Program Files\IAR Systems\Embedded Workbench 7.3\common\bin\cspybat" -f "\\VBOXSVR\Musik\AT04189\SAM-BA_Monitor\settings\samd20_samba_monitor.Debug.general.xcl" "--debug_file=%~1" --backend -f "\\VBOXSVR\Musik\AT04189\SAM-BA_Monitor\settings\samd20_samba_monitor.Debug.driver.xcl"
38 |
39 | @echo off
40 | :end
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/config/conf_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board configuration template
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 CONF_BOARD_H
48 | #define CONF_BOARD_H
49 | #include "stdint.h"
50 | #include "stdbool.h"
51 |
52 |
53 | #endif // CONF_BOARD_H
54 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/config/conf_spi.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM SPI configuration
5 | *
6 | * Copyright (C) 2013-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 |
48 | #ifndef CONF_SPI_H_INCLUDED
49 | #define CONF_SPI_H_INCLUDED
50 |
51 | // #define CONF_SPI_MASTER_ENABLE true
52 | //#define CONF_SPI_SLAVE_ENABLE true
53 | // #define CONF_SPI_TIMEOUT 10000
54 |
55 | #endif /* CONF_SPI_H_INCLUDED */
56 |
57 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.dni:
--------------------------------------------------------------------------------
1 | [Stack]
2 | FillEnabled=0
3 | OverflowWarningsEnabled=1
4 | WarningThreshold=90
5 | SpWarningsEnabled=1
6 | WarnLogOnly=1
7 | UseTrigger=1
8 | TriggerName=main
9 | LimitSize=0
10 | ByteLimit=50
11 | [Interrupts]
12 | Enabled=1
13 | [MemConfig]
14 | Base=1
15 | Manual=0
16 | Ddf=1
17 | TypeViol=0
18 | Stop=1
19 | [Simulator]
20 | Freq=10000000
21 | MultiCoreRunAll=1
22 | [DebugChecksum]
23 | Checksum=-702482464
24 | [Exceptions]
25 | StopOnUncaught=_ 0
26 | StopOnThrow=_ 0
27 | [CallStack]
28 | ShowArgs=0
29 | [Disassembly]
30 | MixedMode=1
31 | [JLinkDriver]
32 | CStepIntDis=_ 0
33 | [SWOTraceHWSettings]
34 | OverrideDefaultClocks=0
35 | CpuClock=72000000
36 | ClockAutoDetect=0
37 | ClockWanted=2000000
38 | JtagSpeed=2000000
39 | Prescaler=36
40 | TimeStampPrescIndex=0
41 | TimeStampPrescData=0
42 | PcSampCYCTAP=1
43 | PcSampPOSTCNT=15
44 | PcSampIndex=0
45 | DataLogMode=0
46 | ITMportsEnable=0
47 | ITMportsTermIO=0
48 | ITMportsLogFile=0
49 | ITMlogFile=$PROJ_DIR$\ITM.log
50 | [SWOTraceWindow]
51 | PcSampling=0
52 | InterruptLogs=0
53 | ForcedTimeStamps=0
54 | EventCPI=0
55 | EventEXC=0
56 | EventFOLD=0
57 | EventLSU=0
58 | EventSLEEP=0
59 | [PowerLog]
60 | LogEnabled=0
61 | GraphEnabled=0
62 | ShowTimeLog=1
63 | ShowTimeSum=0
64 | Title_0=I0
65 | Symbol_0=0 4 1
66 | LiveEnabled=0
67 | LiveFile=PowerLogLive.log
68 | [DataLog]
69 | LogEnabled=0
70 | SumEnabled=0
71 | GraphEnabled=0
72 | ShowTimeLog=1
73 | ShowTimeSum=1
74 | [EventLog]
75 | LogEnabled=0
76 | SumEnabled=0
77 | GraphEnabled=0
78 | ShowTimeLog=1
79 | ShowTimeSum=1
80 | SumSortOrder=0
81 | [InterruptLog]
82 | LogEnabled=0
83 | SumEnabled=0
84 | GraphEnabled=0
85 | ShowTimeLog=1
86 | ShowTimeSum=1
87 | SumSortOrder=0
88 | [Log file]
89 | LoggingEnabled=_ 0
90 | LogFile=_ ""
91 | Category=_ 0
92 | [TermIOLog]
93 | LoggingEnabled=_ 0
94 | LogFile=_ ""
95 | [CallStackLog]
96 | Enabled=0
97 | [PowerProbe]
98 | Frequency=10000
99 | Probe0=I0
100 | ProbeSetup0=2 1 1 2 0 0
101 | [DriverProfiling]
102 | Enabled=0
103 | Mode=3
104 | Graph=0
105 | Symbiont=0
106 | Exclusions=
107 | [Disassemble mode]
108 | mode=0
109 | [Breakpoints2]
110 | Bp0=_ 1 "EMUL_DATA" "0x00000710" 0 0 0 0 4294967295
111 | Bp1=_ 1 "EMUL_DATA" "0x00000720" 0 0 0 0 4294967295
112 | Bp2=_ 1 "EMUL_DATA" "0x00000720" 0 0 0 0 4294967295
113 | Count=3
114 | [Aliases]
115 | Count=0
116 | SuppressDialog=0
117 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/conf_bootloader.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Bootloader specific configuration.
5 | *
6 | * Copyright (c) 2014 Atmel Corporation. All rights reserved.
7 | *
8 | * \page License
9 | *
10 | * Redistribution and use in source and binary forms, with or without
11 | * modification, are permitted provided that the following conditions are met:
12 | *
13 | * 1. Redistributions of source code must retain the above copyright notice,
14 | * this list of conditions and the following disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above copyright notice,
17 | * this list of conditions and the following disclaimer in the documentation
18 | * and/or other materials provided with the distribution.
19 | *
20 | * 3. The name of Atmel may not be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * 4. This software may only be redistributed and used in connection with an
24 | * Atmel microcontroller product.
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | * POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | */
39 |
40 | #ifndef CONF_BOOTLOADER_H_INCLUDED
41 | #define CONF_BOOTLOADER_H_INCLUDED
42 |
43 | #define APP_START_ADDRESS 0x00002000
44 | #define BOOT_LED PIN_PA24
45 | #define BOOT_LOAD_PIN PIN_PA28
46 | #define GPIO_BOOT_PIN_MASK (1U << (BOOT_LOAD_PIN & 0x1F))
47 |
48 | #define BOOT_USART_MODULE SERCOM5
49 |
50 | #define CPU_CLOCK_FREQ 8000000UL
51 |
52 | #define APP_START_PAGE (APP_START_ADDRESS / FLASH_PAGE_SIZE)
53 |
54 | /* DEBUG LED output enable/disable */
55 | #define DEBUG_ENABLE true
56 |
57 | #endif /* CONF_BOOTLOADER_H_INCLUDED */
58 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/source/system_samd20.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_SAMD20_H_INCLUDED_
48 | #define _SYSTEM_SAMD20_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_SAMD20_H_INCLUDED */
66 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/sercom/sercom_interrupt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Serial Peripheral Interface 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 SERCOM_INTERRUPT_H_INCLUDED
47 | #define SERCOM_INTERRUPT_H_INCLUDED
48 |
49 | #include "sercom.h"
50 | #include
51 |
52 | #ifdef __cplusplus
53 | extern "C" {
54 | #endif
55 |
56 | /* Look-up table for device instances. */
57 | extern void *_sercom_instances[SERCOM_INST_NUM];
58 |
59 | typedef void (*sercom_handler_t)(uint8_t instance);
60 |
61 | enum system_interrupt_vector _sercom_get_interrupt_vector(
62 | Sercom *const sercom_instance);
63 |
64 | void _sercom_set_handler(
65 | const uint8_t instance,
66 | const sercom_handler_t interrupt_handler);
67 |
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 |
72 | #endif /* SERCOM_INTERRUPT_H_INCLUDED */
73 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/sam_ba_monitor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Monitor functions for SAM-BA on SAM D20
5 | *
6 | * Copyright (c) 2014 Atmel Corporation. All rights reserved.
7 | *
8 | * \page License
9 | *
10 | * Redistribution and use in source and binary forms, with or without
11 | * modification, are permitted provided that the following conditions are met:
12 | *
13 | * 1. Redistributions of source code must retain the above copyright notice,
14 | * this list of conditions and the following disclaimer.
15 | *
16 | * 2. Redistributions in binary form must reproduce the above copyright notice,
17 | * this list of conditions and the following disclaimer in the documentation
18 | * and/or other materials provided with the distribution.
19 | *
20 | * 3. The name of Atmel may not be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * 4. This software may only be redistributed and used in connection with an
24 | * Atmel microcontroller product.
25 | *
26 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
29 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | * POSSIBILITY OF SUCH DAMAGE.
37 | *
38 | */
39 |
40 | #ifndef _MONITOR_SAM_BA_H_
41 | #define _MONITOR_SAM_BA_H_
42 |
43 | #include
44 |
45 | #define SAM_BA_VERSION "1.1"
46 |
47 | /* Selects USART as the communication interface of the monitor */
48 | #define SAM_BA_INTERFACE_USART 1
49 | /* Selects USB as the communication interface of the monitor */
50 | #define SAM_BA_INTERFACE_USBCDC 0
51 |
52 | /* Selects USB as the communication interface of the monitor */
53 | #define SIZEBUFMAX 64
54 |
55 | /**
56 | * \brief Initialize the monitor
57 | *
58 | */
59 | void sam_ba_monitor_init(uint8_t com_interface);
60 |
61 | /**
62 | * \brief Main function of the SAM-BA Monitor
63 | *
64 | */
65 | void sam_ba_monitor_run(void);
66 |
67 | /**
68 | * \brief
69 | *
70 | */
71 | void sam_ba_putdata_term(uint8_t* data, uint32_t length);
72 |
73 | /**
74 | * \brief
75 | *
76 | */
77 | void call_applet(uint32_t address);
78 |
79 | #endif // _MONITOR_SAM_BA_H_
80 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 (SAMD10)
70 | # include "samd10.h"
71 | #endif
72 |
73 | #if (SAMD11)
74 | # include "samd11.h"
75 | #endif
76 |
77 | #if (SAML21)
78 | # include "saml21.h"
79 | #endif
80 |
81 | #if (SAMDA1)
82 | # include "samda1.h"
83 | #endif
84 |
85 | #if (SAMC20)
86 | # include "samc20.h"
87 | #endif
88 |
89 | #if (SAMC21)
90 | # include "samc21.h"
91 | #endif
92 |
93 | #endif /* _SAM_IO_ */
94 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/pac0.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC0
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_PAC0_INSTANCE_
48 | #define _SAMD20_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 /* _SAMD20_PAC0_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/pac1.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC1
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_PAC1_INSTANCE_
48 | #define _SAMD20_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 /* _SAMD20_PAC1_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/pac2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC2
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_PAC2_INSTANCE_
48 | #define _SAMD20_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 0x00100000 // PAC protection mask at reset
61 |
62 | #endif /* _SAMD20_PAC2_INSTANCE_ */
63 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/source/system_samd20.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup.
5 | *
6 | * Copyright (c) 2013-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 "samd20.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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/spi_support.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 |
20 | #ifndef SPI_SUPPORT_H_
21 | #define SPI_SUPPORT_H_
22 |
23 | /************************************************************************/
24 | /* Includes */
25 | /************************************************************************/
26 |
27 | #include "spi.h"
28 | #include "spi_interrupt.h"
29 |
30 | /************************************************************************/
31 | /* Macro Definitions */
32 | /************************************************************************/
33 |
34 | /*! This is a value of 10 million that can be used to set SPI frequency to 10 MHz. */
35 | #define SPI_BAUDRATE_10M UINT32_C(10000000)
36 | /*! The default value loaded onto SPI baud rate register is 10 MHz. */
37 | #define SPI_BAUDRATE SPI_BAUDRATE_10M
38 |
39 | /************************************************************************/
40 | /* Global Variables */
41 | /************************************************************************/
42 |
43 | /*! Instantiates a SERCOM SPI driver software structure, used to retain
44 | * software state information of the associated hardware module instance. */
45 | struct spi_module spi_master_instance;
46 |
47 | /************************************************************************/
48 | /* Function Declarations */
49 | /************************************************************************/
50 |
51 |
52 | /*!
53 | * @brief Initializes SPI module of the MCU
54 | *
55 | * @param[in] NULL
56 | *
57 | * @param[out] NULL
58 | *
59 | * @return NULL
60 | *
61 | */
62 | void spi_initialize(void);
63 |
64 | /*!
65 | * @brief Configures SPI master module of the MCU
66 | *
67 | * @param[in] NULL
68 | *
69 | * @param[out] NULL
70 | *
71 | * @return NULL
72 | *
73 | */
74 | void spi_configure_master(void);
75 |
76 | /*!
77 | * @brief Configures an SPI slave
78 | *
79 | * @param[in] ss_pin SPI slave-select pin number
80 | *
81 | * @param[out] slave_inst_ptr Pointer to the SPI slave software instance struct
82 | *
83 | * @return NULL
84 | *
85 | */
86 | void spi_configure_slave(struct spi_slave_inst *slave_inst_ptr, uint8_t const ss_pin);
87 |
88 |
89 | #endif /* SPI_SUPPORT_H_ */
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/spi_support.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 |
20 | /************************************************************************/
21 | /* Include Own Header */
22 | /************************************************************************/
23 |
24 | #include "spi_support.h"
25 |
26 | /************************************************************************/
27 | /* Function Definitions */
28 | /************************************************************************/
29 |
30 | void spi_initialize(void)
31 | {
32 | spi_configure_master();
33 | }
34 |
35 | /*!
36 | * @brief Configures SPI master module of the MCU
37 | *
38 | * @param[in] NULL
39 | *
40 | * @param[out] NULL
41 | *
42 | * @return NULL
43 | *
44 | */
45 | void spi_configure_master(void)
46 | {
47 | /* SPI master's configuration structure */
48 | struct spi_config config_spi_master;
49 |
50 | /* get SPI configuration defaults */
51 | spi_get_config_defaults(&config_spi_master);
52 |
53 | /* set SPI Baudrate*/
54 | config_spi_master.mode_specific.master.baudrate = SPI_BAUDRATE;
55 | /* Configure pad 0 for data out (MOSI) */
56 | config_spi_master.pinmux_pad0 = PINMUX_PA16C_SERCOM1_PAD0;
57 | /* Configure pad 1 as clock (SCKL) */
58 | config_spi_master.pinmux_pad1 = PINMUX_PA17C_SERCOM1_PAD1;
59 | /* Configure pad 2 for unused */
60 | config_spi_master.pinmux_pad2 = PINMUX_UNUSED;
61 | /* Configure pad 3 for data in (MISO) */
62 | config_spi_master.pinmux_pad3 = PINMUX_PA19C_SERCOM1_PAD3;
63 |
64 | config_spi_master.generator_source = GCLK_GENERATOR_0;
65 |
66 | /* initialize SERCOM3 as an SPI master */
67 | spi_init(&spi_master_instance, SERCOM1, &config_spi_master);
68 | /* enable the SPI module */
69 | spi_enable(&spi_master_instance);
70 | }
71 |
72 | /*!
73 | * @brief Configure and initialize software device instance of peripheral slave
74 | *
75 | * @param[in] ss_pin SPI slave-select pin number
76 | *
77 | * @param[out] slave_inst_ptr Pointer to the SPI slave software instance struct
78 | *
79 | * @return NULL
80 | *
81 | */
82 | void spi_configure_slave(struct spi_slave_inst *slave_inst_ptr, uint8_t const ss_pin)
83 | {
84 | /* SPI slave's configuration structure */
85 | struct spi_slave_inst_config slave_config;
86 |
87 | /* get SPI slave's default configuration */
88 | spi_slave_inst_get_config_defaults(&slave_config);
89 |
90 | /* Assign a slave slect pin */
91 | slave_config.ss_pin = ss_pin;
92 |
93 | /* initialize the SPI slave instance */
94 | spi_attach_slave(slave_inst_ptr, &slave_config);
95 | }
96 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BMF055-flight-controller
2 |
3 | I wanted to thank Bosch Sensortec for supporting this project with hardware and knowledge.
4 | The idea about this project is to build a flight controller based on a single chip: the BMF055. This system-in-package contains all necessary components: a 3 axis gyroscope, 3 axis accelerometer and a 3 axis magnetometer. These are connected to an Atmel SAMD20 Cortex M0+ micro controller.
5 | This software gives the BMF055 the ability to control a quadrocopter by just adding a receiver and 4 external motors and speed controllers.
6 |
7 | Additional information regarding development state, features and hardware setup will be added to the wiki of this repository.
8 |
9 | ##Idea:
10 | The idea was to set up a flight controller with just a single chip, but the problem was which software it should be based on. Cleanflight is made for the STMFXXX series and lacks some hardware abstraction. It has really gerat features, so the first idea was to either add support for the BMF055 or to port it. But it would have been a lot of work the get it even running. So I chose to take a really simple core and to replace the parts regarding the hardware. Nanowii mw21 came to my mind, because it still has great performance on the 8 bit controllers, flies great and is just simple. So this was the ideal plattform to experiment with the BMF055 and to get to know it.
11 |
12 | This software is based on the following components:
13 |
14 | ### [BMF055 Example Project - Data Stream ](https://gallery.atmel.com/Products/Details/f00f3e26-f14d-40ce-9a74-be14f0db1ff2)
15 | The Atme Studio is based on the data stream example for the BMF055. It was really helpful for initial testing and for getting to know the system. This example sets up the SAMD20 configures the sensors and periaodically reads the sensor values and prints them to a USART interface. The part for setting up, interfacing and reading the sensors was used for this firmware.
16 |
17 | ### [Cleanflight](https://github.com/cleanflight/cleanflight)
18 | Since I am also involved in Cleanflight development some of those ideas found their way into this firmware. The number of improvements and new features is just awesome. A big thanks to Dominic Clifton and all the contributors.
19 |
20 | ### [Betaflight](https://github.com/borisbstyle/betaflight/)
21 | This is the experimenting area of Cleanflight maintained by Boris B and in the past tons of experiments were made here. Lots of them werde considered as stable and merged to Cleanflight. This is just a great motor of innovation with all the experiments made there, so I will also add some of the ideas in here.
22 |
23 | ### Atmel ASF and SAM-BA
24 | The bootloader, which can be flashed to the BMF055 is the Atmel SAM-BA, a special adaption of it can be found in this repository.
25 | The low level hardware interfacing is done using the Atmel Software Framework.
26 |
27 | ### [Multiwii](https://code.google.com/archive/p/multiwii/)
28 | The core and idea for this firmware is based on the "old" MW architecture which was originally developed for small Atmel 8-bit micro controllers and sensors from the Wii console.
29 |
30 | ### Multiwii 2.1 nanowii adaptions by FelixNiessen/[flyduino](http://flyduino.net/)
31 | This MW version is a special adaption by Felix, it contains only necessary parts and is focussed on stunt flying. It also involves new features like the oneshot protocoll for higher ESC refresh rates.
32 |
33 | [](https://ghit.me/repo/NightHawk32/BMF055-flight-controller)
34 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20E15_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x8000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x1000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20G15_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x8000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x1000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20J15_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x8000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x1000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20E16_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x10000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x2000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20E17_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x20000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x4000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20E18_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x40000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x8000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20G16_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x10000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x2000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20G17_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x20000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x4000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20G18_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x40000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x8000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20J16_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x10000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x2000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20J17_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x20000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x4000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/linker/SAMD20J18_flash.icf:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Linker script for running in internal FLASH on the SAMD20G18
5 | *
6 | * Copyright (c) 2013 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 | /*###ICF### Section handled by ICF editor, don't touch! ****/
45 | /*-Editor annotation file-*/
46 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
47 | /*-Specials-*/
48 | define symbol __ICFEDIT_intvec_start__ = 0x00000000;
49 | define symbol __ICFEDIT_cstack_start__ = 0x20000F00;
50 | /*-Memory Regions-*/
51 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
52 | define symbol __ICFEDIT_region_ROM_end__ = (0x00000000+0x40000-1);
53 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
54 | define symbol __ICFEDIT_region_RAM_end__ = (0x20000000+0x8000-1);
55 | /*-Sizes-*/
56 | define symbol __ICFEDIT_size_cstack__ = 0xFF;
57 | define symbol __ICFEDIT_size_heap__ = 0x0;
58 | /**** End of ICF editor section. ###ICF###*/
59 |
60 |
61 | define memory mem with size = 4G ;
62 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
63 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
64 |
65 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ {} ;
66 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ {} ;
67 |
68 | initialize by copy { readwrite };
69 | //initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
70 | do not initialize { section .noinit };
71 |
72 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
73 |
74 | place in ROM_region { readonly } ;
75 | place at address mem:__ICFEDIT_region_RAM_start__ { readwrite, block HEAP };
76 | place at address mem:__ICFEDIT_cstack_start__ { block CSTACK };
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/samd20.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Header file for SAMD20
5 | *
6 | * Copyright (c) 2013-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 _SAMD20_
48 | #define _SAMD20_
49 |
50 | /**
51 | * \defgroup SAMD20_definitions SAMD20 Device Definitions
52 | * \brief SAMD20 CMSIS Definitions.
53 | */
54 |
55 | #if defined(__SAMD20E14__) || defined(__ATSAMD20E14__)
56 | #include "samd20e14.h"
57 | #elif defined(__SAMD20E15__) || defined(__ATSAMD20E15__)
58 | #include "samd20e15.h"
59 | #elif defined(__SAMD20E16__) || defined(__ATSAMD20E16__)
60 | #include "samd20e16.h"
61 | #elif defined(__SAMD20E17__) || defined(__ATSAMD20E17__)
62 | #include "samd20e17.h"
63 | #elif defined(__SAMD20E18__) || defined(__ATSAMD20E18__)
64 | #include "samd20e18.h"
65 | #elif defined(__SAMD20G14__) || defined(__ATSAMD20G14__)
66 | #include "samd20g14.h"
67 | #elif defined(__SAMD20G15__) || defined(__ATSAMD20G15__)
68 | #include "samd20g15.h"
69 | #elif defined(__SAMD20G16__) || defined(__ATSAMD20G16__)
70 | #include "samd20g16.h"
71 | #elif defined(__SAMD20G17__) || defined(__ATSAMD20G17__)
72 | #include "samd20g17.h"
73 | #elif defined(__SAMD20G17U__) || defined(__ATSAMD20G17U__)
74 | #include "samd20g17u.h"
75 | #elif defined(__SAMD20G18__) || defined(__ATSAMD20G18__)
76 | #include "samd20g18.h"
77 | #elif defined(__SAMD20G18U__) || defined(__ATSAMD20G18U__)
78 | #include "samd20g18u.h"
79 | #elif defined(__SAMD20J14__) || defined(__ATSAMD20J14__)
80 | #include "samd20j14.h"
81 | #elif defined(__SAMD20J15__) || defined(__ATSAMD20J15__)
82 | #include "samd20j15.h"
83 | #elif defined(__SAMD20J16__) || defined(__ATSAMD20J16__)
84 | #include "samd20j16.h"
85 | #elif defined(__SAMD20J17__) || defined(__ATSAMD20J17__)
86 | #include "samd20j17.h"
87 | #elif defined(__SAMD20J18__) || defined(__ATSAMD20J18__)
88 | #include "samd20j18.h"
89 | #else
90 | #error Library does not support the specified device.
91 | #endif
92 |
93 | #endif /* _SAMD20_ */
94 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/usart_support.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 |
20 | #ifndef usart_support_h_
21 | #define usart_support_h_
22 |
23 | /************************************************************************/
24 | /* Includes */
25 | /************************************************************************/
26 |
27 | #include "usart.h"
28 | #include "usart_interrupt.h"
29 |
30 | /************************************************************************/
31 | /* Macro Definitions */
32 | /************************************************************************/
33 |
34 | /*! value of 115200 that is used to set USART baud rate */
35 | #define USART_BAUDRATE_115200 UINT32_C(115200)
36 | /*! loaded onto USART baud rate register initially */
37 | #define USART_BAUDRATE USART_BAUDRATE_115200
38 |
39 |
40 | /*! SERCOM USART driver software instance structure, used to retain
41 | * software state information of the associated hardware module instance */
42 | struct usart_module usart_instance;
43 | /*! USART receive callback flag (set after each USART reception) */
44 | volatile bool usart_callback_receive_flag;
45 |
46 | /*! USART receive callback flag (set after each USART transmission) */
47 | volatile bool usart_callback_transmit_flag;
48 |
49 | /*! USART Rx buffer */
50 | uint16_t usart_rx_string[64];
51 | /*! USART Rx byte */
52 | uint16_t usart_rx_byte;
53 | /*! USART Rx buffer length */
54 | uint16_t usart_rx_count;
55 | /************************************************************************/
56 | /* Function Declarations */
57 | /************************************************************************/
58 |
59 | /*!
60 | * @brief Initializes the USART module of the MCU
61 | *
62 | * @param[in] NULL
63 | *
64 | * @param[out] NULL
65 | *
66 | * @return NULL
67 | *
68 | */
69 | void usart_initialize(void);
70 |
71 | /*!
72 | * @brief Configures the USART module of the MCU
73 | *
74 | * @param[in] NULL
75 | *
76 | * @param[out] NULL
77 | *
78 | * @return NULL
79 | *
80 | */
81 | void usart_configure(void);
82 |
83 | /*!
84 | * @brief Configures USART callback register
85 | *
86 | * @param[in] NULL
87 | *
88 | * @param[out] NULL
89 | *
90 | * @return NULL
91 | *
92 | */
93 | void usart_configure_callbacks(void);
94 |
95 | /*!
96 | * @brief Called after USART receptions
97 | *
98 | * @param[in] usart_module_ptr Pointer to the USART module which triggers the interrupt
99 | *
100 | * @param[out] NULL
101 | *
102 | * @return NULL
103 | *
104 | */
105 | void usart_callback_receive(struct usart_module *const usart_module_ptr);
106 |
107 | /*!
108 | * @brief Called after USART transmissions
109 | *
110 | * @param[in] usart_module_ptr Pointer to the USART module which triggers the interrupt
111 | *
112 | * @param[out] NULL
113 | *
114 | * @return NULL
115 | *
116 | */
117 | void usart_callback_transmit(struct usart_module *const usart_module_ptr);
118 |
119 |
120 | #endif /* usart_support_h_ */
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/wdt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for WDT
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_WDT_INSTANCE_
48 | #define _SAMD20_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 1 // Index of Generic Clock
73 |
74 | #endif /* _SAMD20_WDT_INSTANCE_ */
75 |
--------------------------------------------------------------------------------
/AT04189_bootloader/SAM-BA_Monitor/settings/samd20_samba_monitor.wsdt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | samd20_samba_monitor/Debug
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 130272727
16 |
17 |
18 |
19 |
20 |
21 |
22 | 20139537293
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | TabID-5074-6540
32 | Workspace
33 | Workspace
34 |
35 |
36 | samd20_samba_monitorsamd20_samba_monitor/Outputsamd20_samba_monitor/Output/samd20_samba_monitor.outsamd20_samba_monitor/Output/samd20_samba_monitor.out/Output
37 |
38 |
39 |
40 | 0
41 |
42 |
43 | TabID-202-7245
44 | Build
45 | Build
46 |
47 |
48 |
49 |
50 | 0
51 |
52 |
53 |
54 |
55 |
56 | TextEditor$WS_DIR$\main.c00000132523852380TextEditor$WS_DIR$\usart_sam_ba.c000007534103410TextEditor$WS_DIR$\sam_ba_monitor.c000002318811881TextEditor$WS_DIR$\linker\samd20j18_flash.icf0000033776776TextEditor$WS_DIR$\conf_bootloader.h0000018202920290100000010000001
57 |
58 |
59 |
60 |
61 |
62 |
63 | iaridepm.enu1-2-2692204-2-21239860059100719100586713258-2-22362050-2-22052238100195324460460059100719
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/system/reset/reset_sam_d_r/reset.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Reset related functionality
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 | #ifndef RESET_H_INCLUDED
47 | #define RESET_H_INCLUDED
48 |
49 | #include
50 |
51 | #ifdef __cplusplus
52 | extern "C" {
53 | #endif
54 |
55 | /**
56 | * \addtogroup asfdoc_sam0_system_group
57 | * @{
58 | */
59 |
60 | /**
61 | * \brief Reset causes of the system.
62 | *
63 | * List of possible reset causes of the system.
64 | */
65 | enum system_reset_cause {
66 | /** The system was last reset by a software reset. */
67 | SYSTEM_RESET_CAUSE_SOFTWARE = PM_RCAUSE_SYST,
68 | /** The system was last reset by the watchdog timer. */
69 | SYSTEM_RESET_CAUSE_WDT = PM_RCAUSE_WDT,
70 | /** The system was last reset because the external reset line was pulled low. */
71 | SYSTEM_RESET_CAUSE_EXTERNAL_RESET = PM_RCAUSE_EXT,
72 | /** The system was last reset by the BOD33. */
73 | SYSTEM_RESET_CAUSE_BOD33 = PM_RCAUSE_BOD33,
74 | /** The system was last reset by the BOD12. */
75 | SYSTEM_RESET_CAUSE_BOD12 = PM_RCAUSE_BOD12,
76 | /** The system was last reset by the POR (Power on reset). */
77 | SYSTEM_RESET_CAUSE_POR = PM_RCAUSE_POR,
78 | };
79 |
80 |
81 | /**
82 | * \name Reset Control
83 | * @{
84 | */
85 |
86 | /**
87 | * \brief Reset the MCU.
88 | *
89 | * Resets the MCU and all associated peripherals and registers, except RTC, all 32KHz sources,
90 | * WDT (if ALWAYSON is set) and GCLK (if WRTLOCK is set).
91 | *
92 | */
93 | static inline void system_reset(void)
94 | {
95 | NVIC_SystemReset();
96 | }
97 |
98 | /**
99 | * \brief Return the reset cause.
100 | *
101 | * Retrieves the cause of the last system reset.
102 | *
103 | * \return An enum value indicating the cause of the last system reset.
104 | */
105 | static inline enum system_reset_cause system_get_reset_cause(void)
106 | {
107 | return (enum system_reset_cause)PM->RCAUSE.reg;
108 | }
109 |
110 | /**
111 | * @}
112 | */
113 |
114 | /** @} */
115 | #ifdef __cplusplus
116 | }
117 | #endif
118 |
119 | #endif /* RESET_H_INCLUDED */
120 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/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 _SAMD20_DAC_INSTANCE_
48 | #define _SAMD20_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_GCLK_ID 26
75 |
76 | #endif /* _SAMD20_DAC_INSTANCE_ */
77 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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: Common build items for user board support templates
60 | #include
61 |
62 | // From module: EEPROM Emulator Service
63 | #include
64 |
65 | // From module: Generic board support
66 | #include
67 |
68 | // From module: Interrupt management - SAM implementation
69 | #include
70 |
71 | // From module: NVM - Non-Volatile Memory
72 | #include
73 |
74 | // From module: PORT - GPIO Pin Control
75 | #include
76 |
77 | // From module: Part identification macros
78 | #include
79 |
80 | // From module: SERCOM Callback API
81 | #include
82 | #include
83 |
84 | // From module: SERCOM SPI - Serial Peripheral Interface (Callback APIs)
85 | #include
86 | #include
87 |
88 | // From module: SERCOM USART - Serial Communications (Callback APIs)
89 | #include
90 | #include
91 |
92 | // From module: SYSTEM - Clock Management for SAMD20
93 | #include
94 | #include
95 |
96 | // From module: SYSTEM - Core System Driver
97 | #include
98 |
99 | // From module: SYSTEM - I/O Pin Multiplexer
100 | #include
101 |
102 | // From module: SYSTEM - Interrupt Driver
103 | #include
104 |
105 | // From module: SYSTEM - Power Management for SAM D20/D21/R21/D10/D11/DA0/DA1
106 | #include
107 |
108 | // From module: SYSTEM - Reset Management for SAM D20/D21/R21/D10/D11/DA0/DA1
109 | #include
110 |
111 | // From module: TC - Timer Counter (Callback APIs)
112 | #include
113 | #include
114 |
115 | #endif // ASF_H
116 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/sercom/sercom.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Serial Peripheral Interface 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 |
47 | #ifndef SERCOM_H_INCLUDED
48 | #define SERCOM_H_INCLUDED
49 |
50 | #include
51 | #include
52 | #include
53 | #include
54 | #include "sercom_pinout.h"
55 |
56 | #ifdef __cplusplus
57 | extern "C" {
58 | #endif
59 |
60 | /* SERCOM modules should share same slow GCLK channel ID */
61 | #define SERCOM_GCLK_ID SERCOM0_GCLK_ID_SLOW
62 |
63 | #if (0x1ff >= REV_SERCOM)
64 | # define FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_1
65 | #elif (0x400 >= REV_SERCOM)
66 | # define FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_2
67 | #else
68 | # error "Unknown SYNCBUSY scheme for this SERCOM revision"
69 | #endif
70 |
71 | /**
72 | * \brief sercom asynchronous operation mode
73 | *
74 | * Select sercom asynchronous operation mode
75 | */
76 | enum sercom_asynchronous_operation_mode {
77 | SERCOM_ASYNC_OPERATION_MODE_ARITHMETIC = 0,
78 | SERCOM_ASYNC_OPERATION_MODE_FRACTIONAL,
79 | };
80 |
81 | /**
82 | * \brief sercom asynchronous samples per bit
83 | *
84 | * Select number of samples per bit
85 | */
86 | enum sercom_asynchronous_sample_num {
87 | SERCOM_ASYNC_SAMPLE_NUM_3 = 3,
88 | SERCOM_ASYNC_SAMPLE_NUM_8 = 8,
89 | SERCOM_ASYNC_SAMPLE_NUM_16 = 16,
90 | };
91 |
92 | enum status_code sercom_set_gclk_generator(
93 | const enum gclk_generator generator_source,
94 | const bool force_change);
95 |
96 | enum status_code _sercom_get_sync_baud_val(
97 | const uint32_t baudrate,
98 | const uint32_t external_clock,
99 | uint16_t *const baudval);
100 |
101 | enum status_code _sercom_get_async_baud_val(
102 | const uint32_t baudrate,
103 | const uint32_t peripheral_clock,
104 | uint16_t *const baudval,
105 | enum sercom_asynchronous_operation_mode mode,
106 | enum sercom_asynchronous_sample_num sample_num);
107 |
108 | uint32_t _sercom_get_default_pad(
109 | Sercom *const sercom_module,
110 | const uint8_t pad);
111 |
112 | uint8_t _sercom_get_sercom_inst_index(
113 | Sercom *const sercom_instance);
114 | #ifdef __cplusplus
115 | }
116 | #endif
117 |
118 | #endif //__SERCOM_H_INCLUDED
119 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/gclk.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for GCLK
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_GCLK_INSTANCE_
48 | #define _SAMD20_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 8 // Number of Generic Clock Generators
68 | #define GCLK_GEN_NUM_MSB 7 // Number of Generic Clock Generators - 1
69 | #define GCLK_GEN_SOURCE_NUM_MSB 7 // Number of Generic Clock Sources - 1
70 | #define GCLK_NUM 28 // Number of Generic Clock Users
71 | #define GCLK_SOURCE_DFLL48M 7
72 | #define GCLK_SOURCE_FDPLL
73 | #define GCLK_SOURCE_GCLKGEN1 2
74 | #define GCLK_SOURCE_GCLKIN 1
75 | #define GCLK_SOURCE_NUM 8 // Number of Generic Clock Sources
76 | #define GCLK_SOURCE_OSCULP32K 3
77 | #define GCLK_SOURCE_OSC8M 6
78 | #define GCLK_SOURCE_OSC32K 4
79 | #define GCLK_SOURCE_XOSC 0
80 | #define GCLK_SOURCE_XOSC32K 5
81 |
82 | #endif /* _SAMD20_GCLK_INSTANCE_ */
83 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/port/port.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM GPIO Port 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 | #include
47 |
48 | /**
49 | * \brief Writes a Port pin configuration to the hardware module.
50 | *
51 | * Writes out a given configuration of a Port pin configuration to the hardware
52 | * module.
53 | *
54 | * \note If the pin direction is set as an output, the pull-up/pull-down input
55 | * configuration setting is ignored.
56 | *
57 | * \param[in] gpio_pin Index of the GPIO pin to configure
58 | * \param[in] config Configuration settings for the pin
59 | */
60 | void port_pin_set_config(
61 | const uint8_t gpio_pin,
62 | const struct port_config *const config)
63 | {
64 | /* Sanity check arguments */
65 | Assert(config);
66 |
67 | struct system_pinmux_config pinmux_config;
68 | system_pinmux_get_config_defaults(&pinmux_config);
69 |
70 | pinmux_config.mux_position = SYSTEM_PINMUX_GPIO;
71 | pinmux_config.direction = (enum system_pinmux_pin_dir)config->direction;
72 | pinmux_config.input_pull = (enum system_pinmux_pin_pull)config->input_pull;
73 | pinmux_config.powersave = config->powersave;
74 |
75 | system_pinmux_pin_set_config(gpio_pin, &pinmux_config);
76 | }
77 |
78 | /**
79 | * \brief Writes a Port group configuration group to the hardware module.
80 | *
81 | * Writes out a given configuration of a Port group configuration to the
82 | * hardware module.
83 | *
84 | * \note If the pin direction is set as an output, the pull-up/pull-down input
85 | * configuration setting is ignored.
86 | *
87 | * \param[out] port Base of the PORT module to write to
88 | * \param[in] mask Mask of the port pin(s) to configure
89 | * \param[in] config Configuration settings for the pin group
90 | */
91 | void port_group_set_config(
92 | PortGroup *const port,
93 | const uint32_t mask,
94 | const struct port_config *const config)
95 | {
96 | /* Sanity check arguments */
97 | Assert(port);
98 | Assert(config);
99 |
100 | struct system_pinmux_config pinmux_config;
101 | system_pinmux_get_config_defaults(&pinmux_config);
102 |
103 | pinmux_config.mux_position = SYSTEM_PINMUX_GPIO;
104 | pinmux_config.direction = (enum system_pinmux_pin_dir)config->direction;
105 | pinmux_config.input_pull = (enum system_pinmux_pin_pull)config->input_pull;
106 | pinmux_config.powersave = config->powersave;
107 |
108 | system_pinmux_group_set_config(port, mask, &pinmux_config);
109 | }
110 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/system/pinmux/quick_start/qs_pinmux_basic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM PINMUX Driver Quick Start
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 | /**
45 | * \page asfdoc_sam0_system_pinmux_basic_use_case Quick Start Guide for SYSTEM PINMUX - Basic
46 | *
47 | * In this use case, the PINMUX module is configured for:
48 | * \li One pin in input mode, with pull-up enabled, connected to the GPIO
49 | * module
50 | * \li Sampling mode of the pin changed to sample on demand
51 | *
52 | * This use case sets up the PINMUX to configure a physical I/O pin set as
53 | * an input with pull-up and changes the sampling mode of the pin to reduce
54 | * power by only sampling the physical pin state when the user application
55 | * attempts to read it.
56 | *
57 | * \section asfdoc_sam0_system_pinmux_basic_use_case_setup Setup
58 | *
59 | * \subsection asfdoc_sam0_system_pinmux_basic_use_case_setup_prereq Prerequisites
60 | * There are no special setup requirements for this use-case.
61 | *
62 | * \subsection asfdoc_sam0_system_pinmux_basic_use_case_setup_code Code
63 | * Copy-paste the following setup code to your application:
64 | * \snippet qs_pinmux_basic.c setup
65 | *
66 | * \subsection asfdoc_sam0_system_pinmux_basic_use_case_setup_flow Workflow
67 | * -# Create a PINMUX module pin configuration struct, which can be filled out
68 | * to adjust the configuration of a single port pin.
69 | * \snippet qs_pinmux_basic.c pinmux_config
70 | * -# Initialize the pin configuration struct with the module's default values.
71 | * \snippet qs_pinmux_basic.c pinmux_config_defaults
72 | * \note This should always be performed before using the configuration
73 | * struct to ensure that all values are initialized to known default
74 | * settings.
75 | *
76 | * -# Adjust the configuration struct to request an input pin with pullup
77 | * connected to the GPIO peripheral.
78 | * \snippet qs_pinmux_basic.c pinmux_update_config_values
79 | * -# Configure GPIO10 with the initialized pin configuration struct, to enable
80 | * the input sampler on the pin.
81 | * \snippet qs_pinmux_basic.c pinmux_set_config
82 | *
83 | * \section asfdoc_sam0_system_pinmux_basic_use_case_use_main Use Case
84 | *
85 | * \subsection asfdoc_sam0_system_pinmux_basic_use_case_code Code
86 | * Copy-paste the following code to your user application:
87 | * \snippet qs_pinmux_basic.c main
88 | *
89 | * \subsection asfdoc_sam0_system_pinmux_basic_use_case_flow Workflow
90 |
91 | * -# Adjust the configuration of the pin to enable on-demand sampling mode.
92 | * \snippet qs_pinmux_basic.c pinmux_change_input_sampling
93 | */
94 | /*
95 | * Support and FAQ: visit Atmel Support
96 | */
97 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/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
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 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/sercom/usart/quick_start_lin/qs_lin.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM USART LIN Quick Start
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 | /**
45 | * \page asfdoc_sam0_sercom_usart_lin_use_case Quick Start Guide for SERCOM USART LIN
46 | *
47 | * The supported board list:
48 | * - SAMC21 Xplained Pro
49 | *
50 | * This quick start will set up LIN frame format transmission according to your
51 | * configuration \c CONF_LIN_NODE_TYPE.
52 | * For LIN master, it will send LIN command after startup.
53 | * For LIN salve, once received a format from LIN master with ID \c LIN_ID_FIELD_VALUE,
54 | * it will reply four data bytes plus a checksum.
55 | *
56 | * \section asfdoc_sam0_sercom_usart_lin_use_case_setup Setup
57 | *
58 | * \subsection asfdoc_sam0_sercom_usart_lin_use_case_prereq Prerequisites
59 | * When verify data transmission between LIN master and slave, two boards are needed:
60 | * one is for LIN master and the other is for LIN slave.
61 | * connect LIN master LIN PIN with LIN slave LIN PIN.
62 | *
63 | * \subsection asfdoc_sam0_usart_lin_use_case_setup_code Code
64 | * Add to the main application source file, outside of any functions:
65 | * \snippet qs_lin.c module_var
66 | *
67 | * Copy-paste the following setup code to your user application:
68 | * \snippet qs_lin.c setup
69 | *
70 | * Add to user application initialization (typically the start of \c main()):
71 | * \snippet qs_lin.c setup_init
72 | *
73 | * \subsection asfdoc_sam0_usart_lin_use_case_setup_flow Workflow
74 | * -# Create USART CDC and LIN module software instance structure for the USART module to store
75 | * the USART driver state while it is in use.
76 | * \snippet qs_lin.c module_inst
77 | * -# Define LIN ID field for header format.
78 | * \snippet qs_lin.c lin_id
79 | * \note The ID \c LIN_ID_FIELD_VALUE is eight bits as [P1,P0,ID5...ID0], when it's 0x64, the
80 | * data field length is four bytes plus a checksum byte.
81 | *
82 | * -# Define LIN RX/TX buffer.
83 | * \snippet qs_lin.c lin_buffer
84 | * \note For \c tx_buffer and \c rx_buffer, the last byte is for checksum.
85 | *
86 | * -# Configure the USART CDC for output message.
87 | * \snippet qs_lin.c CDC_setup
88 | *
89 | * -# Configure the USART LIN module.
90 | * \snippet qs_lin.c lin_setup
91 | * \note The LIN frame format can be configured as master or slave, refer to \c CONF_LIN_NODE_TYPE .
92 | *
93 | * \section asfdoc_sam0_usart_lin_use_case_main Use Case
94 | *
95 | * \subsection asfdoc_sam0_usart_lin_use_case_main_code Code
96 | * Copy-paste the following code to your user application:
97 | * \snippet qs_lin.c main_setup
98 | *
99 | * \subsection asfdoc_sam0_usart_lin_use_case_main_flow Workflow
100 | * -# Set up USART LIN module.
101 | * \snippet qs_lin.c configure_lin
102 | * -# For LIN master, sending LIN command. For LIN slaver, start reading data .
103 | * \snippet qs_lin.c lin_master_cmd
104 | */
105 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF_Support/usart_support.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the MW21 adaption for BMF055.
3 | *
4 | * BMF055 flight controller is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * BMF055 flight controller is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with BMF055 flight controller. If not, see .
16 | *
17 | */
18 |
19 |
20 | /************************************************************************/
21 | /* Include Own Header */
22 | /************************************************************************/
23 |
24 | #include "usart_support.h"
25 | #include "serial.h"
26 |
27 | /************************************************************************/
28 | /* Function Definitions */
29 | /************************************************************************/
30 |
31 | /*!
32 | * @brief Initializes the USART module of the MCU
33 | *
34 | * @param[in] NULL
35 | *
36 | * @param[out] NULL
37 | *
38 | * @return NULL
39 | *
40 | */
41 | void usart_initialize(void)
42 | {
43 | /* Initialize the variables */
44 | usart_rx_byte = 0;
45 | usart_rx_count = 0;
46 |
47 | /* Configure the USART Module */
48 | usart_configure();
49 |
50 | /* Configure USART callbacks */
51 | usart_configure_callbacks();
52 |
53 | /* Enable the interrupt to receive the first byte */
54 | usart_read_job(&usart_instance, &usart_rx_byte);
55 | }
56 |
57 | /*!
58 | * @brief Configures the USART module of the MCU
59 | *
60 | * @param[in] NULL
61 | *
62 | * @param[out] NULL
63 | *
64 | * @return NULL
65 | *
66 | */
67 | void usart_configure(void)
68 | {
69 | /* USART's configuration structure */
70 | struct usart_config config_usart;
71 |
72 | /* get USART configuration defaults */
73 | usart_get_config_defaults(&config_usart);
74 |
75 | /* set USART Baudrate*/
76 | config_usart.baudrate = USART_BAUDRATE;
77 | /* Set USART GCLK */
78 | config_usart.generator_source = GCLK_GENERATOR_2;
79 | /* Se USART MUX setting */
80 | config_usart.mux_setting = USART_RX_1_TX_0_XCK_1;
81 | /* Configure pad 0 for Tx */
82 | config_usart.pinmux_pad0 = PINMUX_PB16C_SERCOM5_PAD0;
83 | /* Configure pad 1 for Rx */
84 | config_usart.pinmux_pad1 = PINMUX_PB17C_SERCOM5_PAD1;
85 | /* Configure pad 2 for unused */
86 | config_usart.pinmux_pad2 = PINMUX_UNUSED;
87 | /* Configure pad 3 for unused */
88 | config_usart.pinmux_pad3 = PINMUX_UNUSED;
89 |
90 | /* Initialize SERCOM5 as a USART module*/
91 | while (usart_init(&usart_instance,SERCOM5, &config_usart) != STATUS_OK) ;
92 |
93 | /* Enable the USART module */
94 | usart_enable(&usart_instance);
95 | }
96 |
97 | /*!
98 | * @brief Configures USART callback register
99 | *
100 | * @param[in] NULL
101 | *
102 | * @param[out] NULL
103 | *
104 | * @return NULL
105 | *
106 | */
107 | void usart_configure_callbacks(void)
108 | {
109 | /* Configure USART receive callback */
110 | usart_register_callback(&usart_instance, usart_callback_receive, USART_CALLBACK_BUFFER_RECEIVED);
111 | usart_callback_receive_flag = false;
112 | usart_enable_callback(&usart_instance, USART_CALLBACK_BUFFER_RECEIVED);
113 |
114 | /* Configure USART transmit callback */
115 | usart_register_callback(&usart_instance, usart_callback_transmit, USART_CALLBACK_BUFFER_TRANSMITTED);
116 | usart_callback_transmit_flag = true;
117 | usart_enable_callback(&usart_instance, USART_CALLBACK_BUFFER_TRANSMITTED);
118 | }
119 |
120 | /*!
121 | * @brief Called after USART receptions
122 | *
123 | * @param[in] usart_module_ptr Pointer to the USART module which triggers the interrupt
124 | *
125 | * @param[out] NULL
126 | *
127 | * @return NULL
128 | *
129 | */
130 | void usart_callback_receive(struct usart_module *const usart_module_ptr)
131 | {
132 | store_uart_in_buf(usart_rx_byte);
133 | usart_read_job(&usart_instance, &usart_rx_byte);
134 | }
135 |
136 | /*!
137 | * @brief Called after USART transmissions
138 | *
139 | * @param[in] usart_module_ptr Pointer to the USART module which triggers the interrupt
140 | *
141 | * @param[out] NULL
142 | *
143 | * @return NULL
144 | *
145 | */
146 | void usart_callback_transmit(struct usart_module *const usart_module_ptr)
147 | {
148 | /* Set the corresponding flag */
149 | usart_callback_transmit_flag = true;
150 | }
151 |
152 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/utils/cmsis/samd20/include/instance/eic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for EIC
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 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _SAMD20_EIC_INSTANCE_
48 | #define _SAMD20_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_EXTINT_NUM 16 // Number of External Interrupts
80 | #define EIC_GCLK_ID 3 // Index of Generic Clock
81 | #define EIC_NUMBER_OF_CONFIG_REGS 2 // Number of CONFIG registers (obsolete)
82 | #define EIC_NUMBER_OF_INTERRUPTS 16 // Number of External Interrupts (obsolete)
83 |
84 | #endif /* _SAMD20_EIC_INSTANCE_ */
85 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/Makefile_ASF.mk:
--------------------------------------------------------------------------------
1 | ##################### ASF COMPILER FLAGS AND DEFINES #########################
2 | CFLAGS += -DCONF_SPI_MASTER_ENABLE=true \
3 | -DSPI_CALLBACK_MODE=true \
4 | -DARM_MATH_CM0=true \
5 | -DEXTINT_CALLBACK_MODE=true \
6 | -DI2C_SLAVE_CALLBACK_MODE=true \
7 | -DADC_CALLBACK_MODE=true \
8 | -DTC_ASYNC=true \
9 | -DUSART_CALLBACK_MODE=true \
10 | -DWDT_CALLBACK_MODE=true
11 |
12 |
13 |
14 | ##################### ASF COMPILER FLAGS AND DEFINES #########################
15 | ASF_INCLUDEPATHS += \
16 | src \
17 | src/ASF \
18 | src/ASF_Support \
19 | src/ASF/common \
20 | src/ASF/common2 \
21 | src/ASF/sam0 \
22 | src/ASF/sam0/utils/ \
23 | src/ASF/thirdparty \
24 | src/ASF/common/boards \
25 | src/ASF/common/services \
26 | src/ASF/common/utils \
27 | src/ASF/common/utils/interrupt \
28 | src/ASF/common2/components \
29 | src/ASF/common2/services \
30 | src/ASF/common2/components/display \
31 | src/ASF/common2/components/display/ssd1306 \
32 | src/ASF/common2/services/delay \
33 | src/ASF/common2/services/gfx_mono \
34 | src/ASF/common2/services/delay/sam0 \
35 | src/ASF/common2/services/gfx_mono/docsrc \
36 | src/ASF/common2/services/gfx_mono/tools \
37 | src/ASF/sam0/services/eeprom/emulator/main_array \
38 | src/ASF/sam0/boards \
39 | src/ASF/sam0/drivers \
40 | src/ASF/sam0/boards/samd20_xplained_pro \
41 | src/ASF/sam0/drivers/extint \
42 | src/ASF/sam0/drivers/nvm \
43 | src/ASF/sam0/drivers/port \
44 | src/ASF/sam0/drivers/sercom \
45 | src/ASF/sam0/drivers/system \
46 | src/ASF/sam0/drivers/tc \
47 | src/ASF/sam0/drivers/wdt \
48 | src/ASF/sam0/drivers/extint/quick_start_callback \
49 | src/ASF/sam0/drivers/extint/quick_start_polled \
50 | src/ASF/sam0/drivers/port/quick_start \
51 | src/ASF/sam0/drivers/sercom/i2c \
52 | src/ASF/sam0/drivers/sercom/spi \
53 | src/ASF/sam0/drivers/sercom/usart \
54 | src/ASF/sam0/drivers/sercom/i2c/quick_start_slave \
55 | src/ASF/sam0/drivers/sercom/i2c/quick_start_slave_callback \
56 | src/ASF/sam0/drivers/sercom/spi/quick_start_master \
57 | src/ASF/sam0/drivers/sercom/spi/quick_start_master_callback \
58 | src/ASF/sam0/drivers/sercom/spi/quick_start_slave \
59 | src/ASF/sam0/drivers/sercom/spi/quick_start_slave_callback \
60 | src/ASF/sam0/drivers/sercom/usart/quick_start \
61 | src/ASF/sam0/drivers/sercom/usart/quick_start_callback \
62 | src/ASF/sam0/drivers/system/clock/clock_samd20 \
63 | src/ASF/sam0/drivers/system/clock \
64 | src/ASF/sam0/drivers/system/power/power_sam_d_r \
65 | src/ASF/sam0/drivers/system/reset/reset_sam_d_r \
66 | src/ASF/sam0/drivers/system/interrupt \
67 | src/ASF/sam0/drivers/system/interrupt/system_interrupt_samd20 \
68 | src/ASF/sam0/drivers/system/pinmux \
69 | src/ASF/sam0/drivers/system/clock/quick_start_clock \
70 | src/ASF/sam0/drivers/system/clock/quick_start_gclk \
71 | src/ASF/sam0/drivers/system/interrupt/quick_start \
72 | src/ASF/sam0/drivers/system/pinmux/quick_start \
73 | src/ASF/sam0/drivers/tc/quick_start \
74 | src/ASF/sam0/drivers/tc/quick_start_callback \
75 | src/ASF/sam0/drivers/wdt/quick_start \
76 | src/ASF/sam0/drivers/wdt/quick_start_callback \
77 | src/ASF/sam0/utils/cmsis \
78 | src/ASF/sam0/utils/header_files \
79 | src/ASF/sam0/utils/make \
80 | src/ASF/sam0/utils/preprocessor \
81 | src/ASF/sam0/utils/syscalls \
82 | src/ASF/sam0/utils/cmsis/samd20 \
83 | src/ASF/sam0/utils/cmsis/samd20/include \
84 | src/ASF/sam0/utils/cmsis/samd20/source \
85 | src/ASF/sam0/utils/cmsis/samd20/include/component \
86 | src/ASF/sam0/utils/cmsis/samd20/include/instance \
87 | src/ASF/sam0/utils/cmsis/samd20/include/pio \
88 | src/ASF/sam0/utils/cmsis/samd20/source/gcc \
89 | src/ASF/sam0/utils/syscalls/gcc \
90 | src/ASF/thirdparty/CMSIS \
91 | src/ASF/thirdparty/demo \
92 | src/ASF/thirdparty/CMSIS/Include \
93 | src/ASF/common2/boards/user_board \
94 | src/ASF_Support \
95 | src/config
96 |
97 |
98 | ##################### ASF SOURCE FOR COMPLIE #########################
99 | ASF_SRC += \
100 | src/ASF/common/utils/interrupt/interrupt_sam_nvic.c \
101 | src/ASF/common2/boards/user_board/init.c \
102 | src/ASF/sam0/drivers/nvm/nvm.c \
103 | src/ASF/sam0/drivers/port/port.c \
104 | src/ASF/sam0/drivers/sercom/sercom_interrupt.c \
105 | src/ASF/sam0/drivers/sercom/sercom.c \
106 | src/ASF/sam0/drivers/sercom/spi/spi.c \
107 | src/ASF/sam0/drivers/sercom/spi/spi_interrupt.c \
108 | src/ASF/sam0/drivers/sercom/usart/usart_interrupt.c \
109 | src/ASF/sam0/drivers/sercom/usart/usart.c \
110 | src/ASF/sam0/drivers/system/clock/clock_samd20/clock.c \
111 | src/ASF/sam0/drivers/system/clock/clock_samd20/gclk.c \
112 | src/ASF/sam0/drivers/system/interrupt/system_interrupt.c \
113 | src/ASF/sam0/drivers/system/pinmux/pinmux.c \
114 | src/ASF/sam0/drivers/system/system.c \
115 | src/ASF/sam0/drivers/tc/tc_sam_d_r/tc.c \
116 | src/ASF/sam0/drivers/tc/tc_interrupt.c \
117 | src/ASF/sam0/services/eeprom/emulator/main_array/eeprom.c \
118 | src/ASF/sam0/utils/cmsis/samd20/source/system_samd20.c \
119 | src/ASF_Support/clock_support.c \
120 | src/ASF_Support/eeprom_emulator_support.c \
121 | src/ASF_Support/spi_support.c \
122 | src/ASF_Support/tc_support.c \
123 | src/ASF_Support/usart_support.c \
124 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/port/quick_start/qs_port_basic.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM GPIO Port Driver Quick Start
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 | /**
45 | * \page asfdoc_sam0_port_basic_use_case Quick Start Guide for PORT - Basic
46 | *
47 | * In this use case, the PORT module is configured for:
48 | * \li One pin in input mode, with pull-up enabled
49 | * \li One pin in output mode
50 | *
51 | * This use case sets up the PORT to read the current state of a GPIO pin set as
52 | * an input, and mirrors the opposite logical state on a pin configured as an
53 | * output.
54 | *
55 | * \section asfdoc_sam0_port_basic_use_case_setup Setup
56 | *
57 | * \subsection asfdoc_sam0_port_basic_use_case_setup_prereq Prerequisites
58 | * There are no special setup requirements for this use-case.
59 | *
60 | * \subsection asfdoc_sam0_port_basic_use_case_setup_code Code
61 | * Copy-paste the following setup code to your user application:
62 | * \snippet qs_port_basic.c setup
63 | *
64 | * Add to user application initialization (typically the start of \c main()):
65 | * \snippet qs_port_basic.c setup_init
66 | *
67 | * \subsection asfdoc_sam0_port_basic_use_case_setup_flow Workflow
68 | * -# Create a PORT module pin configuration struct, which can be filled out to
69 | * adjust the configuration of a single port pin.
70 | * \snippet qs_port_basic.c setup_1
71 | * -# Initialize the pin configuration struct with the module's default values.
72 | * \snippet qs_port_basic.c setup_2
73 | * \note This should always be performed before using the configuration
74 | * struct to ensure that all values are initialized to known default
75 | * settings.
76 | *
77 | * -# Adjust the configuration struct to request an input pin.
78 | * \snippet qs_port_basic.c setup_3
79 | * -# Configure push button pin with the initialized pin configuration struct, to enable
80 | * the input sampler on the pin.
81 | * \snippet qs_port_basic.c setup_4
82 | * -# Adjust the configuration struct to request an output pin.
83 | * \snippet qs_port_basic.c setup_5
84 | * \note The existing configuration struct may be re-used, as long as any
85 | * values that have been altered from the default settings are taken
86 | * into account by the user application.
87 | *
88 | * -# Configure LED pin with the initialized pin configuration struct, to enable
89 | * the output driver on the pin.
90 | * \snippet qs_port_basic.c setup_6
91 | *
92 | * \section asfdoc_sam0_port_basic_use_case_use_main Use Case
93 | *
94 | * \subsection asfdoc_sam0_port_basic_use_case_code Code
95 | * Copy-paste the following code to your user application:
96 | * \snippet qs_port_basic.c main
97 | *
98 | * \subsection asfdoc_sam0_port_basic_use_case_flow Workflow
99 | * -# Read in the current input sampler state of push button pin, which has been
100 | * configured as an input in the use-case setup code.
101 | * \snippet qs_port_basic.c main_1
102 | * -# Write the inverted pin level state to LED pin, which has been configured as
103 | * an output in the use-case setup code.
104 | * \snippet qs_port_basic.c main_2
105 | */
106 | /*
107 | * Support and FAQ: visit Atmel Support
108 | */
109 |
--------------------------------------------------------------------------------
/BMF055FlightController_MW21/src/ASF/sam0/drivers/sercom/sercom_interrupt.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Serial Peripheral Interface 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 | #include "sercom_interrupt.h"
47 |
48 | void *_sercom_instances[SERCOM_INST_NUM];
49 |
50 | /** Save status of initialized handlers. */
51 | static bool _handler_table_initialized = false;
52 |
53 | /** Void pointers for saving device instance structures. */
54 | static void (*_sercom_interrupt_handlers[SERCOM_INST_NUM])(const uint8_t instance);
55 |
56 | /**
57 | * \internal
58 | * Default interrupt handler.
59 | *
60 | * \param[in] instance SERCOM instance used.
61 | */
62 | static void _sercom_default_handler(
63 | const uint8_t instance)
64 | {
65 | Assert(false);
66 | }
67 |
68 | /**
69 | * \internal
70 | * Saves the given callback handler.
71 | *
72 | * \param[in] instance Instance index.
73 | * \param[in] interrupt_handler Pointer to instance callback handler.
74 | */
75 | void _sercom_set_handler(
76 | const uint8_t instance,
77 | const sercom_handler_t interrupt_handler)
78 | {
79 | /* Initialize handlers with default handler and device instances with 0. */
80 | if (_handler_table_initialized == false) {
81 | for (uint32_t i = 0; i < SERCOM_INST_NUM; i++) {
82 | _sercom_interrupt_handlers[i] = &_sercom_default_handler;
83 | _sercom_instances[i] = NULL;
84 | }
85 |
86 | _handler_table_initialized = true;
87 | }
88 |
89 | /* Save interrupt handler. */
90 | _sercom_interrupt_handlers[instance] = interrupt_handler;
91 | }
92 |
93 |
94 | /** \internal
95 | * Converts a given SERCOM index to its interrupt vector index.
96 | */
97 | #define _SERCOM_INTERRUPT_VECT_NUM(n, unused) \
98 | SYSTEM_INTERRUPT_MODULE_SERCOM##n,
99 |
100 | /** \internal
101 | * Generates a SERCOM interrupt handler function for a given SERCOM index.
102 | */
103 | #define _SERCOM_INTERRUPT_HANDLER(n, unused) \
104 | void SERCOM##n##_Handler(void) \
105 | { \
106 | _sercom_interrupt_handlers[n](n); \
107 | }
108 |
109 | /**
110 | * \internal
111 | * Returns the system interrupt vector.
112 | *
113 | * \param[in] sercom_instance Instance pointer
114 | *
115 | * \return Enum of system interrupt vector
116 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM0
117 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM1
118 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM2
119 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM3
120 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM4
121 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM5
122 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM6
123 | * \retval SYSTEM_INTERRUPT_MODULE_SERCOM7
124 | */
125 | enum system_interrupt_vector _sercom_get_interrupt_vector(
126 | Sercom *const sercom_instance)
127 | {
128 | const uint8_t sercom_int_vectors[SERCOM_INST_NUM] =
129 | {
130 | MREPEAT(SERCOM_INST_NUM, _SERCOM_INTERRUPT_VECT_NUM, ~)
131 | };
132 |
133 | /* Retrieve the index of the SERCOM being requested */
134 | uint8_t instance_index = _sercom_get_sercom_inst_index(sercom_instance);
135 |
136 | /* Get the vector number from the lookup table for the requested SERCOM */
137 | return (enum system_interrupt_vector)sercom_int_vectors[instance_index];
138 | }
139 |
140 | /** Auto-generate a set of interrupt handlers for each SERCOM in the device */
141 | MREPEAT(SERCOM_INST_NUM, _SERCOM_INTERRUPT_HANDLER, ~)
142 |
--------------------------------------------------------------------------------