Merge branch 'master' into unusedvariable
This commit is contained in:
commit
94e908c453
109 changed files with 740 additions and 239 deletions
63
.github/workflows/githubci.yml
vendored
Normal file
63
.github/workflows/githubci.yml
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
name: Build
|
||||
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arduino-platform: ['metro_m0', 'hallowing', 'circuitplayground_m0',
|
||||
'metro_m4', 'pybadge_m4', 'pygamer_m4', 'hallowing_m4', 'pyportal_m4', 'pyportal_m4_titano']
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Checkout submodules
|
||||
shell: bash
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive
|
||||
|
||||
- name: Install Arduino CLI and Tools
|
||||
run: |
|
||||
# make all our directories we need for files and libraries
|
||||
mkdir $HOME/.arduino15
|
||||
mkdir $HOME/.arduino15/packages
|
||||
mkdir $HOME/Arduino
|
||||
mkdir $HOME/Arduino/libraries
|
||||
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
|
||||
echo "::add-path::$GITHUB_WORKSPACE/bin"
|
||||
|
||||
- name: Install BSP and Libraries
|
||||
env:
|
||||
BSP_URL: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
|
||||
BSP_PATH: .arduino15/packages/adafruit/hardware/samd
|
||||
LIB_DEPS: FlashStorage SD
|
||||
run: |
|
||||
arduino-cli config init
|
||||
arduino-cli core update-index
|
||||
arduino-cli core update-index --additional-urls $BSP_URL
|
||||
arduino-cli core install arduino:samd --additional-urls $BSP_URL
|
||||
arduino-cli core install adafruit:samd --additional-urls $BSP_URL
|
||||
# Replace release BSP with our code
|
||||
BSP_VERSION=`eval ls $HOME/$BSP_PATH`
|
||||
rm -r $HOME/$BSP_PATH/*
|
||||
ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION
|
||||
arduino-cli lib install $LIB_DEPS
|
||||
|
||||
- name: Build examples
|
||||
run: python3 extras/build_all.py ${{ matrix.arduino-platform }}
|
||||
|
||||
# How to mark this as allowed-to-fail?
|
||||
- name: Build examples (-Wall)
|
||||
run: python3 extras/build_all.py --all_warnings --warnings_do_not_cause_job_failure
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
# Arduino Core for SAMD21 and SAMD51 CPU
|
||||
|
||||
[](https://github.com/adafruit/ArduinoCore-samd/actions)
|
||||
|
||||
This repository contains the source code and configuration files of the Arduino Core
|
||||
for Atmel's SAMD21 and SAMD51 processor (used on the Arduino/Genuino Zero, MKR1000 and MKRZero boards).
|
||||
|
||||
|
|
|
|||
30
boards.txt
30
boards.txt
|
|
@ -262,7 +262,7 @@ adafruit_trinket_m0.build.variant_system_lib=
|
|||
adafruit_trinket_m0.build.vid=0x239A
|
||||
adafruit_trinket_m0.build.pid=0x801E
|
||||
adafruit_trinket_m0.bootloader.tool=openocd
|
||||
adafruit_trinket_m0.bootloader.file=trinketM0/bootloader-trinket_m0-v2.0.0-adafruit.5.bin
|
||||
adafruit_trinket_m0.bootloader.file=trinketm0/bootloader-trinket_m0-v2.0.0-adafruit.5.bin
|
||||
adafruit_trinket_m0.menu.usbstack.arduino=Arduino
|
||||
adafruit_trinket_m0.menu.usbstack.tinyusb=TinyUSB
|
||||
adafruit_trinket_m0.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB
|
||||
|
|
@ -448,7 +448,7 @@ adafruit_metro_m4.build.vid=0x239A
|
|||
adafruit_metro_m4.build.pid=0x8020
|
||||
adafruit_metro_m4.bootloader.tool=openocd
|
||||
adafruit_metro_m4.bootloader.file=metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_metro_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_metro_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_metro_m4.menu.cache.on=Enabled
|
||||
adafruit_metro_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_metro_m4.menu.cache.off=Disabled
|
||||
|
|
@ -514,7 +514,7 @@ adafruit_grandcentral_m4.build.vid=0x239A
|
|||
adafruit_grandcentral_m4.build.pid=0x8031
|
||||
adafruit_grandcentral_m4.bootloader.tool=openocd
|
||||
adafruit_grandcentral_m4.bootloader.file=grand_central_m4/bootloader-grandcentralM4-v2.0.0-adafruit.5.bin
|
||||
adafruit_grandcentral_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_grandcentral_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_grandcentral_m4.menu.cache.on=Enabled
|
||||
adafruit_grandcentral_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_grandcentral_m4.menu.cache.off=Disabled
|
||||
|
|
@ -577,7 +577,7 @@ adafruit_itsybitsy_m4.build.vid=0x239A
|
|||
adafruit_itsybitsy_m4.build.pid=0x802B
|
||||
adafruit_itsybitsy_m4.bootloader.tool=openocd
|
||||
adafruit_itsybitsy_m4.bootloader.file=itsybitsyM4/bootloader-itsybitsy_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_itsybitsy_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_itsybitsy_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_itsybitsy_m4.menu.cache.on=Enabled
|
||||
adafruit_itsybitsy_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_itsybitsy_m4.menu.cache.off=Disabled
|
||||
|
|
@ -640,7 +640,7 @@ adafruit_feather_m4.build.vid=0x239A
|
|||
adafruit_feather_m4.build.pid=0x8022
|
||||
adafruit_feather_m4.bootloader.tool=openocd
|
||||
adafruit_feather_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_feather_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_feather_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_feather_m4.menu.cache.on=Enabled
|
||||
adafruit_feather_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_feather_m4.menu.cache.off=Disabled
|
||||
|
|
@ -705,7 +705,7 @@ adafruit_trellis_m4.build.vid=0x239A
|
|||
adafruit_trellis_m4.build.pid=0x802F
|
||||
adafruit_trellis_m4.bootloader.tool=openocd
|
||||
adafruit_trellis_m4.bootloader.file=trellisM4/bootloader-trellis_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_trellis_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_trellis_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_trellis_m4.menu.cache.on=Enabled
|
||||
adafruit_trellis_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_trellis_m4.menu.cache.off=Disabled
|
||||
|
|
@ -768,7 +768,7 @@ adafruit_pyportal_m4.build.vid=0x239A
|
|||
adafruit_pyportal_m4.build.pid=0x8035
|
||||
adafruit_pyportal_m4.bootloader.tool=openocd
|
||||
adafruit_pyportal_m4.bootloader.file=metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pyportal_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pyportal_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pyportal_m4.menu.cache.on=Enabled
|
||||
adafruit_pyportal_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pyportal_m4.menu.cache.off=Disabled
|
||||
|
|
@ -831,7 +831,7 @@ adafruit_pyportal_m4_titano.build.vid=0x239A
|
|||
adafruit_pyportal_m4_titano.build.pid=0x8035
|
||||
adafruit_pyportal_m4_titano.bootloader.tool=openocd
|
||||
adafruit_pyportal_m4_titano.bootloader.file=metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pyportal_m4_titano.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pyportal_m4_titano.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pyportal_m4_titano.menu.cache.on=Enabled
|
||||
adafruit_pyportal_m4_titano.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pyportal_m4_titano.menu.cache.off=Disabled
|
||||
|
|
@ -896,7 +896,7 @@ adafruit_pybadge_m4.build.vid=0x239A
|
|||
adafruit_pybadge_m4.build.pid=0x8033
|
||||
adafruit_pybadge_m4.bootloader.tool=openocd
|
||||
adafruit_pybadge_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pybadge_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pybadge_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pybadge_m4.menu.cache.on=Enabled
|
||||
adafruit_pybadge_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pybadge_m4.menu.cache.off=Disabled
|
||||
|
|
@ -960,7 +960,7 @@ adafruit_metro_m4_airliftlite.build.vid=0x239A
|
|||
adafruit_metro_m4_airliftlite.build.pid=0x8037
|
||||
adafruit_metro_m4_airliftlite.bootloader.tool=openocd
|
||||
adafruit_metro_m4_airliftlite.bootloader.file=metroM4/bootloader-metro_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_metro_m4_airliftlite.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_metro_m4_airliftlite.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_metro_m4_airliftlite.menu.cache.on=Enabled
|
||||
adafruit_metro_m4_airliftlite.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_metro_m4_airliftlite.menu.cache.off=Disabled
|
||||
|
|
@ -1025,7 +1025,7 @@ adafruit_pygamer_m4.build.vid=0x239A
|
|||
adafruit_pygamer_m4.build.pid=0x803D
|
||||
adafruit_pygamer_m4.bootloader.tool=openocd
|
||||
adafruit_pygamer_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pygamer_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pygamer_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pygamer_m4.menu.cache.on=Enabled
|
||||
adafruit_pygamer_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pygamer_m4.menu.cache.off=Disabled
|
||||
|
|
@ -1089,7 +1089,7 @@ adafruit_pygamer_advance_m4.build.vid=0x239A
|
|||
adafruit_pygamer_advance_m4.build.pid=0x8041
|
||||
adafruit_pygamer_advance_m4.bootloader.tool=openocd
|
||||
adafruit_pygamer_advance_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pygamer_advance_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pygamer_advance_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pygamer_advance_m4.menu.cache.on=Enabled
|
||||
adafruit_pygamer_advance_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pygamer_advance_m4.menu.cache.off=Disabled
|
||||
|
|
@ -1155,7 +1155,7 @@ adafruit_pybadge_airlift_m4.build.vid=0x239A
|
|||
adafruit_pybadge_airlift_m4.build.pid=0x8043
|
||||
adafruit_pybadge_airlift_m4.bootloader.tool=openocd
|
||||
adafruit_pybadge_airlift_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_pybadge_airlift_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pybadge_airlift_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_pybadge_airlift_m4.menu.cache.on=Enabled
|
||||
adafruit_pybadge_airlift_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_pybadge_airlift_m4.menu.cache.off=Disabled
|
||||
|
|
@ -1221,7 +1221,7 @@ adafruit_monster_m4sk.build.vid=0x239A
|
|||
adafruit_monster_m4sk.build.pid=0x8047
|
||||
adafruit_monster_m4sk.bootloader.tool=openocd
|
||||
adafruit_monster_m4sk.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_monster_m4sk.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_monster_m4sk.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_monster_m4sk.menu.cache.on=Enabled
|
||||
adafruit_monster_m4sk.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_monster_m4sk.menu.cache.off=Disabled
|
||||
|
|
@ -1287,7 +1287,7 @@ adafruit_hallowing_m4.build.vid=0x239A
|
|||
adafruit_hallowing_m4.build.pid=0x8049
|
||||
adafruit_hallowing_m4.bootloader.tool=openocd
|
||||
adafruit_hallowing_m4.bootloader.file=featherM4/bootloader-feather_m4-v2.0.0-adafruit.5.bin
|
||||
adafruit_hallowing_m4.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_hallowing_m4.compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" "-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
adafruit_hallowing_m4.menu.cache.on=Enabled
|
||||
adafruit_hallowing_m4.menu.cache.on.build.cache_flags=-DENABLE_CACHE
|
||||
adafruit_hallowing_m4.menu.cache.off=Disabled
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -218,7 +218,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -222,7 +222,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -226,7 +226,11 @@ void I2S_Handler ( void );
|
|||
* \brief Configuration of the Cortex-M0+ Processor and Core Peripherals
|
||||
*/
|
||||
|
||||
#define LITTLE_ENDIAN 1
|
||||
#if defined(LITTLE_ENDIAN) && (LITTLE_ENDIAN != 1)
|
||||
#error "Little Endian is already defined, but to different value than expected?!"
|
||||
#else
|
||||
#define LITTLE_ENDIAN 1
|
||||
#endif
|
||||
#define __CM0PLUS_REV 1 /*!< Core revision r0p1 */
|
||||
#define __MPU_PRESENT 0 /*!< MPU present or not */
|
||||
#define __NVIC_PRIO_BITS 2 /*!< Number of bits used for Priority Levels */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class Print
|
|||
|
||||
// default to zero, meaning "a single write may block"
|
||||
// should be overriden by subclasses with buffering
|
||||
virtual size_t availableForWrite() { return 0; }
|
||||
virtual int availableForWrite() { return 0; }
|
||||
|
||||
size_t print(const __FlashStringHelper *);
|
||||
size_t print(const String &);
|
||||
|
|
|
|||
|
|
@ -537,8 +537,18 @@ bool SERCOM::startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag
|
|||
// 7-bits address + 1-bits R/W
|
||||
address = (address << 0x1ul) | flag;
|
||||
|
||||
// Wait idle or owner bus mode
|
||||
while ( !isBusIdleWIRE() && !isBusOwnerWIRE() );
|
||||
// If another master owns the bus or the last bus owner has not properly
|
||||
// sent a stop, return failure early. This will prevent some misbehaved
|
||||
// devices from deadlocking here at the cost of the caller being responsible
|
||||
// for retrying the failed transmission. See SercomWireBusState for the
|
||||
// possible bus states.
|
||||
if(!isBusOwnerWIRE())
|
||||
{
|
||||
if( isBusBusyWIRE() || (isArbLostWIRE() && !isBusIdleWIRE()) || isBusUnknownWIRE() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Send start and address
|
||||
sercom->I2CM.ADDR.bit.ADDR = address;
|
||||
|
|
@ -634,6 +644,21 @@ bool SERCOM::isBusOwnerWIRE( void )
|
|||
return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_OWNER_STATE;
|
||||
}
|
||||
|
||||
bool SERCOM::isBusUnknownWIRE( void )
|
||||
{
|
||||
return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
bool SERCOM::isArbLostWIRE( void )
|
||||
{
|
||||
return sercom->I2CM.STATUS.bit.ARBLOST == 1;
|
||||
}
|
||||
|
||||
bool SERCOM::isBusBusyWIRE( void )
|
||||
{
|
||||
return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_BUSY_STATE;
|
||||
}
|
||||
|
||||
bool SERCOM::isDataReadyWIRE( void )
|
||||
{
|
||||
return sercom->I2CS.INTFLAG.bit.DRDY;
|
||||
|
|
|
|||
|
|
@ -225,6 +225,9 @@ class SERCOM
|
|||
bool isSlaveWIRE( void ) ;
|
||||
bool isBusIdleWIRE( void ) ;
|
||||
bool isBusOwnerWIRE( void ) ;
|
||||
bool isBusUnknownWIRE( void ) ;
|
||||
bool isArbLostWIRE( void );
|
||||
bool isBusBusyWIRE( void );
|
||||
bool isDataReadyWIRE( void ) ;
|
||||
bool isStopDetectedWIRE( void ) ;
|
||||
bool isRestartDetectedWIRE( void ) ;
|
||||
|
|
@ -245,7 +248,7 @@ class SERCOM
|
|||
uint32_t getFreqRef(void) { return freqRef; };
|
||||
#else
|
||||
// The equivalent SAMD21 dummy functions...
|
||||
void setClockSource(int8_t idx, SercomClockSource src, bool core) { };
|
||||
void setClockSource(int8_t idx, SercomClockSource src, bool core) { (void)idx; (void)src; (void)core; };
|
||||
SercomClockSource getClockSource(void) { return SERCOM_CLOCK_SOURCE_FCPU; };
|
||||
uint32_t getFreqRef(void) { return F_CPU; };
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 472633c1c4fe2b1c9960fb12bed8c2740d489c51
|
||||
Subproject commit 238a5c0b95fcd402d24524c7bebbdd822168a51e
|
||||
|
|
@ -28,6 +28,27 @@
|
|||
#include "Adafruit_TinyUSB_Core.h"
|
||||
#include <Reset.h> // Needed for auto-reset with 1200bps port touch
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||
//--------------------------------------------------------------------+
|
||||
extern "C"
|
||||
{
|
||||
#if defined(__SAMD51__)
|
||||
|
||||
void USB_0_Handler (void) { tud_int_handler(0); }
|
||||
void USB_1_Handler (void) { tud_int_handler(0); }
|
||||
void USB_2_Handler (void) { tud_int_handler(0); }
|
||||
void USB_3_Handler (void) { tud_int_handler(0); }
|
||||
|
||||
#else
|
||||
|
||||
void USB_Handler(void) { tud_int_handler(0); }
|
||||
|
||||
#endif
|
||||
} // extern C
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
|
||||
//--------------------------------------------------------------------+
|
||||
|
|
@ -74,15 +95,6 @@ void Adafruit_TinyUSB_Core_touch1200(void)
|
|||
//--------------------------------------------------------------------+
|
||||
// Adafruit_USBD_Device platform dependent
|
||||
//--------------------------------------------------------------------+
|
||||
void Adafruit_USBD_Device::detach(void)
|
||||
{
|
||||
USB->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH;
|
||||
}
|
||||
|
||||
void Adafruit_USBD_Device::attach(void)
|
||||
{
|
||||
USB->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH;
|
||||
}
|
||||
|
||||
uint8_t Adafruit_USBD_Device::getSerialDescriptor(uint16_t* serial_str)
|
||||
{
|
||||
|
|
@ -152,6 +164,11 @@ static void usb_hardware_init(void)
|
|||
|
||||
|
||||
GCLK->PCHCTRL[USB_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos);
|
||||
|
||||
NVIC_SetPriority(USB_0_IRQn, 0UL);
|
||||
NVIC_SetPriority(USB_1_IRQn, 0UL);
|
||||
NVIC_SetPriority(USB_2_IRQn, 0UL);
|
||||
NVIC_SetPriority(USB_3_IRQn, 0UL);
|
||||
#else
|
||||
PM->APBBMASK.reg |= PM_APBBMASK_USB;
|
||||
|
||||
|
|
@ -169,6 +186,8 @@ static void usb_hardware_init(void)
|
|||
GCLK_CLKCTRL_CLKEN;
|
||||
while (GCLK->STATUS.bit.SYNCBUSY)
|
||||
;
|
||||
|
||||
NVIC_SetPriority((IRQn_Type) USB_IRQn, 0UL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@
|
|||
#define CFG_TUD_HID_BUFSIZE 64
|
||||
|
||||
// MIDI FIFO size of TX and RX
|
||||
#define CFG_TUD_MIDI_RX_BUFSIZE 64
|
||||
#define CFG_TUD_MIDI_TX_BUFSIZE 64
|
||||
#define CFG_TUD_MIDI_RX_BUFSIZE 128
|
||||
#define CFG_TUD_MIDI_TX_BUFSIZE 128
|
||||
|
||||
// Vendor FIFO size of TX and RX
|
||||
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ int Serial_::available(void)
|
|||
return usb.available(CDC_ENDPOINT_OUT);
|
||||
}
|
||||
|
||||
size_t Serial_::availableForWrite(void)
|
||||
int Serial_::availableForWrite(void)
|
||||
{
|
||||
// return the number of bytes left in the current bank,
|
||||
// always EP size - 1, because bank is flushed on every write
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public:
|
|||
void end(void);
|
||||
|
||||
virtual int available(void);
|
||||
virtual size_t availableForWrite(void);
|
||||
virtual int availableForWrite(void);
|
||||
virtual int peek(void);
|
||||
virtual int read(void);
|
||||
virtual void flush(void);
|
||||
|
|
|
|||
|
|
@ -877,6 +877,7 @@ bool USBDeviceClass::handleStandardSetup(USBSetup &setup)
|
|||
sendZlp(0);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case SET_ADDRESS:
|
||||
setAddress(setup.wValueL);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ int Uart::available()
|
|||
return rxBuffer.available();
|
||||
}
|
||||
|
||||
size_t Uart::availableForWrite()
|
||||
int Uart::availableForWrite()
|
||||
{
|
||||
return txBuffer.availableForStore();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Uart : public HardwareSerial
|
|||
void begin(unsigned long baudrate, uint16_t config);
|
||||
void end();
|
||||
int available();
|
||||
size_t availableForWrite();
|
||||
int availableForWrite();
|
||||
int peek();
|
||||
int read();
|
||||
void flush();
|
||||
|
|
|
|||
|
|
@ -250,8 +250,9 @@ void detachInterrupt(uint32_t pin)
|
|||
* External Interrupt Controller NVIC Interrupt Handler
|
||||
*/
|
||||
#if defined(__SAMD51__)
|
||||
void InterruptHandler(uint32_t i)
|
||||
void InterruptHandler(uint32_t unused_i)
|
||||
{
|
||||
(void)unused_i;
|
||||
// Calling the routine directly from -here- takes about 1us
|
||||
// Depending on where you are in the list it will take longer
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
#define FALLING 3
|
||||
#define RISING 4
|
||||
|
||||
#define DEFAULT 1
|
||||
//#define DEFAULT 1
|
||||
#define EXTERNAL 0
|
||||
|
||||
typedef void (*voidFuncPtr)(void);
|
||||
|
|
|
|||
|
|
@ -164,18 +164,19 @@ void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples)
|
|||
uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t diff, diffCrnt = 0;
|
||||
int32_t diff;
|
||||
uint32_t diffCrnt = 0;
|
||||
uint32_t maxDiff = 0;
|
||||
|
||||
for (i = 0; i < numSamples; i++)
|
||||
{
|
||||
diff = pIn[i] - pOut[i];
|
||||
diffCrnt = (diff > 0) ? diff : -diff;
|
||||
diff = pIn[i] - pOut[i];
|
||||
diffCrnt = (uint32_t)( (diff > 0) ? diff : -diff );
|
||||
|
||||
if(diffCrnt > maxDiff)
|
||||
{
|
||||
maxDiff = diffCrnt;
|
||||
}
|
||||
if(diffCrnt > maxDiff)
|
||||
{
|
||||
maxDiff = diffCrnt;
|
||||
}
|
||||
}
|
||||
|
||||
return(maxDiff);
|
||||
|
|
@ -192,18 +193,19 @@ uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples)
|
|||
uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t * pOut, uint32_t numSamples)
|
||||
{
|
||||
uint32_t i;
|
||||
int32_t diff, diffCrnt = 0;
|
||||
int32_t diff;
|
||||
uint32_t diffCrnt = 0;
|
||||
uint32_t maxDiff = 0;
|
||||
|
||||
for (i = 0; i < numSamples; i++)
|
||||
{
|
||||
diff = pIn[i] - pOut[i];
|
||||
diffCrnt = (diff > 0) ? diff : -diff;
|
||||
diff = pIn[i] - pOut[i];
|
||||
diffCrnt = (uint32_t)( (diff > 0) ? diff : -diff );
|
||||
|
||||
if(diffCrnt > maxDiff)
|
||||
{
|
||||
maxDiff = diffCrnt;
|
||||
}
|
||||
if(diffCrnt > maxDiff)
|
||||
{
|
||||
maxDiff = diffCrnt;
|
||||
}
|
||||
}
|
||||
|
||||
return(maxDiff);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ static int _writeResolution = 12;
|
|||
static int _dacResolution = 12;
|
||||
#else
|
||||
static int _writeResolution = 8;
|
||||
//static int _dacResolution = 10;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
124
extras/build_all.py
Normal file
124
extras/build_all.py
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
import os
|
||||
import glob
|
||||
import sys
|
||||
import subprocess
|
||||
import time
|
||||
import argparse
|
||||
|
||||
FQBN_PREFIX='adafruit:samd:adafruit_'
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description='python wrapper for adafruit arduino CI workflows',
|
||||
allow_abbrev=False
|
||||
)
|
||||
parser.add_argument(
|
||||
'--all_warnings', '--Wall',
|
||||
action='store_true',
|
||||
help='build with all warnings enabled (`--warnings all`)',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--warnings_do_not_cause_job_failure',
|
||||
action='store_true',
|
||||
help='failed builds will be listed as failed, but not cause job to exit with an error status',
|
||||
)
|
||||
parser.add_argument(
|
||||
'build_boards',
|
||||
metavar='board',
|
||||
nargs='*',
|
||||
help='list of boards to be built -- Note that the fqbn is created by prepending "{}"'.format(FQBN_PREFIX),
|
||||
default= [ 'metro_m0', 'metro_m4', 'circuitplayground_m0' ]
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
exit_status = 0
|
||||
success_count = 0
|
||||
fail_count = 0
|
||||
skip_count = 0
|
||||
build_format = '| {:22} | {:30} | {:9} '
|
||||
build_separator = '-' * 80
|
||||
|
||||
def errorOutputFilter(line: str):
|
||||
if len(line) == 0:
|
||||
return False
|
||||
if line.isspace(): # Note: empty string does not match here!
|
||||
return False
|
||||
# TODO: additional items to remove?
|
||||
return True
|
||||
|
||||
def build_examples(variant: str):
|
||||
global args, exit_status, success_count, fail_count, skip_count, build_format, build_separator
|
||||
|
||||
print('\n')
|
||||
print(build_separator)
|
||||
print('| {:^76} |'.format('Board ' + variant))
|
||||
print(build_separator)
|
||||
print((build_format + '| {:6} |').format('Library', 'Example', 'Result', 'Time'))
|
||||
print(build_separator)
|
||||
|
||||
fqbn = "{}{}".format(FQBN_PREFIX, variant)
|
||||
|
||||
for sketch in glob.iglob('libraries/**/*.ino', recursive=True):
|
||||
start_time = time.monotonic()
|
||||
|
||||
# Skip if contains: ".board.test.skip" or ".all.test.skip"
|
||||
# Skip if not contains: ".board.test.only" for a specific board
|
||||
sketchdir = os.path.dirname(sketch)
|
||||
if os.path.exists(sketchdir + '/.all.test.skip') or os.path.exists(sketchdir + '/.' + variant + '.test.skip'):
|
||||
success = "\033[33mskipped\033[0m "
|
||||
elif glob.glob(sketchdir+"/.*.test.only") and not os.path.exists(sketchdir + '/.build.' + variant):
|
||||
success = "\033[33mskipped\033[0m "
|
||||
else:
|
||||
# TODO - preferably, would have STDERR show up in **both** STDOUT and STDERR.
|
||||
# preferably, would use Python logging handler to get both distinct outputs and one merged output
|
||||
# for now, split STDERR when building with all warnings enabled, so can detect warning/error output.
|
||||
if args.all_warnings:
|
||||
build_result = subprocess.run("arduino-cli compile --warnings all --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
else:
|
||||
build_result = subprocess.run("arduino-cli compile --warnings default --fqbn {} {}".format(fqbn, sketch), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
|
||||
# get stderr into a form where len(warningLines) indicates a true warning was output to stderr
|
||||
warningLines = [];
|
||||
if args.all_warnings and build_result.stderr:
|
||||
tmpWarningLines = build_result.stderr.decode("utf-8").splitlines()
|
||||
warningLines = list(filter(errorOutputFilter, (tmpWarningLines)))
|
||||
|
||||
if build_result.returncode != 0:
|
||||
exit_status = build_result.returncode
|
||||
success = "\033[31mfailed\033[0m "
|
||||
fail_count += 1
|
||||
elif len(warningLines) != 0:
|
||||
if not args.warnings_do_not_cause_job_failure:
|
||||
exit_status = -1
|
||||
success = "\033[31mwarnings\033[0m "
|
||||
fail_count += 1
|
||||
else:
|
||||
success = "\033[32msucceeded\033[0m"
|
||||
success_count += 1
|
||||
|
||||
build_duration = time.monotonic() - start_time
|
||||
|
||||
print((build_format + '| {:5.2f}s |').format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, build_duration))
|
||||
|
||||
if success != "\033[33mskipped\033[0m ":
|
||||
if build_result.returncode != 0:
|
||||
print(build_result.stdout.decode("utf-8"))
|
||||
if (build_result.stderr):
|
||||
print(build_result.stderr.decode("utf-8"))
|
||||
if len(warningLines) != 0:
|
||||
for line in warningLines:
|
||||
print(line)
|
||||
else:
|
||||
skip_count += 1
|
||||
|
||||
build_time = time.monotonic()
|
||||
|
||||
for board in args.build_boards:
|
||||
build_examples(board)
|
||||
|
||||
print(build_separator)
|
||||
build_time = time.monotonic() - build_time
|
||||
print("Build Summary: {} \033[32msucceeded\033[0m, {} \033[31mfailed\033[0m, {} \033[33mskipped\033[0m and took {:.2f}s".format(success_count, fail_count, skip_count, build_time))
|
||||
print(build_separator)
|
||||
|
||||
sys.exit(exit_status)
|
||||
|
|
@ -17,6 +17,7 @@ volatile bool transfer_is_done = false; // Done yet?
|
|||
|
||||
// Callback for end-of-DMA-transfer
|
||||
void dma_callback(Adafruit_ZeroDMA *dma) {
|
||||
(void)dma; // avoid compiler warning about unused function parameter
|
||||
transfer_is_done = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ volatile bool transfer_is_done = false; // Done yet?
|
|||
|
||||
// Callback for end-of-DMA-transfer
|
||||
void dma_callback(Adafruit_ZeroDMA *dma) {
|
||||
(void)dma; // avoid compiler warning about unused parameter
|
||||
transfer_is_done = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ volatile bool transfer_is_done = true; // Done yet?
|
|||
|
||||
// Callback for end-of-DMA-transfer
|
||||
void dma_callback(Adafruit_ZeroDMA *dma) {
|
||||
(void)dma; // avoid compiler warning about unused parameter
|
||||
transfer_is_done = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
1
libraries/CI_Tests/CI_Tests.h
Normal file
1
libraries/CI_Tests/CI_Tests.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
// fake empty header file to make Arduino IDE happy
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#include <arm_math.h>
|
||||
|
||||
arm_rfft_fast_instance_f32 plan;
|
||||
|
||||
void setup() {
|
||||
arm_rfft_fast_init_f32(&plan, 256);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
float in[256] = { 0 }, out[256] = { 0 };
|
||||
arm_rfft_fast_f32(&plan, in, out, 0);
|
||||
}
|
||||
0
libraries/I2S/examples/SimpleTone/.metro_m0.test.only
Normal file
0
libraries/I2S/examples/SimpleTone/.metro_m0.test.only
Normal file
0
libraries/SDU/examples/Usage/.metro_m0.test.only
Normal file
0
libraries/SDU/examples/Usage/.metro_m0.test.only
Normal file
0
libraries/SDU/extras/SDUBoot/.metro_m0.test.only
Normal file
0
libraries/SDU/extras/SDUBoot/.metro_m0.test.only
Normal file
|
|
@ -321,7 +321,7 @@ void SPIClass::transfer(const void* txbuf, void* rxbuf, size_t count,
|
|||
bool blockThisPass;
|
||||
if(count > 65535) { // Too big for 1 descriptor
|
||||
blockThisPass = true;
|
||||
bytesThisPass = count % 65535; // Fractional part
|
||||
bytesThisPass = count & 65535; // Fractional part
|
||||
if(!bytesThisPass) bytesThisPass = 65535;
|
||||
} else {
|
||||
blockThisPass = block;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class SPIClass {
|
|||
#else
|
||||
// On SAMD21, this compiles to nothing, so user code doesn't need to
|
||||
// check and conditionally compile lines for different architectures.
|
||||
void setClockSource(SercomClockSource clk) { };
|
||||
void setClockSource(SercomClockSource clk) { (void)clk; };
|
||||
#endif // end __SAMD51__
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ static inline void resetTC (Tc* TCx)
|
|||
|
||||
static void _initISR(Tc *tc, uint8_t channel, uint32_t id, IRQn_Type irqn, uint8_t gcmForTimer, uint8_t intEnableBit)
|
||||
{
|
||||
(void)id;
|
||||
// Select GCLK0 as timer/counter input clock source
|
||||
#if defined(__SAMD51__)
|
||||
int idx = gcmForTimer; // see datasheet Table 14-9
|
||||
|
|
@ -265,6 +266,7 @@ static void initISR(timer16_Sequence_t timer)
|
|||
|
||||
static void finISR(timer16_Sequence_t timer)
|
||||
{
|
||||
(void)timer;
|
||||
#if defined (_useTimer1)
|
||||
// Disable the match channel interrupt request
|
||||
TC_FOR_TIMER1->COUNT16.INTENCLR.reg = INTENCLR_BIT_FOR_TIMER_1;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void setup(void)
|
|||
while (!SERIAL_PORT_MONITOR); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
|
||||
SERIAL_PORT_MONITOR.println("\r\nADK demo start");
|
||||
|
||||
if (usb.Init() == -1)
|
||||
if (usb.Init() == (uint32_t)-1)
|
||||
SERIAL_PORT_MONITOR.println("OSC did not start.");
|
||||
|
||||
delay(20);
|
||||
|
|
|
|||
|
|
@ -83,8 +83,7 @@ void setup()
|
|||
{
|
||||
SerialDebug.begin( 115200 );
|
||||
SerialDebug.println("USB Host Keyboard Controller Program started");
|
||||
|
||||
if (usb.Init() == -1)
|
||||
if (usb.Init() == (uint32_t)-1)
|
||||
SerialDebug.println("USB Host did not start.");
|
||||
|
||||
SerialDebug.println("USB Host started");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void setup()
|
|||
SerialDebug.begin( 115200 );
|
||||
SerialDebug.println("USB Host Mouse Controller Program started");
|
||||
|
||||
if (usb.Init() == -1)
|
||||
if (usb.Init() == (uint32_t)-1)
|
||||
SerialDebug.println("USB Host did not start.");
|
||||
|
||||
SerialDebug.println("USB Host started");
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ void setup()
|
|||
SerialDebug.println("Starting USB Descriptor test");
|
||||
|
||||
SerialDebug.println("Initializing USB");
|
||||
if (usb.Init() == -1)
|
||||
SerialDebug.println("USBhost did not start.");
|
||||
if (usb.Init() == (uint32_t)-1)
|
||||
SerialDebug.println("USBhost did not start.");
|
||||
|
||||
delay( 20 );
|
||||
|
||||
|
|
@ -161,6 +161,7 @@ byte getdevdescr( byte addr, byte &num_conf )
|
|||
|
||||
void printhubdescr(uint8_t *descrptr, uint8_t addr)
|
||||
{
|
||||
(void)addr;
|
||||
HubDescriptor *pHub = (HubDescriptor*) descrptr;
|
||||
uint8_t len = *((uint8_t*)descrptr);
|
||||
|
||||
|
|
@ -209,10 +210,11 @@ byte getconfdescr( byte addr, byte conf )
|
|||
{
|
||||
uint8_t buf[ BUFSIZE ];
|
||||
uint8_t* buf_ptr = buf;
|
||||
byte rcode;
|
||||
byte rcode; // FIXME -- code does not actually check return code (no error handling!)
|
||||
byte descr_length;
|
||||
byte descr_type;
|
||||
uint16_t total_length;
|
||||
// FIXME -- no check of return code from usb.getConfDescr()
|
||||
rcode = usb.getConfDescr( addr, 0, 4, conf, buf ); //get total length
|
||||
LOBYTE( total_length ) = buf[ 2 ];
|
||||
HIBYTE( total_length ) = buf[ 3 ];
|
||||
|
|
@ -220,6 +222,7 @@ byte getconfdescr( byte addr, byte conf )
|
|||
printProgStr(Conf_Trunc_str);
|
||||
total_length = sizeof(buf);
|
||||
}
|
||||
// FIXME -- no check of return code from usb.getConfDescr()
|
||||
rcode = usb.getConfDescr( addr, 0, total_length, conf, buf ); //get the whole descriptor
|
||||
while( buf_ptr < buf + total_length ) { //parsing descriptors
|
||||
descr_length = *( buf_ptr );
|
||||
|
|
@ -382,3 +385,4 @@ void printProgStr(const prog_char str[])
|
|||
if(!str) return;
|
||||
while((c = pgm_read_byte(str++)))
|
||||
SerialDebug.print(c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,15 +59,15 @@ class ConfigDescParser : public USBReadParser {
|
|||
uint32_t ifaceNumber; // Interface number
|
||||
uint32_t ifaceAltSet; // Interface alternate settings
|
||||
|
||||
bool UseOr;
|
||||
bool UseOr;
|
||||
bool ParseDescriptor(uint8_t **pp, uint32_t *pcntdn);
|
||||
void PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc);
|
||||
|
||||
public:
|
||||
|
||||
void SetOR(void) {
|
||||
UseOr = true;
|
||||
}
|
||||
void SetOR(void) {
|
||||
UseOr = true;
|
||||
}
|
||||
ConfigDescParser(UsbConfigXtracter *xtractor);
|
||||
virtual void Parse(const uint32_t len, const uint8_t *pbuf, const uint32_t &offset);
|
||||
};
|
||||
|
|
@ -98,8 +98,19 @@ void ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::Parse(const uin
|
|||
compare masks for them. When the match is found, calls EndpointXtract passing buffer containing endpoint descriptor */
|
||||
template <const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PROTOCOL_ID, const uint8_t MASK>
|
||||
bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor(uint8_t **pp, uint32_t *pcntdn) {
|
||||
USB_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR*>(varBuffer);
|
||||
USB_INTERFACE_DESCRIPTOR* uid = reinterpret_cast<USB_INTERFACE_DESCRIPTOR*>(varBuffer);
|
||||
USB_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR*>(varBuffer);
|
||||
USB_INTERFACE_DESCRIPTOR* uid = reinterpret_cast<USB_INTERFACE_DESCRIPTOR*>(varBuffer);
|
||||
|
||||
|
||||
#pragma GCC diagnostic push // Available since GCC 4.6.4
|
||||
/*
|
||||
* FIXME -- Enabled and review all `-Wimplicit-fallthrough` messages
|
||||
* This code has multiple switch statements that "fall through" to the
|
||||
* next case -- but it's not always clear if this is intentional or not.
|
||||
* Review and commenting of code, and reducing cyclomatic complexity
|
||||
* are highly recommended....
|
||||
*/
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
switch(stateParseDescr) {
|
||||
case 0:
|
||||
theBuffer.valueSize = 2;
|
||||
|
|
@ -112,7 +123,7 @@ bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor
|
|||
dscrType = *((uint8_t*)theBuffer.pValue + 1);
|
||||
stateParseDescr = 2;
|
||||
case 2:
|
||||
// This is a sort of hack. Assuming that two bytes are all ready in the buffer
|
||||
// This is a sort of hack. Assuming that two bytes are all ready in the buffer
|
||||
// the pointer is positioned two bytes ahead in order for the rest of descriptor
|
||||
// to be read right after the size and the type fields.
|
||||
// This should be used carefully. varBuffer should be used directly to handle data
|
||||
|
|
@ -120,14 +131,14 @@ bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor
|
|||
theBuffer.pValue = varBuffer + 2;
|
||||
stateParseDescr = 3;
|
||||
case 3:
|
||||
switch(dscrType) {
|
||||
case USB_DESCRIPTOR_INTERFACE:
|
||||
isGoodInterface = false;
|
||||
case USB_DESCRIPTOR_CONFIGURATION:
|
||||
theBuffer.valueSize = sizeof (USB_CONFIGURATION_DESCRIPTOR) - 2;
|
||||
break;
|
||||
case USB_DESCRIPTOR_ENDPOINT:
|
||||
theBuffer.valueSize = sizeof (USB_ENDPOINT_DESCRIPTOR) - 2;
|
||||
switch(dscrType) {
|
||||
case USB_DESCRIPTOR_INTERFACE:
|
||||
isGoodInterface = false;
|
||||
case USB_DESCRIPTOR_CONFIGURATION:
|
||||
theBuffer.valueSize = sizeof (USB_CONFIGURATION_DESCRIPTOR) - 2;
|
||||
break;
|
||||
case USB_DESCRIPTOR_ENDPOINT:
|
||||
theBuffer.valueSize = sizeof (USB_ENDPOINT_DESCRIPTOR) - 2;
|
||||
break;
|
||||
case HID_DESCRIPTOR_HID:
|
||||
theBuffer.valueSize = dscrLen - 2;
|
||||
|
|
@ -136,37 +147,37 @@ bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor
|
|||
valParser.Initialize(&theBuffer);
|
||||
stateParseDescr = 4;
|
||||
case 4:
|
||||
switch(dscrType) {
|
||||
switch(dscrType) {
|
||||
case USB_DESCRIPTOR_CONFIGURATION:
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
confValue = ucd->bConfigurationValue;
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
confValue = ucd->bConfigurationValue;
|
||||
break;
|
||||
case USB_DESCRIPTOR_INTERFACE:
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
if((MASK & CP_MASK_COMPARE_CLASS) && uid->bInterfaceClass != CLASS_ID)
|
||||
break;
|
||||
if((MASK & CP_MASK_COMPARE_SUBCLASS) && uid->bInterfaceSubClass != SUBCLASS_ID)
|
||||
break;
|
||||
if(UseOr) {
|
||||
if((!((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol)))
|
||||
break;
|
||||
} else {
|
||||
if((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol != PROTOCOL_ID)
|
||||
break;
|
||||
}
|
||||
isGoodInterface = true;
|
||||
ifaceNumber = uid->bInterfaceNumber;
|
||||
ifaceAltSet = uid->bAlternateSetting;
|
||||
protoValue = uid->bInterfaceProtocol;
|
||||
break;
|
||||
case USB_DESCRIPTOR_ENDPOINT:
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
if(isGoodInterface)
|
||||
if(theXtractor)
|
||||
theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_ENDPOINT_DESCRIPTOR*)varBuffer);
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
if((MASK & CP_MASK_COMPARE_CLASS) && uid->bInterfaceClass != CLASS_ID)
|
||||
break;
|
||||
if((MASK & CP_MASK_COMPARE_SUBCLASS) && uid->bInterfaceSubClass != SUBCLASS_ID)
|
||||
break;
|
||||
if(UseOr) {
|
||||
if((!((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol)))
|
||||
break;
|
||||
} else {
|
||||
if((MASK & CP_MASK_COMPARE_PROTOCOL) && uid->bInterfaceProtocol != PROTOCOL_ID)
|
||||
break;
|
||||
}
|
||||
isGoodInterface = true;
|
||||
ifaceNumber = uid->bInterfaceNumber;
|
||||
ifaceAltSet = uid->bAlternateSetting;
|
||||
protoValue = uid->bInterfaceProtocol;
|
||||
break;
|
||||
case USB_DESCRIPTOR_ENDPOINT:
|
||||
if(!valParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
if(isGoodInterface)
|
||||
if(theXtractor)
|
||||
theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_ENDPOINT_DESCRIPTOR*)varBuffer);
|
||||
break;
|
||||
//case HID_DESCRIPTOR_HID:
|
||||
// if (!valParser.Parse(pp, pcntdn))
|
||||
|
|
@ -180,44 +191,47 @@ bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor
|
|||
theBuffer.pValue = varBuffer;
|
||||
stateParseDescr = 0;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PROTOCOL_ID, const uint8_t MASK>
|
||||
void ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::PrintHidDescriptor(const USB_HID_DESCRIPTOR *pDesc) {
|
||||
Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80);
|
||||
Notify(PSTR("bDescLength:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bLength, 0x80);
|
||||
Notify(PSTR("\r\n\r\nHID Descriptor:\r\n"), 0x80);
|
||||
Notify(PSTR("bDescLength:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bLength, 0x80);
|
||||
|
||||
Notify(PSTR("\r\nbDescriptorType:\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bDescriptorType, 0x80);
|
||||
Notify(PSTR("\r\nbDescriptorType:\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bDescriptorType, 0x80);
|
||||
|
||||
Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80);
|
||||
PrintHex<uint16_t > (pDesc->bcdHID, 0x80);
|
||||
Notify(PSTR("\r\nbcdHID:\t\t\t"), 0x80);
|
||||
PrintHex<uint16_t > (pDesc->bcdHID, 0x80);
|
||||
|
||||
Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bCountryCode, 0x80);
|
||||
Notify(PSTR("\r\nbCountryCode:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bCountryCode, 0x80);
|
||||
|
||||
Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bNumDescriptors, 0x80);
|
||||
Notify(PSTR("\r\nbNumDescriptors:\t"), 0x80);
|
||||
PrintHex<uint8_t > (pDesc->bNumDescriptors, 0x80);
|
||||
|
||||
//Notify(PSTR("\r\nbDescrType:\t\t"));
|
||||
//PrintHex<uint8_t>(pDesc->bDescrType);
|
||||
//
|
||||
//Notify(PSTR("\r\nwDescriptorLength:\t"));
|
||||
//PrintHex<uint16_t>(pDesc->wDescriptorLength);
|
||||
//Notify(PSTR("\r\nbDescrType:\t\t"));
|
||||
//PrintHex<uint8_t>(pDesc->bDescrType);
|
||||
//
|
||||
//Notify(PSTR("\r\nwDescriptorLength:\t"));
|
||||
//PrintHex<uint16_t>(pDesc->wDescriptorLength);
|
||||
|
||||
for (uint32_t i = 0; i < pDesc->bNumDescriptors; i++) {
|
||||
HID_CLASS_DESCRIPTOR_LEN_AND_TYPE *pLT = (HID_CLASS_DESCRIPTOR_LEN_AND_TYPE*)&(pDesc->bDescrType);
|
||||
|
||||
Notify(PSTR("\r\nbDescrType:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pLT[i].bDescrType, 0x80);
|
||||
Notify(PSTR("\r\nbDescrType:\t\t"), 0x80);
|
||||
PrintHex<uint8_t > (pLT[i].bDescrType, 0x80);
|
||||
|
||||
Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80);
|
||||
PrintHex<uint16_t > (pLT[i].wDescriptorLength, 0x80);
|
||||
}
|
||||
Notify(PSTR("\r\n"), 0x80);
|
||||
Notify(PSTR("\r\nwDescriptorLength:\t"), 0x80);
|
||||
PrintHex<uint16_t > (pLT[i].wDescriptorLength, 0x80);
|
||||
}
|
||||
Notify(PSTR("\r\n"), 0x80);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // __CONFDESCPARSER_H__
|
||||
|
|
|
|||
|
|
@ -994,7 +994,6 @@ void ReportDescParserBase::Parse(const uint32_t len, const uint8_t *pbuf, const
|
|||
uint32_t cntdn = (uint32_t)len;
|
||||
uint8_t *p = (uint8_t*)pbuf;
|
||||
|
||||
|
||||
totalSize = 0;
|
||||
|
||||
while(cntdn) {
|
||||
|
|
@ -1091,6 +1090,17 @@ void ReportDescParserBase::PrintItemTitle(uint8_t prefix) {
|
|||
uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint32_t *pcntdn) {
|
||||
//uint8_t ret = enErrorSuccess;
|
||||
//reinterpret_cast<>(varBuffer);
|
||||
|
||||
|
||||
#pragma GCC diagnostic push // Available since GCC 4.6.4
|
||||
/*
|
||||
* FIXME -- Enabled and review all `-Wimplicit-fallthrough` messages
|
||||
* This code has multiple switch statements that "fall through" to the
|
||||
* next case -- but it's not always clear if this is intentional or not.
|
||||
* Review and commenting of code, and reducing cyclomatic complexity
|
||||
* are highly recommended....
|
||||
*/
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
switch(itemParseState) {
|
||||
case 0:
|
||||
if(**pp == HID_LONG_ITEM_PREFIX)
|
||||
|
|
@ -1207,6 +1217,7 @@ uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint32_t *pcntdn) {
|
|||
} // switch (**pp & (TYPE_MASK | TAG_MASK))
|
||||
}
|
||||
} // switch (itemParseState)
|
||||
#pragma GCC diagnostic pop
|
||||
itemParseState = 0;
|
||||
return enErrorSuccess;
|
||||
}
|
||||
|
|
@ -1236,18 +1247,18 @@ void ReportDescParserBase::SetUsagePage(uint16_t page) {
|
|||
if(VALUE_BETWEEN(page, 0x00, 0x11))
|
||||
pfUsage = (usagePageFunctions[page - 1]);
|
||||
|
||||
// Dead code...
|
||||
//
|
||||
// pfUsage = (UsagePageFunc)pgm_read_pointer(usagePageFunctions[page - 1]);
|
||||
//else if (page > 0x7f && page < 0x84)
|
||||
// E_Notify(pstrUsagePageMonitor);
|
||||
//else if (page > 0x83 && page < 0x8c)
|
||||
// E_Notify(pstrUsagePagePower);
|
||||
//else if (page > 0x8b && page < 0x92)
|
||||
// E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]));
|
||||
//else if (page > 0xfeff && page <= 0xffff)
|
||||
// E_Notify(pstrUsagePageVendorDefined);
|
||||
//
|
||||
// Dead code...
|
||||
//
|
||||
// pfUsage = (UsagePageFunc)pgm_read_pointer(usagePageFunctions[page - 1]);
|
||||
//else if (page > 0x7f && page < 0x84)
|
||||
// E_Notify(pstrUsagePageMonitor);
|
||||
//else if (page > 0x83 && page < 0x8c)
|
||||
// E_Notify(pstrUsagePagePower);
|
||||
//else if (page > 0x8b && page < 0x92)
|
||||
// E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]));
|
||||
//else if (page > 0xfeff && page <= 0xffff)
|
||||
// E_Notify(pstrUsagePageVendorDefined);
|
||||
//
|
||||
else
|
||||
switch(page) {
|
||||
case 0x14:
|
||||
|
|
@ -1440,6 +1451,15 @@ void ReportDescParserBase::PrintMedicalInstrumentPageUsage(uint16_t usage) {
|
|||
uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint32_t *pcntdn) {
|
||||
//uint8_t ret = enErrorSuccess;
|
||||
|
||||
#pragma GCC diagnostic push // Available since GCC 4.6.4
|
||||
/*
|
||||
* FIXME -- Enabled and review all `-Wimplicit-fallthrough` messages
|
||||
* This code has multiple switch statements that "fall through" to the
|
||||
* next case -- but it's not always clear if this is intentional or not.
|
||||
* Review and commenting of code, and reducing cyclomatic complexity
|
||||
* are highly recommended....
|
||||
*/
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
switch(itemParseState) {
|
||||
case 0:
|
||||
if(**pp == HID_LONG_ITEM_PREFIX)
|
||||
|
|
@ -1519,6 +1539,8 @@ uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint32_t *pcntdn) {
|
|||
} // switch (**pp & (TYPE_MASK | TAG_MASK))
|
||||
}
|
||||
} // switch (itemParseState)
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
itemParseState = 0;
|
||||
return enErrorSuccess;
|
||||
}
|
||||
|
|
@ -1558,8 +1580,7 @@ void ReportDescParser2::OnInputItem(uint8_t itm) {
|
|||
// bits_to_copy - number of bits to copy to result buffer
|
||||
|
||||
// for each bit in a field
|
||||
for(uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left;
|
||||
bits_left -= bits_to_copy) {
|
||||
for(uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left; bits_left -= bits_to_copy) {
|
||||
bits_to_copy = (bits_left > bits_of_byte) ? bits_of_byte : bits_left;
|
||||
|
||||
result.dwResult <<= bits_to_copy; // Result buffer is shifted by the number of bits to be copied into it
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ e-mail : support@circuitsathome.com
|
|||
#include "Usb.h"
|
||||
|
||||
bool MultiByteValueParser::Parse(uint8_t **pp, uint32_t *pcntdn) {
|
||||
if(!pBuf) {
|
||||
Notify(PSTR("Buffer pointer is NULL!\r\n"), 0x80);
|
||||
if(!pBuf) {
|
||||
Notify(PSTR("Buffer pointer is NULL!\r\n"), 0x80);
|
||||
return false;
|
||||
}
|
||||
for (; countDown && (*pcntdn); countDown--, (*pcntdn)--, (*pp)++)
|
||||
pBuf[valueSize - countDown] = (**pp);
|
||||
|
||||
if(countDown)
|
||||
if(countDown)
|
||||
return false;
|
||||
|
||||
countDown = valueSize;
|
||||
|
|
@ -32,36 +32,48 @@ bool MultiByteValueParser::Parse(uint8_t **pp, uint32_t *pcntdn) {
|
|||
}
|
||||
|
||||
bool PTPListParser::Parse(uint8_t **pp, uint32_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me) {
|
||||
switch(nStage) {
|
||||
case 0:
|
||||
pBuf->valueSize = lenSize;
|
||||
theParser.Initialize(pBuf);
|
||||
nStage = 1;
|
||||
|
||||
case 1:
|
||||
if(!theParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
#pragma GCC diagnostic push // Available since GCC 4.6.4
|
||||
/*
|
||||
* FIXME -- Enabled and review all `-Wimplicit-fallthrough` messages
|
||||
* This code has multiple switch statements that "fall through" to the
|
||||
* next case -- but it's not always clear if this is intentional or not.
|
||||
* Review and commenting of code, and reducing cyclomatic complexity
|
||||
* are highly recommended....
|
||||
*/
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
|
||||
arLen = 0;
|
||||
arLen = (pBuf->valueSize >= 4) ? *((uint32_t*)pBuf->pValue) : (uint32_t)(*((uint16_t*)pBuf->pValue));
|
||||
arLenCntdn = arLen;
|
||||
nStage = 2;
|
||||
switch(nStage) {
|
||||
case 0:
|
||||
pBuf->valueSize = lenSize;
|
||||
theParser.Initialize(pBuf);
|
||||
nStage = 1;
|
||||
|
||||
case 2:
|
||||
pBuf->valueSize = valSize;
|
||||
theParser.Initialize(pBuf);
|
||||
nStage = 3;
|
||||
|
||||
case 3:
|
||||
for(; arLenCntdn; arLenCntdn--) {
|
||||
case 1:
|
||||
if(!theParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
|
||||
arLen = 0;
|
||||
arLen = (pBuf->valueSize >= 4) ? *((uint32_t*)pBuf->pValue) : (uint32_t)(*((uint16_t*)pBuf->pValue));
|
||||
arLenCntdn = arLen;
|
||||
nStage = 2;
|
||||
|
||||
case 2:
|
||||
pBuf->valueSize = valSize;
|
||||
theParser.Initialize(pBuf);
|
||||
nStage = 3;
|
||||
|
||||
case 3:
|
||||
for(; arLenCntdn; arLenCntdn--) {
|
||||
if(!theParser.Parse(pp, pcntdn))
|
||||
return false;
|
||||
|
||||
if(pf)
|
||||
pf(pBuf, (arLen - arLenCntdn), me);
|
||||
}
|
||||
|
||||
nStage = 0;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ class MultiByteValueParser {
|
|||
|
||||
public:
|
||||
|
||||
MultiByteValueParser() : pBuf(NULL), countDown(0), valueSize(0) {
|
||||
};
|
||||
MultiByteValueParser() : pBuf(NULL), countDown(0), valueSize(0) {
|
||||
};
|
||||
|
||||
const uint8_t* GetBuffer() {
|
||||
return pBuf;
|
||||
};
|
||||
const uint8_t* GetBuffer() {
|
||||
return pBuf;
|
||||
};
|
||||
|
||||
void Initialize(MultiValueBuffer * const pbuf) {
|
||||
pBuf = (uint8_t*)pbuf->pValue;
|
||||
|
|
@ -58,7 +58,7 @@ class ByteSkipper {
|
|||
public:
|
||||
|
||||
ByteSkipper() : pBuf(NULL), nStage(0), countDown(0) {
|
||||
};
|
||||
};
|
||||
|
||||
void Initialize(MultiValueBuffer *pbuf) {
|
||||
pBuf = (uint8_t*)pbuf->pValue;
|
||||
|
|
@ -66,16 +66,25 @@ public:
|
|||
};
|
||||
|
||||
bool Skip(uint8_t **pp, uint32_t *pcntdn, uint32_t bytes_to_skip) {
|
||||
switch(nStage) {
|
||||
case 0:
|
||||
countDown = bytes_to_skip;
|
||||
nStage++;
|
||||
case 1:
|
||||
for(; countDown && (*pcntdn); countDown--, (*pp)++, (*pcntdn)--);
|
||||
|
||||
if(!countDown)
|
||||
nStage = 0;
|
||||
#pragma GCC diagnostic push // Available since GCC 4.6.4
|
||||
/*
|
||||
* FIXME -- Enabled and review all `-Wimplicit-fallthrough` messages
|
||||
* This code has multiple switch statements that "fall through" to the
|
||||
* next case -- but it's not always clear if this is intentional or not.
|
||||
* Review and commenting of code, and reducing cyclomatic complexity
|
||||
* are highly recommended....
|
||||
*/
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
switch(nStage) {
|
||||
case 0:
|
||||
countDown = bytes_to_skip;
|
||||
nStage++;
|
||||
case 1:
|
||||
for(; countDown && (*pcntdn); countDown--, (*pp)++, (*pcntdn)--);
|
||||
if(!countDown)
|
||||
nStage = 0;
|
||||
};
|
||||
#pragma GCC diagnostic pop
|
||||
return (!countDown);
|
||||
};
|
||||
};
|
||||
|
|
@ -86,9 +95,9 @@ typedef void (*PTP_ARRAY_EL_FUNC)(const MultiValueBuffer * const p, uint32_t cou
|
|||
class PTPListParser {
|
||||
public:
|
||||
|
||||
enum ParseMode {
|
||||
modeArray, modeRange/*, modeEnum*/
|
||||
};
|
||||
enum ParseMode {
|
||||
modeArray, modeRange/*, modeEnum*/
|
||||
};
|
||||
|
||||
private:
|
||||
uint32_t nStage;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ void loop()
|
|||
// this function is registered as an event, see setup()
|
||||
void receiveEvent(int howMany)
|
||||
{
|
||||
(void)howMany; // avoid compiler warning about unused parameter
|
||||
|
||||
while(1 < Wire.available()) // loop through all but the last
|
||||
{
|
||||
char c = Wire.read(); // receive byte as a character
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
|
||||
|
||||
name=Adafruit SAMD (32-bits ARM Cortex-M0+ and Cortex-M4) Boards
|
||||
version=1.5.7
|
||||
version=1.6.1
|
||||
|
||||
# Compile variables
|
||||
# -----------------
|
||||
|
|
@ -31,7 +31,7 @@ compiler.warning_flags.default=
|
|||
compiler.warning_flags.more=-Wall -Wno-expansion-to-defined
|
||||
compiler.warning_flags.all=-Wall -Wextra -Wno-expansion-to-defined
|
||||
|
||||
compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/
|
||||
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
|
||||
compiler.c.cmd=arm-none-eabi-gcc
|
||||
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -D__SKETCH_NAME__="""{build.project_name}"""
|
||||
compiler.c.elf.cmd=arm-none-eabi-g++
|
||||
|
|
@ -70,8 +70,8 @@ compiler.S.extra_flags=
|
|||
compiler.ar.extra_flags=
|
||||
compiler.elf2hex.extra_flags=
|
||||
|
||||
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/"
|
||||
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math
|
||||
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.4.0.path}/CMSIS/DSP/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/"
|
||||
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.4.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math
|
||||
|
||||
compiler.libraries.ldflags=
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,10 @@
|
|||
#define portInputRegister(port) (&(port->IN.reg))
|
||||
#define portModeRegister(port) (&(port->DIR.reg))
|
||||
#define digitalPinHasPWM(P) (g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER)
|
||||
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)
|
||||
|
||||
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE < 10606)
|
||||
#define digitalPinToInterrupt(P) (g_APinDescription[P].ulExtInt)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* digitalPinToTimer(..) is AVR-specific and is not defined for SAMD
|
||||
|
|
@ -108,6 +111,12 @@ static const uint8_t DAC0 = PIN_DAC0;
|
|||
|
||||
#define ADC_RESOLUTION 12
|
||||
|
||||
|
||||
// On-board SPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_SPI SPI
|
||||
#define EXTERNAL_FLASH_USE_CS SS
|
||||
|
||||
/*
|
||||
* SPI Interfaces
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 7, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // Captouch 4
|
||||
|
||||
// A13 - VIN sense pin
|
||||
{ PORTB, 3, PIO_ANALOG, 0, ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // VIN sense divider
|
||||
{ PORTB, 3, PIO_ANALOG, 0, ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // VIN sense divider
|
||||
|
||||
/**************/
|
||||
// 28..31 - 4 Motor PWM pins
|
||||
|
|
@ -88,7 +88,7 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP
|
||||
|
||||
// 35..36 - fake sercom 5 serial
|
||||
{ PORTB, 2, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // Sercom 5.0 UART TX
|
||||
{ PORTB, 2, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // Sercom 5.0 UART TX
|
||||
{ PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // Sercom 5.3 UART RX
|
||||
|
||||
} ;
|
||||
|
|
|
|||
|
|
@ -125,6 +125,12 @@ static const uint8_t DAC0 = PIN_DAC0;
|
|||
#define PIN_ATN (38ul)
|
||||
static const uint8_t ATN = PIN_ATN;
|
||||
|
||||
|
||||
// On-board SPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_SPI SPI1
|
||||
#define EXTERNAL_FLASH_USE_CS SS1
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -62,8 +62,8 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
|
||||
{ PORTB, 8, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel2, TC4_CH0, TC4_CH0, EXTERNAL_INT_8 },
|
||||
{ PORTB, 9, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel3, TC4_CH1, TC4_CH1, EXTERNAL_INT_9 },
|
||||
{ PORTA, 4, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel4, TC0_CH0, TC0_CH0, EXTERNAL_INT_6 },
|
||||
{ PORTA, 6, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel6, TC1_CH0, TC1_CH0, EXTERNAL_INT_10 },
|
||||
{ PORTA, 4, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel4, TC0_CH0, TC0_CH0, EXTERNAL_INT_4 },
|
||||
{ PORTA, 6, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel6, TC1_CH0, TC1_CH0, EXTERNAL_INT_6 },
|
||||
|
||||
// A6, D20 - VDiv!
|
||||
{ PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 },
|
||||
|
|
|
|||
|
|
@ -186,6 +186,10 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
#define PIN_I2S_FS (10u)
|
||||
#define PIN_I2S_MCK PIN_SERIAL1_RX
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (34u)
|
||||
#define PIN_QSPI_CS (35u)
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ const PinDescription g_APinDescription[]=
|
|||
|
||||
// GPIO 3 & 4 - DotStar internal data/clock
|
||||
// ----------------------------------------
|
||||
{ PORTA, 0, PIO_DIGITAL, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4]
|
||||
{ PORTA, 1, PIO_DIGITAL, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5]
|
||||
{ PORTA, 0, PIO_DIGITAL, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 }, // ADC/AIN[4]
|
||||
{ PORTA, 1, PIO_DIGITAL, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // ADC/AIN[5]
|
||||
|
||||
// GPIO 5, 6, 7 (USB interface)
|
||||
// ----------------------------
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -181,6 +181,8 @@ const PinDescription g_APinDescription[]=
|
|||
// ----------------------
|
||||
// 95 SD detect
|
||||
{ PORTB, 31, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_15 },
|
||||
// 96 SWO (on debug header)
|
||||
{ PORTB, 30, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 },
|
||||
} ;
|
||||
|
||||
const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TCC3, TCC4, TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7 } ;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ extern "C"
|
|||
*----------------------------------------------------------------------------*/
|
||||
|
||||
// Number of pins defined in PinDescription array
|
||||
#define PINS_COUNT (94)
|
||||
#define PINS_COUNT (96)
|
||||
#define NUM_DIGITAL_PINS (53)
|
||||
#define NUM_ANALOG_INPUTS (19)
|
||||
#define NUM_ANALOG_OUTPUTS (2)
|
||||
|
|
@ -258,6 +258,10 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
|
|||
#define PIN_I2S_FS (33)
|
||||
#define PIN_I2S_MCK PIN_SERIAL4_RX
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (89)
|
||||
#define PIN_QSPI_CS (90)
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ static const uint8_t DAC0 = PIN_DAC0;
|
|||
#define PIN_ATN (38ul)
|
||||
static const uint8_t ATN = PIN_ATN;
|
||||
|
||||
// On-board SPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_SPI SPI1
|
||||
#define EXTERNAL_FLASH_USE_CS SS1
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -54,14 +54,14 @@ const PinDescription g_APinDescription[]=
|
|||
// --------------------
|
||||
{ PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0 (DAC0)
|
||||
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // A1 (DAC1)
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // A2
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // A2
|
||||
{ PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 }, // A3
|
||||
{ PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // A4
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // A5
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A5
|
||||
|
||||
{ PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // A6, D20 - vbatt
|
||||
{ PORTB, 4, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A7, D21 - Light
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A8 / D2
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // A8 / D2
|
||||
{ PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel14, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A9 / D3
|
||||
|
||||
// 24..25 I2C pins (SDA/SCL)
|
||||
|
|
|
|||
|
|
@ -187,6 +187,9 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
*/
|
||||
#define I2S_INTERFACES_COUNT 0
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (35u)
|
||||
|
|
|
|||
|
|
@ -118,6 +118,11 @@ static const uint8_t DAC0 = PIN_DAC0;
|
|||
#define PIN_ATN (38ul)
|
||||
static const uint8_t ATN = PIN_ATN;
|
||||
|
||||
// On-board SPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_SPI SPI1
|
||||
#define EXTERNAL_FLASH_USE_CS SS1
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -174,6 +174,10 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
#define I2S_DEVICE 0
|
||||
// no I2S on G19!
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (32u)
|
||||
#define PIN_QSPI_CS (33u)
|
||||
|
|
|
|||
|
|
@ -125,6 +125,11 @@ static const uint8_t DAC0 = PIN_DAC0;
|
|||
#define PIN_ATN (38ul)
|
||||
static const uint8_t ATN = PIN_ATN;
|
||||
|
||||
// On-board SPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_SPI SPI1
|
||||
#define EXTERNAL_FLASH_USE_CS SS1
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
*/
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -188,6 +188,10 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
#define PIN_I2S_FS (9u)
|
||||
#define PIN_I2S_MCK (2u)
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (41u)
|
||||
#define PIN_QSPI_CS (42u)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -131,7 +131,8 @@ static const uint8_t ATN = PIN_ATN;
|
|||
#define NINA_GPIO0 ESP32_GPIO0
|
||||
#define NINA_RESETN ESP32_RESETN
|
||||
#define NINA_ACK SPIWIFI_ACK
|
||||
|
||||
#define NINA_CTS SPIWIFI_ACK
|
||||
#define NINA_RTS NINA_GPIO0
|
||||
|
||||
/*
|
||||
* Serial interfaces
|
||||
|
|
@ -205,6 +206,10 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
#define PIN_I2S_FS (9u)
|
||||
#define PIN_I2S_MCK (2u)
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (41u)
|
||||
#define PIN_QSPI_CS (42u)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -196,6 +196,10 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
#define I2S_DEVICE 0
|
||||
// no I2S on G19!
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q64C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (29u)
|
||||
#define PIN_QSPI_CS (30u)
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ const PinDescription g_APinDescription[]=
|
|||
{
|
||||
// GPIO 0 & 1 - DotStar internal data/clock
|
||||
// ----------------------------------------
|
||||
{ PORTA, 0, PIO_DIGITAL, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4]
|
||||
{ PORTA, 1, PIO_DIGITAL, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5]
|
||||
{ PORTA, 0, PIO_DIGITAL, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 }, // ADC/AIN[4]
|
||||
{ PORTA, 1, PIO_DIGITAL, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // ADC/AIN[5]
|
||||
|
||||
// GPIO 2 - Infrared In
|
||||
{ PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable - GPIO #2
|
||||
{ PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // USB Host enable - GPIO #2
|
||||
|
||||
// GPIO 3 & 4 (SWCLK & SWDIO)
|
||||
// --------------------------
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -204,6 +204,9 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
*/
|
||||
#define I2S_INTERFACES_COUNT 0
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (35u)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -54,12 +54,12 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
|
||||
{ PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 },
|
||||
{ PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
|
||||
{ PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // A6, D20 - vbatt
|
||||
{ PORTB, 4, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A7, D21 - Light
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A8 / D2
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // A8 / D2
|
||||
{ PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel14, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A9 / D3
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,9 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
*/
|
||||
#define I2S_INTERFACES_COUNT 0
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (35u)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -54,12 +54,12 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
|
||||
{ PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 },
|
||||
{ PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
|
||||
{ PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // A6, D20 - vbatt
|
||||
{ PORTB, 4, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A7, D21 - Light
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A8 / D2
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // A8 / D2
|
||||
{ PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel14, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A9 / D3
|
||||
{ PORTB, 6, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel8, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // A10 / JOYY
|
||||
{ PORTB, 7, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel9, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // A11 / JOYX
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@ static const uint8_t SCL = PIN_WIRE_SCL;
|
|||
*/
|
||||
#define I2S_INTERFACES_COUNT 0
|
||||
|
||||
// On-board QSPI Flash
|
||||
#define EXTERNAL_FLASH_DEVICES GD25Q16C
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
//QSPI Pins
|
||||
#define PIN_QSPI_SCK (35u)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -54,12 +54,12 @@ const PinDescription g_APinDescription[]=
|
|||
{ PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 },
|
||||
{ PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 },
|
||||
{ PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 },
|
||||
{ PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 },
|
||||
{ PORTA, 6, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 },
|
||||
|
||||
{ PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // A6, D20 - vbatt
|
||||
{ PORTB, 4, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A7, D21 - Light
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A8 / D2
|
||||
{ PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // A8 / D2
|
||||
{ PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel14, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A9 / D3
|
||||
{ PORTB, 6, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel8, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // A10 / JOYY
|
||||
{ PORTB, 7, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel9, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // A11 / JOYX
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue