From 8505de1ced9e567867f2530cee241b28f3456b60 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 11 Apr 2017 17:59:02 -0700 Subject: atmel-samd: rename cplay_m0_flash to circuitplayground_express and update for new rev (F). --- .travis.yml | 2 +- .../boards/circuitplayground_express/conf_access.h | 115 ++++ .../boards/circuitplayground_express/conf_board.h | 14 + .../boards/circuitplayground_express/conf_clocks.h | 1 + .../boards/circuitplayground_express/conf_usb.h | 217 ++++++++ atmel-samd/boards/circuitplayground_express/init.c | 18 + .../circuitplayground_express/mpconfigboard.h | 40 ++ .../circuitplayground_express/mpconfigboard.mk | 7 + atmel-samd/boards/circuitplayground_express/pins.c | 93 ++++ .../boards/circuitplayground_express/touch.h | 613 +++++++++++++++++++++ atmel-samd/boards/cplay_m0_flash/conf_access.h | 115 ---- atmel-samd/boards/cplay_m0_flash/conf_board.h | 14 - atmel-samd/boards/cplay_m0_flash/conf_clocks.h | 1 - atmel-samd/boards/cplay_m0_flash/conf_usb.h | 217 -------- atmel-samd/boards/cplay_m0_flash/init.c | 18 - atmel-samd/boards/cplay_m0_flash/mpconfigboard.h | 40 -- atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk | 7 - atmel-samd/boards/cplay_m0_flash/pins.c | 52 -- atmel-samd/boards/cplay_m0_flash/touch.h | 613 --------------------- tools/build_adafruit_bins.sh | 2 +- 20 files changed, 1120 insertions(+), 1079 deletions(-) create mode 100644 atmel-samd/boards/circuitplayground_express/conf_access.h create mode 100644 atmel-samd/boards/circuitplayground_express/conf_board.h create mode 100644 atmel-samd/boards/circuitplayground_express/conf_clocks.h create mode 100644 atmel-samd/boards/circuitplayground_express/conf_usb.h create mode 100644 atmel-samd/boards/circuitplayground_express/init.c create mode 100644 atmel-samd/boards/circuitplayground_express/mpconfigboard.h create mode 100644 atmel-samd/boards/circuitplayground_express/mpconfigboard.mk create mode 100644 atmel-samd/boards/circuitplayground_express/pins.c create mode 100644 atmel-samd/boards/circuitplayground_express/touch.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/conf_access.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/conf_board.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/conf_clocks.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/conf_usb.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/init.c delete mode 100644 atmel-samd/boards/cplay_m0_flash/mpconfigboard.h delete mode 100644 atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk delete mode 100644 atmel-samd/boards/cplay_m0_flash/pins.c delete mode 100644 atmel-samd/boards/cplay_m0_flash/touch.h diff --git a/.travis.yml b/.travis.yml index 4c8a2f529..5f85b66e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ script: - make -C atmel-samd BOARD=feather_m0_basic - make -C atmel-samd BOARD=feather_m0_express - make -C atmel-samd BOARD=metro_m0_flash - - make -C atmel-samd BOARD=cplay_m0_flash + - make -C atmel-samd BOARD=circuitplayground_express - make -C atmel-samd BOARD=trinket_m0 - make -C atmel-samd BOARD=gemma_m0 - make -C minimal CROSS=1 build/firmware.bin diff --git a/atmel-samd/boards/circuitplayground_express/conf_access.h b/atmel-samd/boards/circuitplayground_express/conf_access.h new file mode 100644 index 000000000..25109b75c --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/conf_access.h @@ -0,0 +1,115 @@ +/** + * \file + * + * \brief Memory access control configuration file. + * + * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _CONF_ACCESS_H_ +#define _CONF_ACCESS_H_ + +#include "compiler.h" +#include "board.h" + + +/*! \name Activation of Logical Unit Numbers + */ +//! @{ +#define LUN_0 ENABLE //!< On-Chip Virtual Memory. +#define LUN_1 DISABLE //!< AT45DBX Data Flash. +#define LUN_2 DISABLE //!< SD/MMC Card over SPI. +#define LUN_3 DISABLE //!< SD/MMC Card over MCI Slot 0. +#define LUN_4 DISABLE +#define LUN_5 DISABLE +#define LUN_6 DISABLE +#define LUN_7 DISABLE +#define LUN_USB DISABLE //!< Host Mass-Storage Memory. +//! @} + +/*! \name LUN 0 Definitions + */ +//! @{ +#define LUN_0_INCLUDE "access_vfs.h" +#define Lun_0_test_unit_ready vfs_test_unit_ready +#define Lun_0_read_capacity vfs_read_capacity +#define Lun_0_unload NULL +#define Lun_0_wr_protect vfs_wr_protect +#define Lun_0_removal vfs_removal +#define Lun_0_usb_read_10 vfs_usb_read_10 +#define Lun_0_usb_write_10 vfs_usb_write_10 +#define LUN_0_NAME "\"MicroPython VFS[0]\"" +//! @} + +#define MEM_USB LUN_USB + +/*! \name Actions Associated with Memory Accesses + * + * Write here the action to associate with each memory access. + * + * \warning Be careful not to waste time in order not to disturb the functions. + */ +//! @{ +#define memory_start_read_action(nb_sectors) +#define memory_stop_read_action() +#define memory_start_write_action(nb_sectors) +#define memory_stop_write_action() +//! @} + +/*! \name Activation of Interface Features + */ +//! @{ +#define ACCESS_USB true //!< MEM <-> USB interface. +#define ACCESS_MEM_TO_RAM false //!< MEM <-> RAM interface. +#define ACCESS_STREAM false //!< Streaming MEM <-> MEM interface. +#define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode. +#define ACCESS_MEM_TO_MEM false //!< MEM <-> MEM interface. +#define ACCESS_CODEC false //!< Codec interface. +//! @} + +/*! \name Specific Options for Access Control + */ +//! @{ +#define GLOBAL_WR_PROTECT false //!< Management of a global write protection. +//! @} + + +#endif // _CONF_ACCESS_H_ diff --git a/atmel-samd/boards/circuitplayground_express/conf_board.h b/atmel-samd/boards/circuitplayground_express/conf_board.h new file mode 100644 index 000000000..7b88c97fc --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/conf_board.h @@ -0,0 +1,14 @@ +/** + * \file + * + * \brief User board configuration template + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef CONF_BOARD_H +#define CONF_BOARD_H + +#endif // CONF_BOARD_H diff --git a/atmel-samd/boards/circuitplayground_express/conf_clocks.h b/atmel-samd/boards/circuitplayground_express/conf_clocks.h new file mode 100644 index 000000000..9e4f7876b --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/conf_clocks.h @@ -0,0 +1 @@ +#include "conf_clocks_crystalless.h" diff --git a/atmel-samd/boards/circuitplayground_express/conf_usb.h b/atmel-samd/boards/circuitplayground_express/conf_usb.h new file mode 100644 index 000000000..5f9570862 --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/conf_usb.h @@ -0,0 +1,217 @@ + +#include +#include + +#ifndef CONF_USB_H_INCLUDED +#define CONF_USB_H_INCLUDED + +#define USB_DEVICE_MAJOR_VERSION 1 +#define USB_DEVICE_MINOR_VERSION 0 +#define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA) +#define USB_DEVICE_ATTR \ + (USB_CONFIG_ATTR_BUS_POWERED) +// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) +// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) + +//! USB Device string definitions (Optional) +#ifndef USB_DEVICE_MANUFACTURE_NAME +# define USB_DEVICE_MANUFACTURE_NAME "Adafruit Industries" +#endif + +#ifndef USB_DEVICE_PRODUCT_NAME +# define USB_DEVICE_PRODUCT_NAME "CircuitPlayground Express" +#endif +// #define USB_DEVICE_SERIAL_NAME "12...EF" +#define USB_DEVICE_GET_SERIAL_NAME_POINTER serial_number +#define USB_DEVICE_GET_SERIAL_NAME_LENGTH 32 +extern char serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH]; + +//! Control endpoint size +#define USB_DEVICE_EP_CTRL_SIZE 64 + +//! Interfaces for this device (CDC COM + CDC DATA + MSC + HID mouse + HID kbd) +#define USB_DEVICE_NB_INTERFACE 5 + +// (3 | USB_EP_DIR_IN) // CDC Notify endpoint +// (4 | USB_EP_DIR_IN) // CDC TX +// (5 | USB_EP_DIR_OUT) // CDC RX +// (1 | USB_EP_DIR_IN) // MSC IN +// (2 | USB_EP_DIR_OUT) // MSC OUT +// (6 | USB_EP_DIR_IN) // HID mouse report +// (7 | USB_EP_DIR_IN) // HID keyboard report +#define USB_DEVICE_MAX_EP 7 + +#define UDI_CDC_PORT_NB 1 +#define UDI_CDC_ENABLE_EXT(port) mp_cdc_enable(port) +extern bool mp_cdc_enable(uint8_t port); +#define UDI_CDC_DISABLE_EXT(port) mp_cdc_disable(port) +extern void mp_cdc_disable(uint8_t port); +#define UDI_CDC_LOW_RATE + +#define UDI_CDC_DEFAULT_RATE 115200 +#define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 +#define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE +#define UDI_CDC_DEFAULT_DATABITS 8 + +#define UDI_CDC_RX_NOTIFY(port) usb_rx_notify() +void usb_rx_notify(void); +#define UDI_CDC_SET_CODING_EXT(port,cfg) +#define UDI_CDC_SET_DTR_EXT(port,set) usb_dtr_notify(port, set) +void usb_dtr_notify(uint8_t port, bool set); +#define UDI_CDC_SET_RTS_EXT(port,set) usb_rts_notify(port, set) +void usb_rts_notify(uint8_t port, bool set); + +/** + * USB CDC low level configuration + * In standalone these configurations are defined by the CDC module. + * For composite device, these configuration must be defined here + * @{ + */ +//! Endpoint numbers definition + +#define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint +#define UDI_CDC_DATA_EP_IN_0 (4 | USB_EP_DIR_IN) // TX +#define UDI_CDC_DATA_EP_OUT_0 (5 | USB_EP_DIR_OUT) // RX + +//! Interface numbers +#define UDI_CDC_COMM_IFACE_NUMBER_0 0 +#define UDI_CDC_DATA_IFACE_NUMBER_0 1 + +/** + * Configuration of MSC interface + * @{ + */ +//! Vendor name and Product version of MSC interface +#define UDI_MSC_GLOBAL_VENDOR_ID \ + 'A', 'T', 'M', 'E', 'L', ' ', ' ', ' ' +#define UDI_MSC_GLOBAL_PRODUCT_VERSION \ + '1', '.', '0', '0' + +//! Interface callback definition +#define UDI_MSC_ENABLE_EXT() mp_msc_enable() +extern bool mp_msc_enable(void); +#define UDI_MSC_DISABLE_EXT() mp_msc_disable() +extern void mp_msc_disable(void); + +//! Enable id string of interface to add an extra USB string +#define UDI_MSC_STRING_ID 5 + +/** + * USB MSC low level configuration + * In standalone these configurations are defined by the MSC module. + * For composite device, these configuration must be defined here + * @{ + */ +//! Endpoint numbers definition +#define UDI_MSC_EP_IN (1 | USB_EP_DIR_IN) +#define UDI_MSC_EP_OUT (2 | USB_EP_DIR_OUT) + +//! Interface number +#define UDI_MSC_IFACE_NUMBER 2 +/** + * Configuration of HID Mouse interface + * @{ + */ +//! Interface callback definition +#define UDI_HID_MOUSE_ENABLE_EXT() mp_mouse_enable() +extern bool mp_mouse_enable(void); +#define UDI_HID_MOUSE_DISABLE_EXT() mp_mouse_disable() +extern void mp_mouse_disable(void); + +//! Enable id string of interface to add an extra USB string +#define UDI_HID_MOUSE_STRING_ID 6 + +/** + * USB HID Mouse low level configuration + * In standalone these configurations are defined by the HID Mouse module. + * For composite device, these configuration must be defined here + * @{ + */ +//! Endpoint numbers definition +#define UDI_HID_MOUSE_EP_IN (6 | USB_EP_DIR_IN) + +//! Interface number +#define UDI_HID_MOUSE_IFACE_NUMBER 3 +//@} +//@} + +/** + * Configuration of HID Keyboard interface + * @{ + */ +//! Interface callback definition +#define UDI_HID_KBD_ENABLE_EXT() mp_keyboard_enable() +extern bool mp_keyboard_enable(void); +#define UDI_HID_KBD_DISABLE_EXT() mp_keyboard_disable() +extern void mp_keyboard_disable(void); +#define UDI_HID_KBD_CHANGE_LED(value) mp_keyboard_led(value) +extern void mp_keyboard_led(uint8_t); + +//! Enable id string of interface to add an extra USB string +#define UDI_HID_KBD_STRING_ID 7 + +/** + * USB HID Keyboard low level configuration + * In standalone these configurations are defined by the HID Keyboard module. + * For composite device, these configuration must be defined here + * @{ + */ +//! Endpoint numbers definition +#define UDI_HID_KBD_EP_IN (7 | USB_EP_DIR_IN) + +//! Interface number +#define UDI_HID_KBD_IFACE_NUMBER 4 + +/** + * Description of Composite Device + * @{ + */ +//! USB Interfaces descriptor structure +#define UDI_COMPOSITE_DESC_T \ + usb_iad_desc_t udi_cdc_iad; \ + udi_cdc_comm_desc_t udi_cdc_comm; \ + udi_cdc_data_desc_t udi_cdc_data; \ + udi_msc_desc_t udi_msc; \ + udi_hid_mouse_desc_t udi_hid_mouse; \ + udi_hid_kbd_desc_t udi_hid_kbd + +//! USB Interfaces descriptor value for Full Speed +#define UDI_COMPOSITE_DESC_FS \ + .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ + .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ + .udi_cdc_data = UDI_CDC_DATA_DESC_0_FS, \ + .udi_msc = UDI_MSC_DESC_FS, \ + .udi_hid_mouse = UDI_HID_MOUSE_DESC, \ + .udi_hid_kbd = UDI_HID_KBD_DESC + +//! USB Interfaces descriptor value for High Speed +#define UDI_COMPOSITE_DESC_HS \ + .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ + .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ + .udi_cdc_data = UDI_CDC_DATA_DESC_0_HS, \ + .udi_msc = UDI_MSC_DESC_HS, \ + .udi_hid_mouse = UDI_HID_MOUSE_DESC, \ + .udi_hid_kbd = UDI_HID_KBD_DESC + +//! USB Interface APIs +#define UDI_COMPOSITE_API \ + &udi_api_cdc_comm, \ + &udi_api_cdc_data, \ + &udi_api_msc, \ + &udi_api_hid_mouse, \ + &udi_api_hid_kbd +//@} + +/** + * USB Device Driver Configuration + * @{ + */ +//@} + +//! The includes of classes and other headers must be done at the end of this file to avoid compile error +#include "udi_cdc.h" +#include "udi_msc.h" +#include "udi_hid_mouse.h" +#include "udi_hid_kbd.h" + +#endif diff --git a/atmel-samd/boards/circuitplayground_express/init.c b/atmel-samd/boards/circuitplayground_express/init.c new file mode 100644 index 000000000..ac240b54b --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/init.c @@ -0,0 +1,18 @@ +/** + * \file + * + * \brief User board initialization template + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "board.h" +#include "conf_board.h" +#include "mpconfigboard.h" +#include "asf/sam0/drivers/port/port.h" + +void board_init(void) +{ +} diff --git a/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/atmel-samd/boards/circuitplayground_express/mpconfigboard.h new file mode 100644 index 000000000..375c28ddd --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -0,0 +1,40 @@ +#define USB_REPL + +#define MICROPY_HW_BOARD_NAME "Adafruit CircuitPlayground Express" +#define MICROPY_HW_MCU_NAME "samd21g18" + +//#define MICROPY_HW_LED_MSC PIN_PA17 + +#define SPI_FLASH_BAUDRATE (1000000) + +// On-board flash +#define SPI_FLASH_MUX_SETTING SPI_SIGNAL_MUX_SETTING_E +// Use default pinmux for the chip select since we manage it ourselves. + +// Rev B: +// #define SPI_FLASH_PAD0_PINMUX PINMUX_PA12D_SERCOM4_PAD0 // MISO +// #define SPI_FLASH_PAD1_PINMUX PINMUX_DEFAULT // CS +// #define SPI_FLASH_PAD2_PINMUX PINMUX_PB10D_SERCOM4_PAD2 // MOSI +// #define SPI_FLASH_PAD3_PINMUX PINMUX_PB11D_SERCOM4_PAD3 // SCK + +// Rev C: +#define SPI_FLASH_PAD0_PINMUX PINMUX_PA16D_SERCOM3_PAD0 // MISO +#define SPI_FLASH_PAD1_PINMUX PINMUX_DEFAULT // CS +#define SPI_FLASH_PAD2_PINMUX PINMUX_PA20D_SERCOM3_PAD2 // MOSI +#define SPI_FLASH_PAD3_PINMUX PINMUX_PA21D_SERCOM3_PAD3 // SCK + +#define SPI_FLASH_CS PIN_PB22 +// rev B: #define SPI_FLASH_SERCOM SERCOM4 +#define SPI_FLASH_SERCOM SERCOM3 + +// PA24 and PA25 are USB. +#define MICROPY_PORT_A (PORT_PA16 | PORT_PA20 | PORT_PA21 | PORT_PA24 | PORT_PA25) +#define MICROPY_PORT_B (PORT_PB22) + +#define AUTORESET_DELAY_MS 500 + +#include "spi_flash.h" + +#define BOARD_FLASH_SIZE (0x00040000 - 0x2000) + +#define CALIBRATE_CRYSTALLESS 1 diff --git a/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk new file mode 100644 index 000000000..514c55a20 --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -0,0 +1,7 @@ +LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld +USB_VID = 0x239A +USB_PID = 0x8015 + +FLASH_IMPL = spi_flash.c + +CHIP_VARIANT = SAMD21G18A diff --git a/atmel-samd/boards/circuitplayground_express/pins.c b/atmel-samd/boards/circuitplayground_express/pins.c new file mode 100644 index 000000000..6c1f40e04 --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/pins.c @@ -0,0 +1,93 @@ +#include "samd21_pins.h" + +// STATIC const mp_map_elem_t board_global_dict_table[] = { +// // Rev C +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D10), (mp_obj_t)&pin_PA06 }, +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D9), (mp_obj_t)&pin_PA07 }, +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D6), (mp_obj_t)&pin_PA04 }, +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D12), (mp_obj_t)&pin_PA05 }, +// // +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D0), (mp_obj_t)&pin_PB09 }, +// // //{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), (mp_obj_t)&pin_PA11 }, +// // { MP_OBJ_NEW_QSTR(MP_QSTR_D1), (mp_obj_t)&pin_PB08 }, +// // //{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), (mp_obj_t)&pin_PA10 }, +// +// // Rev D +// { MP_OBJ_NEW_QSTR(MP_QSTR_A11), (mp_obj_t)&pin_PA06 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A10), (mp_obj_t)&pin_PA07 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A9), (mp_obj_t)&pin_PA04 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A8), (mp_obj_t)&pin_PA05 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_A6), (mp_obj_t)&pin_PB09 }, +// //{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), (mp_obj_t)&pin_PA11 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A7), (mp_obj_t)&pin_PB08 }, +// //{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), (mp_obj_t)&pin_PA10 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), (mp_obj_t)&pin_PB23 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_MICROPHONE), (mp_obj_t)&pin_PA08 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), (mp_obj_t)&pin_PA09 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SDA), (mp_obj_t)&pin_PA00 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SCL), (mp_obj_t)&pin_PA01 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_LEFT_BUTTON), (mp_obj_t)&pin_PA28 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_RIGHT_BUTTON), (mp_obj_t)&pin_PA14 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_SLIDE_SWITCH), (mp_obj_t)&pin_PA15 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), (mp_obj_t)&pin_PA02 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), (mp_obj_t)&pin_PA11 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_TEMPERATURE), (mp_obj_t)&pin_PA10 }, +// +// { MP_OBJ_NEW_QSTR(MP_QSTR_D13), (mp_obj_t)&pin_PA17 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), (mp_obj_t)&pin_PB02 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A5), (mp_obj_t)&pin_PB02 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), (mp_obj_t)&pin_PB03 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_A4), (mp_obj_t)&pin_PB03 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), (mp_obj_t)&pin_PB11 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), (mp_obj_t)&pin_PB10 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), (mp_obj_t)&pin_PA12 }, +// { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), (mp_obj_t)&pin_PB22 }, +// }; + +// Rev F +STATIC const mp_map_elem_t board_global_dict_table[] = { + { MP_OBJ_NEW_QSTR(MP_QSTR_A11), (mp_obj_t)&pin_PA06 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A10), (mp_obj_t)&pin_PA07 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A9), (mp_obj_t)&pin_PA04 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A8), (mp_obj_t)&pin_PA05 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_A6), (mp_obj_t)&pin_PB09 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A7), (mp_obj_t)&pin_PB08 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_REMOTEIN), (mp_obj_t)&pin_PA12 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_REMOTEOUT), (mp_obj_t)&pin_PA23 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), (mp_obj_t)&pin_PB23 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_MICROPHONE_SCK), (mp_obj_t)&pin_PA10 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MICROPHONE_DO), (mp_obj_t)&pin_PA08 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), (mp_obj_t)&pin_PA13 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SDA), (mp_obj_t)&pin_PA00 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SCL), (mp_obj_t)&pin_PA01 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_LEFT_BUTTON), (mp_obj_t)&pin_PA28 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RIGHT_BUTTON), (mp_obj_t)&pin_PA14 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SLIDE_SWITCH), (mp_obj_t)&pin_PA15 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), (mp_obj_t)&pin_PA02 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), (mp_obj_t)&pin_PA11 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_TEMPERATURE), (mp_obj_t)&pin_PA09 }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), (mp_obj_t)&pin_PA17 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), (mp_obj_t)&pin_PB02 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A5), (mp_obj_t)&pin_PB02 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), (mp_obj_t)&pin_PB03 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_A4), (mp_obj_t)&pin_PB03 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), (mp_obj_t)&pin_PA21 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), (mp_obj_t)&pin_PA20 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), (mp_obj_t)&pin_PA16 }, + { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), (mp_obj_t)&pin_PB22 }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/atmel-samd/boards/circuitplayground_express/touch.h b/atmel-samd/boards/circuitplayground_express/touch.h new file mode 100644 index 000000000..416ca1f42 --- /dev/null +++ b/atmel-samd/boards/circuitplayground_express/touch.h @@ -0,0 +1,613 @@ +/* This source file is part of the ATMEL QTouch Library 5.0.8 */ + +/***************************************************************************** + * + * \file + * + * \brief This file contains the SAMD QTouch Library pin, register and + * sensors configuration options for Capacitive Touch acquisition using + * the PTC module. + * + * + * - Userguide: QTouch Library Peripheral Touch Controller User Guide. + * - Support email: www.atmel.com/design-support/ + * + * + * Copyright (c) 2013-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + ******************************************************************************/ + +#ifndef TOUCH_CONFIG_SAMD_H +#define TOUCH_CONFIG_SAMD_H + +/*---------------------------------------------------------------------------- + * Self Cap method enable/disable. + * + * + *----------------------------------------------------------------------------*/ + +/** + * Enable/Disable Self/Mutual Capacitance method. + */ +#define DEF_TOUCH_SELFCAP (1) +#define DEF_TOUCH_MUTLCAP (0) + +/*---------------------------------------------------------------------------- + * PTC module clock and interrupt level configuration. + * + * + *----------------------------------------------------------------------------*/ + +/** + * PTC Module clock configuration. + * Before using the QTouch library API, the PTC module clock generator source + * should be configured appropriately. The PTC module clock can be generated + * using any of the eight generic clock generators (GCLK0-GCLK7). The + *associated + * generic clock multiplexer should be configured such that the PTC module clock + * is set to 4MHz. Refer touch_configure_ptc_clock API in touch.c for more + * information. + */ + +/** + * PTC Module interrupt level. + * The Nested Vectored Interrupt Controller (NVIC) in the SAMD supports + * four different priority levels. The priority level of the PTC end of + * conversion ISR, used within QTouch library can be chosen based on application + * requirements in order to accommodate time critical operations. + * Range: 0u (Highest priority) to 3u (Lowest prioirity) + * For more details refer to the Cortex-M0 Technical Reference Manual. + */ +#define DEF_TOUCH_PTC_ISR_LVL (2u) + +/*---------------------------------------------------------------------------- + * Self Cap method pin configuration. + * + * + *----------------------------------------------------------------------------*/ + +/** + * Self Cap touch channel selected. + * The capacitance measurement is done sequentially in the order in which + * the touch channel (nodes) are specified below. Touch channel numbering + * follows the order in which Y lines are specified. Capacitance measurement + * is done sequentially in the order in which touch channel nodes are specified. + */ +#define DEF_SELFCAP_LINES Y(2),Y(3),Y(4),Y(5),Y(8),Y(9),Y(14),Y(15) + +/*---------------------------------------------------------------------------- + * Self Cap method channel and sensor configuration. + * + * + *----------------------------------------------------------------------------*/ + +/** + * Self Cap number of channels. + * Specify the number of Self Cap touch channels to be used by the Touch + *Library. + * A key is formed used one touch channel. A rotor or slider can be formed + * using 3 touch channels. + * Range: 1u to 16u. + */ +#define DEF_SELFCAP_NUM_CHANNELS (8) //Total number of channels + +/** + * Self Cap number of Sensors. + * Specify the number of Self Cap touch sensors to be used by the Touch Library. + * A sensor is either a key, rotor or slider. + * Example configuration: If the configuration has 6 keys (a key is formed + * using one Sensor Pin), one rotor (a Self Cap rotor is formed using 3 Sensor + * Pins) and one slider (a Self Cap slider is formed using 3 Sensor Pins), then + * the number of sensors is 6 key + 1 rotor + 1 slider = 8 sensors. + * Range: 1u to 16u. + */ +#define DEF_SELFCAP_NUM_SENSORS (8) //Total number of sensors + +/** + * Self Cap number of Rotors and Sliders. + * Specify the total number of Self Cap Rotors and Sliders to be used by + * the Touch Library. The number of Rotors and Sliders mentioned here is part + * of + * the Total number of sensors specified in the QT_NUM_SENSORS macro. When + * no rotors or slider are required, specify a value of 0u. + * Range: 0u to 8u. + */ +#define DEF_SELFCAP_NUM_ROTORS_SLIDERS (0) //Number of rotor sliders + +/*---------------------------------------------------------------------------- + * Self Cap method aquisition parameters. + * + * + *----------------------------------------------------------------------------*/ + +/** + * Self Cap filter level setting. + * The filter level setting controls the number of samples taken + * to resolve each acquisition. A higher filter level setting provides + * improved signal to noise ratio under noisy conditions, while + * increasing the total time for measurement resulting in increased + * power consumption and response time. Refer filter_level_t in + *touch_api_ptc.h + * Range: FILTER_LEVEL_1 (one sample) to FILTER_LEVEL_64 ( 64 samples). + */ +#define DEF_SELFCAP_FILTER_LEVEL_PER_NODE FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16 + + /* + * SelfCap Auto OS function can be enabled/disabled + * 1u = Self cap Auto OS functionality is enabled + * 0u = Self Auto OS functionality is disabled + */ + #define DEF_SELFCAP_AUTO_OS_ENABLE 0u + +/** + * Self Cap auto oversample setting. + * Auto oversample controls the automatic oversampling of sensor channels when + * unstable signals are detected with the default setting of ?Filter level?. + * Enabling Auto oversample results in 'Filter level' x 'Auto Oversample' number + * of samples taken on the corresponding sensor channel when an unstable signal + * is observed. In a case where ?Filter level? is set to FILTER_LEVEL_4 and + * ?Auto Oversample? is set to AUTO_OS_4, 4 oversamples are taken with stable + * signal values and 16 oversamples are taken when unstable signal is detected. + * Refer auto_os_t in touch_api_ptc.h + * Range: 0 to 7 + 0 --> AUTO_OS_DISABLE, 1 --> AUTO_OS_2, + 2 --> AUTO_OS_4, 3 --> AUTO_OS_8, + 4 --> AUTO_OS_16, 5 --> AUTO_OS_32, + 6 --> AUTO_OS_64, 7 --> AUTO_OS_128 + */ +#define DEF_SELFCAP_AUTO_OS_PER_NODE AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE + +/** + * Stability limit is the variance in sensor signal value under noisy environment. + * The signal stability limit level is set to auto trigger oversamples on noise presence. + * It is recommended to keep this setting close to the lowest sensor detect threshold of + * the system and tune it further based on the noise. + * Range: 1 to 1000 + */ +#define DEF_SELFCAP_AUTO_OS_SIGNAL_STABILITY_LIMIT 20 +/** + * Self Cap gain per touch channel. + * Gain is applied on a per-channel basis to allow a scaling-up of the touch + * sensitivity on contact. + * Note: delta on touch contact, not the resting signal which is measured on + * each sensor. + * Refer gain_t in touch_api_ptc.h + * Range:GAIN_1 (no scaling) to GAIN_32 (scale-up by 32) + */ +#define DEF_SELFCAP_GAIN_PER_NODE GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1 + +/*---------------------------------------------------------------------------- + * Tuning for Noise performance, touch response time and Power consumption. + * + * + *----------------------------------------------------------------------------*/ + +/** + * Refer QTouch Library Peripheral Touch Controller User Guide for detailed + * information on tuning for Noise performance, touch response time and Power + * consumption + */ + +/** + * For best noise performance, set - + * - DEF_SELFCAP_FREQ_MODE to FREQ_MODE_HOP + * - DEF_SELFCAP_SENSE_RESISTOR to RSEL_VAL_100 + * - use AUTO_TUNE_PRSC input to touch_xxcap_sensors_calibrate() API in touch.c + * Based on the type of noise, FREQ_MODE_SPREAD or FREQ_MODE_SPREAD_MEDIAN can + * also be used. + * + * For best power consumption, set - + * - DEF_SELFCAP_FREQ_MODE to FREQ_MODE_NONE + * - DEF_SELFCAP_CLK_PRESCALE to PRSC_DIV_SEL_1 + * - use AUTO_TUNE_RSEL input to touch_xxcap_sensors_calibrate() API in touch.c + * + */ + +/** + * Self Cap acquisition frequency mode. + * + * FREQ_MODE_HOP: + * When frequency mode hopping option is selected, the PTC runs a + * frequency hopping cycle with subsequent measurements done using + * the three PTC acquisition frequency delay settings as specified in + * DEF_SELFCAP_HOP_FREQS. + * + * FREQ_MODE_SPREAD: + * When frequency mode spread spectrum option is selected, the PTC + * runs with spread spectrum enabled for jittered delay based + * acquisition. + * + * FREQ_MODE_SPREAD_MEDIAN: + * When frequency mode spread spectrum median option is selected, + * the PTC runs with spread spectrum enabled. In this case, an + * additional software median filter is applied to the measured + * signal values. + * + * FREQ_MODE_NONE: + * When frequency mode none option is selected, the PTC runs at + * constant speed. This mode is suited for best power consumption. + */ +#define DEF_SELFCAP_FREQ_MODE FREQ_MODE_NONE + +/** + * PTC acquisition frequency delay setting. + * + * Specify three frequency hop delay settings. + * + * The PTC acquisition frequency is dependent on the Generic clock + * input to PTC and PTC clock pre-scaler setting. This delay setting + * inserts "n" PTC clock cycles between consecutive measurements on + * a given sensor, thereby changing the PTC acquisition frequency. + * FREQ_HOP_SEL_1 setting inserts 0 PTC clock cycle between consecutive + * measurements. FREQ_HOP_SEL_16 setting inserts 15 PTC clock cycles. + * Hence, higher delay setting will increase the total time taken for + * capacitance measurement on a given sensor as compared to a lower + * delay setting. + * + * A desired setting can be used to avoid noise around the same frequency + * as the acquisition frequency. + * Range: FREQ_HOP_SEL_1 to FREQ_HOP_SEL_16 + */ +#define DEF_SELFCAP_HOP_FREQS FREQ_HOP_SEL_1,FREQ_HOP_SEL_2,FREQ_HOP_SEL_3 + +/** + * Self cap PTC clock pre-scalar. + * PTC clock prescale setting. Refer touch_configure_ptc_clock() API in + *touch.c + * Example: if Generic clock input to PTC = 4MHz, then: + * PRSC_DIV_SEL_1 sets PTC Clock to 4MHz + * PRSC_DIV_SEL_2 sets PTC Clock to 2MHz + * PRSC_DIV_SEL_4 sets PTC Clock to 1MHz + * PRSC_DIV_SEL_8 sets PTC Clock to 500KHz + */ +#define DEF_SELFCAP_CLK_PRESCALE_PER_NODE PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1 + +/** + * PTC series resistor setting. For Mutual cap mode, this series + * resistor is switched internally on the Y-pin. For Self cap mode, + * the series resistor is switched internally on the Sensor pin. + * + * Example: + * RSEL_VAL_0 sets internal series resistor to 0ohms. + * RSEL_VAL_20 sets internal series resistor to 20Kohms. + * RSEL_VAL_50 sets internal series resistor to 50Kohms. + * RSEL_VAL_100 sets internal series resistor to 100Kohms. + */ +#define DEF_SELFCAP_SENSE_RESISTOR_PER_NODE + +/** + This is the default auto tune mode selection. + This is used in the AUTO calibration routine, + The allowed values are 0 to 2 + 0 --> DEF_AUTO_TUNE_NONE if Auto tune is not required + 1 --> DEF_AUTO_TUNE_PRSC if the Pre-scaler needs to be tuned + 2 --> DEF_AUTO_TUNE_RSEL if the Series resistor needs to be tuned + 3 --> DEF_AUTO_TUNE_CSD this is available only in C2x devices, +DEF_AUTO_TUNE_CSD tunes internal Charge sharing delay for proper charge transfer +*/ +#define DEF_SELF_AUTO_TUNE_VALUE 2 +/*---------------------------------------------------------------------------- + * Self Cap method sensor global parameters. + * + * + *----------------------------------------------------------------------------*/ + +/*! \name Self Cap Global acquisition parameters. + * Refer the Touch Library User guide for more information on these parameters. + */ +/* ! @{ */ + +/** + * Self Cap Sensor measurement interval. + * Speicify period in milliseconds. Example, DEF_TOUCH_MEASUREMENT_PERIOD_MS + *50u + * will perform measurement on touch sensors every 50msec. + */ +#define DEF_TOUCH_MEASUREMENT_PERIOD_MS 20u + + +/** + * Self Cap Sensor detect integration (DI) limit. + * Range: 0u to 255u. + */ +#define DEF_SELFCAP_DI 4u + + +/** + * Self Cap Sensor towards touch drift rate. + * Units: 200ms + * Default value: 20 = 4 seconds. + * Range: 1u to 127u. + */ +#define DEF_SELFCAP_TCH_DRIFT_RATE 20u + + +/** + * Self Cap Sensor away from touch drift rate. + * Units: 200ms + * Default value: 5u = 1 second. + * Range: 1u to 127u. + */ +#define DEF_SELFCAP_ATCH_DRIFT_RATE 5u + + +/** + * Self Cap Sensor maximum ON time duration. + * Units: 200ms (Example: a value 5u indicated Max ON duration of 1 second.) + * Default value: 0 (No maximum ON time limit). + * Range: 0u to 255u. + */ +#define DEF_SELFCAP_MAX_ON_DURATION 0u + + +/** + * Self Cap Sensor drift hold time. + * Units: 200ms + * Default value: 20 (hold off drifting for 4 seconds after leaving detect). + * Range: 1u to 255u. + */ +#define DEF_SELFCAP_DRIFT_HOLD_TIME 20u + + +/** + * Self Cap Sensor away from touch recalibration delay. + * Default value: 10. + * Range: 0u to 255u. + */ +#define DEF_SELFCAP_ATCH_RECAL_DELAY 10u + + +/** Self Cap Sensor away from touch recalibration threshold. + * Default: RECAL_50 (recalibration threshold = 50% of detection threshold). + * Range: refer recal_threshold_t enum in touch_api_ptc.h. + */ +#define DEF_SELFCAP_ATCH_RECAL_THRESHOLD 0u + + +/** Self Cap Sensor post-processing mode. + * Default: TOUCH_LIBRARY_DRIVEN. + * Range: TOUCH_LIBRARY_DRIVEN or TOUCH_APPLN_DRIVEN refer in touch_api_ptc.h. + */ +#define DEF_SELFCAP_TOUCH_POSTPROCESS_MODE TOUCH_APPLN_DRIVEN + +/* ! @} */ + +/*---------------------------------------------------------------------------- +* Self Cap method moisture detection feature parameters. +* +* +*----------------------------------------------------------------------------*/ +/*! \name Mutual Cap method moisture feature parameters. +* Refer the Touch Library User guide for more information on these parameters. +*/ +/* ! @{ */ + +/** + * Enable or disable moisture detection feature. + */ +#define DEF_SELFCAP_MOIS_TOLERANCE_ENABLE (0u) + +/** + * Enable or disable quick re-burst feature within a given moisture group. + * When enabled, if within a given moisture group, when any sensor is touched, + * repeated measurements are done only that sensor to resolve detect integration or de-bounce. + * When disabled, if within a given moisture group, when any sensor is touched, repeated measurements are done + * on all sensors within the moisture group to resolve detect integration or de-bounce. + * It is recommended to enable this feature for best touch response time. + */ +#define DEF_SELFCAP_MOIS_QUICK_REBURST_ENABLE (1u) + +/** + * Self cap number of moisture groups + */ +#define DEF_SELFCAP_NUM_MOIS_GROUPS (0u) + + +/**State of the Self Cap PTC pins. + * Default: GND_WHEN_NOT_MEASURED (PTC pins are pulled to GND when they are not bursted). + * Range: ptc_gpio_state_t enum in touch_api_ptc.h. + */ +#define DEF_SELFCAP_PTC_GPIO_STATE (PULLHIGH_WHEN_NOT_MEASURED) + +/* ! @} */ + +/* + * AKS grouping function can be enabled/disabled + * 1u = AKS grouping functionality is enabled + * 0u = AKS grouping functionality is disabled + */ +#define DEF_SELFCAP_AKS_ENABLE (0u) + +/* + * Charge share delay indicates the number of additional charge cycles that are inserted within a capacitance measurement cycle + * to ensure full charging of the touch sensor. + * The CSD value is dependent on the sensor capacitance along with the series resistor on the Y line. + * When manual tuning is done, the CSD value for the sensor with largest combination of capacitance along with series resistance + * should be considered. + * allowed Range 0-255 + */ +#define DEF_SELF_CAP_CSD_VALUE 0 + +/*---------------------------------------------------------------------------- + * Self Cap method noise measurement & lockout. + * + * + *----------------------------------------------------------------------------*/ + +/*! \name Self Cap Global acquisition parameters. + * Refer the Touch Library User guide for more information on these parameters. + */ +/* ! @{ */ + +/** + * Noise measurement enable/disable + * If configured as 1, noise measurement will be enabled + * If configured as 0, noise measurement will be disabled + */ +#define DEF_SELFCAP_NOISE_MEAS_ENABLE (0u) + +/** + * Stability limit is the variance in sensor signal value under noisy environment. + * Any noise level over and above the noise signal stability limit contributes to the Noise limit. + * It is recommended to keep this setting close to the lowest sensor detect threshold of + * the system and tune it further based on the noise. + * Range: 1 to 1000 + */ +#define DEF_SELFCAP_NOISE_MEAS_SIGNAL_STABILITY_LIMIT 10u + +/** + * The noise limit specifies the limit to the total noise accumulated over the noise buffer count. + * If the accumulated noise exceeds the noise limit, then lockout is triggered. + * Range: 1 to 255 + */ +#define DEF_SELFCAP_NOISE_LIMIT 12u + +/** + * Noise buffer count + * Selection of buffer count for noise calculation. + * Defines the buffer limit for internal noise measurement + * Range: 3 to 10 (select value N + 1, here N nmber of samples) + * if N = 4 then set DEF_NM_BUFFER_CNT 5u ->> (N + 1). + * Default : 5u + */ +#define DEF_SELFCAP_NOISE_MEAS_BUFFER_CNT (5u) + +/** + * Mutual cap method : noisy Sensor lockout settings. + * 0u: single sensor lockout. + * 1u: Global sensor lockout. + * 2u : No lockout + * Range : 0 to 2 + */ +#define DEF_SELFCAP_LOCKOUT_SEL 0 + +/** + * Mutual cap Lockout count down + * If the sensor signal is moves from noisy to a good condition and stays there + * for a count value higher than the max count defined by user, sensor is + *declared as stable + * Range: 1 to 255 + */ +#define DEF_SELFCAP_LOCKOUT_CNTDOWN 10 + +/* ! @} */ + +/*---------------------------------------------------------------------------- + * Self Cap method Frequency auto tune. + * + * + *----------------------------------------------------------------------------*/ + +/*! \name Self Cap Global acquisition parameters. + * Refer the Touch Library User guide for more information on these parameters. + */ +/* ! @{ */ + +/** + * Freq auto tune enable/disable ( applicable only to freq_hop mode) + * If configured as 1, Freq auto tune will be enabled + * If configured as 0, Freq auto tune will be disabled + */ +#define DEF_SELFCAP_FREQ_AUTO_TUNE_ENABLE (0u) + +/** + * Stability limit is the variance in sensor signal value under noisy environment. + * A signal stability limit level is set to auto tune acquisition frequency on noise presence. + * It is recommended to keep this setting close to the lowest sensor detect threshold of the system + * and tune it further based on the noise. + * Range: 1 to 1000 + */ +#define DEF_SELFCAP_FREQ_AUTO_TUNE_SIGNAL_STABILITY_LIMIT 10u + +/** + * Frequency Auto tune-in count + * If the channel signal is noisy for a count value higher than the max count + *defined by user, + * system will trigger auto tune + * Range: 1 to 255 + * Note : this appies only for FREQ_MODE_HOP + */ +#define DEF_SELFCAP_FREQ_AUTO_TUNE_IN_CNT 12 + +/* ! @} */ + +/*---------------------------------------------------------------------------- + * Self Cap Callback functions. + * + * + *----------------------------------------------------------------------------*/ + +/*! \name Self Cap Callback functions. + */ +/* ! @{ */ + +/** + * Self Cap Filter callback function. + * A filter callback (when not NULL) is called by the Touch Library each time + * a new set of Signal values are available. + * An Example filter callback function prototype. + * void touch_filter_callback( touch_filter_data_t *p_filter_data ); + */ +#define DEF_SELFCAP_FILTER_CALLBACK (NULL) + +/** + * Touch Application Error Handler Enable or Disable; while(1) is used to trap errors when it is enabled + * If configured as 1, Touch Application Error Handler will be enabled + * If configured as 0, Touch Application Error Handler will be disabled + * Default: Touch Application Error Handler will be disabled + */ +#define DEF_TOUCH_APP_ERR_HANDLER 0 + + +/* ! @} */ + +/*---------------------------------------------------------------------------- + * QDebug debug communication parameters. + * + * + *----------------------------------------------------------------------------*/ + +/*! \name QDebug debug communication parameters. + */ +/* ! @{ */ + +#define DEF_TOUCH_QDEBUG_ENABLE_SELFCAP + +#define DEF_TOUCH_QDEBUG_ENABLE 0u + + +/* ! @} */ + +#endif /* TOUCH_CONFIG_SAMD_H */ diff --git a/atmel-samd/boards/cplay_m0_flash/conf_access.h b/atmel-samd/boards/cplay_m0_flash/conf_access.h deleted file mode 100644 index 25109b75c..000000000 --- a/atmel-samd/boards/cplay_m0_flash/conf_access.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * \file - * - * \brief Memory access control configuration file. - * - * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef _CONF_ACCESS_H_ -#define _CONF_ACCESS_H_ - -#include "compiler.h" -#include "board.h" - - -/*! \name Activation of Logical Unit Numbers - */ -//! @{ -#define LUN_0 ENABLE //!< On-Chip Virtual Memory. -#define LUN_1 DISABLE //!< AT45DBX Data Flash. -#define LUN_2 DISABLE //!< SD/MMC Card over SPI. -#define LUN_3 DISABLE //!< SD/MMC Card over MCI Slot 0. -#define LUN_4 DISABLE -#define LUN_5 DISABLE -#define LUN_6 DISABLE -#define LUN_7 DISABLE -#define LUN_USB DISABLE //!< Host Mass-Storage Memory. -//! @} - -/*! \name LUN 0 Definitions - */ -//! @{ -#define LUN_0_INCLUDE "access_vfs.h" -#define Lun_0_test_unit_ready vfs_test_unit_ready -#define Lun_0_read_capacity vfs_read_capacity -#define Lun_0_unload NULL -#define Lun_0_wr_protect vfs_wr_protect -#define Lun_0_removal vfs_removal -#define Lun_0_usb_read_10 vfs_usb_read_10 -#define Lun_0_usb_write_10 vfs_usb_write_10 -#define LUN_0_NAME "\"MicroPython VFS[0]\"" -//! @} - -#define MEM_USB LUN_USB - -/*! \name Actions Associated with Memory Accesses - * - * Write here the action to associate with each memory access. - * - * \warning Be careful not to waste time in order not to disturb the functions. - */ -//! @{ -#define memory_start_read_action(nb_sectors) -#define memory_stop_read_action() -#define memory_start_write_action(nb_sectors) -#define memory_stop_write_action() -//! @} - -/*! \name Activation of Interface Features - */ -//! @{ -#define ACCESS_USB true //!< MEM <-> USB interface. -#define ACCESS_MEM_TO_RAM false //!< MEM <-> RAM interface. -#define ACCESS_STREAM false //!< Streaming MEM <-> MEM interface. -#define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode. -#define ACCESS_MEM_TO_MEM false //!< MEM <-> MEM interface. -#define ACCESS_CODEC false //!< Codec interface. -//! @} - -/*! \name Specific Options for Access Control - */ -//! @{ -#define GLOBAL_WR_PROTECT false //!< Management of a global write protection. -//! @} - - -#endif // _CONF_ACCESS_H_ diff --git a/atmel-samd/boards/cplay_m0_flash/conf_board.h b/atmel-samd/boards/cplay_m0_flash/conf_board.h deleted file mode 100644 index 7b88c97fc..000000000 --- a/atmel-samd/boards/cplay_m0_flash/conf_board.h +++ /dev/null @@ -1,14 +0,0 @@ -/** - * \file - * - * \brief User board configuration template - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#ifndef CONF_BOARD_H -#define CONF_BOARD_H - -#endif // CONF_BOARD_H diff --git a/atmel-samd/boards/cplay_m0_flash/conf_clocks.h b/atmel-samd/boards/cplay_m0_flash/conf_clocks.h deleted file mode 100644 index 9e4f7876b..000000000 --- a/atmel-samd/boards/cplay_m0_flash/conf_clocks.h +++ /dev/null @@ -1 +0,0 @@ -#include "conf_clocks_crystalless.h" diff --git a/atmel-samd/boards/cplay_m0_flash/conf_usb.h b/atmel-samd/boards/cplay_m0_flash/conf_usb.h deleted file mode 100644 index f4ba8eccb..000000000 --- a/atmel-samd/boards/cplay_m0_flash/conf_usb.h +++ /dev/null @@ -1,217 +0,0 @@ - -#include -#include - -#ifndef CONF_USB_H_INCLUDED -#define CONF_USB_H_INCLUDED - -#define USB_DEVICE_MAJOR_VERSION 1 -#define USB_DEVICE_MINOR_VERSION 0 -#define USB_DEVICE_POWER 100 // Consumption on Vbus line (mA) -#define USB_DEVICE_ATTR \ - (USB_CONFIG_ATTR_BUS_POWERED) -// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) -// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) - -//! USB Device string definitions (Optional) -#ifndef USB_DEVICE_MANUFACTURE_NAME -# define USB_DEVICE_MANUFACTURE_NAME "Adafruit Industries" -#endif - -#ifndef USB_DEVICE_PRODUCT_NAME -# define USB_DEVICE_PRODUCT_NAME "Circuit Playground M0 (Experimental)" -#endif -// #define USB_DEVICE_SERIAL_NAME "12...EF" -#define USB_DEVICE_GET_SERIAL_NAME_POINTER serial_number -#define USB_DEVICE_GET_SERIAL_NAME_LENGTH 32 -extern char serial_number[USB_DEVICE_GET_SERIAL_NAME_LENGTH]; - -//! Control endpoint size -#define USB_DEVICE_EP_CTRL_SIZE 64 - -//! Interfaces for this device (CDC COM + CDC DATA + MSC + HID mouse + HID kbd) -#define USB_DEVICE_NB_INTERFACE 5 - -// (3 | USB_EP_DIR_IN) // CDC Notify endpoint -// (4 | USB_EP_DIR_IN) // CDC TX -// (5 | USB_EP_DIR_OUT) // CDC RX -// (1 | USB_EP_DIR_IN) // MSC IN -// (2 | USB_EP_DIR_OUT) // MSC OUT -// (6 | USB_EP_DIR_IN) // HID mouse report -// (7 | USB_EP_DIR_IN) // HID keyboard report -#define USB_DEVICE_MAX_EP 7 - -#define UDI_CDC_PORT_NB 1 -#define UDI_CDC_ENABLE_EXT(port) mp_cdc_enable(port) -extern bool mp_cdc_enable(uint8_t port); -#define UDI_CDC_DISABLE_EXT(port) mp_cdc_disable(port) -extern void mp_cdc_disable(uint8_t port); -#define UDI_CDC_LOW_RATE - -#define UDI_CDC_DEFAULT_RATE 115200 -#define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 -#define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE -#define UDI_CDC_DEFAULT_DATABITS 8 - -#define UDI_CDC_RX_NOTIFY(port) usb_rx_notify() -void usb_rx_notify(void); -#define UDI_CDC_SET_CODING_EXT(port,cfg) -#define UDI_CDC_SET_DTR_EXT(port,set) usb_dtr_notify(port, set) -void usb_dtr_notify(uint8_t port, bool set); -#define UDI_CDC_SET_RTS_EXT(port,set) usb_rts_notify(port, set) -void usb_rts_notify(uint8_t port, bool set); - -/** - * USB CDC low level configuration - * In standalone these configurations are defined by the CDC module. - * For composite device, these configuration must be defined here - * @{ - */ -//! Endpoint numbers definition - -#define UDI_CDC_COMM_EP_0 (3 | USB_EP_DIR_IN) // Notify endpoint -#define UDI_CDC_DATA_EP_IN_0 (4 | USB_EP_DIR_IN) // TX -#define UDI_CDC_DATA_EP_OUT_0 (5 | USB_EP_DIR_OUT) // RX - -//! Interface numbers -#define UDI_CDC_COMM_IFACE_NUMBER_0 0 -#define UDI_CDC_DATA_IFACE_NUMBER_0 1 - -/** - * Configuration of MSC interface - * @{ - */ -//! Vendor name and Product version of MSC interface -#define UDI_MSC_GLOBAL_VENDOR_ID \ - 'A', 'T', 'M', 'E', 'L', ' ', ' ', ' ' -#define UDI_MSC_GLOBAL_PRODUCT_VERSION \ - '1', '.', '0', '0' - -//! Interface callback definition -#define UDI_MSC_ENABLE_EXT() mp_msc_enable() -extern bool mp_msc_enable(void); -#define UDI_MSC_DISABLE_EXT() mp_msc_disable() -extern void mp_msc_disable(void); - -//! Enable id string of interface to add an extra USB string -#define UDI_MSC_STRING_ID 5 - -/** - * USB MSC low level configuration - * In standalone these configurations are defined by the MSC module. - * For composite device, these configuration must be defined here - * @{ - */ -//! Endpoint numbers definition -#define UDI_MSC_EP_IN (1 | USB_EP_DIR_IN) -#define UDI_MSC_EP_OUT (2 | USB_EP_DIR_OUT) - -//! Interface number -#define UDI_MSC_IFACE_NUMBER 2 -/** - * Configuration of HID Mouse interface - * @{ - */ -//! Interface callback definition -#define UDI_HID_MOUSE_ENABLE_EXT() mp_mouse_enable() -extern bool mp_mouse_enable(void); -#define UDI_HID_MOUSE_DISABLE_EXT() mp_mouse_disable() -extern void mp_mouse_disable(void); - -//! Enable id string of interface to add an extra USB string -#define UDI_HID_MOUSE_STRING_ID 6 - -/** - * USB HID Mouse low level configuration - * In standalone these configurations are defined by the HID Mouse module. - * For composite device, these configuration must be defined here - * @{ - */ -//! Endpoint numbers definition -#define UDI_HID_MOUSE_EP_IN (6 | USB_EP_DIR_IN) - -//! Interface number -#define UDI_HID_MOUSE_IFACE_NUMBER 3 -//@} -//@} - -/** - * Configuration of HID Keyboard interface - * @{ - */ -//! Interface callback definition -#define UDI_HID_KBD_ENABLE_EXT() mp_keyboard_enable() -extern bool mp_keyboard_enable(void); -#define UDI_HID_KBD_DISABLE_EXT() mp_keyboard_disable() -extern void mp_keyboard_disable(void); -#define UDI_HID_KBD_CHANGE_LED(value) mp_keyboard_led(value) -extern void mp_keyboard_led(uint8_t); - -//! Enable id string of interface to add an extra USB string -#define UDI_HID_KBD_STRING_ID 7 - -/** - * USB HID Keyboard low level configuration - * In standalone these configurations are defined by the HID Keyboard module. - * For composite device, these configuration must be defined here - * @{ - */ -//! Endpoint numbers definition -#define UDI_HID_KBD_EP_IN (7 | USB_EP_DIR_IN) - -//! Interface number -#define UDI_HID_KBD_IFACE_NUMBER 4 - -/** - * Description of Composite Device - * @{ - */ -//! USB Interfaces descriptor structure -#define UDI_COMPOSITE_DESC_T \ - usb_iad_desc_t udi_cdc_iad; \ - udi_cdc_comm_desc_t udi_cdc_comm; \ - udi_cdc_data_desc_t udi_cdc_data; \ - udi_msc_desc_t udi_msc; \ - udi_hid_mouse_desc_t udi_hid_mouse; \ - udi_hid_kbd_desc_t udi_hid_kbd - -//! USB Interfaces descriptor value for Full Speed -#define UDI_COMPOSITE_DESC_FS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_FS, \ - .udi_msc = UDI_MSC_DESC_FS, \ - .udi_hid_mouse = UDI_HID_MOUSE_DESC, \ - .udi_hid_kbd = UDI_HID_KBD_DESC - -//! USB Interfaces descriptor value for High Speed -#define UDI_COMPOSITE_DESC_HS \ - .udi_cdc_iad = UDI_CDC_IAD_DESC_0, \ - .udi_cdc_comm = UDI_CDC_COMM_DESC_0, \ - .udi_cdc_data = UDI_CDC_DATA_DESC_0_HS, \ - .udi_msc = UDI_MSC_DESC_HS, \ - .udi_hid_mouse = UDI_HID_MOUSE_DESC, \ - .udi_hid_kbd = UDI_HID_KBD_DESC - -//! USB Interface APIs -#define UDI_COMPOSITE_API \ - &udi_api_cdc_comm, \ - &udi_api_cdc_data, \ - &udi_api_msc, \ - &udi_api_hid_mouse, \ - &udi_api_hid_kbd -//@} - -/** - * USB Device Driver Configuration - * @{ - */ -//@} - -//! The includes of classes and other headers must be done at the end of this file to avoid compile error -#include "udi_cdc.h" -#include "udi_msc.h" -#include "udi_hid_mouse.h" -#include "udi_hid_kbd.h" - -#endif diff --git a/atmel-samd/boards/cplay_m0_flash/init.c b/atmel-samd/boards/cplay_m0_flash/init.c deleted file mode 100644 index ac240b54b..000000000 --- a/atmel-samd/boards/cplay_m0_flash/init.c +++ /dev/null @@ -1,18 +0,0 @@ -/** - * \file - * - * \brief User board initialization template - * - */ -/* - * Support and FAQ: visit Atmel Support - */ - -#include "board.h" -#include "conf_board.h" -#include "mpconfigboard.h" -#include "asf/sam0/drivers/port/port.h" - -void board_init(void) -{ -} diff --git a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h b/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h deleted file mode 100644 index c8ece7ad3..000000000 --- a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.h +++ /dev/null @@ -1,40 +0,0 @@ -#define USB_REPL - -#define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground M0 (Experimental)" -#define MICROPY_HW_MCU_NAME "samd21g18" - -//#define MICROPY_HW_LED_MSC PIN_PA17 - -#define SPI_FLASH_BAUDRATE (1000000) - -// On-board flash -#define SPI_FLASH_MUX_SETTING SPI_SIGNAL_MUX_SETTING_E -// Use default pinmux for the chip select since we manage it ourselves. - -// Rev B: -// #define SPI_FLASH_PAD0_PINMUX PINMUX_PA12D_SERCOM4_PAD0 // MISO -// #define SPI_FLASH_PAD1_PINMUX PINMUX_DEFAULT // CS -// #define SPI_FLASH_PAD2_PINMUX PINMUX_PB10D_SERCOM4_PAD2 // MOSI -// #define SPI_FLASH_PAD3_PINMUX PINMUX_PB11D_SERCOM4_PAD3 // SCK - -// Rev C: -#define SPI_FLASH_PAD0_PINMUX PINMUX_PA16D_SERCOM3_PAD0 // MISO -#define SPI_FLASH_PAD1_PINMUX PINMUX_DEFAULT // CS -#define SPI_FLASH_PAD2_PINMUX PINMUX_PA20D_SERCOM3_PAD2 // MOSI -#define SPI_FLASH_PAD3_PINMUX PINMUX_PA21D_SERCOM3_PAD3 // SCK - -#define SPI_FLASH_CS PIN_PB22 -// rev B: #define SPI_FLASH_SERCOM SERCOM4 -#define SPI_FLASH_SERCOM SERCOM3 - -// PA24 and PA25 are USB. -#define MICROPY_PORT_A (PORT_PA16 | PORT_PA20 | PORT_PA21 | PORT_PA24 | PORT_PA25) -#define MICROPY_PORT_B (PORT_PB22) - -#define AUTORESET_DELAY_MS 500 - -#include "spi_flash.h" - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000) - -#define CALIBRATE_CRYSTALLESS 1 diff --git a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk b/atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk deleted file mode 100644 index 514c55a20..000000000 --- a/atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk +++ /dev/null @@ -1,7 +0,0 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld -USB_VID = 0x239A -USB_PID = 0x8015 - -FLASH_IMPL = spi_flash.c - -CHIP_VARIANT = SAMD21G18A diff --git a/atmel-samd/boards/cplay_m0_flash/pins.c b/atmel-samd/boards/cplay_m0_flash/pins.c deleted file mode 100644 index 99c6d004b..000000000 --- a/atmel-samd/boards/cplay_m0_flash/pins.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "samd21_pins.h" - -STATIC const mp_map_elem_t board_global_dict_table[] = { - // Rev C - // { MP_OBJ_NEW_QSTR(MP_QSTR_D10), (mp_obj_t)&pin_PA06 }, - // { MP_OBJ_NEW_QSTR(MP_QSTR_D9), (mp_obj_t)&pin_PA07 }, - // { MP_OBJ_NEW_QSTR(MP_QSTR_D6), (mp_obj_t)&pin_PA04 }, - // { MP_OBJ_NEW_QSTR(MP_QSTR_D12), (mp_obj_t)&pin_PA05 }, - // - // { MP_OBJ_NEW_QSTR(MP_QSTR_D0), (mp_obj_t)&pin_PB09 }, - // //{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), (mp_obj_t)&pin_PA11 }, - // { MP_OBJ_NEW_QSTR(MP_QSTR_D1), (mp_obj_t)&pin_PB08 }, - // //{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), (mp_obj_t)&pin_PA10 }, - - // Rev D - { MP_OBJ_NEW_QSTR(MP_QSTR_A11), (mp_obj_t)&pin_PA06 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A10), (mp_obj_t)&pin_PA07 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A9), (mp_obj_t)&pin_PA04 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A8), (mp_obj_t)&pin_PA05 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_A6), (mp_obj_t)&pin_PB09 }, - //{ MP_OBJ_NEW_QSTR(MP_QSTR_RX), (mp_obj_t)&pin_PA11 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A7), (mp_obj_t)&pin_PB08 }, - //{ MP_OBJ_NEW_QSTR(MP_QSTR_TX), (mp_obj_t)&pin_PA10 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), (mp_obj_t)&pin_PB23 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_MICROPHONE), (mp_obj_t)&pin_PA08 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), (mp_obj_t)&pin_PA09 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SDA), (mp_obj_t)&pin_PA00 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ACCELEROMETER_SCL), (mp_obj_t)&pin_PA01 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_LEFT_BUTTON), (mp_obj_t)&pin_PA28 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RIGHT_BUTTON), (mp_obj_t)&pin_PA14 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_SLIDE_SWITCH), (mp_obj_t)&pin_PA15 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), (mp_obj_t)&pin_PA02 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LIGHT), (mp_obj_t)&pin_PA11 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TEMPERATURE), (mp_obj_t)&pin_PA10 }, - - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), (mp_obj_t)&pin_PA17 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), (mp_obj_t)&pin_PB02 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), (mp_obj_t)&pin_PB02 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), (mp_obj_t)&pin_PB03 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), (mp_obj_t)&pin_PB03 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), (mp_obj_t)&pin_PB11 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), (mp_obj_t)&pin_PB10 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), (mp_obj_t)&pin_PA12 }, - { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), (mp_obj_t)&pin_PB22 }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/atmel-samd/boards/cplay_m0_flash/touch.h b/atmel-samd/boards/cplay_m0_flash/touch.h deleted file mode 100644 index 416ca1f42..000000000 --- a/atmel-samd/boards/cplay_m0_flash/touch.h +++ /dev/null @@ -1,613 +0,0 @@ -/* This source file is part of the ATMEL QTouch Library 5.0.8 */ - -/***************************************************************************** - * - * \file - * - * \brief This file contains the SAMD QTouch Library pin, register and - * sensors configuration options for Capacitive Touch acquisition using - * the PTC module. - * - * - * - Userguide: QTouch Library Peripheral Touch Controller User Guide. - * - Support email: www.atmel.com/design-support/ - * - * - * Copyright (c) 2013-2015 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - ******************************************************************************/ - -#ifndef TOUCH_CONFIG_SAMD_H -#define TOUCH_CONFIG_SAMD_H - -/*---------------------------------------------------------------------------- - * Self Cap method enable/disable. - * - * - *----------------------------------------------------------------------------*/ - -/** - * Enable/Disable Self/Mutual Capacitance method. - */ -#define DEF_TOUCH_SELFCAP (1) -#define DEF_TOUCH_MUTLCAP (0) - -/*---------------------------------------------------------------------------- - * PTC module clock and interrupt level configuration. - * - * - *----------------------------------------------------------------------------*/ - -/** - * PTC Module clock configuration. - * Before using the QTouch library API, the PTC module clock generator source - * should be configured appropriately. The PTC module clock can be generated - * using any of the eight generic clock generators (GCLK0-GCLK7). The - *associated - * generic clock multiplexer should be configured such that the PTC module clock - * is set to 4MHz. Refer touch_configure_ptc_clock API in touch.c for more - * information. - */ - -/** - * PTC Module interrupt level. - * The Nested Vectored Interrupt Controller (NVIC) in the SAMD supports - * four different priority levels. The priority level of the PTC end of - * conversion ISR, used within QTouch library can be chosen based on application - * requirements in order to accommodate time critical operations. - * Range: 0u (Highest priority) to 3u (Lowest prioirity) - * For more details refer to the Cortex-M0 Technical Reference Manual. - */ -#define DEF_TOUCH_PTC_ISR_LVL (2u) - -/*---------------------------------------------------------------------------- - * Self Cap method pin configuration. - * - * - *----------------------------------------------------------------------------*/ - -/** - * Self Cap touch channel selected. - * The capacitance measurement is done sequentially in the order in which - * the touch channel (nodes) are specified below. Touch channel numbering - * follows the order in which Y lines are specified. Capacitance measurement - * is done sequentially in the order in which touch channel nodes are specified. - */ -#define DEF_SELFCAP_LINES Y(2),Y(3),Y(4),Y(5),Y(8),Y(9),Y(14),Y(15) - -/*---------------------------------------------------------------------------- - * Self Cap method channel and sensor configuration. - * - * - *----------------------------------------------------------------------------*/ - -/** - * Self Cap number of channels. - * Specify the number of Self Cap touch channels to be used by the Touch - *Library. - * A key is formed used one touch channel. A rotor or slider can be formed - * using 3 touch channels. - * Range: 1u to 16u. - */ -#define DEF_SELFCAP_NUM_CHANNELS (8) //Total number of channels - -/** - * Self Cap number of Sensors. - * Specify the number of Self Cap touch sensors to be used by the Touch Library. - * A sensor is either a key, rotor or slider. - * Example configuration: If the configuration has 6 keys (a key is formed - * using one Sensor Pin), one rotor (a Self Cap rotor is formed using 3 Sensor - * Pins) and one slider (a Self Cap slider is formed using 3 Sensor Pins), then - * the number of sensors is 6 key + 1 rotor + 1 slider = 8 sensors. - * Range: 1u to 16u. - */ -#define DEF_SELFCAP_NUM_SENSORS (8) //Total number of sensors - -/** - * Self Cap number of Rotors and Sliders. - * Specify the total number of Self Cap Rotors and Sliders to be used by - * the Touch Library. The number of Rotors and Sliders mentioned here is part - * of - * the Total number of sensors specified in the QT_NUM_SENSORS macro. When - * no rotors or slider are required, specify a value of 0u. - * Range: 0u to 8u. - */ -#define DEF_SELFCAP_NUM_ROTORS_SLIDERS (0) //Number of rotor sliders - -/*---------------------------------------------------------------------------- - * Self Cap method aquisition parameters. - * - * - *----------------------------------------------------------------------------*/ - -/** - * Self Cap filter level setting. - * The filter level setting controls the number of samples taken - * to resolve each acquisition. A higher filter level setting provides - * improved signal to noise ratio under noisy conditions, while - * increasing the total time for measurement resulting in increased - * power consumption and response time. Refer filter_level_t in - *touch_api_ptc.h - * Range: FILTER_LEVEL_1 (one sample) to FILTER_LEVEL_64 ( 64 samples). - */ -#define DEF_SELFCAP_FILTER_LEVEL_PER_NODE FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16,FILTER_LEVEL_16 - - /* - * SelfCap Auto OS function can be enabled/disabled - * 1u = Self cap Auto OS functionality is enabled - * 0u = Self Auto OS functionality is disabled - */ - #define DEF_SELFCAP_AUTO_OS_ENABLE 0u - -/** - * Self Cap auto oversample setting. - * Auto oversample controls the automatic oversampling of sensor channels when - * unstable signals are detected with the default setting of ?Filter level?. - * Enabling Auto oversample results in 'Filter level' x 'Auto Oversample' number - * of samples taken on the corresponding sensor channel when an unstable signal - * is observed. In a case where ?Filter level? is set to FILTER_LEVEL_4 and - * ?Auto Oversample? is set to AUTO_OS_4, 4 oversamples are taken with stable - * signal values and 16 oversamples are taken when unstable signal is detected. - * Refer auto_os_t in touch_api_ptc.h - * Range: 0 to 7 - 0 --> AUTO_OS_DISABLE, 1 --> AUTO_OS_2, - 2 --> AUTO_OS_4, 3 --> AUTO_OS_8, - 4 --> AUTO_OS_16, 5 --> AUTO_OS_32, - 6 --> AUTO_OS_64, 7 --> AUTO_OS_128 - */ -#define DEF_SELFCAP_AUTO_OS_PER_NODE AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE,AUTO_OS_DISABLE - -/** - * Stability limit is the variance in sensor signal value under noisy environment. - * The signal stability limit level is set to auto trigger oversamples on noise presence. - * It is recommended to keep this setting close to the lowest sensor detect threshold of - * the system and tune it further based on the noise. - * Range: 1 to 1000 - */ -#define DEF_SELFCAP_AUTO_OS_SIGNAL_STABILITY_LIMIT 20 -/** - * Self Cap gain per touch channel. - * Gain is applied on a per-channel basis to allow a scaling-up of the touch - * sensitivity on contact. - * Note: delta on touch contact, not the resting signal which is measured on - * each sensor. - * Refer gain_t in touch_api_ptc.h - * Range:GAIN_1 (no scaling) to GAIN_32 (scale-up by 32) - */ -#define DEF_SELFCAP_GAIN_PER_NODE GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1,GAIN_1 - -/*---------------------------------------------------------------------------- - * Tuning for Noise performance, touch response time and Power consumption. - * - * - *----------------------------------------------------------------------------*/ - -/** - * Refer QTouch Library Peripheral Touch Controller User Guide for detailed - * information on tuning for Noise performance, touch response time and Power - * consumption - */ - -/** - * For best noise performance, set - - * - DEF_SELFCAP_FREQ_MODE to FREQ_MODE_HOP - * - DEF_SELFCAP_SENSE_RESISTOR to RSEL_VAL_100 - * - use AUTO_TUNE_PRSC input to touch_xxcap_sensors_calibrate() API in touch.c - * Based on the type of noise, FREQ_MODE_SPREAD or FREQ_MODE_SPREAD_MEDIAN can - * also be used. - * - * For best power consumption, set - - * - DEF_SELFCAP_FREQ_MODE to FREQ_MODE_NONE - * - DEF_SELFCAP_CLK_PRESCALE to PRSC_DIV_SEL_1 - * - use AUTO_TUNE_RSEL input to touch_xxcap_sensors_calibrate() API in touch.c - * - */ - -/** - * Self Cap acquisition frequency mode. - * - * FREQ_MODE_HOP: - * When frequency mode hopping option is selected, the PTC runs a - * frequency hopping cycle with subsequent measurements done using - * the three PTC acquisition frequency delay settings as specified in - * DEF_SELFCAP_HOP_FREQS. - * - * FREQ_MODE_SPREAD: - * When frequency mode spread spectrum option is selected, the PTC - * runs with spread spectrum enabled for jittered delay based - * acquisition. - * - * FREQ_MODE_SPREAD_MEDIAN: - * When frequency mode spread spectrum median option is selected, - * the PTC runs with spread spectrum enabled. In this case, an - * additional software median filter is applied to the measured - * signal values. - * - * FREQ_MODE_NONE: - * When frequency mode none option is selected, the PTC runs at - * constant speed. This mode is suited for best power consumption. - */ -#define DEF_SELFCAP_FREQ_MODE FREQ_MODE_NONE - -/** - * PTC acquisition frequency delay setting. - * - * Specify three frequency hop delay settings. - * - * The PTC acquisition frequency is dependent on the Generic clock - * input to PTC and PTC clock pre-scaler setting. This delay setting - * inserts "n" PTC clock cycles between consecutive measurements on - * a given sensor, thereby changing the PTC acquisition frequency. - * FREQ_HOP_SEL_1 setting inserts 0 PTC clock cycle between consecutive - * measurements. FREQ_HOP_SEL_16 setting inserts 15 PTC clock cycles. - * Hence, higher delay setting will increase the total time taken for - * capacitance measurement on a given sensor as compared to a lower - * delay setting. - * - * A desired setting can be used to avoid noise around the same frequency - * as the acquisition frequency. - * Range: FREQ_HOP_SEL_1 to FREQ_HOP_SEL_16 - */ -#define DEF_SELFCAP_HOP_FREQS FREQ_HOP_SEL_1,FREQ_HOP_SEL_2,FREQ_HOP_SEL_3 - -/** - * Self cap PTC clock pre-scalar. - * PTC clock prescale setting. Refer touch_configure_ptc_clock() API in - *touch.c - * Example: if Generic clock input to PTC = 4MHz, then: - * PRSC_DIV_SEL_1 sets PTC Clock to 4MHz - * PRSC_DIV_SEL_2 sets PTC Clock to 2MHz - * PRSC_DIV_SEL_4 sets PTC Clock to 1MHz - * PRSC_DIV_SEL_8 sets PTC Clock to 500KHz - */ -#define DEF_SELFCAP_CLK_PRESCALE_PER_NODE PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1,PRSC_DIV_SEL_1 - -/** - * PTC series resistor setting. For Mutual cap mode, this series - * resistor is switched internally on the Y-pin. For Self cap mode, - * the series resistor is switched internally on the Sensor pin. - * - * Example: - * RSEL_VAL_0 sets internal series resistor to 0ohms. - * RSEL_VAL_20 sets internal series resistor to 20Kohms. - * RSEL_VAL_50 sets internal series resistor to 50Kohms. - * RSEL_VAL_100 sets internal series resistor to 100Kohms. - */ -#define DEF_SELFCAP_SENSE_RESISTOR_PER_NODE - -/** - This is the default auto tune mode selection. - This is used in the AUTO calibration routine, - The allowed values are 0 to 2 - 0 --> DEF_AUTO_TUNE_NONE if Auto tune is not required - 1 --> DEF_AUTO_TUNE_PRSC if the Pre-scaler needs to be tuned - 2 --> DEF_AUTO_TUNE_RSEL if the Series resistor needs to be tuned - 3 --> DEF_AUTO_TUNE_CSD this is available only in C2x devices, -DEF_AUTO_TUNE_CSD tunes internal Charge sharing delay for proper charge transfer -*/ -#define DEF_SELF_AUTO_TUNE_VALUE 2 -/*---------------------------------------------------------------------------- - * Self Cap method sensor global parameters. - * - * - *----------------------------------------------------------------------------*/ - -/*! \name Self Cap Global acquisition parameters. - * Refer the Touch Library User guide for more information on these parameters. - */ -/* ! @{ */ - -/** - * Self Cap Sensor measurement interval. - * Speicify period in milliseconds. Example, DEF_TOUCH_MEASUREMENT_PERIOD_MS - *50u - * will perform measurement on touch sensors every 50msec. - */ -#define DEF_TOUCH_MEASUREMENT_PERIOD_MS 20u - - -/** - * Self Cap Sensor detect integration (DI) limit. - * Range: 0u to 255u. - */ -#define DEF_SELFCAP_DI 4u - - -/** - * Self Cap Sensor towards touch drift rate. - * Units: 200ms - * Default value: 20 = 4 seconds. - * Range: 1u to 127u. - */ -#define DEF_SELFCAP_TCH_DRIFT_RATE 20u - - -/** - * Self Cap Sensor away from touch drift rate. - * Units: 200ms - * Default value: 5u = 1 second. - * Range: 1u to 127u. - */ -#define DEF_SELFCAP_ATCH_DRIFT_RATE 5u - - -/** - * Self Cap Sensor maximum ON time duration. - * Units: 200ms (Example: a value 5u indicated Max ON duration of 1 second.) - * Default value: 0 (No maximum ON time limit). - * Range: 0u to 255u. - */ -#define DEF_SELFCAP_MAX_ON_DURATION 0u - - -/** - * Self Cap Sensor drift hold time. - * Units: 200ms - * Default value: 20 (hold off drifting for 4 seconds after leaving detect). - * Range: 1u to 255u. - */ -#define DEF_SELFCAP_DRIFT_HOLD_TIME 20u - - -/** - * Self Cap Sensor away from touch recalibration delay. - * Default value: 10. - * Range: 0u to 255u. - */ -#define DEF_SELFCAP_ATCH_RECAL_DELAY 10u - - -/** Self Cap Sensor away from touch recalibration threshold. - * Default: RECAL_50 (recalibration threshold = 50% of detection threshold). - * Range: refer recal_threshold_t enum in touch_api_ptc.h. - */ -#define DEF_SELFCAP_ATCH_RECAL_THRESHOLD 0u - - -/** Self Cap Sensor post-processing mode. - * Default: TOUCH_LIBRARY_DRIVEN. - * Range: TOUCH_LIBRARY_DRIVEN or TOUCH_APPLN_DRIVEN refer in touch_api_ptc.h. - */ -#define DEF_SELFCAP_TOUCH_POSTPROCESS_MODE TOUCH_APPLN_DRIVEN - -/* ! @} */ - -/*---------------------------------------------------------------------------- -* Self Cap method moisture detection feature parameters. -* -* -*----------------------------------------------------------------------------*/ -/*! \name Mutual Cap method moisture feature parameters. -* Refer the Touch Library User guide for more information on these parameters. -*/ -/* ! @{ */ - -/** - * Enable or disable moisture detection feature. - */ -#define DEF_SELFCAP_MOIS_TOLERANCE_ENABLE (0u) - -/** - * Enable or disable quick re-burst feature within a given moisture group. - * When enabled, if within a given moisture group, when any sensor is touched, - * repeated measurements are done only that sensor to resolve detect integration or de-bounce. - * When disabled, if within a given moisture group, when any sensor is touched, repeated measurements are done - * on all sensors within the moisture group to resolve detect integration or de-bounce. - * It is recommended to enable this feature for best touch response time. - */ -#define DEF_SELFCAP_MOIS_QUICK_REBURST_ENABLE (1u) - -/** - * Self cap number of moisture groups - */ -#define DEF_SELFCAP_NUM_MOIS_GROUPS (0u) - - -/**State of the Self Cap PTC pins. - * Default: GND_WHEN_NOT_MEASURED (PTC pins are pulled to GND when they are not bursted). - * Range: ptc_gpio_state_t enum in touch_api_ptc.h. - */ -#define DEF_SELFCAP_PTC_GPIO_STATE (PULLHIGH_WHEN_NOT_MEASURED) - -/* ! @} */ - -/* - * AKS grouping function can be enabled/disabled - * 1u = AKS grouping functionality is enabled - * 0u = AKS grouping functionality is disabled - */ -#define DEF_SELFCAP_AKS_ENABLE (0u) - -/* - * Charge share delay indicates the number of additional charge cycles that are inserted within a capacitance measurement cycle - * to ensure full charging of the touch sensor. - * The CSD value is dependent on the sensor capacitance along with the series resistor on the Y line. - * When manual tuning is done, the CSD value for the sensor with largest combination of capacitance along with series resistance - * should be considered. - * allowed Range 0-255 - */ -#define DEF_SELF_CAP_CSD_VALUE 0 - -/*---------------------------------------------------------------------------- - * Self Cap method noise measurement & lockout. - * - * - *----------------------------------------------------------------------------*/ - -/*! \name Self Cap Global acquisition parameters. - * Refer the Touch Library User guide for more information on these parameters. - */ -/* ! @{ */ - -/** - * Noise measurement enable/disable - * If configured as 1, noise measurement will be enabled - * If configured as 0, noise measurement will be disabled - */ -#define DEF_SELFCAP_NOISE_MEAS_ENABLE (0u) - -/** - * Stability limit is the variance in sensor signal value under noisy environment. - * Any noise level over and above the noise signal stability limit contributes to the Noise limit. - * It is recommended to keep this setting close to the lowest sensor detect threshold of - * the system and tune it further based on the noise. - * Range: 1 to 1000 - */ -#define DEF_SELFCAP_NOISE_MEAS_SIGNAL_STABILITY_LIMIT 10u - -/** - * The noise limit specifies the limit to the total noise accumulated over the noise buffer count. - * If the accumulated noise exceeds the noise limit, then lockout is triggered. - * Range: 1 to 255 - */ -#define DEF_SELFCAP_NOISE_LIMIT 12u - -/** - * Noise buffer count - * Selection of buffer count for noise calculation. - * Defines the buffer limit for internal noise measurement - * Range: 3 to 10 (select value N + 1, here N nmber of samples) - * if N = 4 then set DEF_NM_BUFFER_CNT 5u ->> (N + 1). - * Default : 5u - */ -#define DEF_SELFCAP_NOISE_MEAS_BUFFER_CNT (5u) - -/** - * Mutual cap method : noisy Sensor lockout settings. - * 0u: single sensor lockout. - * 1u: Global sensor lockout. - * 2u : No lockout - * Range : 0 to 2 - */ -#define DEF_SELFCAP_LOCKOUT_SEL 0 - -/** - * Mutual cap Lockout count down - * If the sensor signal is moves from noisy to a good condition and stays there - * for a count value higher than the max count defined by user, sensor is - *declared as stable - * Range: 1 to 255 - */ -#define DEF_SELFCAP_LOCKOUT_CNTDOWN 10 - -/* ! @} */ - -/*---------------------------------------------------------------------------- - * Self Cap method Frequency auto tune. - * - * - *----------------------------------------------------------------------------*/ - -/*! \name Self Cap Global acquisition parameters. - * Refer the Touch Library User guide for more information on these parameters. - */ -/* ! @{ */ - -/** - * Freq auto tune enable/disable ( applicable only to freq_hop mode) - * If configured as 1, Freq auto tune will be enabled - * If configured as 0, Freq auto tune will be disabled - */ -#define DEF_SELFCAP_FREQ_AUTO_TUNE_ENABLE (0u) - -/** - * Stability limit is the variance in sensor signal value under noisy environment. - * A signal stability limit level is set to auto tune acquisition frequency on noise presence. - * It is recommended to keep this setting close to the lowest sensor detect threshold of the system - * and tune it further based on the noise. - * Range: 1 to 1000 - */ -#define DEF_SELFCAP_FREQ_AUTO_TUNE_SIGNAL_STABILITY_LIMIT 10u - -/** - * Frequency Auto tune-in count - * If the channel signal is noisy for a count value higher than the max count - *defined by user, - * system will trigger auto tune - * Range: 1 to 255 - * Note : this appies only for FREQ_MODE_HOP - */ -#define DEF_SELFCAP_FREQ_AUTO_TUNE_IN_CNT 12 - -/* ! @} */ - -/*---------------------------------------------------------------------------- - * Self Cap Callback functions. - * - * - *----------------------------------------------------------------------------*/ - -/*! \name Self Cap Callback functions. - */ -/* ! @{ */ - -/** - * Self Cap Filter callback function. - * A filter callback (when not NULL) is called by the Touch Library each time - * a new set of Signal values are available. - * An Example filter callback function prototype. - * void touch_filter_callback( touch_filter_data_t *p_filter_data ); - */ -#define DEF_SELFCAP_FILTER_CALLBACK (NULL) - -/** - * Touch Application Error Handler Enable or Disable; while(1) is used to trap errors when it is enabled - * If configured as 1, Touch Application Error Handler will be enabled - * If configured as 0, Touch Application Error Handler will be disabled - * Default: Touch Application Error Handler will be disabled - */ -#define DEF_TOUCH_APP_ERR_HANDLER 0 - - -/* ! @} */ - -/*---------------------------------------------------------------------------- - * QDebug debug communication parameters. - * - * - *----------------------------------------------------------------------------*/ - -/*! \name QDebug debug communication parameters. - */ -/* ! @{ */ - -#define DEF_TOUCH_QDEBUG_ENABLE_SELFCAP - -#define DEF_TOUCH_QDEBUG_ENABLE 0u - - -/* ! @} */ - -#endif /* TOUCH_CONFIG_SAMD_H */ diff --git a/tools/build_adafruit_bins.sh b/tools/build_adafruit_bins.sh index 83b18547c..8dcbb274e 100755 --- a/tools/build_adafruit_bins.sh +++ b/tools/build_adafruit_bins.sh @@ -1,7 +1,7 @@ rm -rf atmel-samd/build* rm -rf esp8266/build* -ATMEL_BOARDS="arduino_zero cplay_m0_flash feather_m0_basic feather_m0_adalogger feather_m0_express metro_m0_flash trinket_m0 gemma_m0" +ATMEL_BOARDS="arduino_zero circuitplayground_express feather_m0_basic feather_m0_adalogger feather_m0_express metro_m0_flash trinket_m0 gemma_m0" for board in $ATMEL_BOARDS; do make -C atmel-samd BOARD=$board -- cgit v1.2.3