mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-28 10:00:24 +00:00
Add Microchip SAM series MCU support for RT-Thread (#5771)
* Add Microchip SAM series MCU support for RT-Thread Add Microchip SAM series MCU support for RT-Thread, including SAM Cortex-M0+, M4F and M7. * Add bsp directory to ignored check list Add bsp directory to ignored check list, add microchip /samc21/same54/same70 to workflows list * remove STDIO definition and bug fix 1. remove STDIO code from Microchip official BSP. 2. bug fix of SAME70 hpl/hpl_usart.c, samc21&same54 hpl/hpl_sercom.c baudrate update interface. 3. Add RT-Thread standard STDIO implementation on Microchip SAM MCU. * add CAN driver & example and script fix Add CAN driver and example for SAMC21/SAME5x/SAME70 and fix rtconfig.py issue(unused space might result link error) * Add Chinese version README Add Chinese version README for SAMC21/E54/E70
This commit is contained in:
648
bsp/microchip/same70/.config
Normal file
648
bsp/microchip/same70/.config
Normal file
@@ -0,0 +1,648 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# RT-Thread Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# RT-Thread Kernel
|
||||
#
|
||||
CONFIG_RT_NAME_MAX=8
|
||||
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
|
||||
# CONFIG_RT_USING_SMP is not set
|
||||
CONFIG_RT_ALIGN_SIZE=4
|
||||
# CONFIG_RT_THREAD_PRIORITY_8 is not set
|
||||
CONFIG_RT_THREAD_PRIORITY_32=y
|
||||
# CONFIG_RT_THREAD_PRIORITY_256 is not set
|
||||
CONFIG_RT_THREAD_PRIORITY_MAX=32
|
||||
CONFIG_RT_TICK_PER_SECOND=1000
|
||||
CONFIG_RT_USING_OVERFLOW_CHECK=y
|
||||
CONFIG_RT_USING_HOOK=y
|
||||
CONFIG_RT_HOOK_USING_FUNC_PTR=y
|
||||
CONFIG_RT_USING_IDLE_HOOK=y
|
||||
CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
|
||||
CONFIG_IDLE_THREAD_STACK_SIZE=256
|
||||
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||
|
||||
#
|
||||
# kservice optimization
|
||||
#
|
||||
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
|
||||
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
|
||||
# CONFIG_RT_USING_TINY_FFS is not set
|
||||
# CONFIG_RT_PRINTF_LONGLONG is not set
|
||||
CONFIG_RT_DEBUG=y
|
||||
# CONFIG_RT_DEBUG_COLOR is not set
|
||||
# CONFIG_RT_DEBUG_INIT_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_THREAD_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_IPC_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_TIMER_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_IRQ_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_MEM_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_SLAB_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_MEMHEAP_CONFIG is not set
|
||||
# CONFIG_RT_DEBUG_MODULE_CONFIG is not set
|
||||
|
||||
#
|
||||
# Inter-Thread communication
|
||||
#
|
||||
CONFIG_RT_USING_SEMAPHORE=y
|
||||
CONFIG_RT_USING_MUTEX=y
|
||||
CONFIG_RT_USING_EVENT=y
|
||||
CONFIG_RT_USING_MAILBOX=y
|
||||
CONFIG_RT_USING_MESSAGEQUEUE=y
|
||||
# CONFIG_RT_USING_SIGNALS is not set
|
||||
|
||||
#
|
||||
# Memory Management
|
||||
#
|
||||
CONFIG_RT_USING_MEMPOOL=y
|
||||
CONFIG_RT_USING_SMALL_MEM=y
|
||||
# CONFIG_RT_USING_SLAB is not set
|
||||
# CONFIG_RT_USING_MEMHEAP is not set
|
||||
CONFIG_RT_USING_SMALL_MEM_AS_HEAP=y
|
||||
# CONFIG_RT_USING_MEMHEAP_AS_HEAP is not set
|
||||
# CONFIG_RT_USING_SLAB_AS_HEAP is not set
|
||||
# CONFIG_RT_USING_USERHEAP is not set
|
||||
# CONFIG_RT_USING_NOHEAP is not set
|
||||
# CONFIG_RT_USING_MEMTRACE is not set
|
||||
# CONFIG_RT_USING_HEAP_ISR is not set
|
||||
CONFIG_RT_USING_HEAP=y
|
||||
|
||||
#
|
||||
# Kernel Device Object
|
||||
#
|
||||
CONFIG_RT_USING_DEVICE=y
|
||||
# CONFIG_RT_USING_DEVICE_OPS is not set
|
||||
# CONFIG_RT_USING_INTERRUPT_INFO is not set
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart0"
|
||||
CONFIG_RT_VER_NUM=0x40100
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_RT_USING_CPU_FFS=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M7=y
|
||||
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
|
||||
|
||||
#
|
||||
# RT-Thread Components
|
||||
#
|
||||
CONFIG_RT_USING_COMPONENTS_INIT=y
|
||||
CONFIG_RT_USING_USER_MAIN=y
|
||||
CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048
|
||||
CONFIG_RT_MAIN_THREAD_PRIORITY=10
|
||||
# CONFIG_RT_USING_LEGACY is not set
|
||||
# CONFIG_RT_USING_MSH is not set
|
||||
# CONFIG_RT_USING_DFS is not set
|
||||
# CONFIG_RT_USING_FAL is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
CONFIG_RT_USING_DEVICE_IPC=y
|
||||
# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
|
||||
CONFIG_RT_USING_SERIAL=y
|
||||
CONFIG_RT_USING_SERIAL_V1=y
|
||||
# CONFIG_RT_USING_SERIAL_V2 is not set
|
||||
CONFIG_RT_SERIAL_USING_DMA=y
|
||||
CONFIG_RT_SERIAL_RB_BUFSZ=64
|
||||
# CONFIG_RT_USING_CAN is not set
|
||||
# CONFIG_RT_USING_HWTIMER is not set
|
||||
# CONFIG_RT_USING_CPUTIME is not set
|
||||
# CONFIG_RT_USING_I2C is not set
|
||||
# CONFIG_RT_USING_PHY is not set
|
||||
CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_ADC is not set
|
||||
# CONFIG_RT_USING_DAC is not set
|
||||
# CONFIG_RT_USING_PWM is not set
|
||||
# CONFIG_RT_USING_MTD_NOR is not set
|
||||
# CONFIG_RT_USING_MTD_NAND is not set
|
||||
# CONFIG_RT_USING_PM is not set
|
||||
# CONFIG_RT_USING_RTC is not set
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI is not set
|
||||
# CONFIG_RT_USING_WDT is not set
|
||||
# CONFIG_RT_USING_AUDIO is not set
|
||||
# CONFIG_RT_USING_SENSOR is not set
|
||||
# CONFIG_RT_USING_TOUCH is not set
|
||||
# CONFIG_RT_USING_HWCRYPTO is not set
|
||||
# CONFIG_RT_USING_PULSE_ENCODER is not set
|
||||
# CONFIG_RT_USING_INPUT_CAPTURE is not set
|
||||
# CONFIG_RT_USING_WIFI is not set
|
||||
|
||||
#
|
||||
# Using USB
|
||||
#
|
||||
# CONFIG_RT_USING_USB is not set
|
||||
# CONFIG_RT_USING_USB_HOST is not set
|
||||
# CONFIG_RT_USING_USB_DEVICE is not set
|
||||
|
||||
#
|
||||
# C/C++ and POSIX layer
|
||||
#
|
||||
CONFIG_RT_LIBC_DEFAULT_TIMEZONE=8
|
||||
|
||||
#
|
||||
# POSIX (Portable Operating System Interface) layer
|
||||
#
|
||||
# CONFIG_RT_USING_POSIX_FS is not set
|
||||
# CONFIG_RT_USING_POSIX_DELAY is not set
|
||||
# CONFIG_RT_USING_POSIX_CLOCK is not set
|
||||
# CONFIG_RT_USING_POSIX_TIMER is not set
|
||||
# CONFIG_RT_USING_PTHREADS is not set
|
||||
# CONFIG_RT_USING_MODULE is not set
|
||||
|
||||
#
|
||||
# Interprocess Communication (IPC)
|
||||
#
|
||||
# CONFIG_RT_USING_POSIX_PIPE is not set
|
||||
# CONFIG_RT_USING_POSIX_MESSAGE_QUEUE is not set
|
||||
# CONFIG_RT_USING_POSIX_MESSAGE_SEMAPHORE is not set
|
||||
|
||||
#
|
||||
# Socket is in the 'Network' category
|
||||
#
|
||||
# CONFIG_RT_USING_CPLUSPLUS is not set
|
||||
|
||||
#
|
||||
# Network
|
||||
#
|
||||
# CONFIG_RT_USING_SAL is not set
|
||||
# CONFIG_RT_USING_NETDEV is not set
|
||||
# CONFIG_RT_USING_LWIP is not set
|
||||
# CONFIG_RT_USING_AT is not set
|
||||
|
||||
#
|
||||
# Utilities
|
||||
#
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
# CONFIG_RT_USING_VAR_EXPORT is not set
|
||||
# CONFIG_RT_USING_RT_LINK is not set
|
||||
# CONFIG_RT_USING_VBUS is not set
|
||||
|
||||
#
|
||||
# RT-Thread Utestcases
|
||||
#
|
||||
# CONFIG_RT_USING_UTESTCASES is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
#
|
||||
|
||||
#
|
||||
# IoT - internet of things
|
||||
#
|
||||
# CONFIG_PKG_USING_LWIP is not set
|
||||
# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
|
||||
# CONFIG_PKG_USING_PAHOMQTT is not set
|
||||
# CONFIG_PKG_USING_UMQTT is not set
|
||||
# CONFIG_PKG_USING_WEBCLIENT is not set
|
||||
# CONFIG_PKG_USING_WEBNET is not set
|
||||
# CONFIG_PKG_USING_MONGOOSE is not set
|
||||
# CONFIG_PKG_USING_MYMQTT is not set
|
||||
# CONFIG_PKG_USING_KAWAII_MQTT is not set
|
||||
# CONFIG_PKG_USING_BC28_MQTT is not set
|
||||
# CONFIG_PKG_USING_WEBTERMINAL is not set
|
||||
# CONFIG_PKG_USING_LIBMODBUS is not set
|
||||
# CONFIG_PKG_USING_FREEMODBUS is not set
|
||||
# CONFIG_PKG_USING_NANOPB is not set
|
||||
|
||||
#
|
||||
# Wi-Fi
|
||||
#
|
||||
|
||||
#
|
||||
# Marvell WiFi
|
||||
#
|
||||
# CONFIG_PKG_USING_WLANMARVELL is not set
|
||||
|
||||
#
|
||||
# Wiced WiFi
|
||||
#
|
||||
# CONFIG_PKG_USING_WLAN_WICED is not set
|
||||
# CONFIG_PKG_USING_RW007 is not set
|
||||
# CONFIG_PKG_USING_COAP is not set
|
||||
# CONFIG_PKG_USING_NOPOLL is not set
|
||||
# CONFIG_PKG_USING_NETUTILS is not set
|
||||
# CONFIG_PKG_USING_CMUX is not set
|
||||
# CONFIG_PKG_USING_PPP_DEVICE is not set
|
||||
# CONFIG_PKG_USING_AT_DEVICE is not set
|
||||
# CONFIG_PKG_USING_ATSRV_SOCKET is not set
|
||||
# CONFIG_PKG_USING_WIZNET is not set
|
||||
# CONFIG_PKG_USING_ZB_COORDINATOR is not set
|
||||
|
||||
#
|
||||
# IoT Cloud
|
||||
#
|
||||
# CONFIG_PKG_USING_ONENET is not set
|
||||
# CONFIG_PKG_USING_GAGENT_CLOUD is not set
|
||||
# CONFIG_PKG_USING_ALI_IOTKIT is not set
|
||||
# CONFIG_PKG_USING_AZURE is not set
|
||||
# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set
|
||||
# CONFIG_PKG_USING_JIOT-C-SDK is not set
|
||||
# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
|
||||
# CONFIG_PKG_USING_JOYLINK is not set
|
||||
# CONFIG_PKG_USING_EZ_IOT_OS is not set
|
||||
# CONFIG_PKG_USING_NIMBLE is not set
|
||||
# CONFIG_PKG_USING_LLSYNC_SDK_ADAPTER is not set
|
||||
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
|
||||
# CONFIG_PKG_USING_IPMSG is not set
|
||||
# CONFIG_PKG_USING_LSSDP is not set
|
||||
# CONFIG_PKG_USING_AIRKISS_OPEN is not set
|
||||
# CONFIG_PKG_USING_LIBRWS is not set
|
||||
# CONFIG_PKG_USING_TCPSERVER is not set
|
||||
# CONFIG_PKG_USING_PROTOBUF_C is not set
|
||||
# CONFIG_PKG_USING_DLT645 is not set
|
||||
# CONFIG_PKG_USING_QXWZ is not set
|
||||
# CONFIG_PKG_USING_SMTP_CLIENT is not set
|
||||
# CONFIG_PKG_USING_ABUP_FOTA is not set
|
||||
# CONFIG_PKG_USING_LIBCURL2RTT is not set
|
||||
# CONFIG_PKG_USING_CAPNP is not set
|
||||
# CONFIG_PKG_USING_AGILE_TELNET is not set
|
||||
# CONFIG_PKG_USING_NMEALIB is not set
|
||||
# CONFIG_PKG_USING_PDULIB is not set
|
||||
# CONFIG_PKG_USING_BTSTACK is not set
|
||||
# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
|
||||
# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
|
||||
# CONFIG_PKG_USING_MAVLINK is not set
|
||||
# CONFIG_PKG_USING_BSAL is not set
|
||||
# CONFIG_PKG_USING_AGILE_MODBUS is not set
|
||||
# CONFIG_PKG_USING_AGILE_FTP is not set
|
||||
# CONFIG_PKG_USING_EMBEDDEDPROTO is not set
|
||||
# CONFIG_PKG_USING_RT_LINK_HW is not set
|
||||
# CONFIG_PKG_USING_LORA_PKT_FWD is not set
|
||||
# CONFIG_PKG_USING_LORA_GW_DRIVER_LIB is not set
|
||||
# CONFIG_PKG_USING_LORA_PKT_SNIFFER is not set
|
||||
# CONFIG_PKG_USING_HM is not set
|
||||
# CONFIG_PKG_USING_SMALL_MODBUS is not set
|
||||
# CONFIG_PKG_USING_NET_SERVER is not set
|
||||
|
||||
#
|
||||
# security packages
|
||||
#
|
||||
# CONFIG_PKG_USING_MBEDTLS is not set
|
||||
# CONFIG_PKG_USING_LIBSODIUM is not set
|
||||
# CONFIG_PKG_USING_TINYCRYPT is not set
|
||||
# CONFIG_PKG_USING_TFM is not set
|
||||
# CONFIG_PKG_USING_YD_CRYPTO is not set
|
||||
|
||||
#
|
||||
# language packages
|
||||
#
|
||||
|
||||
#
|
||||
# JSON: JavaScript Object Notation, a lightweight data-interchange format
|
||||
#
|
||||
# CONFIG_PKG_USING_CJSON is not set
|
||||
# CONFIG_PKG_USING_LJSON is not set
|
||||
# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
|
||||
# CONFIG_PKG_USING_RAPIDJSON is not set
|
||||
# CONFIG_PKG_USING_JSMN is not set
|
||||
# CONFIG_PKG_USING_AGILE_JSMN is not set
|
||||
|
||||
#
|
||||
# XML: Extensible Markup Language
|
||||
#
|
||||
# CONFIG_PKG_USING_SIMPLE_XML is not set
|
||||
# CONFIG_PKG_USING_EZXML is not set
|
||||
# CONFIG_PKG_USING_LUATOS_SOC is not set
|
||||
# CONFIG_PKG_USING_LUA is not set
|
||||
# CONFIG_PKG_USING_JERRYSCRIPT is not set
|
||||
# CONFIG_PKG_USING_MICROPYTHON is not set
|
||||
# CONFIG_PKG_USING_PIKASCRIPT is not set
|
||||
|
||||
#
|
||||
# multimedia packages
|
||||
#
|
||||
|
||||
#
|
||||
# LVGL: powerful and easy-to-use embedded GUI library
|
||||
#
|
||||
# CONFIG_PKG_USING_LVGL is not set
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_LV_MUSIC_DEMO is not set
|
||||
|
||||
#
|
||||
# u8g2: a monochrome graphic library
|
||||
#
|
||||
# CONFIG_PKG_USING_U8G2_OFFICIAL is not set
|
||||
# CONFIG_PKG_USING_U8G2 is not set
|
||||
# CONFIG_PKG_USING_OPENMV is not set
|
||||
# CONFIG_PKG_USING_MUPDF is not set
|
||||
# CONFIG_PKG_USING_STEMWIN is not set
|
||||
# CONFIG_PKG_USING_WAVPLAYER is not set
|
||||
# CONFIG_PKG_USING_TJPGD is not set
|
||||
# CONFIG_PKG_USING_PDFGEN is not set
|
||||
# CONFIG_PKG_USING_HELIX is not set
|
||||
# CONFIG_PKG_USING_AZUREGUIX is not set
|
||||
# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
|
||||
# CONFIG_PKG_USING_NUEMWIN is not set
|
||||
# CONFIG_PKG_USING_MP3PLAYER is not set
|
||||
# CONFIG_PKG_USING_TINYJPEG is not set
|
||||
# CONFIG_PKG_USING_UGUI is not set
|
||||
|
||||
#
|
||||
# PainterEngine: A cross-platform graphics application framework written in C language
|
||||
#
|
||||
# CONFIG_PKG_USING_PAINTERENGINE is not set
|
||||
# CONFIG_PKG_USING_PAINTERENGINE_AUX is not set
|
||||
# CONFIG_PKG_USING_MCURSES is not set
|
||||
# CONFIG_PKG_USING_TERMBOX is not set
|
||||
# CONFIG_PKG_USING_VT100 is not set
|
||||
# CONFIG_PKG_USING_QRCODE is not set
|
||||
# CONFIG_PKG_USING_GUIENGINE is not set
|
||||
# CONFIG_PKG_USING_PERSIMMON is not set
|
||||
|
||||
#
|
||||
# tools packages
|
||||
#
|
||||
# CONFIG_PKG_USING_CMBACKTRACE is not set
|
||||
# CONFIG_PKG_USING_EASYFLASH is not set
|
||||
# CONFIG_PKG_USING_EASYLOGGER is not set
|
||||
# CONFIG_PKG_USING_SYSTEMVIEW is not set
|
||||
# CONFIG_PKG_USING_SEGGER_RTT is not set
|
||||
# CONFIG_PKG_USING_RDB is not set
|
||||
# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
|
||||
# CONFIG_PKG_USING_ULOG_FILE is not set
|
||||
# CONFIG_PKG_USING_LOGMGR is not set
|
||||
# CONFIG_PKG_USING_ADBD is not set
|
||||
# CONFIG_PKG_USING_COREMARK is not set
|
||||
# CONFIG_PKG_USING_DHRYSTONE is not set
|
||||
# CONFIG_PKG_USING_MEMORYPERF is not set
|
||||
# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
|
||||
# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
|
||||
# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
|
||||
# CONFIG_PKG_USING_BS8116A is not set
|
||||
# CONFIG_PKG_USING_GPS_RMC is not set
|
||||
# CONFIG_PKG_USING_URLENCODE is not set
|
||||
# CONFIG_PKG_USING_UMCN is not set
|
||||
# CONFIG_PKG_USING_LWRB2RTT is not set
|
||||
# CONFIG_PKG_USING_CPU_USAGE is not set
|
||||
# CONFIG_PKG_USING_GBK2UTF8 is not set
|
||||
# CONFIG_PKG_USING_VCONSOLE is not set
|
||||
# CONFIG_PKG_USING_KDB is not set
|
||||
# CONFIG_PKG_USING_WAMR is not set
|
||||
# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
|
||||
# CONFIG_PKG_USING_LWLOG is not set
|
||||
# CONFIG_PKG_USING_ANV_TRACE is not set
|
||||
# CONFIG_PKG_USING_ANV_MEMLEAK is not set
|
||||
# CONFIG_PKG_USING_ANV_TESTSUIT is not set
|
||||
# CONFIG_PKG_USING_ANV_BENCH is not set
|
||||
# CONFIG_PKG_USING_DEVMEM is not set
|
||||
# CONFIG_PKG_USING_REGEX is not set
|
||||
# CONFIG_PKG_USING_MEM_SANDBOX is not set
|
||||
# CONFIG_PKG_USING_SOLAR_TERMS is not set
|
||||
# CONFIG_PKG_USING_GAN_ZHI is not set
|
||||
# CONFIG_PKG_USING_FDT is not set
|
||||
# CONFIG_PKG_USING_CBOX is not set
|
||||
# CONFIG_PKG_USING_SNOWFLAKE is not set
|
||||
|
||||
#
|
||||
# system packages
|
||||
#
|
||||
|
||||
#
|
||||
# enhanced kernel services
|
||||
#
|
||||
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
|
||||
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
|
||||
# CONFIG_PKG_USING_RT_VSNPRINTF_FULL is not set
|
||||
|
||||
#
|
||||
# POSIX extension functions
|
||||
#
|
||||
# CONFIG_PKG_USING_POSIX_GETLINE is not set
|
||||
# CONFIG_PKG_USING_POSIX_WCWIDTH is not set
|
||||
# CONFIG_PKG_USING_POSIX_ITOA is not set
|
||||
# CONFIG_PKG_USING_POSIX_STRINGS is not set
|
||||
|
||||
#
|
||||
# acceleration: Assembly language or algorithmic acceleration packages
|
||||
#
|
||||
# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
|
||||
# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
|
||||
# CONFIG_PKG_USING_QFPLIB_M3 is not set
|
||||
|
||||
#
|
||||
# CMSIS: ARM Cortex-M Microcontroller Software Interface Standard
|
||||
#
|
||||
# CONFIG_PKG_USING_CMSIS_5 is not set
|
||||
# CONFIG_PKG_USING_CMSIS_RTOS2 is not set
|
||||
|
||||
#
|
||||
# Micrium: Micrium software products porting for RT-Thread
|
||||
#
|
||||
# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
|
||||
# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
|
||||
# CONFIG_PKG_USING_UC_CRC is not set
|
||||
# CONFIG_PKG_USING_UC_CLK is not set
|
||||
# CONFIG_PKG_USING_UC_COMMON is not set
|
||||
# CONFIG_PKG_USING_UC_MODBUS is not set
|
||||
# CONFIG_PKG_USING_RTDUINO is not set
|
||||
# CONFIG_PKG_USING_CAIRO is not set
|
||||
# CONFIG_PKG_USING_PIXMAN is not set
|
||||
# CONFIG_PKG_USING_PARTITION is not set
|
||||
# CONFIG_PKG_USING_FLASHDB is not set
|
||||
# CONFIG_PKG_USING_SQLITE is not set
|
||||
# CONFIG_PKG_USING_RTI is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
# CONFIG_PKG_USING_DFS_JFFS2 is not set
|
||||
# CONFIG_PKG_USING_DFS_UFFS is not set
|
||||
# CONFIG_PKG_USING_LWEXT4 is not set
|
||||
# CONFIG_PKG_USING_THREAD_POOL is not set
|
||||
# CONFIG_PKG_USING_ROBOTS is not set
|
||||
# CONFIG_PKG_USING_EV is not set
|
||||
# CONFIG_PKG_USING_SYSWATCH is not set
|
||||
# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
|
||||
# CONFIG_PKG_USING_PLCCORE is not set
|
||||
# CONFIG_PKG_USING_RAMDISK is not set
|
||||
# CONFIG_PKG_USING_MININI is not set
|
||||
# CONFIG_PKG_USING_QBOOT is not set
|
||||
# CONFIG_PKG_USING_PPOOL is not set
|
||||
# CONFIG_PKG_USING_OPENAMP is not set
|
||||
# CONFIG_PKG_USING_LPM is not set
|
||||
# CONFIG_PKG_USING_TLSF is not set
|
||||
# CONFIG_PKG_USING_EVENT_RECORDER is not set
|
||||
# CONFIG_PKG_USING_ARM_2D is not set
|
||||
# CONFIG_PKG_USING_MCUBOOT is not set
|
||||
# CONFIG_PKG_USING_TINYUSB is not set
|
||||
# CONFIG_PKG_USING_CHERRYUSB is not set
|
||||
# CONFIG_PKG_USING_KMULTI_RTIMER is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
#
|
||||
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
|
||||
# CONFIG_PKG_USING_REALTEK_AMEBA is not set
|
||||
# CONFIG_PKG_USING_SHT2X is not set
|
||||
# CONFIG_PKG_USING_SHT3X is not set
|
||||
# CONFIG_PKG_USING_AS7341 is not set
|
||||
# CONFIG_PKG_USING_STM32_SDIO is not set
|
||||
# CONFIG_PKG_USING_ICM20608 is not set
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_SX12XX is not set
|
||||
# CONFIG_PKG_USING_SIGNAL_LED is not set
|
||||
# CONFIG_PKG_USING_LEDBLINK is not set
|
||||
# CONFIG_PKG_USING_LITTLED is not set
|
||||
# CONFIG_PKG_USING_LKDGUI is not set
|
||||
# CONFIG_PKG_USING_NRF5X_SDK is not set
|
||||
# CONFIG_PKG_USING_NRFX is not set
|
||||
# CONFIG_PKG_USING_WM_LIBRARIES is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
# CONFIG_PKG_USING_INFRARED is not set
|
||||
# CONFIG_PKG_USING_MULTI_INFRARED is not set
|
||||
# CONFIG_PKG_USING_AGILE_BUTTON is not set
|
||||
# CONFIG_PKG_USING_AGILE_LED is not set
|
||||
# CONFIG_PKG_USING_AT24CXX is not set
|
||||
# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
|
||||
# CONFIG_PKG_USING_AD7746 is not set
|
||||
# CONFIG_PKG_USING_PCA9685 is not set
|
||||
# CONFIG_PKG_USING_I2C_TOOLS is not set
|
||||
# CONFIG_PKG_USING_NRF24L01 is not set
|
||||
# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
|
||||
# CONFIG_PKG_USING_MAX17048 is not set
|
||||
# CONFIG_PKG_USING_RPLIDAR is not set
|
||||
# CONFIG_PKG_USING_AS608 is not set
|
||||
# CONFIG_PKG_USING_RC522 is not set
|
||||
# CONFIG_PKG_USING_WS2812B is not set
|
||||
# CONFIG_PKG_USING_EMBARC_BSP is not set
|
||||
# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set
|
||||
# CONFIG_PKG_USING_MULTI_RTIMER is not set
|
||||
# CONFIG_PKG_USING_MAX7219 is not set
|
||||
# CONFIG_PKG_USING_BEEP is not set
|
||||
# CONFIG_PKG_USING_EASYBLINK is not set
|
||||
# CONFIG_PKG_USING_PMS_SERIES is not set
|
||||
# CONFIG_PKG_USING_CAN_YMODEM is not set
|
||||
# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set
|
||||
# CONFIG_PKG_USING_QLED is not set
|
||||
# CONFIG_PKG_USING_PAJ7620 is not set
|
||||
# CONFIG_PKG_USING_AGILE_CONSOLE is not set
|
||||
# CONFIG_PKG_USING_LD3320 is not set
|
||||
# CONFIG_PKG_USING_WK2124 is not set
|
||||
# CONFIG_PKG_USING_LY68L6400 is not set
|
||||
# CONFIG_PKG_USING_DM9051 is not set
|
||||
# CONFIG_PKG_USING_SSD1306 is not set
|
||||
# CONFIG_PKG_USING_QKEY is not set
|
||||
# CONFIG_PKG_USING_RS485 is not set
|
||||
# CONFIG_PKG_USING_RS232 is not set
|
||||
# CONFIG_PKG_USING_NES is not set
|
||||
# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
|
||||
# CONFIG_PKG_USING_VDEVICE is not set
|
||||
# CONFIG_PKG_USING_SGM706 is not set
|
||||
# CONFIG_PKG_USING_STM32WB55_SDK is not set
|
||||
# CONFIG_PKG_USING_RDA58XX is not set
|
||||
# CONFIG_PKG_USING_LIBNFC is not set
|
||||
# CONFIG_PKG_USING_MFOC is not set
|
||||
# CONFIG_PKG_USING_TMC51XX is not set
|
||||
# CONFIG_PKG_USING_TCA9534 is not set
|
||||
# CONFIG_PKG_USING_KOBUKI is not set
|
||||
# CONFIG_PKG_USING_ROSSERIAL is not set
|
||||
# CONFIG_PKG_USING_MICRO_ROS is not set
|
||||
# CONFIG_PKG_USING_MCP23008 is not set
|
||||
# CONFIG_PKG_USING_BLUETRUM_SDK is not set
|
||||
# CONFIG_PKG_USING_MISAKA_AT24CXX is not set
|
||||
# CONFIG_PKG_USING_MISAKA_RGB_BLING is not set
|
||||
# CONFIG_PKG_USING_LORA_MODEM_DRIVER is not set
|
||||
# CONFIG_PKG_USING_BL_MCU_SDK is not set
|
||||
# CONFIG_PKG_USING_SOFT_SERIAL is not set
|
||||
# CONFIG_PKG_USING_MB85RS16 is not set
|
||||
# CONFIG_PKG_USING_CW2015 is not set
|
||||
# CONFIG_PKG_USING_RFM300 is not set
|
||||
|
||||
#
|
||||
# AI packages
|
||||
#
|
||||
# CONFIG_PKG_USING_LIBANN is not set
|
||||
# CONFIG_PKG_USING_NNOM is not set
|
||||
# CONFIG_PKG_USING_ONNX_BACKEND is not set
|
||||
# CONFIG_PKG_USING_ONNX_PARSER is not set
|
||||
# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
|
||||
# CONFIG_PKG_USING_ELAPACK is not set
|
||||
# CONFIG_PKG_USING_ULAPACK is not set
|
||||
# CONFIG_PKG_USING_QUEST is not set
|
||||
# CONFIG_PKG_USING_NAXOS is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
#
|
||||
|
||||
#
|
||||
# project laboratory
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
# CONFIG_PKG_USING_KERNEL_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# entertainment: terminal games and other interesting software packages
|
||||
#
|
||||
# CONFIG_PKG_USING_CMATRIX is not set
|
||||
# CONFIG_PKG_USING_SL is not set
|
||||
# CONFIG_PKG_USING_CAL is not set
|
||||
# CONFIG_PKG_USING_ACLOCK is not set
|
||||
# CONFIG_PKG_USING_THREES is not set
|
||||
# CONFIG_PKG_USING_2048 is not set
|
||||
# CONFIG_PKG_USING_SNAKE is not set
|
||||
# CONFIG_PKG_USING_TETRIS is not set
|
||||
# CONFIG_PKG_USING_DONUT is not set
|
||||
# CONFIG_PKG_USING_COWSAY is not set
|
||||
# CONFIG_PKG_USING_LIBCSV is not set
|
||||
# CONFIG_PKG_USING_OPTPARSE is not set
|
||||
# CONFIG_PKG_USING_FASTLZ is not set
|
||||
# CONFIG_PKG_USING_MINILZO is not set
|
||||
# CONFIG_PKG_USING_QUICKLZ is not set
|
||||
# CONFIG_PKG_USING_LZMA is not set
|
||||
# CONFIG_PKG_USING_MULTIBUTTON is not set
|
||||
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
|
||||
# CONFIG_PKG_USING_CANFESTIVAL is not set
|
||||
# CONFIG_PKG_USING_ZLIB is not set
|
||||
# CONFIG_PKG_USING_MINIZIP is not set
|
||||
# CONFIG_PKG_USING_HEATSHRINK is not set
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
|
||||
# CONFIG_PKG_USING_DIGITALCTRL is not set
|
||||
# CONFIG_PKG_USING_UPACKER is not set
|
||||
# CONFIG_PKG_USING_UPARAM is not set
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
# CONFIG_PKG_USING_VI is not set
|
||||
# CONFIG_PKG_USING_KI is not set
|
||||
# CONFIG_PKG_USING_ARMv7M_DWT is not set
|
||||
# CONFIG_PKG_USING_UKAL is not set
|
||||
# CONFIG_PKG_USING_CRCLIB is not set
|
||||
# CONFIG_PKG_USING_LWGPS is not set
|
||||
# CONFIG_PKG_USING_STATE_MACHINE is not set
|
||||
# CONFIG_PKG_USING_DESIGN_PATTERN is not set
|
||||
# CONFIG_PKG_USING_CONTROLLER is not set
|
||||
# CONFIG_PKG_USING_PHASE_LOCKED_LOOP is not set
|
||||
# CONFIG_PKG_USING_MFBD is not set
|
||||
|
||||
#
|
||||
# Hardware Drivers Config
|
||||
#
|
||||
CONFIG_SOC_SAME70Q21=y
|
||||
# CONFIG_SOC_SAME70N21 is not set
|
||||
# CONFIG_SOC_SAME70J21 is not set
|
||||
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
CONFIG_SAME70_CAN0=y
|
||||
CONFIG_SAME70_ADC0=y
|
||||
|
||||
#
|
||||
# Application Demo Config
|
||||
#
|
||||
CONFIG_SAM_CAN_EXAMPLE=y
|
||||
CONFIG_SOC_SAME70=y
|
||||
6
bsp/microchip/same70/.ignore_format.yml
Normal file
6
bsp/microchip/same70/.ignore_format.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
# files format check exclude path, please follow the instructions below to modify;
|
||||
# If you need to exclude an entire folder, add the folder path in dir_path;
|
||||
# If you need to exclude a file, add the path to the file in file_path.
|
||||
|
||||
dir_path:
|
||||
- bsp
|
||||
31
bsp/microchip/same70/Kconfig
Normal file
31
bsp/microchip/same70/Kconfig
Normal file
@@ -0,0 +1,31 @@
|
||||
mainmenu "RT-Thread Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config RTT_DIR
|
||||
string
|
||||
option env="RTT_ROOT"
|
||||
default "../../.."
|
||||
|
||||
# you can change the RTT_ROOT default: "rt-thread"
|
||||
|
||||
config PKGS_DIR
|
||||
string
|
||||
option env="PKGS_ROOT"
|
||||
default "packages"
|
||||
|
||||
source "$RTT_DIR/Kconfig"
|
||||
source "$PKGS_DIR/Kconfig"
|
||||
source "board/Kconfig"
|
||||
|
||||
config SOC_SAME70
|
||||
bool
|
||||
select ARCH_ARM
|
||||
select ARCH_ARM_CORTEX_M
|
||||
select ARCH_ARM_CORTEX_M7
|
||||
select RT_USING_COMPONENTS_INIT
|
||||
select RT_USING_USER_MAIN
|
||||
default y
|
||||
69
bsp/microchip/same70/README.md
Normal file
69
bsp/microchip/same70/README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# SAME70Q21B BSP Introduction
|
||||
|
||||
[中文](README_zh.md)
|
||||
- MCU: ATSAME70Q21B @300MHz, 2MB FLASH, 384KB RAM
|
||||
- V71: Auto grade Cortex-M7 + Advanced Feature Set + Ethernet + 2x CAN-FD
|
||||
- E70: Industrial Cortex-M7 + Advanced Feature Set + Ethernet + 2x CAN-FD
|
||||
- S70: Industrial Cortex-M7 + Advanced Feature Set
|
||||
- Pin: J=64 pins, N=100 pins, Q=144 pins
|
||||
- Flash: 19=512KB, 20=1024KB, 21=2048KB (size=2^n)
|
||||
- Datasheet: <https://www.microchip.com/en-us/product/ATSAME70Q21>
|
||||
|
||||
#### KEY FEATURES
|
||||
|
||||
#### Core
|
||||
- 32-bit Arm® Cortex®-M7 core with double-precision FPU and L1 cache: 16 Kbytes of data and 16 Kbytes of instruction cache; frequency up to 300 MHz, MPU, 2.14 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
|
||||
|
||||
#### Memories
|
||||
- Up to 2 Mbytes of embedded Flash with unique identifier and user signature for user-defined data
|
||||
- Up to 384 Kbyte embedded Multi-port SRAM, can be configured as ITCM, DTCM.
|
||||
- 16 Kbytes ROM with embedded Bootloader routines (UART0, USB) and IAP routines
|
||||
|
||||
#### Peripherals
|
||||
- 16-bit Static Memory Controller (SMC) with support for SRAM, PSRAM, LCD module, NOR and NAND Flash with on-the-fly scrambling
|
||||
- 16-bit SDRAM Controller (SDRAMC) interfacing up to 128 MB and with on-the-fly scrambling
|
||||
- One Ethernet MAC (GMAC) 10/100 Mbps in MII mode and RMII with dedicated DMA. IEEE® 1588 PTP frames and 802.3az Energy-efficiency support.
|
||||
- USB 2.0 Device/Mini Host High-speed (USBHS) at 480 Mbps, 4-Kbyte FIFO, up to 10 bidirectional endpoints, dedicated DMA
|
||||
- 12-bit ITU-R BT. 601/656 Image Sensor Interface (ISI)
|
||||
- Two master Controller Area Networks (MCAN) with Flexible Data Rate (CAN-FD) with SRAM-based mailboxes, time-triggered and event-triggered transmission
|
||||
- MediaLB® device with 3-wire mode, up to 1024 x Fs speed, supporting MOST25 and MOST50 networks
|
||||
- Three USARTs, USART0, USART1, USART2, support LIN mode, ISO7816, IrDA®, RS-485, SPI, Manchester and Modem modes; USART1 supports LON mode.
|
||||
- Five 2-wire UARTs with SleepWalking™ support
|
||||
- Three Two-Wire Interfaces (TWIHS) (I2C-compatible) with SleepWalking support
|
||||
- Quad I/O Serial Peripheral Interface (QSPI) interfacing up to 256 MB Flash and with eXecute-In-Place and onthe-fly scrambling
|
||||
- Two Serial Peripheral Interfaces (SPI)
|
||||
- One Serial Synchronous Controller (SSC) with I2S and TDM support
|
||||
- Two Inter-IC Sound Controllers (I2SC)
|
||||
- One High-speed Multimedia Card Interface (HSMCI) (SDIO/SD Card/e.MMC)
|
||||
- Four Three-Channel 16-bit Timer/Counters (TC) with Capture, Waveform, Compare and PWM modes, constant on time. Quadrature decoder logic and 2-bit Gray Up/Down Counter for stepper motor
|
||||
- Two 4-channel 16-bit PWMs with complementary outputs, Dead Time Generator and eight fault inputs per PWM for motor control, two external triggers to manage power factor correction (PFC), DC-DC and lighting control
|
||||
- Two Analog Front-End Controllers (AFEC), each supporting up to 12 channels with differential input mode and programmable gain stage, allowing dual sample-and-hold (S&H) at up to 1.7 Msps. Offset and gain error correction feature.
|
||||
- One 2-channel, 12-bit, 1 Msps-per-channel Digital-to-Analog Controller (DAC) with Differential and Over Sampling modes
|
||||
- One Analog Comparator Controller (ACC) with flexible input selection, selectable input hysteresis
|
||||
|
||||
#### Cryptography
|
||||
- True Random Number Generator (TRNG)
|
||||
- AES: 256-bit, 192-bit, 128-bit Key Algorithm, Compliant with FIPS PUB-197 Specifications
|
||||
- Integrity Check Monitor (ICM). Supports Secure Hash Algorithm SHA1, SHA224 and SHA256.
|
||||
|
||||
#### I/O
|
||||
- Up to 114 I/O lines with external interrupt capability (edge- or level-sensitivity), debouncing, glitch filtering and On-die Series Resistor Termination
|
||||
- Five Parallel Input/Output Controllers (PIO)
|
||||
|
||||
#### Voltage
|
||||
- Single supply voltage from 3.0V to 3.6V for Qualification AEC - Q100 Grade 2 Devices
|
||||
- Single Supply voltage from 1.7V to 3.6V for Industrial Temperature Devices
|
||||
|
||||
#### Packages
|
||||
- LQFP144, 144-lead LQFP, 20x20 mm, pitch 0.5 mm
|
||||
- LFBGA144, 144-ball LFBGA, 10x10 mm, pitch 0.8 mm
|
||||
- TFBGA144, 144-ball TFBGA, 10x10 mm, pitch 0.8 mm
|
||||
- UFBGA144, 144-ball UFBGA, 6x6 mm, pitch 0.4 mm
|
||||
- LQFP100, 100-lead LQFP, 14x14 mm, pitch 0.5 mm
|
||||
- TFBGA100, 100-ball TFBGA, 9x9 mm, pitch 0.8 mm
|
||||
- VFBGA100, 100-ball VFBGA, 7x7 mm, pitch 0.65 mm
|
||||
- LQFP64, 64-lead LQFP, 10x10 mm, pitch 0.5 mm
|
||||
- QFN64, 64-pad QFN 9x9 mm, pitch 0.5 mm with wettable flanks
|
||||
|
||||
#### Board info
|
||||
- [SAM E70 XPLAINED](https://www.microchip.com/en-us/development-tool/ATSAME70-XPLD)
|
||||
69
bsp/microchip/same70/README_zh.md
Normal file
69
bsp/microchip/same70/README_zh.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# SAME70Q21B BSP 介绍
|
||||
|
||||
[English](README.md)
|
||||
- MCU: ATSAME70Q21B @300MHz, 2MB FLASH, 384KB RAM
|
||||
- V71: 汽车级产品 AEC-Q100 Cortex-M7内核 + 100M以太网 + 2路CAN-FD + 丰富外设
|
||||
- E70: 工业级产品 -40~105C Cortex-M7内核 + 100M以太网 + 2路CAN-FD + 丰富外设
|
||||
- S70: 工业级产品 -40~105C Cortex-M7内核 + 丰富外设
|
||||
- 管脚: J系列-64 pins, N系列-100 pins, Q系列-144 pins
|
||||
- Flash: 尾缀19=512KB, 20=1024KB, 21=2048KB (flash容量=2^n)
|
||||
- 手册: <https://www.microchip.com/en-us/product/ATSAME70Q21>
|
||||
|
||||
#### 关键特性
|
||||
|
||||
#### 内核
|
||||
- 32-bit Arm® Cortex®-M7 core + 双精度FPU + L1 cache: 16 Kbytes 数据DCache and 16 Kbytes 指令 Icache; 主频高达300 MHz, MPU, 2.14 DMIPS/MHz (Dhrystone 2.1), 支持 DSP指令集
|
||||
|
||||
#### 内存
|
||||
- 最大提供2MB 内嵌Flash,芯片内嵌独一无二的UID信息
|
||||
- 最大提供384KB 内嵌多端口SRAM, 可以将其配置为ITCM, DTCM.
|
||||
- 内部集成16 Kbytes ROM,用于板载Bootloader(UART0, USB)和IAP应用.
|
||||
|
||||
#### 外设
|
||||
- 16-bit Static Memory Controller (SMC) with support for SRAM, PSRAM, LCD module, NOR and NAND Flash with on-the-fly scrambling
|
||||
- 16-bit SDRAM Controller (SDRAMC) interfacing up to 128 MB and with on-the-fly scrambling
|
||||
- One Ethernet MAC (GMAC) 10/100 Mbps in MII mode and RMII with dedicated DMA. IEEE® 1588 PTP frames and 802.3az Energy-efficiency support.
|
||||
- USB 2.0 Device/Mini Host High-speed (USBHS) at 480 Mbps, 4-Kbyte FIFO, up to 10 bidirectional endpoints, dedicated DMA
|
||||
- 12-bit ITU-R BT. 601/656 Image Sensor Interface (ISI)
|
||||
- Two master Controller Area Networks (MCAN) with Flexible Data Rate (CAN-FD) with SRAM-based mailboxes, time-triggered and event-triggered transmission
|
||||
- MediaLB® device with 3-wire mode, up to 1024 x Fs speed, supporting MOST25 and MOST50 networks
|
||||
- Three USARTs, USART0, USART1, USART2, support LIN mode, ISO7816, IrDA®, RS-485, SPI, Manchester and Modem modes; USART1 supports LON mode.
|
||||
- Five 2-wire UARTs with SleepWalking™ support
|
||||
- Three Two-Wire Interfaces (TWIHS) (I2C-compatible) with SleepWalking support
|
||||
- Quad I/O Serial Peripheral Interface (QSPI) interfacing up to 256 MB Flash and with eXecute-In-Place and onthe-fly scrambling
|
||||
- Two Serial Peripheral Interfaces (SPI)
|
||||
- One Serial Synchronous Controller (SSC) with I2S and TDM support
|
||||
- Two Inter-IC Sound Controllers (I2SC)
|
||||
- One High-speed Multimedia Card Interface (HSMCI) (SDIO/SD Card/e.MMC)
|
||||
- Four Three-Channel 16-bit Timer/Counters (TC) with Capture, Waveform, Compare and PWM modes, constant on time. Quadrature decoder logic and 2-bit Gray Up/Down Counter for stepper motor
|
||||
- Two 4-channel 16-bit PWMs with complementary outputs, Dead Time Generator and eight fault inputs per PWM for motor control, two external triggers to manage power factor correction (PFC), DC-DC and lighting control
|
||||
- Two Analog Front-End Controllers (AFEC), each supporting up to 12 channels with differential input mode and programmable gain stage, allowing dual sample-and-hold (S&H) at up to 1.7 Msps. Offset and gain error correction feature.
|
||||
- One 2-channel, 12-bit, 1 Msps-per-channel Digital-to-Analog Controller (DAC) with Differential and Over Sampling modes
|
||||
- One Analog Comparator Controller (ACC) with flexible input selection, selectable input hysteresis
|
||||
|
||||
#### 加密模块
|
||||
- True Random Number Generator (TRNG)
|
||||
- AES: 256-bit, 192-bit, 128-bit Key Algorithm, Compliant with FIPS PUB-197 Specifications
|
||||
- Integrity Check Monitor (ICM). Supports Secure Hash Algorithm SHA1, SHA224 and SHA256.
|
||||
|
||||
#### I/O接口
|
||||
- Up to 114 I/O lines with external interrupt capability (edge- or level-sensitivity), debouncing, glitch filtering and On-die Series Resistor Termination
|
||||
- Five Parallel Input/Output Controllers (PIO)
|
||||
|
||||
#### 工作电压
|
||||
- Single supply voltage from 3.0V to 3.6V for Qualification AEC - Q100 Grade 2 Devices
|
||||
- Single Supply voltage from 1.7V to 3.6V for Industrial Temperature Devices
|
||||
|
||||
#### 封装
|
||||
- LQFP144, 144-lead LQFP, 20x20 mm, pitch 0.5 mm
|
||||
- LFBGA144, 144-ball LFBGA, 10x10 mm, pitch 0.8 mm
|
||||
- TFBGA144, 144-ball TFBGA, 10x10 mm, pitch 0.8 mm
|
||||
- UFBGA144, 144-ball UFBGA, 6x6 mm, pitch 0.4 mm
|
||||
- LQFP100, 100-lead LQFP, 14x14 mm, pitch 0.5 mm
|
||||
- TFBGA100, 100-ball TFBGA, 9x9 mm, pitch 0.8 mm
|
||||
- VFBGA100, 100-ball VFBGA, 7x7 mm, pitch 0.65 mm
|
||||
- LQFP64, 64-lead LQFP, 10x10 mm, pitch 0.5 mm
|
||||
- QFN64, 64-pad QFN 9x9 mm, pitch 0.5 mm with wettable flanks
|
||||
|
||||
#### 官方开发板信息
|
||||
- [SAM E70 XPLAINED](https://www.microchip.com/en-us/development-tool/ATSAME70-XPLD)
|
||||
14
bsp/microchip/same70/SConscript
Normal file
14
bsp/microchip/same70/SConscript
Normal file
@@ -0,0 +1,14 @@
|
||||
# for module compiling
|
||||
import os
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
||||
41
bsp/microchip/same70/SConstruct
Normal file
41
bsp/microchip/same70/SConstruct
Normal file
@@ -0,0 +1,41 @@
|
||||
import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
try:
|
||||
from building import *
|
||||
except:
|
||||
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
|
||||
print(RTT_ROOT)
|
||||
exit(-1)
|
||||
|
||||
TARGET = 'rt-thread-' + rtconfig.DEVICE_PART + '.' + rtconfig.TARGET_EXT
|
||||
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
if rtconfig.PLATFORM == 'iar':
|
||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(ARFLAGS = [''])
|
||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread-'+ rtconfig.DEVICE_PART + '.map')
|
||||
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
||||
10
bsp/microchip/same70/applications/SConscript
Normal file
10
bsp/microchip/same70/applications/SConscript
Normal file
@@ -0,0 +1,10 @@
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, str(Dir('#'))]
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
333
bsp/microchip/same70/applications/can_demo.c
Normal file
333
bsp/microchip/same70/applications/can_demo.c
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include <finsh.h>
|
||||
#include <shell.h>
|
||||
#endif
|
||||
|
||||
#include "atmel_start.h"
|
||||
#include "driver_init.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "can_demo.h"
|
||||
|
||||
#ifdef SAM_CAN_EXAMPLE
|
||||
|
||||
static volatile enum can_async_interrupt_type can_errors;
|
||||
static rt_sem_t can_txdone;
|
||||
static rt_sem_t can_rxdone;
|
||||
static rt_uint8_t can_stack[ 512 ];
|
||||
static struct rt_thread can_thread;
|
||||
|
||||
/**
|
||||
* @brief Callback function and should be invoked after call can_async_write.
|
||||
*
|
||||
* @note
|
||||
*
|
||||
* @param descr is CAN device description.
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
|
||||
static void can_tx_callback(struct can_async_descriptor *const descr)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
rt_interrupt_enter();
|
||||
result = rt_sem_release(can_txdone);
|
||||
if (RT_EOK != result)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("rt_sem_release failed in %s %d\r\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
}
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback function and should be invoked after remote device send.
|
||||
*
|
||||
* @note This callback function will be called in CAN interrupt function
|
||||
*
|
||||
* @param descr is CAN device description.
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
|
||||
static void can_rx_callback(struct can_async_descriptor *const descr)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
rt_interrupt_enter();
|
||||
result = rt_sem_release(can_rxdone);
|
||||
if (RT_EOK != result)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("rt_sem_release failed in %s %d\r\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
}
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback function and should be invoked after CAN device IRQ handler detects errors happened.
|
||||
*
|
||||
* @note This callback function will be called in CAN interrupt function
|
||||
*
|
||||
* @param descr is CAN device description.
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
|
||||
static void can_err_callback(struct can_async_descriptor *const descr,
|
||||
enum can_async_interrupt_type type)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
if (type == CAN_IRQ_EW)
|
||||
{
|
||||
/* Error warning, Error counter has reached the error warning limit of 96,
|
||||
* An error count value greater than about 96 indicates a heavily disturbed
|
||||
* bus. It may be of advantage to provide means to test for this condition.
|
||||
*/
|
||||
}
|
||||
else if (type == CAN_IRQ_EA)
|
||||
{
|
||||
/* Error Active State, The CAN node normally take part in bus communication
|
||||
* and sends an ACTIVE ERROR FLAG when an error has been detected.
|
||||
*/
|
||||
}
|
||||
else if (type == CAN_IRQ_EP)
|
||||
{
|
||||
/* Error Passive State, The Can node goes into error passive state if at least
|
||||
* one of its error counters is greater than 127. It still takes part in bus
|
||||
* activities, but it sends a passive error frame only, on errors.
|
||||
*/
|
||||
}
|
||||
else if (type == CAN_IRQ_BO)
|
||||
{
|
||||
/* Bus Off State, The CAN node is 'bus off' when the TRANSMIT ERROR COUNT is
|
||||
* greater than or equal to 256.
|
||||
*/
|
||||
|
||||
/* Suspend CAN task and re-initialize CAN module. */
|
||||
can_errors = type;
|
||||
rt_interrupt_enter();
|
||||
result = rt_sem_release(can_rxdone);
|
||||
if (RT_EOK != result)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("rt_sem_release failed in %s %d\r\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
}
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
else if (type == CAN_IRQ_DO)
|
||||
{
|
||||
/* Data Overrun in receive queue. A message was lost because the messages in
|
||||
* the queue was not reading and releasing fast enough. There is not enough
|
||||
* space for a new message in receive queue.
|
||||
*/
|
||||
|
||||
/* Suggest to delete CAN task and re-initialize it. */
|
||||
can_errors = type;
|
||||
rt_interrupt_enter();
|
||||
result = rt_sem_release(can_rxdone);
|
||||
if (RT_EOK != result)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("rt_sem_release failed in %s %d\r\n",__FUNCTION__, __LINE__);
|
||||
#endif
|
||||
}
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize CAN module before task run.
|
||||
*
|
||||
* @note This function will set CAN Tx/Rx callback function and filters.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
|
||||
static inline void can_demo_init(void)
|
||||
{
|
||||
struct can_filter filter;
|
||||
|
||||
/**
|
||||
* CAN_Node0_tx_callback callback should be invoked after call
|
||||
* can_async_write, and remote device should receive message with ID=0x45A
|
||||
*/
|
||||
can_async_register_callback(&CAN_0, CAN_ASYNC_TX_CB, (FUNC_PTR)can_tx_callback);
|
||||
|
||||
/**
|
||||
* CAN_0_rx_callback callback should be invoked after call
|
||||
* can_async_set_filter and remote device send CAN Message with the same
|
||||
* content as the filter.
|
||||
*/
|
||||
can_async_register_callback(&CAN_0, CAN_ASYNC_RX_CB, (FUNC_PTR)can_rx_callback);
|
||||
|
||||
|
||||
/* Should set at least one CAN standard & message filter before enable it. */
|
||||
|
||||
filter.id = 0x469;
|
||||
filter.mask = 0;
|
||||
can_async_set_filter(&CAN_0, 0, CAN_FMT_STDID, &filter);
|
||||
|
||||
/* If set second standard message filter, should increase filter index
|
||||
* and filter algorithm
|
||||
* For example: index should set to 1, otherwise it will replace filter 0.
|
||||
* can_async_set_filter(&CAN_0, 1, CAN_FMT_STDID, &filter); */
|
||||
|
||||
filter.id = 0x10000096;
|
||||
filter.mask = 0;
|
||||
can_async_set_filter(&CAN_0, 0, CAN_FMT_EXTID, &filter);
|
||||
|
||||
can_async_enable(&CAN_0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CAN task.
|
||||
*
|
||||
* @note This task will waiting for CAN RX semaphore and then process input.
|
||||
*
|
||||
* @param parameter - task input parameter.
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
|
||||
static void can_thread_entry(void* parameter)
|
||||
{
|
||||
int32_t ret;
|
||||
rt_err_t result;
|
||||
uint8_t data[64];
|
||||
uint32_t count=0;
|
||||
struct can_message msg;
|
||||
|
||||
while (1)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("can task run count : %d\r\n",count);
|
||||
#endif
|
||||
count++;
|
||||
|
||||
result = rt_sem_take(can_rxdone, RT_WAITING_FOREVER);
|
||||
if (RT_EOK != result)
|
||||
continue;
|
||||
|
||||
do
|
||||
{
|
||||
/* Process the incoming packet. */
|
||||
ret = can_async_read(&CAN_0, &msg);
|
||||
if (ret == ERR_NONE)
|
||||
{
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("CAN RX Message is % frame\r\n",
|
||||
msg.type == CAN_TYPE_DATA ? "data" : "remote");
|
||||
rt_kprintf("CAN RX Message is % frame\r\n",
|
||||
msg.type == CAN_FMT_STDID ? "Standard" : "Extended");
|
||||
rt_kprintf("can RX Message ID: 0x%X length: %d\r\n", msg.id, msg.len);
|
||||
rt_kprintf("CAN RX Message content: ");
|
||||
for (uint8_t i = 0; i < msg.len; i++)
|
||||
rt_kprintf("0x%02X ", data[i]);
|
||||
rt_kprintf("\r\n");
|
||||
#endif
|
||||
}
|
||||
} while (ret == ERR_NONE); /* Get all data stored in CAN RX FIFO */
|
||||
|
||||
/* CAN task got CAN error message, handler CAN Error Status */
|
||||
if ((can_errors == CAN_IRQ_BO) || (can_errors == CAN_IRQ_DO))
|
||||
{
|
||||
can_async_init(&CAN_0, MCAN1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call this function will to send a CAN message.
|
||||
*
|
||||
* @note
|
||||
*
|
||||
* @param msg - message to be sent, timeouts - wait timeouts for Tx completion.
|
||||
*
|
||||
* @return RT_OK or RT_ERROR.
|
||||
*/
|
||||
|
||||
rt_err_t can_send_message(struct can_message *msg, rt_uint32_t timeouts)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
if (RT_NULL == msg)
|
||||
{
|
||||
rt_kprintf("can_send_message input message error\r\n");
|
||||
return RT_ERROR;
|
||||
}
|
||||
|
||||
can_async_write(&CAN_0, msg);
|
||||
result = rt_sem_take(can_rxdone, timeouts);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Call this function will create a CAN task.
|
||||
*
|
||||
* @note Should create Tx/Rx semaphore before run task.
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return RT_OK or -RT_ERROR.
|
||||
*/
|
||||
|
||||
rt_err_t can_demo_run(void)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
can_rxdone = rt_sem_create("can_rx", 0, RT_IPC_FLAG_FIFO);
|
||||
if (RT_NULL == can_rxdone)
|
||||
{
|
||||
rt_kprintf("can_rx semaphore create failed\r\n");
|
||||
return (-RT_ERROR);
|
||||
}
|
||||
|
||||
can_txdone = rt_sem_create("can_tx", 0, RT_IPC_FLAG_FIFO);
|
||||
if (RT_NULL == can_txdone)
|
||||
{
|
||||
rt_kprintf("can_tx semaphore create failed\r\n");
|
||||
return (-RT_ERROR);
|
||||
}
|
||||
|
||||
can_demo_init();
|
||||
|
||||
/* initialize CAN thread */
|
||||
result = rt_thread_init(&can_thread,
|
||||
"can",
|
||||
can_thread_entry,
|
||||
RT_NULL,
|
||||
(rt_uint8_t*)&can_stack[0],
|
||||
sizeof(can_stack),
|
||||
RT_THREAD_PRIORITY_MAX/3,
|
||||
5);
|
||||
if (result == RT_EOK)
|
||||
{
|
||||
rt_thread_startup(&can_thread);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*@}*/
|
||||
24
bsp/microchip/same70/applications/can_demo.h
Normal file
24
bsp/microchip/same70/applications/can_demo.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c)
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#ifndef __APPLICATION_CAN_H_
|
||||
#define __APPLICATION_CAN_H_
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/**
|
||||
* @brief External function definitions
|
||||
*
|
||||
*/
|
||||
rt_err_t can_demo_run(void);
|
||||
|
||||
rt_err_t can_send_message(struct can_message *msg, rt_uint32_t timeouts);
|
||||
|
||||
#endif // __APPLICATION_CAN_H_
|
||||
69
bsp/microchip/same70/applications/main.c
Normal file
69
bsp/microchip/same70/applications/main.c
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include <finsh.h>
|
||||
#include <shell.h>
|
||||
#endif
|
||||
|
||||
#include "atmel_start.h"
|
||||
#include <hal_gpio.h>
|
||||
|
||||
#ifdef SAM_CAN_EXAMPLE
|
||||
#include "can_demo.h"
|
||||
#endif
|
||||
|
||||
static rt_uint8_t led_stack[ 512 ];
|
||||
static struct rt_thread led_thread;
|
||||
|
||||
static void led_thread_entry(void* parameter)
|
||||
{
|
||||
unsigned int count=0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* toggle led */
|
||||
#ifndef RT_USING_FINSH
|
||||
rt_kprintf("led toggle, count : %d\r\n",count);
|
||||
#endif
|
||||
count++;
|
||||
gpio_toggle_pin_level(LED0);
|
||||
rt_thread_delay( RT_TICK_PER_SECOND/2 ); /* sleep 0.5 second and switch to other thread */
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rt_err_t result;
|
||||
|
||||
/* initialize led thread */
|
||||
result = rt_thread_init(&led_thread,
|
||||
"led",
|
||||
led_thread_entry,
|
||||
RT_NULL,
|
||||
(rt_uint8_t*)&led_stack[0],
|
||||
sizeof(led_stack),
|
||||
RT_THREAD_PRIORITY_MAX/3,
|
||||
5);
|
||||
if (result == RT_EOK)
|
||||
{
|
||||
rt_thread_startup(&led_thread);
|
||||
}
|
||||
|
||||
#ifdef SAM_CAN_EXAMPLE
|
||||
can_demo_run();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
50
bsp/microchip/same70/board/Kconfig
Normal file
50
bsp/microchip/same70/board/Kconfig
Normal file
@@ -0,0 +1,50 @@
|
||||
menu "Hardware Drivers Config"
|
||||
|
||||
choice
|
||||
prompt "select chip type"
|
||||
default SOC_SAME70Q21
|
||||
|
||||
config SOC_SAME70Q21
|
||||
bool "SOC_SAME70Q21"
|
||||
help
|
||||
Refer to SAME70 DataSheet
|
||||
|
||||
config SOC_SAME70N21
|
||||
bool "SOC_SAME70N21"
|
||||
help
|
||||
Refer to SAME70 DataSheet
|
||||
|
||||
config SOC_SAME70J21
|
||||
bool "SOC_SAME70J21"
|
||||
help
|
||||
Refer to SAME70 DataSheet
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
|
||||
menu "Onboard Peripheral Drivers"
|
||||
config SAME70_CAN0
|
||||
bool "Enable CAN0"
|
||||
default false
|
||||
|
||||
config SAME70_ADC0
|
||||
bool "Enable ADC0"
|
||||
default false
|
||||
endmenu
|
||||
|
||||
menu "Application Demo Config"
|
||||
config SAM_CAN_EXAMPLE
|
||||
bool "Enable SAM CAN Example"
|
||||
depends on SAME70_CAN0
|
||||
default true
|
||||
help
|
||||
Add CAN example task to project
|
||||
|
||||
config SAM_ADC_EXAMPLE
|
||||
bool "Enable SAM ADC Example"
|
||||
depends on SAME70_ADC0
|
||||
default true
|
||||
help
|
||||
Add ADC example task to project
|
||||
|
||||
endmenu
|
||||
17
bsp/microchip/same70/board/SConscript
Normal file
17
bsp/microchip/same70/board/SConscript
Normal file
@@ -0,0 +1,17 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
#remove other no use files
|
||||
#SrcRemove(src, '*.c')
|
||||
|
||||
# You can select chips from the list above
|
||||
CPPDEFINES = ['SAME70xxx']
|
||||
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
100
bsp/microchip/same70/board/board.c
Normal file
100
bsp/microchip/same70/board/board.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c)
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <atmel_start.h>
|
||||
#include "peripheral_clk_config.h"
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "board.h"
|
||||
|
||||
#ifdef RT_USING_SERIAL
|
||||
extern int rt_hw_uart_init(void);
|
||||
#endif
|
||||
|
||||
static struct io_descriptor* g_stdio;
|
||||
|
||||
void rt_hw_console_output(const char *str)
|
||||
{
|
||||
io_write(g_stdio, (uint8_t *)str, strlen(str));
|
||||
}
|
||||
RTM_EXPORT(rt_hw_console_output);
|
||||
|
||||
static inline void hw_board_init_usart(void)
|
||||
{
|
||||
usart_sync_get_io_descriptor(&TARGET_IO, &g_stdio);
|
||||
usart_sync_enable(&TARGET_IO);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the timer interrupt service routine.
|
||||
*
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* enter interrupt */
|
||||
rt_interrupt_enter();
|
||||
|
||||
rt_tick_increase();
|
||||
|
||||
/* leave interrupt */
|
||||
rt_interrupt_leave();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will initial SAME70 board.
|
||||
*/
|
||||
void rt_hw_board_init(void)
|
||||
{
|
||||
/* Initializes MCU, drivers and middleware */
|
||||
atmel_start_init();
|
||||
|
||||
/* Disable the watchdog */
|
||||
WDT->WDT_MR = WDT_MR_WDDIS;
|
||||
|
||||
SCB_EnableICache();
|
||||
|
||||
/* enable USART stdout module */
|
||||
hw_board_init_usart();
|
||||
|
||||
/* UART driver initialization is open by default */
|
||||
#ifdef RT_USING_SERIAL
|
||||
rt_hw_uart_init();
|
||||
#endif
|
||||
|
||||
/* init systick */
|
||||
SysTick_Config(CONF_CPU_FREQUENCY / RT_TICK_PER_SECOND);
|
||||
|
||||
/* set pend exception priority */
|
||||
NVIC_SetPriority(PendSV_IRQn, (1 << __NVIC_PRIO_BITS) - 1);
|
||||
|
||||
#ifdef RT_USING_HEAP
|
||||
#if defined(__CC_ARM) || defined(__CLANG_ARM)
|
||||
rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)HEAP_END);
|
||||
#elif __ICCARM__
|
||||
rt_system_heap_init((void*)HEAP_BEGIN, (void*)HEAP_END);
|
||||
#else
|
||||
/* init memory system */
|
||||
rt_system_heap_init((void*)&__bss_end, (void*)HEAP_END);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Set the shell console output device */
|
||||
#if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
|
||||
rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_COMPONENTS_INIT
|
||||
rt_components_board_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
111
bsp/microchip/same70/board/board.h
Normal file
111
bsp/microchip/same70/board/board.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c)
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
#ifndef __BOARD_H__
|
||||
#define __BOARD_H__
|
||||
|
||||
#include "sam.h"
|
||||
|
||||
// <o> Internal SRAM memory size[Kbytes] <256-384>
|
||||
// <i>Default: 384
|
||||
#if defined(__SAME70J19B__) || defined(__ATSAME70J19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAME70J20B__) || defined(__ATSAME70J20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAME70J21B__) || defined(__ATSAME70J21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAME70N19B__) || defined(__ATSAME70N19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAME70N20B__) || defined(__ATSAME70N20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAME70N21B__) || defined(__ATSAME70N21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAME70Q19B__) || defined(__ATSAME70Q19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAME70Q20B__) || defined(__ATSAME70Q20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAME70Q21B__) || defined(__ATSAME70Q21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70J19B__) || defined(__ATSAMS70J19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMS70J20B__) || defined(__ATSAMS70J20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70J21B__) || defined(__ATSAMS70J21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70N19B__) || defined(__ATSAMS70N19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMS70N20B__) || defined(__ATSAMS70N20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70N21B__) || defined(__ATSAMS70N21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70Q19B__) || defined(__ATSAMS70Q19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMS70Q20B__) || defined(__ATSAMS70Q20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMS70Q21B__) || defined(__ATSAMS70Q21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70J19B__) || defined(__ATSAMV70J19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV70J20B__) || defined(__ATSAMV70J20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70J21B__) || defined(__ATSAMV70J21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70N19B__) || defined(__ATSAMV70N19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV70N20B__) || defined(__ATSAMV70N20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70N21B__) || defined(__ATSAMV70N21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70Q19B__) || defined(__ATSAMV70Q19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV70Q20B__) || defined(__ATSAMV70Q20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV70Q21B__) || defined(__ATSAMV70Q21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71J19B__) || defined(__ATSAMV71J19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV71J20B__) || defined(__ATSAMV71J20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71J21B__) || defined(__ATSAMV71J21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71N19B__) || defined(__ATSAMV71N19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV71N20B__) || defined(__ATSAMV71N20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71N21B__) || defined(__ATSAMV71N21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71Q19B__) || defined(__ATSAMV71Q19B__)
|
||||
#define SAME70_SRAM_SIZE 256
|
||||
#elif defined(__SAMV71Q20B__) || defined(__ATSAMV71Q20B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#elif defined(__SAMV71Q21B__) || defined(__ATSAMV71Q21B__)
|
||||
#define SAME70_SRAM_SIZE 384
|
||||
#else
|
||||
#error Board does not support the specified device
|
||||
#endif
|
||||
|
||||
#define SAME70_SRAM_END (0x20400000 + SAME70_SRAM_SIZE * 1024)
|
||||
|
||||
#if defined(__CC_ARM) || defined(__CLANG_ARM)
|
||||
extern int Image$$RW_IRAM1$$ZI$$Limit;
|
||||
#define HEAP_BEGIN (&Image$$RW_IRAM1$$ZI$$Limit)
|
||||
#elif __ICCARM__
|
||||
#pragma section="HEAP"
|
||||
#define HEAP_BEGIN (__segment_begin("HEAP"))
|
||||
#define HEAP_END (__segment_end("HEAP"))
|
||||
#else
|
||||
extern int __bss_end;
|
||||
#define HEAP_BEGIN (&__bss_end)
|
||||
#define HEAP_END SAME70_SRAM_END
|
||||
#endif
|
||||
|
||||
void rt_hw_board_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
199
bsp/microchip/same70/board/serial.c
Normal file
199
bsp/microchip/same70/board/serial.c
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright (c)
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
#include <atmel_start.h>
|
||||
|
||||
/* SAM MCU serial device */
|
||||
static struct rt_serial_device sam_serial;
|
||||
|
||||
/**
|
||||
* @brief Configure serial port
|
||||
*
|
||||
* This function will configure UART baudrate, parity and so on.
|
||||
*
|
||||
* @return RT_EOK.
|
||||
*/
|
||||
static rt_err_t serial_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
|
||||
{
|
||||
struct usart_sync_descriptor* desc;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
|
||||
desc = (struct usart_sync_descriptor *)serial->parent.user_data;
|
||||
|
||||
RT_ASSERT(desc != RT_NULL);
|
||||
RT_ASSERT(cfg != RT_NULL);
|
||||
|
||||
usart_sync_disable(desc);
|
||||
|
||||
/* Set baudrate */
|
||||
usart_sync_set_baud_rate(desc, (const uint32_t)cfg->baud_rate);
|
||||
|
||||
/* Set stop bit */
|
||||
if (cfg->stop_bits == STOP_BITS_1)
|
||||
usart_sync_set_stopbits(desc, USART_STOP_BITS_ONE);
|
||||
else if (cfg->stop_bits == STOP_BITS_2)
|
||||
usart_sync_set_stopbits(desc, USART_STOP_BITS_TWO);
|
||||
|
||||
if (cfg->bit_order == BIT_ORDER_LSB)
|
||||
usart_sync_set_data_order(desc, USART_DATA_ORDER_LSB);
|
||||
else if (cfg->bit_order == BIT_ORDER_MSB)
|
||||
usart_sync_set_data_order(desc, USART_DATA_ORDER_MSB);
|
||||
|
||||
/* Set character size */
|
||||
switch (cfg->data_bits)
|
||||
{
|
||||
case DATA_BITS_5:
|
||||
usart_sync_set_character_size(desc, USART_CHARACTER_SIZE_5BITS);
|
||||
break;
|
||||
case DATA_BITS_6:
|
||||
usart_sync_set_character_size(desc, USART_CHARACTER_SIZE_6BITS);
|
||||
break;
|
||||
case DATA_BITS_7:
|
||||
usart_sync_set_character_size(desc, USART_CHARACTER_SIZE_7BITS);
|
||||
break;
|
||||
case DATA_BITS_8:
|
||||
usart_sync_set_character_size(desc, USART_CHARACTER_SIZE_8BITS);
|
||||
break;
|
||||
case DATA_BITS_9:
|
||||
usart_sync_set_character_size(desc, USART_CHARACTER_SIZE_9BITS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (cfg->parity == PARITY_NONE)
|
||||
usart_sync_set_parity(desc, USART_PARITY_NONE);
|
||||
else if (cfg->parity == PARITY_ODD)
|
||||
usart_sync_set_parity(desc, USART_PARITY_ODD);
|
||||
else if (cfg->parity == PARITY_EVEN)
|
||||
usart_sync_set_parity(desc, USART_PARITY_EVEN);
|
||||
|
||||
usart_sync_enable(desc);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Control serial port
|
||||
*
|
||||
* This function provide UART enable/disable control.
|
||||
*
|
||||
* @return RT_EOK.
|
||||
*/
|
||||
static rt_err_t serial_control(struct rt_serial_device *serial, int cmd, void *arg)
|
||||
{
|
||||
struct usart_sync_descriptor* desc;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
desc = (struct usart_sync_descriptor *)serial->parent.user_data;
|
||||
|
||||
RT_ASSERT(desc != RT_NULL);
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
/* disable interrupt */
|
||||
case RT_DEVICE_CTRL_CLR_INT:
|
||||
usart_sync_disable(desc);
|
||||
break;
|
||||
/* enable interrupt */
|
||||
case RT_DEVICE_CTRL_SET_INT:
|
||||
usart_sync_enable(desc);
|
||||
break;
|
||||
/* UART config */
|
||||
case RT_DEVICE_CTRL_CONFIG :
|
||||
break;
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Serial sends a char
|
||||
*
|
||||
* This function will send a char to the UART
|
||||
*
|
||||
* @return 1.
|
||||
*/
|
||||
static int serial_putc(struct rt_serial_device *serial, char c)
|
||||
{
|
||||
struct usart_sync_descriptor* desc;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
desc = (struct usart_sync_descriptor *)serial->parent.user_data;
|
||||
|
||||
RT_ASSERT(desc != RT_NULL);
|
||||
|
||||
io_write(&desc->io, (const uint8_t *)&c, 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Serial gets a char
|
||||
*
|
||||
* This function will get a char from the UART
|
||||
*
|
||||
* @return received char character or -1 if no char received.
|
||||
*/
|
||||
static int serial_getc(struct rt_serial_device *serial)
|
||||
{
|
||||
char c;
|
||||
int ch;
|
||||
struct usart_sync_descriptor* desc;
|
||||
|
||||
RT_ASSERT(serial != RT_NULL);
|
||||
desc = (struct usart_sync_descriptor *)serial->parent.user_data;
|
||||
|
||||
RT_ASSERT(desc != RT_NULL);
|
||||
|
||||
ch = -1;
|
||||
if (usart_sync_is_rx_not_empty(desc))
|
||||
{
|
||||
io_read(&desc->io, (uint8_t *)&c, 1);;
|
||||
ch = c & 0xff;
|
||||
}
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
static const struct rt_uart_ops sam_serial_ops =
|
||||
{
|
||||
serial_configure,
|
||||
serial_control,
|
||||
serial_putc,
|
||||
serial_getc,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Initialize the UART
|
||||
*
|
||||
* This function initialize the UART
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
int rt_hw_uart_init(void)
|
||||
{
|
||||
struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
|
||||
|
||||
sam_serial.ops = &sam_serial_ops;
|
||||
sam_serial.config = config;
|
||||
sam_serial.serial_rx = RT_NULL;
|
||||
sam_serial.serial_rx = RT_NULL;
|
||||
rt_hw_serial_register(&sam_serial, "uart0",
|
||||
RT_DEVICE_FLAG_RDWR, (void *)&TARGET_IO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
22
bsp/microchip/same70/board/serial.h
Normal file
22
bsp/microchip/same70/board/serial.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c)
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Email Notes
|
||||
* 2019-07-16 Kevin.Liu kevin.liu.mchp@gmail.com First Release
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_SERIAL_H_
|
||||
#define __BOARD_SERIAL_H_
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
/**
|
||||
* @brief External function definitions
|
||||
*
|
||||
*/
|
||||
int rt_hw_uart_init(void);
|
||||
|
||||
#endif // __BOARD_SERIAL_H_
|
||||
6
bsp/microchip/same70/bsp/AtmelStart.env_conf
Normal file
6
bsp/microchip/same70/bsp/AtmelStart.env_conf
Normal file
@@ -0,0 +1,6 @@
|
||||
<environment>
|
||||
<configurations/>
|
||||
<device-packs>
|
||||
<device-pack device="ATSAME70Q21B" name="SAME70_DFP" vendor="Atmel" version="2.4.166"/>
|
||||
</device-packs>
|
||||
</environment>
|
||||
179
bsp/microchip/same70/bsp/AtmelStart.gpdsc
Normal file
179
bsp/microchip/same70/bsp/AtmelStart.gpdsc
Normal file
@@ -0,0 +1,179 @@
|
||||
<package xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" xs:noNamespaceSchemaLocation="PACK.xsd">
|
||||
<vendor>Atmel</vendor>
|
||||
<name>SAME70 LED switcher</name>
|
||||
<description>Project generated by Atmel Start</description>
|
||||
<url>http://start.atmel.com/</url>
|
||||
<releases>
|
||||
<release version="1.0.1">Initial version</release>
|
||||
</releases>
|
||||
<taxonomy>
|
||||
<description Cclass="AtmelStart" generator="AtmelStart">Configuration Files generated by Atmel Start</description>
|
||||
</taxonomy>
|
||||
<generators>
|
||||
<generator id="AtmelStart">
|
||||
<description>Atmel Start</description>
|
||||
<select Dname="ATSAME70Q21B" Dvendor="Atmel:3"/>
|
||||
<command>http://start.atmel.com/</command>
|
||||
<files>
|
||||
<file category="generator" name="atmel_start_config.atstart"/>
|
||||
<file attr="template" category="other" name="AtmelStart.env_conf" select="Environment configuration"/>
|
||||
</files>
|
||||
</generator>
|
||||
</generators>
|
||||
<conditions>
|
||||
<condition id="CMSIS Device Startup">
|
||||
<description>Dependency on CMSIS core and Device Startup components</description>
|
||||
<require Cclass="CMSIS" Cgroup="CORE" Cversion="5.1.2"/>
|
||||
<require Cclass="Device" Cgroup="Startup" Cversion="2.4.0"/>
|
||||
</condition>
|
||||
<condition id="ARMCC, GCC, IAR">
|
||||
<require Dname="ATSAME70Q21B"/>
|
||||
<accept Tcompiler="ARMCC"/>
|
||||
<accept Tcompiler="GCC"/>
|
||||
<accept Tcompiler="IAR"/>
|
||||
</condition>
|
||||
<condition id="GCC">
|
||||
<require Dname="ATSAME70Q21B"/>
|
||||
<accept Tcompiler="GCC"/>
|
||||
</condition>
|
||||
</conditions>
|
||||
<components generator="AtmelStart">
|
||||
<component Cclass="AtmelStart" Cgroup="Framework" Cversion="1.0.0" condition="CMSIS Device Startup">
|
||||
<description>Atmel Start Framework</description>
|
||||
<RTE_Components_h>#define ATMEL_START</RTE_Components_h>
|
||||
<files>
|
||||
<file category="doc" condition="ARMCC, GCC, IAR" name="hal/documentation/can_async.rst"/>
|
||||
<file category="doc" condition="ARMCC, GCC, IAR" name="hal/documentation/usart_sync.rst"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_atomic.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_can_async.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_delay.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_gpio.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_init.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_io.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_sleep.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_can.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_can_async.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_core.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_delay.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_dma.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_ext_irq.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_gpio.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_init.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_irq.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_sleep.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_time_measure.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_atomic.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_can_async.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_delay.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_gpio.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_init.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_io.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_sleep.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/compiler.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/err_codes.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/events.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_assert.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_event.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_increment_macro.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_list.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_repeat_macro.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/utils_ringbuffer.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_assert.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_event.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_list.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/utils/src/utils_ringbuffer.c"/>
|
||||
<file category="source" condition="GCC" name="hal/utils/src/utils_syscalls.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_acc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_aes_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_afec_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_chipid_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_dacc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_efc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_gmac_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_gpbr_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_hsmci_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_i2sc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_icm_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_isi_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_lockbit_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_matrix_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_mcan_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pio_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pmc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_pwm_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_qspi_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rstc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rswdt_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rtc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_rtt_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_sdramc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_smc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_spi_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_ssc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_supc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_tc_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_trng_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_twihs_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_uart_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_usart_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_usbhs_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_utmi_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_wdt_e70b.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hri/hri_xdmac_e70b.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="led_switcher_main.c"/>
|
||||
<file category="doc" condition="ARMCC, GCC, IAR" name="documentation/led_switcher.rst"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="driver_init.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="driver_init.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="atmel_start_pins.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="examples/driver_examples.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="examples/driver_examples.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hal_usart_sync.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_missing_features.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_reset.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart_async.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart_dma.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/include/hpl_usart_sync.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hal/src/hal_usart_sync.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hal/utils/include/parts.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_core_m7_base.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_core_port.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/core/hpl_init.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/mcan/hpl_mcan.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/mcan/hpl_mcan.h"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/pio/hpl_gpio_base.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/pmc/hpl_pmc.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/pmc/hpl_pmc.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/pmc/hpl_sleep.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/systick/hpl_systick_ARMv7_base.c"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/usart/hpl_usart.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="hpl/usart/hpl_usart_base.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="hpl/xdmac/hpl_xdmac.c"/>
|
||||
<file category="header" condition="ARMCC, GCC, IAR" name="atmel_start.h"/>
|
||||
<file category="source" condition="ARMCC, GCC, IAR" name="atmel_start.c"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_mcan_config.h"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_pmc_config.h"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_systick_ARMv7_config.h"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_usart_config.h"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/hpl_xdmac_config.h"/>
|
||||
<file attr="config" category="header" condition="ARMCC, GCC, IAR" name="config/peripheral_clk_config.h"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name=""/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="config"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="examples"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hal/include"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hal/utils/include"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/core"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/mcan"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/pio"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/pmc"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/systick"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/usart"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hpl/xdmac"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name="hri"/>
|
||||
<file category="include" condition="ARMCC, GCC, IAR" name=""/>
|
||||
</files>
|
||||
</component>
|
||||
</components>
|
||||
</package>
|
||||
865
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_armcc.h
Normal file
865
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_armcc.h
Normal file
@@ -0,0 +1,865 @@
|
||||
/**************************************************************************//**
|
||||
* @file cmsis_armcc.h
|
||||
* @brief CMSIS compiler ARMCC (Arm Compiler 5) header file
|
||||
* @version V5.0.4
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __CMSIS_ARMCC_H
|
||||
#define __CMSIS_ARMCC_H
|
||||
|
||||
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
|
||||
#error "Please use Arm Compiler Toolchain V4.0.677 or later!"
|
||||
#endif
|
||||
|
||||
/* CMSIS compiler control architecture macros */
|
||||
#if ((defined (__TARGET_ARCH_6_M ) && (__TARGET_ARCH_6_M == 1)) || \
|
||||
(defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M == 1)) )
|
||||
#define __ARM_ARCH_6M__ 1
|
||||
#endif
|
||||
|
||||
#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M == 1))
|
||||
#define __ARM_ARCH_7M__ 1
|
||||
#endif
|
||||
|
||||
#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))
|
||||
#define __ARM_ARCH_7EM__ 1
|
||||
#endif
|
||||
|
||||
/* __ARM_ARCH_8M_BASE__ not applicable */
|
||||
/* __ARM_ARCH_8M_MAIN__ not applicable */
|
||||
|
||||
|
||||
/* CMSIS compiler specific defines */
|
||||
#ifndef __ASM
|
||||
#define __ASM __asm
|
||||
#endif
|
||||
#ifndef __INLINE
|
||||
#define __INLINE __inline
|
||||
#endif
|
||||
#ifndef __STATIC_INLINE
|
||||
#define __STATIC_INLINE static __inline
|
||||
#endif
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE static __forceinline
|
||||
#endif
|
||||
#ifndef __NO_RETURN
|
||||
#define __NO_RETURN __declspec(noreturn)
|
||||
#endif
|
||||
#ifndef __USED
|
||||
#define __USED __attribute__((used))
|
||||
#endif
|
||||
#ifndef __WEAK
|
||||
#define __WEAK __attribute__((weak))
|
||||
#endif
|
||||
#ifndef __PACKED
|
||||
#define __PACKED __attribute__((packed))
|
||||
#endif
|
||||
#ifndef __PACKED_STRUCT
|
||||
#define __PACKED_STRUCT __packed struct
|
||||
#endif
|
||||
#ifndef __PACKED_UNION
|
||||
#define __PACKED_UNION __packed union
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||
#define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x)))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_WRITE
|
||||
#define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_READ
|
||||
#define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr)))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_WRITE
|
||||
#define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_READ
|
||||
#define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr)))
|
||||
#endif
|
||||
#ifndef __ALIGNED
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#endif
|
||||
#ifndef __RESTRICT
|
||||
#define __RESTRICT __restrict
|
||||
#endif
|
||||
|
||||
/* ########################### Core Function Access ########################### */
|
||||
/** \ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Enable IRQ Interrupts
|
||||
\details Enables IRQ interrupts by clearing the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
/* intrinsic void __enable_irq(); */
|
||||
|
||||
|
||||
/**
|
||||
\brief Disable IRQ Interrupts
|
||||
\details Disables IRQ interrupts by setting the I-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
/* intrinsic void __disable_irq(); */
|
||||
|
||||
/**
|
||||
\brief Get Control Register
|
||||
\details Returns the content of the Control Register.
|
||||
\return Control Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
return(__regControl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Control Register
|
||||
\details Writes the given value to the Control Register.
|
||||
\param [in] control Control Register value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||
{
|
||||
register uint32_t __regControl __ASM("control");
|
||||
__regControl = control;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get IPSR Register
|
||||
\details Returns the content of the IPSR Register.
|
||||
\return IPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_IPSR(void)
|
||||
{
|
||||
register uint32_t __regIPSR __ASM("ipsr");
|
||||
return(__regIPSR);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get APSR Register
|
||||
\details Returns the content of the APSR Register.
|
||||
\return APSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
register uint32_t __regAPSR __ASM("apsr");
|
||||
return(__regAPSR);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get xPSR Register
|
||||
\details Returns the content of the xPSR Register.
|
||||
\return xPSR Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_xPSR(void)
|
||||
{
|
||||
register uint32_t __regXPSR __ASM("xpsr");
|
||||
return(__regXPSR);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Process Stack Pointer
|
||||
\details Returns the current value of the Process Stack Pointer (PSP).
|
||||
\return PSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PSP(void)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
return(__regProcessStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Process Stack Pointer
|
||||
\details Assigns the given value to the Process Stack Pointer (PSP).
|
||||
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||
{
|
||||
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||
__regProcessStackPointer = topOfProcStack;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Main Stack Pointer
|
||||
\details Returns the current value of the Main Stack Pointer (MSP).
|
||||
\return MSP Register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_MSP(void)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
return(__regMainStackPointer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Main Stack Pointer
|
||||
\details Assigns the given value to the Main Stack Pointer (MSP).
|
||||
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||
{
|
||||
register uint32_t __regMainStackPointer __ASM("msp");
|
||||
__regMainStackPointer = topOfMainStack;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Priority Mask
|
||||
\details Returns the current state of the priority mask bit from the Priority Mask Register.
|
||||
\return Priority Mask value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
return(__regPriMask);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Priority Mask
|
||||
\details Assigns the given value to the Priority Mask Register.
|
||||
\param [in] priMask Priority Mask
|
||||
*/
|
||||
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||
{
|
||||
register uint32_t __regPriMask __ASM("primask");
|
||||
__regPriMask = (priMask);
|
||||
}
|
||||
|
||||
|
||||
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||
|
||||
/**
|
||||
\brief Enable FIQ
|
||||
\details Enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __enable_fault_irq __enable_fiq
|
||||
|
||||
|
||||
/**
|
||||
\brief Disable FIQ
|
||||
\details Disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||
Can only be executed in Privileged modes.
|
||||
*/
|
||||
#define __disable_fault_irq __disable_fiq
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Base Priority
|
||||
\details Returns the current value of the Base Priority register.
|
||||
\return Base Priority register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
return(__regBasePri);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Base Priority
|
||||
\details Assigns the given value to the Base Priority register.
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
|
||||
{
|
||||
register uint32_t __regBasePri __ASM("basepri");
|
||||
__regBasePri = (basePri & 0xFFU);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Base Priority with condition
|
||||
\details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
|
||||
or the new value increases the BASEPRI priority level.
|
||||
\param [in] basePri Base Priority value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
|
||||
{
|
||||
register uint32_t __regBasePriMax __ASM("basepri_max");
|
||||
__regBasePriMax = (basePri & 0xFFU);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Fault Mask
|
||||
\details Returns the current value of the Fault Mask register.
|
||||
\return Fault Mask register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
return(__regFaultMask);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Fault Mask
|
||||
\details Assigns the given value to the Fault Mask register.
|
||||
\param [in] faultMask Fault Mask value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||
{
|
||||
register uint32_t __regFaultMask __ASM("faultmask");
|
||||
__regFaultMask = (faultMask & (uint32_t)1U);
|
||||
}
|
||||
|
||||
#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||
|
||||
|
||||
/**
|
||||
\brief Get FPSCR
|
||||
\details Returns the current value of the Floating Point Status/Control register.
|
||||
\return Floating Point Status/Control register value
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||
{
|
||||
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
return(__regfpscr);
|
||||
#else
|
||||
return(0U);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set FPSCR
|
||||
\details Assigns the given value to the Floating Point Status/Control register.
|
||||
\param [in] fpscr Floating Point Status/Control value to set
|
||||
*/
|
||||
__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||
{
|
||||
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||
register uint32_t __regfpscr __ASM("fpscr");
|
||||
__regfpscr = (fpscr);
|
||||
#else
|
||||
(void)fpscr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*@} end of CMSIS_Core_RegAccFunctions */
|
||||
|
||||
|
||||
/* ########################## Core Instruction Access ######################### */
|
||||
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
|
||||
Access to dedicated instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief No Operation
|
||||
\details No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||
*/
|
||||
#define __NOP __nop
|
||||
|
||||
|
||||
/**
|
||||
\brief Wait For Interrupt
|
||||
\details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFI __wfi
|
||||
|
||||
|
||||
/**
|
||||
\brief Wait For Event
|
||||
\details Wait For Event is a hint instruction that permits the processor to enter
|
||||
a low-power state until one of a number of events occurs.
|
||||
*/
|
||||
#define __WFE __wfe
|
||||
|
||||
|
||||
/**
|
||||
\brief Send Event
|
||||
\details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||
*/
|
||||
#define __SEV __sev
|
||||
|
||||
|
||||
/**
|
||||
\brief Instruction Synchronization Barrier
|
||||
\details Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
so that all instructions following the ISB are fetched from cache or memory,
|
||||
after the instruction has been completed.
|
||||
*/
|
||||
#define __ISB() do {\
|
||||
__schedule_barrier();\
|
||||
__isb(0xF);\
|
||||
__schedule_barrier();\
|
||||
} while (0U)
|
||||
|
||||
/**
|
||||
\brief Data Synchronization Barrier
|
||||
\details Acts as a special kind of Data Memory Barrier.
|
||||
It completes when all explicit memory accesses before this instruction complete.
|
||||
*/
|
||||
#define __DSB() do {\
|
||||
__schedule_barrier();\
|
||||
__dsb(0xF);\
|
||||
__schedule_barrier();\
|
||||
} while (0U)
|
||||
|
||||
/**
|
||||
\brief Data Memory Barrier
|
||||
\details Ensures the apparent order of the explicit memory operations before
|
||||
and after the instruction, without ensuring their completion.
|
||||
*/
|
||||
#define __DMB() do {\
|
||||
__schedule_barrier();\
|
||||
__dmb(0xF);\
|
||||
__schedule_barrier();\
|
||||
} while (0U)
|
||||
|
||||
|
||||
/**
|
||||
\brief Reverse byte order (32 bit)
|
||||
\details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#define __REV __rev
|
||||
|
||||
|
||||
/**
|
||||
\brief Reverse byte order (16 bit)
|
||||
\details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#ifndef __NO_EMBEDDED_ASM
|
||||
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
|
||||
{
|
||||
rev16 r0, r0
|
||||
bx lr
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief Reverse byte order (16 bit)
|
||||
\details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#ifndef __NO_EMBEDDED_ASM
|
||||
__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value)
|
||||
{
|
||||
revsh r0, r0
|
||||
bx lr
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief Rotate Right in unsigned value (32 bit)
|
||||
\details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||
\param [in] op1 Value to rotate
|
||||
\param [in] op2 Number of Bits to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
#define __ROR __ror
|
||||
|
||||
|
||||
/**
|
||||
\brief Breakpoint
|
||||
\details Causes the processor to enter Debug state.
|
||||
Debug tools can use this to investigate system state when the instruction at a particular address is reached.
|
||||
\param [in] value is ignored by the processor.
|
||||
If required, a debugger can use it to store additional information about the breakpoint.
|
||||
*/
|
||||
#define __BKPT(value) __breakpoint(value)
|
||||
|
||||
|
||||
/**
|
||||
\brief Reverse bit order of value
|
||||
\details Reverses the bit order of the given value.
|
||||
\param [in] value Value to reverse
|
||||
\return Reversed value
|
||||
*/
|
||||
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||
#define __RBIT __rbit
|
||||
#else
|
||||
__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */
|
||||
|
||||
result = value; /* r will be reversed bits of v; first get LSB of v */
|
||||
for (value >>= 1U; value != 0U; value >>= 1U)
|
||||
{
|
||||
result <<= 1U;
|
||||
result |= value & 1U;
|
||||
s--;
|
||||
}
|
||||
result <<= s; /* shift when v's highest bits are zero */
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief Count leading zeros
|
||||
\details Counts the number of leading zeros of a data value.
|
||||
\param [in] value Value to count the leading zeros
|
||||
\return number of leading zeros in value
|
||||
*/
|
||||
#define __CLZ __clz
|
||||
|
||||
|
||||
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||
|
||||
/**
|
||||
\brief LDR Exclusive (8 bit)
|
||||
\details Executes a exclusive LDR instruction for 8 bit value.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
|
||||
#else
|
||||
#define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief LDR Exclusive (16 bit)
|
||||
\details Executes a exclusive LDR instruction for 16 bit values.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
|
||||
#else
|
||||
#define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief LDR Exclusive (32 bit)
|
||||
\details Executes a exclusive LDR instruction for 32 bit values.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
|
||||
#else
|
||||
#define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief STR Exclusive (8 bit)
|
||||
\details Executes a exclusive STR instruction for 8 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __STREXB(value, ptr) __strex(value, ptr)
|
||||
#else
|
||||
#define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief STR Exclusive (16 bit)
|
||||
\details Executes a exclusive STR instruction for 16 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __STREXH(value, ptr) __strex(value, ptr)
|
||||
#else
|
||||
#define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief STR Exclusive (32 bit)
|
||||
\details Executes a exclusive STR instruction for 32 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
\return 0 Function succeeded
|
||||
\return 1 Function failed
|
||||
*/
|
||||
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||
#define __STREXW(value, ptr) __strex(value, ptr)
|
||||
#else
|
||||
#define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief Remove the exclusive lock
|
||||
\details Removes the exclusive lock which is created by LDREX.
|
||||
*/
|
||||
#define __CLREX __clrex
|
||||
|
||||
|
||||
/**
|
||||
\brief Signed Saturate
|
||||
\details Saturates a signed value.
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __SSAT __ssat
|
||||
|
||||
|
||||
/**
|
||||
\brief Unsigned Saturate
|
||||
\details Saturates an unsigned value.
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
#define __USAT __usat
|
||||
|
||||
|
||||
/**
|
||||
\brief Rotate Right with Extend (32 bit)
|
||||
\details Moves each bit of a bitstring right by one bit.
|
||||
The carry input is shifted in at the left end of the bitstring.
|
||||
\param [in] value Value to rotate
|
||||
\return Rotated value
|
||||
*/
|
||||
#ifndef __NO_EMBEDDED_ASM
|
||||
__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
|
||||
{
|
||||
rrx r0, r0
|
||||
bx lr
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
\brief LDRT Unprivileged (8 bit)
|
||||
\details Executes a Unprivileged LDRT instruction for 8 bit value.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint8_t at (*ptr)
|
||||
*/
|
||||
#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr))
|
||||
|
||||
|
||||
/**
|
||||
\brief LDRT Unprivileged (16 bit)
|
||||
\details Executes a Unprivileged LDRT instruction for 16 bit values.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint16_t at (*ptr)
|
||||
*/
|
||||
#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr))
|
||||
|
||||
|
||||
/**
|
||||
\brief LDRT Unprivileged (32 bit)
|
||||
\details Executes a Unprivileged LDRT instruction for 32 bit values.
|
||||
\param [in] ptr Pointer to data
|
||||
\return value of type uint32_t at (*ptr)
|
||||
*/
|
||||
#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr))
|
||||
|
||||
|
||||
/**
|
||||
\brief STRT Unprivileged (8 bit)
|
||||
\details Executes a Unprivileged STRT instruction for 8 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
*/
|
||||
#define __STRBT(value, ptr) __strt(value, ptr)
|
||||
|
||||
|
||||
/**
|
||||
\brief STRT Unprivileged (16 bit)
|
||||
\details Executes a Unprivileged STRT instruction for 16 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
*/
|
||||
#define __STRHT(value, ptr) __strt(value, ptr)
|
||||
|
||||
|
||||
/**
|
||||
\brief STRT Unprivileged (32 bit)
|
||||
\details Executes a Unprivileged STRT instruction for 32 bit values.
|
||||
\param [in] value Value to store
|
||||
\param [in] ptr Pointer to location
|
||||
*/
|
||||
#define __STRT(value, ptr) __strt(value, ptr)
|
||||
|
||||
#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||
|
||||
/**
|
||||
\brief Signed Saturate
|
||||
\details Saturates a signed value.
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (1..32)
|
||||
\return Saturated value
|
||||
*/
|
||||
__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)
|
||||
{
|
||||
if ((sat >= 1U) && (sat <= 32U))
|
||||
{
|
||||
const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
|
||||
const int32_t min = -1 - max ;
|
||||
if (val > max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
else if (val < min)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Unsigned Saturate
|
||||
\details Saturates an unsigned value.
|
||||
\param [in] value Value to be saturated
|
||||
\param [in] sat Bit position to saturate to (0..31)
|
||||
\return Saturated value
|
||||
*/
|
||||
__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)
|
||||
{
|
||||
if (sat <= 31U)
|
||||
{
|
||||
const uint32_t max = ((1U << sat) - 1U);
|
||||
if (val > (int32_t)max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
else if (val < 0)
|
||||
{
|
||||
return 0U;
|
||||
}
|
||||
}
|
||||
return (uint32_t)val;
|
||||
}
|
||||
|
||||
#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||
|
||||
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
||||
|
||||
|
||||
/* ################### Compiler specific Intrinsics ########################### */
|
||||
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
|
||||
Access to dedicated SIMD instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||
|
||||
#define __SADD8 __sadd8
|
||||
#define __QADD8 __qadd8
|
||||
#define __SHADD8 __shadd8
|
||||
#define __UADD8 __uadd8
|
||||
#define __UQADD8 __uqadd8
|
||||
#define __UHADD8 __uhadd8
|
||||
#define __SSUB8 __ssub8
|
||||
#define __QSUB8 __qsub8
|
||||
#define __SHSUB8 __shsub8
|
||||
#define __USUB8 __usub8
|
||||
#define __UQSUB8 __uqsub8
|
||||
#define __UHSUB8 __uhsub8
|
||||
#define __SADD16 __sadd16
|
||||
#define __QADD16 __qadd16
|
||||
#define __SHADD16 __shadd16
|
||||
#define __UADD16 __uadd16
|
||||
#define __UQADD16 __uqadd16
|
||||
#define __UHADD16 __uhadd16
|
||||
#define __SSUB16 __ssub16
|
||||
#define __QSUB16 __qsub16
|
||||
#define __SHSUB16 __shsub16
|
||||
#define __USUB16 __usub16
|
||||
#define __UQSUB16 __uqsub16
|
||||
#define __UHSUB16 __uhsub16
|
||||
#define __SASX __sasx
|
||||
#define __QASX __qasx
|
||||
#define __SHASX __shasx
|
||||
#define __UASX __uasx
|
||||
#define __UQASX __uqasx
|
||||
#define __UHASX __uhasx
|
||||
#define __SSAX __ssax
|
||||
#define __QSAX __qsax
|
||||
#define __SHSAX __shsax
|
||||
#define __USAX __usax
|
||||
#define __UQSAX __uqsax
|
||||
#define __UHSAX __uhsax
|
||||
#define __USAD8 __usad8
|
||||
#define __USADA8 __usada8
|
||||
#define __SSAT16 __ssat16
|
||||
#define __USAT16 __usat16
|
||||
#define __UXTB16 __uxtb16
|
||||
#define __UXTAB16 __uxtab16
|
||||
#define __SXTB16 __sxtb16
|
||||
#define __SXTAB16 __sxtab16
|
||||
#define __SMUAD __smuad
|
||||
#define __SMUADX __smuadx
|
||||
#define __SMLAD __smlad
|
||||
#define __SMLADX __smladx
|
||||
#define __SMLALD __smlald
|
||||
#define __SMLALDX __smlaldx
|
||||
#define __SMUSD __smusd
|
||||
#define __SMUSDX __smusdx
|
||||
#define __SMLSD __smlsd
|
||||
#define __SMLSDX __smlsdx
|
||||
#define __SMLSLD __smlsld
|
||||
#define __SMLSLDX __smlsldx
|
||||
#define __SEL __sel
|
||||
#define __QADD __qadd
|
||||
#define __QSUB __qsub
|
||||
|
||||
#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
|
||||
((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
|
||||
|
||||
#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
|
||||
((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
|
||||
|
||||
#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
|
||||
((int64_t)(ARG3) << 32U) ) >> 32U))
|
||||
|
||||
#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||
/*@} end of group CMSIS_SIMD_intrinsics */
|
||||
|
||||
|
||||
#endif /* __CMSIS_ARMCC_H */
|
||||
1869
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_armclang.h
Normal file
1869
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_armclang.h
Normal file
File diff suppressed because it is too large
Load Diff
266
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_compiler.h
Normal file
266
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_compiler.h
Normal file
@@ -0,0 +1,266 @@
|
||||
/**************************************************************************//**
|
||||
* @file cmsis_compiler.h
|
||||
* @brief CMSIS compiler generic header file
|
||||
* @version V5.0.4
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __CMSIS_COMPILER_H
|
||||
#define __CMSIS_COMPILER_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Arm Compiler 4/5
|
||||
*/
|
||||
#if defined ( __CC_ARM )
|
||||
#include "cmsis_armcc.h"
|
||||
|
||||
|
||||
/*
|
||||
* Arm Compiler 6 (armclang)
|
||||
*/
|
||||
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#include "cmsis_armclang.h"
|
||||
|
||||
|
||||
/*
|
||||
* GNU Compiler
|
||||
*/
|
||||
#elif defined ( __GNUC__ )
|
||||
#include "cmsis_gcc.h"
|
||||
|
||||
|
||||
/*
|
||||
* IAR Compiler
|
||||
*/
|
||||
#elif defined ( __ICCARM__ )
|
||||
#include <cmsis_iccarm.h>
|
||||
|
||||
|
||||
/*
|
||||
* TI Arm Compiler
|
||||
*/
|
||||
#elif defined ( __TI_ARM__ )
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
#ifndef __ASM
|
||||
#define __ASM __asm
|
||||
#endif
|
||||
#ifndef __INLINE
|
||||
#define __INLINE inline
|
||||
#endif
|
||||
#ifndef __STATIC_INLINE
|
||||
#define __STATIC_INLINE static inline
|
||||
#endif
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||
#endif
|
||||
#ifndef __NO_RETURN
|
||||
#define __NO_RETURN __attribute__((noreturn))
|
||||
#endif
|
||||
#ifndef __USED
|
||||
#define __USED __attribute__((used))
|
||||
#endif
|
||||
#ifndef __WEAK
|
||||
#define __WEAK __attribute__((weak))
|
||||
#endif
|
||||
#ifndef __PACKED
|
||||
#define __PACKED __attribute__((packed))
|
||||
#endif
|
||||
#ifndef __PACKED_STRUCT
|
||||
#define __PACKED_STRUCT struct __attribute__((packed))
|
||||
#endif
|
||||
#ifndef __PACKED_UNION
|
||||
#define __PACKED_UNION union __attribute__((packed))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||
struct __attribute__((packed)) T_UINT32 { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_WRITE
|
||||
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_READ
|
||||
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_WRITE
|
||||
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_READ
|
||||
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __ALIGNED
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#endif
|
||||
#ifndef __RESTRICT
|
||||
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
|
||||
#define __RESTRICT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* TASKING Compiler
|
||||
*/
|
||||
#elif defined ( __TASKING__ )
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
#ifndef __ASM
|
||||
#define __ASM __asm
|
||||
#endif
|
||||
#ifndef __INLINE
|
||||
#define __INLINE inline
|
||||
#endif
|
||||
#ifndef __STATIC_INLINE
|
||||
#define __STATIC_INLINE static inline
|
||||
#endif
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||
#endif
|
||||
#ifndef __NO_RETURN
|
||||
#define __NO_RETURN __attribute__((noreturn))
|
||||
#endif
|
||||
#ifndef __USED
|
||||
#define __USED __attribute__((used))
|
||||
#endif
|
||||
#ifndef __WEAK
|
||||
#define __WEAK __attribute__((weak))
|
||||
#endif
|
||||
#ifndef __PACKED
|
||||
#define __PACKED __packed__
|
||||
#endif
|
||||
#ifndef __PACKED_STRUCT
|
||||
#define __PACKED_STRUCT struct __packed__
|
||||
#endif
|
||||
#ifndef __PACKED_UNION
|
||||
#define __PACKED_UNION union __packed__
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||
struct __packed__ T_UINT32 { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_WRITE
|
||||
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_READ
|
||||
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_WRITE
|
||||
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_READ
|
||||
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __ALIGNED
|
||||
#define __ALIGNED(x) __align(x)
|
||||
#endif
|
||||
#ifndef __RESTRICT
|
||||
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
|
||||
#define __RESTRICT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* COSMIC Compiler
|
||||
*/
|
||||
#elif defined ( __CSMC__ )
|
||||
#include <cmsis_csm.h>
|
||||
|
||||
#ifndef __ASM
|
||||
#define __ASM _asm
|
||||
#endif
|
||||
#ifndef __INLINE
|
||||
#define __INLINE inline
|
||||
#endif
|
||||
#ifndef __STATIC_INLINE
|
||||
#define __STATIC_INLINE static inline
|
||||
#endif
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||
#endif
|
||||
#ifndef __NO_RETURN
|
||||
// NO RETURN is automatically detected hence no warning here
|
||||
#define __NO_RETURN
|
||||
#endif
|
||||
#ifndef __USED
|
||||
#warning No compiler specific solution for __USED. __USED is ignored.
|
||||
#define __USED
|
||||
#endif
|
||||
#ifndef __WEAK
|
||||
#define __WEAK __weak
|
||||
#endif
|
||||
#ifndef __PACKED
|
||||
#define __PACKED @packed
|
||||
#endif
|
||||
#ifndef __PACKED_STRUCT
|
||||
#define __PACKED_STRUCT @packed struct
|
||||
#endif
|
||||
#ifndef __PACKED_UNION
|
||||
#define __PACKED_UNION @packed union
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||
@packed struct T_UINT32 { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_WRITE
|
||||
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT16_READ
|
||||
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_WRITE
|
||||
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||
#endif
|
||||
#ifndef __UNALIGNED_UINT32_READ
|
||||
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||
#endif
|
||||
#ifndef __ALIGNED
|
||||
#warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.
|
||||
#define __ALIGNED(x)
|
||||
#endif
|
||||
#ifndef __RESTRICT
|
||||
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
|
||||
#define __RESTRICT
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
#error Unknown compiler.
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CMSIS_COMPILER_H */
|
||||
|
||||
2085
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_gcc.h
Normal file
2085
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_gcc.h
Normal file
File diff suppressed because it is too large
Load Diff
935
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_iccarm.h
Normal file
935
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_iccarm.h
Normal file
@@ -0,0 +1,935 @@
|
||||
/**************************************************************************//**
|
||||
* @file cmsis_iccarm.h
|
||||
* @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file
|
||||
* @version V5.0.7
|
||||
* @date 19. June 2018
|
||||
******************************************************************************/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2017-2018 IAR Systems
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License")
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef __CMSIS_ICCARM_H__
|
||||
#define __CMSIS_ICCARM_H__
|
||||
|
||||
#ifndef __ICCARM__
|
||||
#error This file should only be compiled by ICCARM
|
||||
#endif
|
||||
|
||||
#pragma system_include
|
||||
|
||||
#define __IAR_FT _Pragma("inline=forced") __intrinsic
|
||||
|
||||
#if (__VER__ >= 8000000)
|
||||
#define __ICCARM_V8 1
|
||||
#else
|
||||
#define __ICCARM_V8 0
|
||||
#endif
|
||||
|
||||
#ifndef __ALIGNED
|
||||
#if __ICCARM_V8
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#elif (__VER__ >= 7080000)
|
||||
/* Needs IAR language extensions */
|
||||
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||
#else
|
||||
#warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored.
|
||||
#define __ALIGNED(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Define compiler macros for CPU architecture, used in CMSIS 5.
|
||||
*/
|
||||
#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__
|
||||
/* Macros already defined */
|
||||
#else
|
||||
#if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__)
|
||||
#define __ARM_ARCH_8M_MAIN__ 1
|
||||
#elif defined(__ARM8M_BASELINE__)
|
||||
#define __ARM_ARCH_8M_BASE__ 1
|
||||
#elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M'
|
||||
#if __ARM_ARCH == 6
|
||||
#define __ARM_ARCH_6M__ 1
|
||||
#elif __ARM_ARCH == 7
|
||||
#if __ARM_FEATURE_DSP
|
||||
#define __ARM_ARCH_7EM__ 1
|
||||
#else
|
||||
#define __ARM_ARCH_7M__ 1
|
||||
#endif
|
||||
#endif /* __ARM_ARCH */
|
||||
#endif /* __ARM_ARCH_PROFILE == 'M' */
|
||||
#endif
|
||||
|
||||
/* Alternativ core deduction for older ICCARM's */
|
||||
#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \
|
||||
!defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__)
|
||||
#if defined(__ARM6M__) && (__CORE__ == __ARM6M__)
|
||||
#define __ARM_ARCH_6M__ 1
|
||||
#elif defined(__ARM7M__) && (__CORE__ == __ARM7M__)
|
||||
#define __ARM_ARCH_7M__ 1
|
||||
#elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__)
|
||||
#define __ARM_ARCH_7EM__ 1
|
||||
#elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__)
|
||||
#define __ARM_ARCH_8M_BASE__ 1
|
||||
#elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__)
|
||||
#define __ARM_ARCH_8M_MAIN__ 1
|
||||
#elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__)
|
||||
#define __ARM_ARCH_8M_MAIN__ 1
|
||||
#else
|
||||
#error "Unknown target."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1
|
||||
#define __IAR_M0_FAMILY 1
|
||||
#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1
|
||||
#define __IAR_M0_FAMILY 1
|
||||
#else
|
||||
#define __IAR_M0_FAMILY 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __ASM
|
||||
#define __ASM __asm
|
||||
#endif
|
||||
|
||||
#ifndef __INLINE
|
||||
#define __INLINE inline
|
||||
#endif
|
||||
|
||||
#ifndef __NO_RETURN
|
||||
#if __ICCARM_V8
|
||||
#define __NO_RETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
#define __NO_RETURN _Pragma("object_attribute=__noreturn")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __PACKED
|
||||
#if __ICCARM_V8
|
||||
#define __PACKED __attribute__((packed, aligned(1)))
|
||||
#else
|
||||
/* Needs IAR language extensions */
|
||||
#define __PACKED __packed
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __PACKED_STRUCT
|
||||
#if __ICCARM_V8
|
||||
#define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
|
||||
#else
|
||||
/* Needs IAR language extensions */
|
||||
#define __PACKED_STRUCT __packed struct
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __PACKED_UNION
|
||||
#if __ICCARM_V8
|
||||
#define __PACKED_UNION union __attribute__((packed, aligned(1)))
|
||||
#else
|
||||
/* Needs IAR language extensions */
|
||||
#define __PACKED_UNION __packed union
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __RESTRICT
|
||||
#define __RESTRICT __restrict
|
||||
#endif
|
||||
|
||||
#ifndef __STATIC_INLINE
|
||||
#define __STATIC_INLINE static inline
|
||||
#endif
|
||||
|
||||
#ifndef __FORCEINLINE
|
||||
#define __FORCEINLINE _Pragma("inline=forced")
|
||||
#endif
|
||||
|
||||
#ifndef __STATIC_FORCEINLINE
|
||||
#define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE
|
||||
#endif
|
||||
|
||||
#ifndef __UNALIGNED_UINT16_READ
|
||||
#pragma language=save
|
||||
#pragma language=extended
|
||||
__IAR_FT uint16_t __iar_uint16_read(void const *ptr)
|
||||
{
|
||||
return *(__packed uint16_t*)(ptr);
|
||||
}
|
||||
#pragma language=restore
|
||||
#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __UNALIGNED_UINT16_WRITE
|
||||
#pragma language=save
|
||||
#pragma language=extended
|
||||
__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val)
|
||||
{
|
||||
*(__packed uint16_t*)(ptr) = val;;
|
||||
}
|
||||
#pragma language=restore
|
||||
#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL)
|
||||
#endif
|
||||
|
||||
#ifndef __UNALIGNED_UINT32_READ
|
||||
#pragma language=save
|
||||
#pragma language=extended
|
||||
__IAR_FT uint32_t __iar_uint32_read(void const *ptr)
|
||||
{
|
||||
return *(__packed uint32_t*)(ptr);
|
||||
}
|
||||
#pragma language=restore
|
||||
#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR)
|
||||
#endif
|
||||
|
||||
#ifndef __UNALIGNED_UINT32_WRITE
|
||||
#pragma language=save
|
||||
#pragma language=extended
|
||||
__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val)
|
||||
{
|
||||
*(__packed uint32_t*)(ptr) = val;;
|
||||
}
|
||||
#pragma language=restore
|
||||
#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL)
|
||||
#endif
|
||||
|
||||
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||
#pragma language=save
|
||||
#pragma language=extended
|
||||
__packed struct __iar_u32 { uint32_t v; };
|
||||
#pragma language=restore
|
||||
#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v)
|
||||
#endif
|
||||
|
||||
#ifndef __USED
|
||||
#if __ICCARM_V8
|
||||
#define __USED __attribute__((used))
|
||||
#else
|
||||
#define __USED _Pragma("__root")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __WEAK
|
||||
#if __ICCARM_V8
|
||||
#define __WEAK __attribute__((weak))
|
||||
#else
|
||||
#define __WEAK _Pragma("__weak")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __ICCARM_INTRINSICS_VERSION__
|
||||
#define __ICCARM_INTRINSICS_VERSION__ 0
|
||||
#endif
|
||||
|
||||
#if __ICCARM_INTRINSICS_VERSION__ == 2
|
||||
|
||||
#if defined(__CLZ)
|
||||
#undef __CLZ
|
||||
#endif
|
||||
#if defined(__REVSH)
|
||||
#undef __REVSH
|
||||
#endif
|
||||
#if defined(__RBIT)
|
||||
#undef __RBIT
|
||||
#endif
|
||||
#if defined(__SSAT)
|
||||
#undef __SSAT
|
||||
#endif
|
||||
#if defined(__USAT)
|
||||
#undef __USAT
|
||||
#endif
|
||||
|
||||
#include "iccarm_builtin.h"
|
||||
|
||||
#define __disable_fault_irq __iar_builtin_disable_fiq
|
||||
#define __disable_irq __iar_builtin_disable_interrupt
|
||||
#define __enable_fault_irq __iar_builtin_enable_fiq
|
||||
#define __enable_irq __iar_builtin_enable_interrupt
|
||||
#define __arm_rsr __iar_builtin_rsr
|
||||
#define __arm_wsr __iar_builtin_wsr
|
||||
|
||||
|
||||
#define __get_APSR() (__arm_rsr("APSR"))
|
||||
#define __get_BASEPRI() (__arm_rsr("BASEPRI"))
|
||||
#define __get_CONTROL() (__arm_rsr("CONTROL"))
|
||||
#define __get_FAULTMASK() (__arm_rsr("FAULTMASK"))
|
||||
|
||||
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||
#define __get_FPSCR() (__arm_rsr("FPSCR"))
|
||||
#define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE)))
|
||||
#else
|
||||
#define __get_FPSCR() ( 0 )
|
||||
#define __set_FPSCR(VALUE) ((void)VALUE)
|
||||
#endif
|
||||
|
||||
#define __get_IPSR() (__arm_rsr("IPSR"))
|
||||
#define __get_MSP() (__arm_rsr("MSP"))
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||
#define __get_MSPLIM() (0U)
|
||||
#else
|
||||
#define __get_MSPLIM() (__arm_rsr("MSPLIM"))
|
||||
#endif
|
||||
#define __get_PRIMASK() (__arm_rsr("PRIMASK"))
|
||||
#define __get_PSP() (__arm_rsr("PSP"))
|
||||
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
#define __get_PSPLIM() (0U)
|
||||
#else
|
||||
#define __get_PSPLIM() (__arm_rsr("PSPLIM"))
|
||||
#endif
|
||||
|
||||
#define __get_xPSR() (__arm_rsr("xPSR"))
|
||||
|
||||
#define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE)))
|
||||
#define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE)))
|
||||
#define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE)))
|
||||
#define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE)))
|
||||
#define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE)))
|
||||
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||
#define __set_MSPLIM(VALUE) ((void)(VALUE))
|
||||
#else
|
||||
#define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE)))
|
||||
#endif
|
||||
#define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE)))
|
||||
#define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE)))
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
#define __set_PSPLIM(VALUE) ((void)(VALUE))
|
||||
#else
|
||||
#define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE)))
|
||||
#endif
|
||||
|
||||
#define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS"))
|
||||
#define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE)))
|
||||
#define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS"))
|
||||
#define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE)))
|
||||
#define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS"))
|
||||
#define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE)))
|
||||
#define __TZ_get_SP_NS() (__arm_rsr("SP_NS"))
|
||||
#define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE)))
|
||||
#define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS"))
|
||||
#define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE)))
|
||||
#define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS"))
|
||||
#define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE)))
|
||||
#define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS"))
|
||||
#define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE)))
|
||||
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
#define __TZ_get_PSPLIM_NS() (0U)
|
||||
#define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE))
|
||||
#else
|
||||
#define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS"))
|
||||
#define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE)))
|
||||
#endif
|
||||
|
||||
#define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS"))
|
||||
#define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE)))
|
||||
|
||||
#define __NOP __iar_builtin_no_operation
|
||||
|
||||
#define __CLZ __iar_builtin_CLZ
|
||||
#define __CLREX __iar_builtin_CLREX
|
||||
|
||||
#define __DMB __iar_builtin_DMB
|
||||
#define __DSB __iar_builtin_DSB
|
||||
#define __ISB __iar_builtin_ISB
|
||||
|
||||
#define __LDREXB __iar_builtin_LDREXB
|
||||
#define __LDREXH __iar_builtin_LDREXH
|
||||
#define __LDREXW __iar_builtin_LDREX
|
||||
|
||||
#define __RBIT __iar_builtin_RBIT
|
||||
#define __REV __iar_builtin_REV
|
||||
#define __REV16 __iar_builtin_REV16
|
||||
|
||||
__IAR_FT int16_t __REVSH(int16_t val)
|
||||
{
|
||||
return (int16_t) __iar_builtin_REVSH(val);
|
||||
}
|
||||
|
||||
#define __ROR __iar_builtin_ROR
|
||||
#define __RRX __iar_builtin_RRX
|
||||
|
||||
#define __SEV __iar_builtin_SEV
|
||||
|
||||
#if !__IAR_M0_FAMILY
|
||||
#define __SSAT __iar_builtin_SSAT
|
||||
#endif
|
||||
|
||||
#define __STREXB __iar_builtin_STREXB
|
||||
#define __STREXH __iar_builtin_STREXH
|
||||
#define __STREXW __iar_builtin_STREX
|
||||
|
||||
#if !__IAR_M0_FAMILY
|
||||
#define __USAT __iar_builtin_USAT
|
||||
#endif
|
||||
|
||||
#define __WFE __iar_builtin_WFE
|
||||
#define __WFI __iar_builtin_WFI
|
||||
|
||||
#if __ARM_MEDIA__
|
||||
#define __SADD8 __iar_builtin_SADD8
|
||||
#define __QADD8 __iar_builtin_QADD8
|
||||
#define __SHADD8 __iar_builtin_SHADD8
|
||||
#define __UADD8 __iar_builtin_UADD8
|
||||
#define __UQADD8 __iar_builtin_UQADD8
|
||||
#define __UHADD8 __iar_builtin_UHADD8
|
||||
#define __SSUB8 __iar_builtin_SSUB8
|
||||
#define __QSUB8 __iar_builtin_QSUB8
|
||||
#define __SHSUB8 __iar_builtin_SHSUB8
|
||||
#define __USUB8 __iar_builtin_USUB8
|
||||
#define __UQSUB8 __iar_builtin_UQSUB8
|
||||
#define __UHSUB8 __iar_builtin_UHSUB8
|
||||
#define __SADD16 __iar_builtin_SADD16
|
||||
#define __QADD16 __iar_builtin_QADD16
|
||||
#define __SHADD16 __iar_builtin_SHADD16
|
||||
#define __UADD16 __iar_builtin_UADD16
|
||||
#define __UQADD16 __iar_builtin_UQADD16
|
||||
#define __UHADD16 __iar_builtin_UHADD16
|
||||
#define __SSUB16 __iar_builtin_SSUB16
|
||||
#define __QSUB16 __iar_builtin_QSUB16
|
||||
#define __SHSUB16 __iar_builtin_SHSUB16
|
||||
#define __USUB16 __iar_builtin_USUB16
|
||||
#define __UQSUB16 __iar_builtin_UQSUB16
|
||||
#define __UHSUB16 __iar_builtin_UHSUB16
|
||||
#define __SASX __iar_builtin_SASX
|
||||
#define __QASX __iar_builtin_QASX
|
||||
#define __SHASX __iar_builtin_SHASX
|
||||
#define __UASX __iar_builtin_UASX
|
||||
#define __UQASX __iar_builtin_UQASX
|
||||
#define __UHASX __iar_builtin_UHASX
|
||||
#define __SSAX __iar_builtin_SSAX
|
||||
#define __QSAX __iar_builtin_QSAX
|
||||
#define __SHSAX __iar_builtin_SHSAX
|
||||
#define __USAX __iar_builtin_USAX
|
||||
#define __UQSAX __iar_builtin_UQSAX
|
||||
#define __UHSAX __iar_builtin_UHSAX
|
||||
#define __USAD8 __iar_builtin_USAD8
|
||||
#define __USADA8 __iar_builtin_USADA8
|
||||
#define __SSAT16 __iar_builtin_SSAT16
|
||||
#define __USAT16 __iar_builtin_USAT16
|
||||
#define __UXTB16 __iar_builtin_UXTB16
|
||||
#define __UXTAB16 __iar_builtin_UXTAB16
|
||||
#define __SXTB16 __iar_builtin_SXTB16
|
||||
#define __SXTAB16 __iar_builtin_SXTAB16
|
||||
#define __SMUAD __iar_builtin_SMUAD
|
||||
#define __SMUADX __iar_builtin_SMUADX
|
||||
#define __SMMLA __iar_builtin_SMMLA
|
||||
#define __SMLAD __iar_builtin_SMLAD
|
||||
#define __SMLADX __iar_builtin_SMLADX
|
||||
#define __SMLALD __iar_builtin_SMLALD
|
||||
#define __SMLALDX __iar_builtin_SMLALDX
|
||||
#define __SMUSD __iar_builtin_SMUSD
|
||||
#define __SMUSDX __iar_builtin_SMUSDX
|
||||
#define __SMLSD __iar_builtin_SMLSD
|
||||
#define __SMLSDX __iar_builtin_SMLSDX
|
||||
#define __SMLSLD __iar_builtin_SMLSLD
|
||||
#define __SMLSLDX __iar_builtin_SMLSLDX
|
||||
#define __SEL __iar_builtin_SEL
|
||||
#define __QADD __iar_builtin_QADD
|
||||
#define __QSUB __iar_builtin_QSUB
|
||||
#define __PKHBT __iar_builtin_PKHBT
|
||||
#define __PKHTB __iar_builtin_PKHTB
|
||||
#endif
|
||||
|
||||
#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */
|
||||
|
||||
#if __IAR_M0_FAMILY
|
||||
/* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */
|
||||
#define __CLZ __cmsis_iar_clz_not_active
|
||||
#define __SSAT __cmsis_iar_ssat_not_active
|
||||
#define __USAT __cmsis_iar_usat_not_active
|
||||
#define __RBIT __cmsis_iar_rbit_not_active
|
||||
#define __get_APSR __cmsis_iar_get_APSR_not_active
|
||||
#endif
|
||||
|
||||
|
||||
#if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||
(defined (__FPU_USED ) && (__FPU_USED == 1U)) ))
|
||||
#define __get_FPSCR __cmsis_iar_get_FPSR_not_active
|
||||
#define __set_FPSCR __cmsis_iar_set_FPSR_not_active
|
||||
#endif
|
||||
|
||||
#ifdef __INTRINSICS_INCLUDED
|
||||
#error intrinsics.h is already included previously!
|
||||
#endif
|
||||
|
||||
#include <intrinsics.h>
|
||||
|
||||
#if __IAR_M0_FAMILY
|
||||
/* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */
|
||||
#undef __CLZ
|
||||
#undef __SSAT
|
||||
#undef __USAT
|
||||
#undef __RBIT
|
||||
#undef __get_APSR
|
||||
|
||||
__STATIC_INLINE uint8_t __CLZ(uint32_t data)
|
||||
{
|
||||
if (data == 0U) { return 32U; }
|
||||
|
||||
uint32_t count = 0U;
|
||||
uint32_t mask = 0x80000000U;
|
||||
|
||||
while ((data & mask) == 0U)
|
||||
{
|
||||
count += 1U;
|
||||
mask = mask >> 1U;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
__STATIC_INLINE uint32_t __RBIT(uint32_t v)
|
||||
{
|
||||
uint8_t sc = 31U;
|
||||
uint32_t r = v;
|
||||
for (v >>= 1U; v; v >>= 1U)
|
||||
{
|
||||
r <<= 1U;
|
||||
r |= v & 1U;
|
||||
sc--;
|
||||
}
|
||||
return (r << sc);
|
||||
}
|
||||
|
||||
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm("MRS %0,APSR" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||
(defined (__FPU_USED ) && (__FPU_USED == 1U)) ))
|
||||
#undef __get_FPSCR
|
||||
#undef __set_FPSCR
|
||||
#define __get_FPSCR() (0)
|
||||
#define __set_FPSCR(VALUE) ((void)VALUE)
|
||||
#endif
|
||||
|
||||
#pragma diag_suppress=Pe940
|
||||
#pragma diag_suppress=Pe177
|
||||
|
||||
#define __enable_irq __enable_interrupt
|
||||
#define __disable_irq __disable_interrupt
|
||||
#define __NOP __no_operation
|
||||
|
||||
#define __get_xPSR __get_PSR
|
||||
|
||||
#if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0)
|
||||
|
||||
__IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr)
|
||||
{
|
||||
return __LDREX((unsigned long *)ptr);
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr)
|
||||
{
|
||||
return __STREX(value, (unsigned long *)ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */
|
||||
#if (__CORTEX_M >= 0x03)
|
||||
|
||||
__IAR_FT uint32_t __RRX(uint32_t value)
|
||||
{
|
||||
uint32_t result;
|
||||
__ASM("RRX %0, %1" : "=r"(result) : "r" (value) : "cc");
|
||||
return(result);
|
||||
}
|
||||
|
||||
__IAR_FT void __set_BASEPRI_MAX(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR BASEPRI_MAX,%0"::"r" (value));
|
||||
}
|
||||
|
||||
|
||||
#define __enable_fault_irq __enable_fiq
|
||||
#define __disable_fault_irq __disable_fiq
|
||||
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
__IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2)
|
||||
{
|
||||
return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2));
|
||||
}
|
||||
|
||||
#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
||||
(defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
||||
|
||||
__IAR_FT uint32_t __get_MSPLIM(void)
|
||||
{
|
||||
uint32_t res;
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||
res = 0U;
|
||||
#else
|
||||
__asm volatile("MRS %0,MSPLIM" : "=r" (res));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __set_MSPLIM(uint32_t value)
|
||||
{
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||
(void)value;
|
||||
#else
|
||||
__asm volatile("MSR MSPLIM,%0" :: "r" (value));
|
||||
#endif
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __get_PSPLIM(void)
|
||||
{
|
||||
uint32_t res;
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
res = 0U;
|
||||
#else
|
||||
__asm volatile("MRS %0,PSPLIM" : "=r" (res));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __set_PSPLIM(uint32_t value)
|
||||
{
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
(void)value;
|
||||
#else
|
||||
__asm volatile("MSR PSPLIM,%0" :: "r" (value));
|
||||
#endif
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_CONTROL_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,CONTROL_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_CONTROL_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR CONTROL_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_PSP_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,PSP_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_PSP_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR PSP_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_MSP_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,MSP_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_MSP_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR MSP_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_SP_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,SP_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
__IAR_FT void __TZ_set_SP_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR SP_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_PRIMASK_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,PRIMASK_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR PRIMASK_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_BASEPRI_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,BASEPRI_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR BASEPRI_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_PSPLIM_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
res = 0U;
|
||||
#else
|
||||
__asm volatile("MRS %0,PSPLIM_NS" : "=r" (res));
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value)
|
||||
{
|
||||
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||
(void)value;
|
||||
#else
|
||||
__asm volatile("MSR PSPLIM_NS,%0" :: "r" (value));
|
||||
#endif
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __TZ_get_MSPLIM_NS(void)
|
||||
{
|
||||
uint32_t res;
|
||||
__asm volatile("MRS %0,MSPLIM_NS" : "=r" (res));
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value)
|
||||
{
|
||||
__asm volatile("MSR MSPLIM_NS,%0" :: "r" (value));
|
||||
}
|
||||
|
||||
#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */
|
||||
|
||||
#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */
|
||||
|
||||
#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value))
|
||||
|
||||
#if __IAR_M0_FAMILY
|
||||
__STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)
|
||||
{
|
||||
if ((sat >= 1U) && (sat <= 32U))
|
||||
{
|
||||
const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
|
||||
const int32_t min = -1 - max ;
|
||||
if (val > max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
else if (val < min)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
__STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)
|
||||
{
|
||||
if (sat <= 31U)
|
||||
{
|
||||
const uint32_t max = ((1U << sat) - 1U);
|
||||
if (val > (int32_t)max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
else if (val < 0)
|
||||
{
|
||||
return 0U;
|
||||
}
|
||||
}
|
||||
return (uint32_t)val;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */
|
||||
|
||||
__IAR_FT uint8_t __LDRBT(volatile uint8_t *addr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||
return ((uint8_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint16_t __LDRHT(volatile uint16_t *addr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||
return ((uint16_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __LDRT(volatile uint32_t *addr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr)
|
||||
{
|
||||
__ASM("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");
|
||||
}
|
||||
|
||||
__IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr)
|
||||
{
|
||||
__ASM("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");
|
||||
}
|
||||
|
||||
__IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr)
|
||||
{
|
||||
__ASM("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory");
|
||||
}
|
||||
|
||||
#endif /* (__CORTEX_M >= 0x03) */
|
||||
|
||||
#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
||||
(defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
||||
|
||||
|
||||
__IAR_FT uint8_t __LDAB(volatile uint8_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return ((uint8_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint16_t __LDAH(volatile uint16_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return ((uint16_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __LDA(volatile uint32_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr)
|
||||
{
|
||||
__ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||
}
|
||||
|
||||
__IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr)
|
||||
{
|
||||
__ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||
}
|
||||
|
||||
__IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr)
|
||||
{
|
||||
__ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||
}
|
||||
|
||||
__IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return ((uint8_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return ((uint16_t)res);
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
__IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr)
|
||||
{
|
||||
uint32_t res;
|
||||
__ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */
|
||||
|
||||
#undef __IAR_FT
|
||||
#undef __IAR_M0_FAMILY
|
||||
#undef __ICCARM_V8
|
||||
|
||||
#pragma diag_default=Pe940
|
||||
#pragma diag_default=Pe177
|
||||
|
||||
#endif /* __CMSIS_ICCARM_H__ */
|
||||
39
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_version.h
Normal file
39
bsp/microchip/same70/bsp/CMSIS/Core/Include/cmsis_version.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/**************************************************************************//**
|
||||
* @file cmsis_version.h
|
||||
* @brief CMSIS Core(M) Version definitions
|
||||
* @version V5.0.2
|
||||
* @date 19. April 2017
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2017 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CMSIS_VERSION_H
|
||||
#define __CMSIS_VERSION_H
|
||||
|
||||
/* CMSIS Version definitions */
|
||||
#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
|
||||
#define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */
|
||||
#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
|
||||
__CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
|
||||
#endif
|
||||
1918
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_armv8mbl.h
Normal file
1918
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_armv8mbl.h
Normal file
File diff suppressed because it is too large
Load Diff
2927
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_armv8mml.h
Normal file
2927
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_armv8mml.h
Normal file
File diff suppressed because it is too large
Load Diff
949
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm0.h
Normal file
949
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm0.h
Normal file
@@ -0,0 +1,949 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cm0.h
|
||||
* @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
|
||||
* @version V5.0.5
|
||||
* @date 28. May 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CM0_H_GENERIC
|
||||
#define __CORE_CM0_H_GENERIC
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
|
||||
CMSIS violates the following MISRA-C:2004 rules:
|
||||
|
||||
\li Required Rule 8.5, object/function definition in header file.<br>
|
||||
Function definitions in header files are used to allow 'inlining'.
|
||||
|
||||
\li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
|
||||
Unions are used for effective representation of core registers.
|
||||
|
||||
\li Advisory Rule 19.7, Function-like macro defined.<br>
|
||||
Function-like macros are used to allow more efficient code.
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* CMSIS definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
\ingroup Cortex_M0
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "cmsis_version.h"
|
||||
|
||||
/* CMSIS CM0 definitions */
|
||||
#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
|
||||
#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
|
||||
#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
|
||||
__CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
|
||||
|
||||
#define __CORTEX_M (0U) /*!< Cortex-M Core */
|
||||
|
||||
/** __FPU_USED indicates whether an FPU is used or not.
|
||||
This core does not support an FPU at all
|
||||
*/
|
||||
#define __FPU_USED 0U
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#if defined __TARGET_FPU_VFP
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#if defined __ARM_PCS_VFP
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __GNUC__ )
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __ICCARM__ )
|
||||
#if defined __ARMVFP__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __TI_ARM__ )
|
||||
#if defined __TI_VFP_SUPPORT__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __TASKING__ )
|
||||
#if defined __FPU_VFP__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __CSMC__ )
|
||||
#if ( __CSMC__ & 0x400U)
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CORE_CM0_H_GENERIC */
|
||||
|
||||
#ifndef __CMSIS_GENERIC
|
||||
|
||||
#ifndef __CORE_CM0_H_DEPENDANT
|
||||
#define __CORE_CM0_H_DEPENDANT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* check device defines and use defaults */
|
||||
#if defined __CHECK_DEVICE_DEFINES
|
||||
#ifndef __CM0_REV
|
||||
#define __CM0_REV 0x0000U
|
||||
#warning "__CM0_REV not defined in device header file; using default!"
|
||||
#endif
|
||||
|
||||
#ifndef __NVIC_PRIO_BITS
|
||||
#define __NVIC_PRIO_BITS 2U
|
||||
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
|
||||
#endif
|
||||
|
||||
#ifndef __Vendor_SysTickConfig
|
||||
#define __Vendor_SysTickConfig 0U
|
||||
#warning "__Vendor_SysTickConfig not defined in device header file; using default!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* IO definitions (access restrictions to peripheral registers) */
|
||||
/**
|
||||
\defgroup CMSIS_glob_defs CMSIS Global Defines
|
||||
|
||||
<strong>IO Type Qualifiers</strong> are used
|
||||
\li to specify the access to peripheral variables.
|
||||
\li for automatic generation of peripheral register debug information.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#define __I volatile /*!< Defines 'read only' permissions */
|
||||
#else
|
||||
#define __I volatile const /*!< Defines 'read only' permissions */
|
||||
#endif
|
||||
#define __O volatile /*!< Defines 'write only' permissions */
|
||||
#define __IO volatile /*!< Defines 'read / write' permissions */
|
||||
|
||||
/* following defines should be used for structure members */
|
||||
#define __IM volatile const /*! Defines 'read only' structure member permissions */
|
||||
#define __OM volatile /*! Defines 'write only' structure member permissions */
|
||||
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
|
||||
|
||||
/*@} end of group Cortex_M0 */
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Register Abstraction
|
||||
Core Register contain:
|
||||
- Core Register
|
||||
- Core NVIC Register
|
||||
- Core SCB Register
|
||||
- Core SysTick Register
|
||||
******************************************************************************/
|
||||
/**
|
||||
\defgroup CMSIS_core_register Defines and Type Definitions
|
||||
\brief Type definitions and defines for Cortex-M processor based devices.
|
||||
*/
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_CORE Status and Control Registers
|
||||
\brief Core Register type definitions.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Union type to access the Application Program Status Register (APSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
|
||||
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} APSR_Type;
|
||||
|
||||
/* APSR Register Definitions */
|
||||
#define APSR_N_Pos 31U /*!< APSR: N Position */
|
||||
#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
|
||||
|
||||
#define APSR_Z_Pos 30U /*!< APSR: Z Position */
|
||||
#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
|
||||
|
||||
#define APSR_C_Pos 29U /*!< APSR: C Position */
|
||||
#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
|
||||
|
||||
#define APSR_V_Pos 28U /*!< APSR: V Position */
|
||||
#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Interrupt Program Status Register (IPSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||
uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} IPSR_Type;
|
||||
|
||||
/* IPSR Register Definitions */
|
||||
#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
|
||||
#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Special-Purpose Program Status Registers (xPSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||
uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
|
||||
uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
|
||||
uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
|
||||
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} xPSR_Type;
|
||||
|
||||
/* xPSR Register Definitions */
|
||||
#define xPSR_N_Pos 31U /*!< xPSR: N Position */
|
||||
#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
|
||||
|
||||
#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
|
||||
#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
|
||||
|
||||
#define xPSR_C_Pos 29U /*!< xPSR: C Position */
|
||||
#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
|
||||
|
||||
#define xPSR_V_Pos 28U /*!< xPSR: V Position */
|
||||
#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
|
||||
|
||||
#define xPSR_T_Pos 24U /*!< xPSR: T Position */
|
||||
#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
|
||||
|
||||
#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
|
||||
#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Control Registers (CONTROL).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t _reserved0:1; /*!< bit: 0 Reserved */
|
||||
uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
|
||||
uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} CONTROL_Type;
|
||||
|
||||
/* CONTROL Register Definitions */
|
||||
#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
|
||||
#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
|
||||
|
||||
/*@} end of group CMSIS_CORE */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
|
||||
\brief Type definitions for the NVIC Registers
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
|
||||
uint32_t RESERVED0[31U];
|
||||
__IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
|
||||
uint32_t RSERVED1[31U];
|
||||
__IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
|
||||
uint32_t RESERVED2[31U];
|
||||
__IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
|
||||
uint32_t RESERVED3[31U];
|
||||
uint32_t RESERVED4[64U];
|
||||
__IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
|
||||
} NVIC_Type;
|
||||
|
||||
/*@} end of group CMSIS_NVIC */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_SCB System Control Block (SCB)
|
||||
\brief Type definitions for the System Control Block Registers
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the System Control Block (SCB).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
|
||||
__IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
|
||||
uint32_t RESERVED0;
|
||||
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
|
||||
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
|
||||
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
|
||||
uint32_t RESERVED1;
|
||||
__IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
|
||||
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
|
||||
} SCB_Type;
|
||||
|
||||
/* SCB CPUID Register Definitions */
|
||||
#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
|
||||
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
|
||||
|
||||
#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
|
||||
#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
|
||||
|
||||
#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
|
||||
#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
|
||||
|
||||
#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
|
||||
#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
|
||||
|
||||
#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
|
||||
#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
|
||||
|
||||
/* SCB Interrupt Control State Register Definitions */
|
||||
#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */
|
||||
#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
|
||||
#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
|
||||
#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
|
||||
#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
|
||||
#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
|
||||
#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
|
||||
#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
|
||||
#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
|
||||
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
|
||||
|
||||
/* SCB Application Interrupt and Reset Control Register Definitions */
|
||||
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
|
||||
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
|
||||
|
||||
#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
|
||||
#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
|
||||
|
||||
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
|
||||
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
|
||||
|
||||
/* SCB System Control Register Definitions */
|
||||
#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
|
||||
#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
|
||||
#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
|
||||
#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
|
||||
|
||||
/* SCB Configuration Control Register Definitions */
|
||||
#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */
|
||||
#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
|
||||
|
||||
#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
|
||||
#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
|
||||
|
||||
/* SCB System Handler Control and State Register Definitions */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
|
||||
|
||||
/*@} end of group CMSIS_SCB */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_SysTick System Tick Timer (SysTick)
|
||||
\brief Type definitions for the System Timer Registers.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the System Timer (SysTick).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
|
||||
__IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
|
||||
__IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
|
||||
__IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
|
||||
} SysTick_Type;
|
||||
|
||||
/* SysTick Control / Status Register Definitions */
|
||||
#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
|
||||
#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
|
||||
|
||||
#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
|
||||
#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
|
||||
|
||||
#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
|
||||
#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
|
||||
|
||||
#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
|
||||
#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
|
||||
|
||||
/* SysTick Reload Register Definitions */
|
||||
#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
|
||||
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
|
||||
|
||||
/* SysTick Current Register Definitions */
|
||||
#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
|
||||
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
|
||||
|
||||
/* SysTick Calibration Register Definitions */
|
||||
#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
|
||||
#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
|
||||
|
||||
#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
|
||||
#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
|
||||
|
||||
#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
|
||||
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
|
||||
|
||||
/*@} end of group CMSIS_SysTick */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
|
||||
\brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.
|
||||
Therefore they are not covered by the Cortex-M0 header file.
|
||||
@{
|
||||
*/
|
||||
/*@} end of group CMSIS_CoreDebug */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_core_bitfield Core register bit field macros
|
||||
\brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Mask and shift a bit field value for use in a register bit range.
|
||||
\param[in] field Name of the register bit field.
|
||||
\param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
|
||||
\return Masked and shifted value.
|
||||
*/
|
||||
#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
|
||||
|
||||
/**
|
||||
\brief Mask and shift a register value to extract a bit filed value.
|
||||
\param[in] field Name of the register bit field.
|
||||
\param[in] value Value of register. This parameter is interpreted as an uint32_t type.
|
||||
\return Masked and shifted bit field value.
|
||||
*/
|
||||
#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
|
||||
|
||||
/*@} end of group CMSIS_core_bitfield */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_core_base Core Definitions
|
||||
\brief Definitions for base addresses, unions, and structures.
|
||||
@{
|
||||
*/
|
||||
|
||||
/* Memory mapping of Core Hardware */
|
||||
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
|
||||
#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
|
||||
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
|
||||
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
|
||||
|
||||
#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
|
||||
#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
|
||||
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
|
||||
|
||||
|
||||
/*@} */
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Hardware Abstraction Layer
|
||||
Core Function Interface contains:
|
||||
- Core NVIC Functions
|
||||
- Core SysTick Functions
|
||||
- Core Register Access Functions
|
||||
******************************************************************************/
|
||||
/**
|
||||
\defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ########################## NVIC functions #################################### */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_NVICFunctions NVIC Functions
|
||||
\brief Functions that manage interrupts and exceptions via the NVIC.
|
||||
@{
|
||||
*/
|
||||
|
||||
#ifdef CMSIS_NVIC_VIRTUAL
|
||||
#ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||
#define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
|
||||
#endif
|
||||
#include CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||
#else
|
||||
#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
|
||||
#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
|
||||
#define NVIC_EnableIRQ __NVIC_EnableIRQ
|
||||
#define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
|
||||
#define NVIC_DisableIRQ __NVIC_DisableIRQ
|
||||
#define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
|
||||
#define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
|
||||
#define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
|
||||
/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */
|
||||
#define NVIC_SetPriority __NVIC_SetPriority
|
||||
#define NVIC_GetPriority __NVIC_GetPriority
|
||||
#define NVIC_SystemReset __NVIC_SystemReset
|
||||
#endif /* CMSIS_NVIC_VIRTUAL */
|
||||
|
||||
#ifdef CMSIS_VECTAB_VIRTUAL
|
||||
#ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||
#define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
|
||||
#endif
|
||||
#include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||
#else
|
||||
#define NVIC_SetVector __NVIC_SetVector
|
||||
#define NVIC_GetVector __NVIC_GetVector
|
||||
#endif /* (CMSIS_VECTAB_VIRTUAL) */
|
||||
|
||||
#define NVIC_USER_IRQ_OFFSET 16
|
||||
|
||||
|
||||
/* The following EXC_RETURN values are saved the LR on exception entry */
|
||||
#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
|
||||
#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
|
||||
#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
|
||||
|
||||
|
||||
/* Interrupt Priorities are WORD accessible only under Armv6-M */
|
||||
/* The following MACROS handle generation of the register offset and byte masks */
|
||||
#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
|
||||
#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
|
||||
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||
|
||||
#define __NVIC_SetPriorityGrouping(X) (void)(X)
|
||||
#define __NVIC_GetPriorityGrouping() (0U)
|
||||
|
||||
/**
|
||||
\brief Enable Interrupt
|
||||
\details Enables a device specific interrupt in the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Enable status
|
||||
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\return 0 Interrupt is not enabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Disable Interrupt
|
||||
\details Disables a device specific interrupt in the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
__DSB();
|
||||
__ISB();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Pending Interrupt
|
||||
\details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\return 0 Interrupt status is not pending.
|
||||
\return 1 Interrupt status is pending.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Pending Interrupt
|
||||
\details Sets the pending bit of a device specific interrupt in the NVIC pending register.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Clear Pending Interrupt
|
||||
\details Clears the pending bit of a device specific interrupt in the NVIC pending register.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Interrupt Priority
|
||||
\details Sets the priority of a device specific interrupt or a processor exception.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\param [in] priority Priority to set.
|
||||
\note The priority cannot be set for every processor exception.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||
}
|
||||
else
|
||||
{
|
||||
SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Priority
|
||||
\details Reads the priority of a device specific interrupt or a processor exception.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\return Interrupt Priority.
|
||||
Value is aligned automatically to the implemented priority bits of the microcontroller.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
|
||||
{
|
||||
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Encode Priority
|
||||
\details Encodes the priority for an interrupt with the given priority group,
|
||||
preemptive priority value, and subpriority value.
|
||||
In case of a conflict between priority grouping and available
|
||||
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
|
||||
\param [in] PriorityGroup Used priority group.
|
||||
\param [in] PreemptPriority Preemptive priority value (starting from 0).
|
||||
\param [in] SubPriority Subpriority value (starting from 0).
|
||||
\return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
|
||||
{
|
||||
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||
uint32_t PreemptPriorityBits;
|
||||
uint32_t SubPriorityBits;
|
||||
|
||||
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||
|
||||
return (
|
||||
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
|
||||
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Decode Priority
|
||||
\details Decodes an interrupt priority value with a given priority group to
|
||||
preemptive priority value and subpriority value.
|
||||
In case of a conflict between priority grouping and available
|
||||
priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
|
||||
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
|
||||
\param [in] PriorityGroup Used priority group.
|
||||
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
|
||||
\param [out] pSubPriority Subpriority value (starting from 0).
|
||||
*/
|
||||
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
|
||||
{
|
||||
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||
uint32_t PreemptPriorityBits;
|
||||
uint32_t SubPriorityBits;
|
||||
|
||||
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||
|
||||
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
|
||||
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Interrupt Vector
|
||||
\details Sets an interrupt vector in SRAM based interrupt vector table.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
Address 0 must be mapped to SRAM.
|
||||
\param [in] IRQn Interrupt number
|
||||
\param [in] vector Address of interrupt handler function
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
|
||||
{
|
||||
uint32_t *vectors = (uint32_t *)0x0U;
|
||||
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Vector
|
||||
\details Reads an interrupt vector from interrupt vector table.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\return Address of interrupt handler function
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
|
||||
{
|
||||
uint32_t *vectors = (uint32_t *)0x0U;
|
||||
return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief System Reset
|
||||
\details Initiates a system reset request to reset the MCU.
|
||||
*/
|
||||
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
|
||||
{
|
||||
__DSB(); /* Ensure all outstanding memory accesses included
|
||||
buffered write are completed before reset */
|
||||
SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
|
||||
SCB_AIRCR_SYSRESETREQ_Msk);
|
||||
__DSB(); /* Ensure completion of memory access */
|
||||
|
||||
for(;;) /* wait until reset */
|
||||
{
|
||||
__NOP();
|
||||
}
|
||||
}
|
||||
|
||||
/*@} end of CMSIS_Core_NVICFunctions */
|
||||
|
||||
|
||||
/* ########################## FPU functions #################################### */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_FpuFunctions FPU Functions
|
||||
\brief Function that provides FPU type.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief get FPU type
|
||||
\details returns the FPU type
|
||||
\returns
|
||||
- \b 0: No FPU
|
||||
- \b 1: Single precision FPU
|
||||
- \b 2: Double + Single precision FPU
|
||||
*/
|
||||
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
|
||||
{
|
||||
return 0U; /* No FPU */
|
||||
}
|
||||
|
||||
|
||||
/*@} end of CMSIS_Core_FpuFunctions */
|
||||
|
||||
|
||||
|
||||
/* ################################## SysTick function ############################################ */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_SysTickFunctions SysTick Functions
|
||||
\brief Functions that configure the System.
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
|
||||
|
||||
/**
|
||||
\brief System Tick Configuration
|
||||
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
|
||||
Counter is in free running mode to generate periodic interrupts.
|
||||
\param [in] ticks Number of ticks between two interrupts.
|
||||
\return 0 Function succeeded.
|
||||
\return 1 Function failed.
|
||||
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
|
||||
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
|
||||
must contain a vendor-specific implementation of this function.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
||||
{
|
||||
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
|
||||
{
|
||||
return (1UL); /* Reload value impossible */
|
||||
}
|
||||
|
||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_TICKINT_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
|
||||
return (0UL); /* Function successful */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of CMSIS_Core_SysTickFunctions */
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CORE_CM0_H_DEPENDANT */
|
||||
|
||||
#endif /* __CMSIS_GENERIC */
|
||||
1083
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm0plus.h
Normal file
1083
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm0plus.h
Normal file
File diff suppressed because it is too large
Load Diff
976
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm1.h
Normal file
976
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm1.h
Normal file
@@ -0,0 +1,976 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cm1.h
|
||||
* @brief CMSIS Cortex-M1 Core Peripheral Access Layer Header File
|
||||
* @version V1.0.0
|
||||
* @date 23. July 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CM1_H_GENERIC
|
||||
#define __CORE_CM1_H_GENERIC
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
|
||||
CMSIS violates the following MISRA-C:2004 rules:
|
||||
|
||||
\li Required Rule 8.5, object/function definition in header file.<br>
|
||||
Function definitions in header files are used to allow 'inlining'.
|
||||
|
||||
\li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
|
||||
Unions are used for effective representation of core registers.
|
||||
|
||||
\li Advisory Rule 19.7, Function-like macro defined.<br>
|
||||
Function-like macros are used to allow more efficient code.
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* CMSIS definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
\ingroup Cortex_M1
|
||||
@{
|
||||
*/
|
||||
|
||||
#include "cmsis_version.h"
|
||||
|
||||
/* CMSIS CM1 definitions */
|
||||
#define __CM1_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
|
||||
#define __CM1_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
|
||||
#define __CM1_CMSIS_VERSION ((__CM1_CMSIS_VERSION_MAIN << 16U) | \
|
||||
__CM1_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
|
||||
|
||||
#define __CORTEX_M (1U) /*!< Cortex-M Core */
|
||||
|
||||
/** __FPU_USED indicates whether an FPU is used or not.
|
||||
This core does not support an FPU at all
|
||||
*/
|
||||
#define __FPU_USED 0U
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#if defined __TARGET_FPU_VFP
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#if defined __ARM_PCS_VFP
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __GNUC__ )
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __ICCARM__ )
|
||||
#if defined __ARMVFP__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __TI_ARM__ )
|
||||
#if defined __TI_VFP_SUPPORT__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __TASKING__ )
|
||||
#if defined __FPU_VFP__
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#elif defined ( __CSMC__ )
|
||||
#if ( __CSMC__ & 0x400U)
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CORE_CM1_H_GENERIC */
|
||||
|
||||
#ifndef __CMSIS_GENERIC
|
||||
|
||||
#ifndef __CORE_CM1_H_DEPENDANT
|
||||
#define __CORE_CM1_H_DEPENDANT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* check device defines and use defaults */
|
||||
#if defined __CHECK_DEVICE_DEFINES
|
||||
#ifndef __CM1_REV
|
||||
#define __CM1_REV 0x0100U
|
||||
#warning "__CM1_REV not defined in device header file; using default!"
|
||||
#endif
|
||||
|
||||
#ifndef __NVIC_PRIO_BITS
|
||||
#define __NVIC_PRIO_BITS 2U
|
||||
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
|
||||
#endif
|
||||
|
||||
#ifndef __Vendor_SysTickConfig
|
||||
#define __Vendor_SysTickConfig 0U
|
||||
#warning "__Vendor_SysTickConfig not defined in device header file; using default!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* IO definitions (access restrictions to peripheral registers) */
|
||||
/**
|
||||
\defgroup CMSIS_glob_defs CMSIS Global Defines
|
||||
|
||||
<strong>IO Type Qualifiers</strong> are used
|
||||
\li to specify the access to peripheral variables.
|
||||
\li for automatic generation of peripheral register debug information.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#define __I volatile /*!< Defines 'read only' permissions */
|
||||
#else
|
||||
#define __I volatile const /*!< Defines 'read only' permissions */
|
||||
#endif
|
||||
#define __O volatile /*!< Defines 'write only' permissions */
|
||||
#define __IO volatile /*!< Defines 'read / write' permissions */
|
||||
|
||||
/* following defines should be used for structure members */
|
||||
#define __IM volatile const /*! Defines 'read only' structure member permissions */
|
||||
#define __OM volatile /*! Defines 'write only' structure member permissions */
|
||||
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
|
||||
|
||||
/*@} end of group Cortex_M1 */
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Register Abstraction
|
||||
Core Register contain:
|
||||
- Core Register
|
||||
- Core NVIC Register
|
||||
- Core SCB Register
|
||||
- Core SysTick Register
|
||||
******************************************************************************/
|
||||
/**
|
||||
\defgroup CMSIS_core_register Defines and Type Definitions
|
||||
\brief Type definitions and defines for Cortex-M processor based devices.
|
||||
*/
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_CORE Status and Control Registers
|
||||
\brief Core Register type definitions.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Union type to access the Application Program Status Register (APSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
|
||||
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} APSR_Type;
|
||||
|
||||
/* APSR Register Definitions */
|
||||
#define APSR_N_Pos 31U /*!< APSR: N Position */
|
||||
#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
|
||||
|
||||
#define APSR_Z_Pos 30U /*!< APSR: Z Position */
|
||||
#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
|
||||
|
||||
#define APSR_C_Pos 29U /*!< APSR: C Position */
|
||||
#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
|
||||
|
||||
#define APSR_V_Pos 28U /*!< APSR: V Position */
|
||||
#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Interrupt Program Status Register (IPSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||
uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} IPSR_Type;
|
||||
|
||||
/* IPSR Register Definitions */
|
||||
#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
|
||||
#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Special-Purpose Program Status Registers (xPSR).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||
uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
|
||||
uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
|
||||
uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
|
||||
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} xPSR_Type;
|
||||
|
||||
/* xPSR Register Definitions */
|
||||
#define xPSR_N_Pos 31U /*!< xPSR: N Position */
|
||||
#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
|
||||
|
||||
#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
|
||||
#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
|
||||
|
||||
#define xPSR_C_Pos 29U /*!< xPSR: C Position */
|
||||
#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
|
||||
|
||||
#define xPSR_V_Pos 28U /*!< xPSR: V Position */
|
||||
#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
|
||||
|
||||
#define xPSR_T_Pos 24U /*!< xPSR: T Position */
|
||||
#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
|
||||
|
||||
#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
|
||||
#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
|
||||
|
||||
|
||||
/**
|
||||
\brief Union type to access the Control Registers (CONTROL).
|
||||
*/
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t _reserved0:1; /*!< bit: 0 Reserved */
|
||||
uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
|
||||
uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
|
||||
} b; /*!< Structure used for bit access */
|
||||
uint32_t w; /*!< Type used for word access */
|
||||
} CONTROL_Type;
|
||||
|
||||
/* CONTROL Register Definitions */
|
||||
#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
|
||||
#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
|
||||
|
||||
/*@} end of group CMSIS_CORE */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
|
||||
\brief Type definitions for the NVIC Registers
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
|
||||
uint32_t RESERVED0[31U];
|
||||
__IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
|
||||
uint32_t RSERVED1[31U];
|
||||
__IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
|
||||
uint32_t RESERVED2[31U];
|
||||
__IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
|
||||
uint32_t RESERVED3[31U];
|
||||
uint32_t RESERVED4[64U];
|
||||
__IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
|
||||
} NVIC_Type;
|
||||
|
||||
/*@} end of group CMSIS_NVIC */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_SCB System Control Block (SCB)
|
||||
\brief Type definitions for the System Control Block Registers
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the System Control Block (SCB).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
|
||||
__IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
|
||||
uint32_t RESERVED0;
|
||||
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
|
||||
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
|
||||
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
|
||||
uint32_t RESERVED1;
|
||||
__IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
|
||||
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
|
||||
} SCB_Type;
|
||||
|
||||
/* SCB CPUID Register Definitions */
|
||||
#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
|
||||
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
|
||||
|
||||
#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
|
||||
#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
|
||||
|
||||
#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
|
||||
#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
|
||||
|
||||
#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
|
||||
#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
|
||||
|
||||
#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
|
||||
#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
|
||||
|
||||
/* SCB Interrupt Control State Register Definitions */
|
||||
#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */
|
||||
#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
|
||||
#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
|
||||
#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
|
||||
#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
|
||||
|
||||
#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
|
||||
#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
|
||||
#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
|
||||
|
||||
#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
|
||||
#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
|
||||
#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
|
||||
|
||||
#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
|
||||
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
|
||||
|
||||
/* SCB Application Interrupt and Reset Control Register Definitions */
|
||||
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
|
||||
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
|
||||
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
|
||||
|
||||
#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
|
||||
#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
|
||||
|
||||
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
|
||||
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
|
||||
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
|
||||
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
|
||||
|
||||
/* SCB System Control Register Definitions */
|
||||
#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
|
||||
#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
|
||||
#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
|
||||
|
||||
#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
|
||||
#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
|
||||
|
||||
/* SCB Configuration Control Register Definitions */
|
||||
#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */
|
||||
#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
|
||||
|
||||
#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
|
||||
#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
|
||||
|
||||
/* SCB System Handler Control and State Register Definitions */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
|
||||
#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
|
||||
|
||||
/*@} end of group CMSIS_SCB */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
|
||||
\brief Type definitions for the System Control and ID Register not in the SCB
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the System Control and ID Register not in the SCB.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t RESERVED0[2U];
|
||||
__IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
|
||||
} SCnSCB_Type;
|
||||
|
||||
/* Auxiliary Control Register Definitions */
|
||||
#define SCnSCB_ACTLR_ITCMUAEN_Pos 4U /*!< ACTLR: Instruction TCM Upper Alias Enable Position */
|
||||
#define SCnSCB_ACTLR_ITCMUAEN_Msk (1UL << SCnSCB_ACTLR_ITCMUAEN_Pos) /*!< ACTLR: Instruction TCM Upper Alias Enable Mask */
|
||||
|
||||
#define SCnSCB_ACTLR_ITCMLAEN_Pos 3U /*!< ACTLR: Instruction TCM Lower Alias Enable Position */
|
||||
#define SCnSCB_ACTLR_ITCMLAEN_Msk (1UL << SCnSCB_ACTLR_ITCMLAEN_Pos) /*!< ACTLR: Instruction TCM Lower Alias Enable Mask */
|
||||
|
||||
/*@} end of group CMSIS_SCnotSCB */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_SysTick System Tick Timer (SysTick)
|
||||
\brief Type definitions for the System Timer Registers.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Structure type to access the System Timer (SysTick).
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
|
||||
__IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
|
||||
__IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
|
||||
__IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
|
||||
} SysTick_Type;
|
||||
|
||||
/* SysTick Control / Status Register Definitions */
|
||||
#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
|
||||
#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
|
||||
|
||||
#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
|
||||
#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
|
||||
|
||||
#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
|
||||
#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
|
||||
|
||||
#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
|
||||
#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
|
||||
|
||||
/* SysTick Reload Register Definitions */
|
||||
#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
|
||||
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
|
||||
|
||||
/* SysTick Current Register Definitions */
|
||||
#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
|
||||
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
|
||||
|
||||
/* SysTick Calibration Register Definitions */
|
||||
#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
|
||||
#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
|
||||
|
||||
#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
|
||||
#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
|
||||
|
||||
#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
|
||||
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
|
||||
|
||||
/*@} end of group CMSIS_SysTick */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
|
||||
\brief Cortex-M1 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.
|
||||
Therefore they are not covered by the Cortex-M1 header file.
|
||||
@{
|
||||
*/
|
||||
/*@} end of group CMSIS_CoreDebug */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_core_bitfield Core register bit field macros
|
||||
\brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief Mask and shift a bit field value for use in a register bit range.
|
||||
\param[in] field Name of the register bit field.
|
||||
\param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
|
||||
\return Masked and shifted value.
|
||||
*/
|
||||
#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
|
||||
|
||||
/**
|
||||
\brief Mask and shift a register value to extract a bit filed value.
|
||||
\param[in] field Name of the register bit field.
|
||||
\param[in] value Value of register. This parameter is interpreted as an uint32_t type.
|
||||
\return Masked and shifted bit field value.
|
||||
*/
|
||||
#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
|
||||
|
||||
/*@} end of group CMSIS_core_bitfield */
|
||||
|
||||
|
||||
/**
|
||||
\ingroup CMSIS_core_register
|
||||
\defgroup CMSIS_core_base Core Definitions
|
||||
\brief Definitions for base addresses, unions, and structures.
|
||||
@{
|
||||
*/
|
||||
|
||||
/* Memory mapping of Core Hardware */
|
||||
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
|
||||
#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
|
||||
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
|
||||
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
|
||||
|
||||
#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
|
||||
#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
|
||||
#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
|
||||
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
|
||||
|
||||
|
||||
/*@} */
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Hardware Abstraction Layer
|
||||
Core Function Interface contains:
|
||||
- Core NVIC Functions
|
||||
- Core SysTick Functions
|
||||
- Core Register Access Functions
|
||||
******************************************************************************/
|
||||
/**
|
||||
\defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* ########################## NVIC functions #################################### */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_NVICFunctions NVIC Functions
|
||||
\brief Functions that manage interrupts and exceptions via the NVIC.
|
||||
@{
|
||||
*/
|
||||
|
||||
#ifdef CMSIS_NVIC_VIRTUAL
|
||||
#ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||
#define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
|
||||
#endif
|
||||
#include CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||
#else
|
||||
#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
|
||||
#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
|
||||
#define NVIC_EnableIRQ __NVIC_EnableIRQ
|
||||
#define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
|
||||
#define NVIC_DisableIRQ __NVIC_DisableIRQ
|
||||
#define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
|
||||
#define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
|
||||
#define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
|
||||
/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M1 */
|
||||
#define NVIC_SetPriority __NVIC_SetPriority
|
||||
#define NVIC_GetPriority __NVIC_GetPriority
|
||||
#define NVIC_SystemReset __NVIC_SystemReset
|
||||
#endif /* CMSIS_NVIC_VIRTUAL */
|
||||
|
||||
#ifdef CMSIS_VECTAB_VIRTUAL
|
||||
#ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||
#define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
|
||||
#endif
|
||||
#include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||
#else
|
||||
#define NVIC_SetVector __NVIC_SetVector
|
||||
#define NVIC_GetVector __NVIC_GetVector
|
||||
#endif /* (CMSIS_VECTAB_VIRTUAL) */
|
||||
|
||||
#define NVIC_USER_IRQ_OFFSET 16
|
||||
|
||||
|
||||
/* The following EXC_RETURN values are saved the LR on exception entry */
|
||||
#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
|
||||
#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
|
||||
#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
|
||||
|
||||
|
||||
/* Interrupt Priorities are WORD accessible only under Armv6-M */
|
||||
/* The following MACROS handle generation of the register offset and byte masks */
|
||||
#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
|
||||
#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
|
||||
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||
|
||||
#define __NVIC_SetPriorityGrouping(X) (void)(X)
|
||||
#define __NVIC_GetPriorityGrouping() (0U)
|
||||
|
||||
/**
|
||||
\brief Enable Interrupt
|
||||
\details Enables a device specific interrupt in the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Enable status
|
||||
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\return 0 Interrupt is not enabled.
|
||||
\return 1 Interrupt is enabled.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Disable Interrupt
|
||||
\details Disables a device specific interrupt in the NVIC interrupt controller.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
__DSB();
|
||||
__ISB();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Pending Interrupt
|
||||
\details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\return 0 Interrupt status is not pending.
|
||||
\return 1 Interrupt status is pending.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0U);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Pending Interrupt
|
||||
\details Sets the pending bit of a device specific interrupt in the NVIC pending register.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Clear Pending Interrupt
|
||||
\details Clears the pending bit of a device specific interrupt in the NVIC pending register.
|
||||
\param [in] IRQn Device specific interrupt number.
|
||||
\note IRQn must not be negative.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Interrupt Priority
|
||||
\details Sets the priority of a device specific interrupt or a processor exception.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\param [in] priority Priority to set.
|
||||
\note The priority cannot be set for every processor exception.
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
|
||||
{
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||
}
|
||||
else
|
||||
{
|
||||
SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Priority
|
||||
\details Reads the priority of a device specific interrupt or a processor exception.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\return Interrupt Priority.
|
||||
Value is aligned automatically to the implemented priority bits of the microcontroller.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
|
||||
{
|
||||
|
||||
if ((int32_t)(IRQn) >= 0)
|
||||
{
|
||||
return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Encode Priority
|
||||
\details Encodes the priority for an interrupt with the given priority group,
|
||||
preemptive priority value, and subpriority value.
|
||||
In case of a conflict between priority grouping and available
|
||||
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
|
||||
\param [in] PriorityGroup Used priority group.
|
||||
\param [in] PreemptPriority Preemptive priority value (starting from 0).
|
||||
\param [in] SubPriority Subpriority value (starting from 0).
|
||||
\return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
|
||||
*/
|
||||
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
|
||||
{
|
||||
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||
uint32_t PreemptPriorityBits;
|
||||
uint32_t SubPriorityBits;
|
||||
|
||||
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||
|
||||
return (
|
||||
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
|
||||
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Decode Priority
|
||||
\details Decodes an interrupt priority value with a given priority group to
|
||||
preemptive priority value and subpriority value.
|
||||
In case of a conflict between priority grouping and available
|
||||
priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
|
||||
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
|
||||
\param [in] PriorityGroup Used priority group.
|
||||
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
|
||||
\param [out] pSubPriority Subpriority value (starting from 0).
|
||||
*/
|
||||
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
|
||||
{
|
||||
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||
uint32_t PreemptPriorityBits;
|
||||
uint32_t SubPriorityBits;
|
||||
|
||||
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||
|
||||
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
|
||||
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
\brief Set Interrupt Vector
|
||||
\details Sets an interrupt vector in SRAM based interrupt vector table.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
Address 0 must be mapped to SRAM.
|
||||
\param [in] IRQn Interrupt number
|
||||
\param [in] vector Address of interrupt handler function
|
||||
*/
|
||||
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
|
||||
{
|
||||
uint32_t *vectors = (uint32_t *)0x0U;
|
||||
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Get Interrupt Vector
|
||||
\details Reads an interrupt vector from interrupt vector table.
|
||||
The interrupt number can be positive to specify a device specific interrupt,
|
||||
or negative to specify a processor exception.
|
||||
\param [in] IRQn Interrupt number.
|
||||
\return Address of interrupt handler function
|
||||
*/
|
||||
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
|
||||
{
|
||||
uint32_t *vectors = (uint32_t *)0x0U;
|
||||
return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief System Reset
|
||||
\details Initiates a system reset request to reset the MCU.
|
||||
*/
|
||||
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
|
||||
{
|
||||
__DSB(); /* Ensure all outstanding memory accesses included
|
||||
buffered write are completed before reset */
|
||||
SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
|
||||
SCB_AIRCR_SYSRESETREQ_Msk);
|
||||
__DSB(); /* Ensure completion of memory access */
|
||||
|
||||
for(;;) /* wait until reset */
|
||||
{
|
||||
__NOP();
|
||||
}
|
||||
}
|
||||
|
||||
/*@} end of CMSIS_Core_NVICFunctions */
|
||||
|
||||
|
||||
/* ########################## FPU functions #################################### */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_FpuFunctions FPU Functions
|
||||
\brief Function that provides FPU type.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
\brief get FPU type
|
||||
\details returns the FPU type
|
||||
\returns
|
||||
- \b 0: No FPU
|
||||
- \b 1: Single precision FPU
|
||||
- \b 2: Double + Single precision FPU
|
||||
*/
|
||||
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
|
||||
{
|
||||
return 0U; /* No FPU */
|
||||
}
|
||||
|
||||
|
||||
/*@} end of CMSIS_Core_FpuFunctions */
|
||||
|
||||
|
||||
|
||||
/* ################################## SysTick function ############################################ */
|
||||
/**
|
||||
\ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_SysTickFunctions SysTick Functions
|
||||
\brief Functions that configure the System.
|
||||
@{
|
||||
*/
|
||||
|
||||
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
|
||||
|
||||
/**
|
||||
\brief System Tick Configuration
|
||||
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
|
||||
Counter is in free running mode to generate periodic interrupts.
|
||||
\param [in] ticks Number of ticks between two interrupts.
|
||||
\return 0 Function succeeded.
|
||||
\return 1 Function failed.
|
||||
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
|
||||
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
|
||||
must contain a vendor-specific implementation of this function.
|
||||
*/
|
||||
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
||||
{
|
||||
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
|
||||
{
|
||||
return (1UL); /* Reload value impossible */
|
||||
}
|
||||
|
||||
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||
SysTick_CTRL_TICKINT_Msk |
|
||||
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
|
||||
return (0UL); /* Function successful */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of CMSIS_Core_SysTickFunctions */
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CORE_CM1_H_DEPENDANT */
|
||||
|
||||
#endif /* __CMSIS_GENERIC */
|
||||
1993
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm23.h
Normal file
1993
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm23.h
Normal file
File diff suppressed because it is too large
Load Diff
1941
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm3.h
Normal file
1941
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm3.h
Normal file
File diff suppressed because it is too large
Load Diff
3002
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm33.h
Normal file
3002
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm33.h
Normal file
File diff suppressed because it is too large
Load Diff
2129
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm4.h
Normal file
2129
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm4.h
Normal file
File diff suppressed because it is too large
Load Diff
2671
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm7.h
Normal file
2671
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_cm7.h
Normal file
File diff suppressed because it is too large
Load Diff
1022
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_sc000.h
Normal file
1022
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_sc000.h
Normal file
File diff suppressed because it is too large
Load Diff
1915
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_sc300.h
Normal file
1915
bsp/microchip/same70/bsp/CMSIS/Core/Include/core_sc300.h
Normal file
File diff suppressed because it is too large
Load Diff
270
bsp/microchip/same70/bsp/CMSIS/Core/Include/mpu_armv7.h
Normal file
270
bsp/microchip/same70/bsp/CMSIS/Core/Include/mpu_armv7.h
Normal file
@@ -0,0 +1,270 @@
|
||||
/******************************************************************************
|
||||
* @file mpu_armv7.h
|
||||
* @brief CMSIS MPU API for Armv7-M MPU
|
||||
* @version V5.0.4
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef ARM_MPU_ARMV7_H
|
||||
#define ARM_MPU_ARMV7_H
|
||||
|
||||
#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes
|
||||
#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes
|
||||
#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes
|
||||
#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes
|
||||
#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes
|
||||
#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte
|
||||
#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes
|
||||
#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte
|
||||
#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes
|
||||
#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte
|
||||
#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes
|
||||
#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes
|
||||
|
||||
#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access
|
||||
#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only
|
||||
#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only
|
||||
#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access
|
||||
#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only
|
||||
#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access
|
||||
|
||||
/** MPU Region Base Address Register Value
|
||||
*
|
||||
* \param Region The region to be configured, number 0 to 15.
|
||||
* \param BaseAddress The base address for the region.
|
||||
*/
|
||||
#define ARM_MPU_RBAR(Region, BaseAddress) \
|
||||
(((BaseAddress) & MPU_RBAR_ADDR_Msk) | \
|
||||
((Region) & MPU_RBAR_REGION_Msk) | \
|
||||
(MPU_RBAR_VALID_Msk))
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attributes
|
||||
*
|
||||
* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.
|
||||
* \param IsShareable Region is shareable between multiple bus masters.
|
||||
* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache.
|
||||
* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.
|
||||
*/
|
||||
#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \
|
||||
((((TypeExtField ) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \
|
||||
(((IsShareable ) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \
|
||||
(((IsCacheable ) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \
|
||||
(((IsBufferable ) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk))
|
||||
|
||||
/**
|
||||
* MPU Region Attribute and Size Register Value
|
||||
*
|
||||
* \param DisableExec Instruction access disable bit, 1= disable instruction fetches.
|
||||
* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode.
|
||||
* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_.
|
||||
* \param SubRegionDisable Sub-region disable field.
|
||||
* \param Size Region size of the region to be configured, for example 4K, 8K.
|
||||
*/
|
||||
#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \
|
||||
((((DisableExec ) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \
|
||||
(((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \
|
||||
(((AccessAttributes) ) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk)))
|
||||
|
||||
/**
|
||||
* MPU Region Attribute and Size Register Value
|
||||
*
|
||||
* \param DisableExec Instruction access disable bit, 1= disable instruction fetches.
|
||||
* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode.
|
||||
* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.
|
||||
* \param IsShareable Region is shareable between multiple bus masters.
|
||||
* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache.
|
||||
* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.
|
||||
* \param SubRegionDisable Sub-region disable field.
|
||||
* \param Size Region size of the region to be configured, for example 4K, 8K.
|
||||
*/
|
||||
#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \
|
||||
ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size)
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute for strongly ordered memory.
|
||||
* - TEX: 000b
|
||||
* - Shareable
|
||||
* - Non-cacheable
|
||||
* - Non-bufferable
|
||||
*/
|
||||
#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U)
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute for device memory.
|
||||
* - TEX: 000b (if non-shareable) or 010b (if shareable)
|
||||
* - Shareable or non-shareable
|
||||
* - Non-cacheable
|
||||
* - Bufferable (if shareable) or non-bufferable (if non-shareable)
|
||||
*
|
||||
* \param IsShareable Configures the device memory as shareable or non-shareable.
|
||||
*/
|
||||
#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U))
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute for normal memory.
|
||||
* - TEX: 1BBb (reflecting outer cacheability rules)
|
||||
* - Shareable or non-shareable
|
||||
* - Cacheable or non-cacheable (reflecting inner cacheability rules)
|
||||
* - Bufferable or non-bufferable (reflecting inner cacheability rules)
|
||||
*
|
||||
* \param OuterCp Configures the outer cache policy.
|
||||
* \param InnerCp Configures the inner cache policy.
|
||||
* \param IsShareable Configures the memory as shareable or non-shareable.
|
||||
*/
|
||||
#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) & 2U), ((InnerCp) & 1U))
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute non-cacheable policy.
|
||||
*/
|
||||
#define ARM_MPU_CACHEP_NOCACHE 0U
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute write-back, write and read allocate policy.
|
||||
*/
|
||||
#define ARM_MPU_CACHEP_WB_WRA 1U
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute write-through, no write allocate policy.
|
||||
*/
|
||||
#define ARM_MPU_CACHEP_WT_NWA 2U
|
||||
|
||||
/**
|
||||
* MPU Memory Access Attribute write-back, no write allocate policy.
|
||||
*/
|
||||
#define ARM_MPU_CACHEP_WB_NWA 3U
|
||||
|
||||
|
||||
/**
|
||||
* Struct for a single MPU Region
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t RBAR; //!< The region base address register value (RBAR)
|
||||
uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR
|
||||
} ARM_MPU_Region_t;
|
||||
|
||||
/** Enable the MPU.
|
||||
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Disable the MPU.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Disable(void)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||
}
|
||||
|
||||
/** Clear and disable the given MPU region.
|
||||
* \param rnr Region number to be cleared.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
|
||||
{
|
||||
MPU->RNR = rnr;
|
||||
MPU->RASR = 0U;
|
||||
}
|
||||
|
||||
/** Configure an MPU region.
|
||||
* \param rbar Value for RBAR register.
|
||||
* \param rsar Value for RSAR register.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr)
|
||||
{
|
||||
MPU->RBAR = rbar;
|
||||
MPU->RASR = rasr;
|
||||
}
|
||||
|
||||
/** Configure the given MPU region.
|
||||
* \param rnr Region number to be configured.
|
||||
* \param rbar Value for RBAR register.
|
||||
* \param rsar Value for RSAR register.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr)
|
||||
{
|
||||
MPU->RNR = rnr;
|
||||
MPU->RBAR = rbar;
|
||||
MPU->RASR = rasr;
|
||||
}
|
||||
|
||||
/** Memcopy with strictly ordered memory access, e.g. for register targets.
|
||||
* \param dst Destination data is copied to.
|
||||
* \param src Source data is copied from.
|
||||
* \param len Amount of data words to be copied.
|
||||
*/
|
||||
__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0U; i < len; ++i)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
/** Load the given number of MPU regions from a table.
|
||||
* \param table Pointer to the MPU configuration table.
|
||||
* \param cnt Amount of regions to be configured.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||
{
|
||||
const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
|
||||
while (cnt > MPU_TYPE_RALIASES) {
|
||||
orderedCpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize);
|
||||
table += MPU_TYPE_RALIASES;
|
||||
cnt -= MPU_TYPE_RALIASES;
|
||||
}
|
||||
orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize);
|
||||
}
|
||||
|
||||
#endif
|
||||
333
bsp/microchip/same70/bsp/CMSIS/Core/Include/mpu_armv8.h
Normal file
333
bsp/microchip/same70/bsp/CMSIS/Core/Include/mpu_armv8.h
Normal file
@@ -0,0 +1,333 @@
|
||||
/******************************************************************************
|
||||
* @file mpu_armv8.h
|
||||
* @brief CMSIS MPU API for Armv8-M MPU
|
||||
* @version V5.0.4
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef ARM_MPU_ARMV8_H
|
||||
#define ARM_MPU_ARMV8_H
|
||||
|
||||
/** \brief Attribute for device memory (outer only) */
|
||||
#define ARM_MPU_ATTR_DEVICE ( 0U )
|
||||
|
||||
/** \brief Attribute for non-cacheable, normal memory */
|
||||
#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U )
|
||||
|
||||
/** \brief Attribute for normal memory (outer and inner)
|
||||
* \param NT Non-Transient: Set to 1 for non-transient data.
|
||||
* \param WB Write-Back: Set to 1 to use write-back update policy.
|
||||
* \param RA Read Allocation: Set to 1 to use cache allocation on read miss.
|
||||
* \param WA Write Allocation: Set to 1 to use cache allocation on write miss.
|
||||
*/
|
||||
#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \
|
||||
(((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U))
|
||||
|
||||
/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */
|
||||
#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U)
|
||||
|
||||
/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */
|
||||
#define ARM_MPU_ATTR_DEVICE_nGnRE (1U)
|
||||
|
||||
/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */
|
||||
#define ARM_MPU_ATTR_DEVICE_nGRE (2U)
|
||||
|
||||
/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */
|
||||
#define ARM_MPU_ATTR_DEVICE_GRE (3U)
|
||||
|
||||
/** \brief Memory Attribute
|
||||
* \param O Outer memory attributes
|
||||
* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes
|
||||
*/
|
||||
#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U)))
|
||||
|
||||
/** \brief Normal memory non-shareable */
|
||||
#define ARM_MPU_SH_NON (0U)
|
||||
|
||||
/** \brief Normal memory outer shareable */
|
||||
#define ARM_MPU_SH_OUTER (2U)
|
||||
|
||||
/** \brief Normal memory inner shareable */
|
||||
#define ARM_MPU_SH_INNER (3U)
|
||||
|
||||
/** \brief Memory access permissions
|
||||
* \param RO Read-Only: Set to 1 for read-only memory.
|
||||
* \param NP Non-Privileged: Set to 1 for non-privileged memory.
|
||||
*/
|
||||
#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U))
|
||||
|
||||
/** \brief Region Base Address Register value
|
||||
* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned.
|
||||
* \param SH Defines the Shareability domain for this memory region.
|
||||
* \param RO Read-Only: Set to 1 for a read-only memory region.
|
||||
* \param NP Non-Privileged: Set to 1 for a non-privileged memory region.
|
||||
* \oaram XN eXecute Never: Set to 1 for a non-executable memory region.
|
||||
*/
|
||||
#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \
|
||||
((BASE & MPU_RBAR_BASE_Msk) | \
|
||||
((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \
|
||||
((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \
|
||||
((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk))
|
||||
|
||||
/** \brief Region Limit Address Register value
|
||||
* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
|
||||
* \param IDX The attribute index to be associated with this memory region.
|
||||
*/
|
||||
#define ARM_MPU_RLAR(LIMIT, IDX) \
|
||||
((LIMIT & MPU_RLAR_LIMIT_Msk) | \
|
||||
((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
|
||||
(MPU_RLAR_EN_Msk))
|
||||
|
||||
/**
|
||||
* Struct for a single MPU Region
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t RBAR; /*!< Region Base Address Register value */
|
||||
uint32_t RLAR; /*!< Region Limit Address Register value */
|
||||
} ARM_MPU_Region_t;
|
||||
|
||||
/** Enable the MPU.
|
||||
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Disable the MPU.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Disable(void)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||
}
|
||||
|
||||
#ifdef MPU_NS
|
||||
/** Enable the Non-secure MPU.
|
||||
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
}
|
||||
|
||||
/** Disable the Non-secure MPU.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Disable_NS(void)
|
||||
{
|
||||
__DSB();
|
||||
__ISB();
|
||||
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||
SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||
#endif
|
||||
MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Set the memory attribute encoding to the given MPU.
|
||||
* \param mpu Pointer to the MPU to be configured.
|
||||
* \param idx The attribute index to be set [0-7]
|
||||
* \param attr The attribute value to be set.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr)
|
||||
{
|
||||
const uint8_t reg = idx / 4U;
|
||||
const uint32_t pos = ((idx % 4U) * 8U);
|
||||
const uint32_t mask = 0xFFU << pos;
|
||||
|
||||
if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) {
|
||||
return; // invalid index
|
||||
}
|
||||
|
||||
mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask));
|
||||
}
|
||||
|
||||
/** Set the memory attribute encoding.
|
||||
* \param idx The attribute index to be set [0-7]
|
||||
* \param attr The attribute value to be set.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr)
|
||||
{
|
||||
ARM_MPU_SetMemAttrEx(MPU, idx, attr);
|
||||
}
|
||||
|
||||
#ifdef MPU_NS
|
||||
/** Set the memory attribute encoding to the Non-secure MPU.
|
||||
* \param idx The attribute index to be set [0-7]
|
||||
* \param attr The attribute value to be set.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr)
|
||||
{
|
||||
ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Clear and disable the given MPU region of the given MPU.
|
||||
* \param mpu Pointer to MPU to be used.
|
||||
* \param rnr Region number to be cleared.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr)
|
||||
{
|
||||
mpu->RNR = rnr;
|
||||
mpu->RLAR = 0U;
|
||||
}
|
||||
|
||||
/** Clear and disable the given MPU region.
|
||||
* \param rnr Region number to be cleared.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
|
||||
{
|
||||
ARM_MPU_ClrRegionEx(MPU, rnr);
|
||||
}
|
||||
|
||||
#ifdef MPU_NS
|
||||
/** Clear and disable the given Non-secure MPU region.
|
||||
* \param rnr Region number to be cleared.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr)
|
||||
{
|
||||
ARM_MPU_ClrRegionEx(MPU_NS, rnr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Configure the given MPU region of the given MPU.
|
||||
* \param mpu Pointer to MPU to be used.
|
||||
* \param rnr Region number to be configured.
|
||||
* \param rbar Value for RBAR register.
|
||||
* \param rlar Value for RLAR register.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||
{
|
||||
mpu->RNR = rnr;
|
||||
mpu->RBAR = rbar;
|
||||
mpu->RLAR = rlar;
|
||||
}
|
||||
|
||||
/** Configure the given MPU region.
|
||||
* \param rnr Region number to be configured.
|
||||
* \param rbar Value for RBAR register.
|
||||
* \param rlar Value for RLAR register.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||
{
|
||||
ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar);
|
||||
}
|
||||
|
||||
#ifdef MPU_NS
|
||||
/** Configure the given Non-secure MPU region.
|
||||
* \param rnr Region number to be configured.
|
||||
* \param rbar Value for RBAR register.
|
||||
* \param rlar Value for RLAR register.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||
{
|
||||
ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Memcopy with strictly ordered memory access, e.g. for register targets.
|
||||
* \param dst Destination data is copied to.
|
||||
* \param src Source data is copied from.
|
||||
* \param len Amount of data words to be copied.
|
||||
*/
|
||||
__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0U; i < len; ++i)
|
||||
{
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
||||
/** Load the given number of MPU regions from a table to the given MPU.
|
||||
* \param mpu Pointer to the MPU registers to be used.
|
||||
* \param rnr First region number to be configured.
|
||||
* \param table Pointer to the MPU configuration table.
|
||||
* \param cnt Amount of regions to be configured.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||
{
|
||||
const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
|
||||
if (cnt == 1U) {
|
||||
mpu->RNR = rnr;
|
||||
orderedCpy(&(mpu->RBAR), &(table->RBAR), rowWordSize);
|
||||
} else {
|
||||
uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U);
|
||||
uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES;
|
||||
|
||||
mpu->RNR = rnrBase;
|
||||
while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) {
|
||||
uint32_t c = MPU_TYPE_RALIASES - rnrOffset;
|
||||
orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize);
|
||||
table += c;
|
||||
cnt -= c;
|
||||
rnrOffset = 0U;
|
||||
rnrBase += MPU_TYPE_RALIASES;
|
||||
mpu->RNR = rnrBase;
|
||||
}
|
||||
|
||||
orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize);
|
||||
}
|
||||
}
|
||||
|
||||
/** Load the given number of MPU regions from a table.
|
||||
* \param rnr First region number to be configured.
|
||||
* \param table Pointer to the MPU configuration table.
|
||||
* \param cnt Amount of regions to be configured.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||
{
|
||||
ARM_MPU_LoadEx(MPU, rnr, table, cnt);
|
||||
}
|
||||
|
||||
#ifdef MPU_NS
|
||||
/** Load the given number of MPU regions from a table to the Non-secure MPU.
|
||||
* \param rnr First region number to be configured.
|
||||
* \param table Pointer to the MPU configuration table.
|
||||
* \param cnt Amount of regions to be configured.
|
||||
*/
|
||||
__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||
{
|
||||
ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
70
bsp/microchip/same70/bsp/CMSIS/Core/Include/tz_context.h
Normal file
70
bsp/microchip/same70/bsp/CMSIS/Core/Include/tz_context.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/******************************************************************************
|
||||
* @file tz_context.h
|
||||
* @brief Context Management for Armv8-M TrustZone
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef TZ_CONTEXT_H
|
||||
#define TZ_CONTEXT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef TZ_MODULEID_T
|
||||
#define TZ_MODULEID_T
|
||||
/// \details Data type that identifies secure software modules called by a process.
|
||||
typedef uint32_t TZ_ModuleId_t;
|
||||
#endif
|
||||
|
||||
/// \details TZ Memory ID identifies an allocated memory slot.
|
||||
typedef uint32_t TZ_MemoryId_t;
|
||||
|
||||
/// Initialize secure context memory system
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_InitContextSystem_S (void);
|
||||
|
||||
/// Allocate context memory for calling secure software modules in TrustZone
|
||||
/// \param[in] module identifies software modules called from non-secure mode
|
||||
/// \return value != 0 id TrustZone memory slot identifier
|
||||
/// \return value 0 no memory available or internal error
|
||||
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
|
||||
|
||||
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
|
||||
|
||||
/// Load secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
|
||||
|
||||
/// Store secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
|
||||
|
||||
#endif // TZ_CONTEXT_H
|
||||
@@ -0,0 +1,196 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<title>Overview</title>
|
||||
<title>CMSIS-Core (Cortex-M): Overview</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="cmsis.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="printComponentTabs.js"></script>
|
||||
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="resize.js"></script>
|
||||
<script type="text/javascript" src="navtree.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(initResizable);
|
||||
$(window).load(resizeHeight);
|
||||
</script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 46px;">
|
||||
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">CMSIS-Core (Cortex-M)
|
||||
 <span id="projectnumber">Version 5.1.2</span>
|
||||
</div>
|
||||
<div id="projectbrief">CMSIS-Core support for Cortex-M processor-based devices</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<div id="CMSISnav" class="tabs1">
|
||||
<ul class="tablist">
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
writeComponentTabs.call(this);
|
||||
//-->
|
||||
</script>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Generated by Doxygen 1.8.6 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="pages.html"><span>Usage and Description</span></a></li>
|
||||
<li><a href="modules.html"><span>Reference</span></a></li>
|
||||
<li>
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){initNavTree('index.html','');});
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Pages</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Overview </div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><p>CMSIS-Core (Cortex-M) implements the basic run-time system for a Cortex-M device and gives the user access to the processor core and the device peripherals. In detail it defines:</p>
|
||||
<ul>
|
||||
<li><b>Hardware Abstraction Layer (HAL)</b> for Cortex-M processor registers with standardized definitions for the SysTick, NVIC, System Control Block registers, MPU registers, FPU registers, and core access functions.</li>
|
||||
<li><b>System exception names</b> to interface to system exceptions without having compatibility issues.</li>
|
||||
<li><b>Methods to organize header files</b> that makes it easy to learn new Cortex-M microcontroller products and improve software portability. This includes naming conventions for device-specific interrupts.</li>
|
||||
<li><b>Methods for system initialization</b> to be used by each MCU vendor. For example, the standardized <a class="el" href="group__system__init__gr.html#ga93f514700ccf00d08dbdcff7f1224eb2" title="Function to Initialize the system. ">SystemInit()</a> function is essential for configuring the clock system of the device.</li>
|
||||
<li><b>Intrinsic functions</b> used to generate CPU instructions that are not supported by standard C functions.</li>
|
||||
<li>A variable to determine the <b>system clock frequency</b> which simplifies the setup the SysTick timer.</li>
|
||||
</ul>
|
||||
<p>The following sections provide details about the CMSIS-Core (Cortex-M):</p>
|
||||
<ul>
|
||||
<li><a class="el" href="using_pg.html">Using CMSIS in Embedded Applications</a> describes the project setup and shows a simple program example.</li>
|
||||
<li><a class="el" href="using_TrustZone_pg.html">Using TrustZone® for Armv8-M</a> describes how to use the security extensions available in the Armv8-M architecture.</li>
|
||||
<li><a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a> describes the files of the CMSIS-Core (Cortex-M) in detail and explains how to adapt template files provided by Arm to silicon vendor devices.</li>
|
||||
<li><a class="el" href="coreMISRA_Exceptions_pg.html">MISRA-C Deviations</a> describes the violations to the MISRA standard.</li>
|
||||
<li><a href="Modules.html"><b>Reference</b> </a> describe the features and functions of the <a class="el" href="device_h_pg.html">Device Header File <device.h></a> in detail.</li>
|
||||
<li><a href="Annotated.html"><b>Data</b> <b>Structures</b> </a> describe the data structures of the <a class="el" href="device_h_pg.html">Device Header File <device.h></a> in detail.</li>
|
||||
</ul>
|
||||
<hr/>
|
||||
<h2>CMSIS-Core (Cortex-M) in ARM::CMSIS Pack </h2>
|
||||
<p>Files relevant to CMSIS-Core (Cortex-M) are present in the following <b>ARM::CMSIS</b> directories: </p>
|
||||
<table class="doxtable">
|
||||
<tr>
|
||||
<th>File/Folder </th><th>Content </th></tr>
|
||||
<tr>
|
||||
<td><b>CMSIS\Documentation\Core</b> </td><td>This documentation </td></tr>
|
||||
<tr>
|
||||
<td><b>CMSIS\Core\Include</b> </td><td>CMSIS-Core (Cortex-M) header files (for example core_cm3.h, core_cmInstr.h, etc.) </td></tr>
|
||||
<tr>
|
||||
<td><b>Device</b> </td><td><a class="el" href="using_ARM_pg.html">Arm reference implementations</a> of Cortex-M devices </td></tr>
|
||||
<tr>
|
||||
<td><b>Device\_Template_Vendor</b> </td><td><a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a> for extension by silicon vendors </td></tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<h1><a class="anchor" id="ref_v6-v8M"></a>
|
||||
Processor Support</h1>
|
||||
<p>CMSIS supports the complete range of <a href="http://www.arm.com/products/processors/cortex-m/index.php" target="_blank"><b>Cortex-M processors</b></a> (with exception of Cortex-M1) and the <a href="http://www.arm.com/products/processors/instruction-set-architectures/armv8-m-architecture.php" target="_blank"><b>Armv8-M architecture</b></a> including security extensions.</p>
|
||||
<h2><a class="anchor" id="ref_man_sec"></a>
|
||||
Cortex-M Reference Manuals</h2>
|
||||
<p>The Cortex-M Device Generic User Guides contain the programmers model and detailed information about the core peripherals and are available for:</p>
|
||||
<ul>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0497a/DUI0497A_cortex_m0_r0p0_generic_ug.pdf" target="_blank"><b>Cortex-M0 Devices Generic User Guide</b></a> (Armv6-M architecture)</li>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf" target="_blank"><b>Cortex-M0+ Devices Generic User Guide</b></a> (Armv6-M architecture)</li>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0552a/DUI0552A_cortex_m3_dgug.pdf" target="_blank"><b>Cortex-M3 Devices Generic User Guide</b></a> (Armv7-M architecture)</li>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0553a/DUI0553A_cortex_m4_dgug.pdf" target="_blank"><b>Cortex-M4 Devices Generic User Guide</b></a> (ARMv7-M architecture)</li>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.dui0646a/DUI0646A_cortex_m7_dgug.pdf" target="_blank"><b>Cortex-M7 Devices Generic User Guide</b></a> (Armv7-M architecture)</li>
|
||||
</ul>
|
||||
<p>The <b>Cortex-M23</b> and <b>Cortex-M33</b> are described with Technical Reference Manuals that are available here:</p>
|
||||
<ul>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.ddi0550c/cortex_m23_r1p0_technical_reference_manual_DDI0550C_en.pdf" target="_blank"><b>Cortex-M23 Technical Reference Manual</b></a> (Armv8-M baseline architecture)</li>
|
||||
<li><a href="http://infocenter.arm.com/help/topic/com.arm.doc.100230_0002_00_en/cortex_m33_trm_100230_0002_00_en.pdf" target="_blank"><b>Cortex-M33 Technical Reference Manual</b></a> (Armv8-M mainline architecture)</li>
|
||||
</ul>
|
||||
<h2><a class="anchor" id="ARMv8M"></a>
|
||||
Armv8-M Architecture</h2>
|
||||
<p>Armv8-M introduces two profiles <b>baseline</b> (for power and area constrained applications) and <b>mainline</b> (full-featured with optional SIMD, floating-point, and co-processor extensions). Both Armv8-M profiles are supported by CMSIS.</p>
|
||||
<p>The Armv8-M Architecture is described in the <a href="http://developer.arm.com/products/architecture/m-profile/docs/ddi0553/latest/armv8-m-architecture-reference-manual" target="_blank"><b>Armv8-M Architecture Reference Manual</b></a>.</p>
|
||||
<hr/>
|
||||
<h1><a class="anchor" id="tested_tools_sec"></a>
|
||||
Tested and Verified Toolchains</h1>
|
||||
<p>The <a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a> supplied by Arm have been tested and verified with the following toolchains:</p>
|
||||
<ul>
|
||||
<li>Arm: Arm Compiler 5.06 update 6 (not for Cortex-M23, Cortex-M33, Armv8-M)</li>
|
||||
<li>Arm: Arm Compiler 6.9</li>
|
||||
<li>Arm: Arm Compiler 6.6.2 (not for Cortex-M0, Cortex-M23, Cortex-M33, Armv8-M)</li>
|
||||
<li>GNU: GNU Tools for Arm Embedded 6.3.1 20170620</li>
|
||||
<li>IAR: IAR ANSI C/C++ Compiler for Arm 8.20.1.14183</li>
|
||||
</ul>
|
||||
<hr/>
|
||||
</div></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer">Generated on Wed Aug 1 2018 17:12:09 for CMSIS-Core (Cortex-M) by Arm Ltd. All rights reserved.
|
||||
<!--
|
||||
<a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6
|
||||
-->
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
54
bsp/microchip/same70/bsp/SConscript
Normal file
54
bsp/microchip/same70/bsp/SConscript
Normal file
@@ -0,0 +1,54 @@
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
# get current directory
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
#var defined
|
||||
CPPDEFINES = []
|
||||
|
||||
#common lib define
|
||||
CPPDEFINES += [rtconfig.DEVICE_TYPE]
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
|
||||
src = Glob('hal/src/*.c')
|
||||
src += Glob('hal/utils/src/*.c')
|
||||
src += Glob('hpl/core/*.c')
|
||||
src += Glob('hpl/mcan/*.c')
|
||||
src += Glob('hpl/pmc/*.c')
|
||||
src += Glob('hpl/systick/*.c')
|
||||
src += Glob('hpl/usart/*.c')
|
||||
src += Glob('hpl/xdmac/*.c')
|
||||
src += [cwd + '/atmel_start.c']
|
||||
src += [cwd + '/driver_init.c']
|
||||
|
||||
#add for startup script
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src += [cwd + '/same70b/gcc/system_same70q21b.c']
|
||||
src += [cwd + '/same70b/gcc/gcc/startup_same70q21b.c']
|
||||
elif rtconfig.CROSS_TOOL == 'keil':
|
||||
src += [cwd + '/same70b/armcc/Source/' + 'system_same70q21b.c']
|
||||
src += [cwd + '/same70b/armcc/Source/ARM/' + 'startup_SAME70.s']
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src += [cwd + '/same70b/iar/' + 'system_same70q21b.c']
|
||||
src += [cwd + '/same70b/iar/iar/' + 'startup_same70q21b.c']
|
||||
|
||||
path = [
|
||||
cwd,
|
||||
cwd + '/CMSIS/Core/Include',
|
||||
cwd + '/config',
|
||||
cwd + '/hal/include',
|
||||
cwd + '/hal/utils/include',
|
||||
cwd + '/hpl/core',
|
||||
cwd + '/hpl/mcan',
|
||||
cwd + '/hpl/pio',
|
||||
cwd + '/hpl/pmc',
|
||||
cwd + '/hpl/systick',
|
||||
cwd + '/hpl/usart',
|
||||
cwd + '/hri',
|
||||
cwd + '/same70b/include',]
|
||||
|
||||
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
Return('group')
|
||||
9
bsp/microchip/same70/bsp/atmel_start.c
Normal file
9
bsp/microchip/same70/bsp/atmel_start.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <atmel_start.h>
|
||||
|
||||
/**
|
||||
* Initializes MCU, drivers and middleware in the project
|
||||
**/
|
||||
void atmel_start_init(void)
|
||||
{
|
||||
system_init();
|
||||
}
|
||||
18
bsp/microchip/same70/bsp/atmel_start.h
Normal file
18
bsp/microchip/same70/bsp/atmel_start.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef ATMEL_START_H_INCLUDED
|
||||
#define ATMEL_START_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "driver_init.h"
|
||||
|
||||
/**
|
||||
* Initializes MCU, drivers and middleware in the project
|
||||
**/
|
||||
void atmel_start_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
585
bsp/microchip/same70/bsp/atmel_start_config.atstart
Normal file
585
bsp/microchip/same70/bsp/atmel_start_config.atstart
Normal file
@@ -0,0 +1,585 @@
|
||||
format_version: '2'
|
||||
name: SAME70 LED switcher
|
||||
versions:
|
||||
api: '1.0'
|
||||
backend: 1.8.580
|
||||
commit: f3d8d96e294de8dee688333bbbe8d8458a4f6b4c
|
||||
content: unknown
|
||||
content_pack_name: unknown
|
||||
format: '2'
|
||||
frontend: 1.8.580
|
||||
packs_version_avr8: 1.0.1463
|
||||
packs_version_qtouch: unknown
|
||||
packs_version_sam: 1.0.1726
|
||||
version_backend: 1.8.580
|
||||
version_frontend: ''
|
||||
board:
|
||||
identifier: SAME70Xplained
|
||||
device: ATSAME70Q21B-AN
|
||||
details: null
|
||||
application:
|
||||
definition: 'Atmel:Application_Examples:0.0.1::Application:LED_switcher:'
|
||||
configuration: null
|
||||
middlewares: {}
|
||||
drivers:
|
||||
PMC:
|
||||
user_label: PMC
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::PMC::driver_config_definition::PMC::HAL:HPL:PMC
|
||||
functionality: System
|
||||
api: HAL:HPL:PMC
|
||||
configuration:
|
||||
$input: 240000000
|
||||
$input_id: UDPLL with Divider (MCKR UPLLDIV2)
|
||||
RESERVED_InputFreq: 240000000
|
||||
RESERVED_InputFreq_id: UDPLL with Divider (MCKR UPLLDIV2)
|
||||
_$freq_output_32kHz External Crystal Oscillator (XOSC32K): 0
|
||||
_$freq_output_32kHz High Accuracy Internal Oscillator (OSC32K): 0
|
||||
_$freq_output_Embedded 4/8/12MHz RC Oscillator (OSC12M): '12000000'
|
||||
_$freq_output_External 3-20MHz Oscillator (XOSC20M): 12000000
|
||||
_$freq_output_External Clock: 1
|
||||
_$freq_output_Generic Clock 0 (GCLK0) for I2SC0: 75000000
|
||||
_$freq_output_Generic Clock 1 (GCLK1) for I2SC1: 100000000
|
||||
_$freq_output_MCK / 8 for USART: 18750000
|
||||
_$freq_output_Master Clock (MCK): 150000000
|
||||
_$freq_output_Master Clock Controller (PMC_MCKR): 300000000
|
||||
_$freq_output_PLLA Clock (PLLACK): 300000000
|
||||
_$freq_output_Programmable Clock Controller 0 (PMC_PCK0): 12000000
|
||||
_$freq_output_Programmable Clock Controller 1 (PMC_PCK1): 6000000
|
||||
_$freq_output_Programmable Clock Controller 2 (PMC_PCK2): 4000000
|
||||
_$freq_output_Programmable Clock Controller 3 (PMC_PCK3): 3000000
|
||||
_$freq_output_Programmable Clock Controller 4 (PMC_PCK4): 2400000
|
||||
_$freq_output_Programmable Clock Controller 5 (PMC_PCK5): 40000000
|
||||
_$freq_output_Programmable Clock Controller 6 (PMC_PCK6): 1714285.7142857143
|
||||
_$freq_output_SysTick External Clock: 37500000
|
||||
_$freq_output_UDPLL with Divider (MCKR UPLLDIV2): 240000000
|
||||
_$freq_output_USB 480M Clock (UPLLCK): 480000000
|
||||
_$freq_output_USB Clock Controller (USB_48M): 300000000
|
||||
clk_gen_cfden_enable: false
|
||||
clk_gen_fclk_oscillator: Master Clock Controller (PMC_MCKR)
|
||||
clk_gen_gclk0_arch_enable: true
|
||||
clk_gen_gclk0_oscillator: Master Clock (MCK)
|
||||
clk_gen_gclk1_arch_enable: true
|
||||
clk_gen_gclk1_oscillator: PLLA Clock (PLLACK)
|
||||
clk_gen_mainck_arch_enable: true
|
||||
clk_gen_mainck_oscillator: External 3-20MHz Oscillator (XOSC20M)
|
||||
clk_gen_mck_oscillator: Master Clock Controller (PMC_MCKR)
|
||||
clk_gen_mckr_arch_enable: true
|
||||
clk_gen_mckr_oscillator: PLLA Clock (PLLACK)
|
||||
clk_gen_pck0_arch_enable: false
|
||||
clk_gen_pck0_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_pck1_arch_enable: false
|
||||
clk_gen_pck1_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_pck2_arch_enable: false
|
||||
clk_gen_pck2_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_pck3_arch_enable: false
|
||||
clk_gen_pck3_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_pck4_arch_enable: false
|
||||
clk_gen_pck4_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_pck5_arch_enable: true
|
||||
clk_gen_pck5_oscillator: UDPLL with Divider (MCKR UPLLDIV2)
|
||||
clk_gen_pck6_arch_enable: false
|
||||
clk_gen_pck6_oscillator: Main Clock (MAINCK)
|
||||
clk_gen_slck2_oscillator: Slow Clock (SLCK)
|
||||
clk_gen_slck_arch_enable: true
|
||||
clk_gen_slck_oscillator: 32kHz High Accuracy Internal Oscillator (OSC32K)
|
||||
clk_gen_systick_oscillator: Master Clock Controller (PMC_MCKR)
|
||||
clk_gen_usb_480m_oscillator: USB 480M Clock (UPLLCK)
|
||||
clk_gen_usb_48m_arch_enable: false
|
||||
clk_gen_usb_48m_oscillator: PLLA Clock (PLLACK)
|
||||
dummy_ext_clk_src: External Clock Input
|
||||
dummy_ext_src: Specific clock input from specific pin
|
||||
efc_fws: 6 cycles
|
||||
enable_clk_gen_fclk: true
|
||||
enable_clk_gen_gclk0: true
|
||||
enable_clk_gen_gclk1: true
|
||||
enable_clk_gen_mainck: true
|
||||
enable_clk_gen_mck: true
|
||||
enable_clk_gen_mckr: true
|
||||
enable_clk_gen_pck0: true
|
||||
enable_clk_gen_pck1: true
|
||||
enable_clk_gen_pck2: true
|
||||
enable_clk_gen_pck3: true
|
||||
enable_clk_gen_pck4: true
|
||||
enable_clk_gen_pck5: true
|
||||
enable_clk_gen_pck6: true
|
||||
enable_clk_gen_slck: true
|
||||
enable_clk_gen_slck2: true
|
||||
enable_clk_gen_systick: true
|
||||
enable_clk_gen_usb_480m: true
|
||||
enable_clk_gen_usb_48m: true
|
||||
enable_dummy_ext: true
|
||||
enable_dummy_ext_clk: true
|
||||
enable_hclk_clock: true
|
||||
enable_mck_div_8: false
|
||||
enable_osc12m: false
|
||||
enable_osc32k: true
|
||||
enable_pllack: true
|
||||
enable_systick_clk_clock: true
|
||||
enable_upllck: true
|
||||
enable_upllckdiv: true
|
||||
enable_xosc20m: true
|
||||
enable_xosc32k: false
|
||||
gclk0_div: 2
|
||||
gclk0_gclken_enable: false
|
||||
gclk1_div: 3
|
||||
gclk1_gclken_enable: false
|
||||
hclk_clock_source: Master Clock Controller (PMC_MCKR)
|
||||
mck_div: '2'
|
||||
mck_div_8_src: Master Clock (MCK)
|
||||
mckr_presc: '1'
|
||||
osc12m_arch_enable: false
|
||||
osc12m_selector: '12000000'
|
||||
osc32k_arch_enable: false
|
||||
pck0_presc: 1
|
||||
pck1_presc: 2
|
||||
pck2_presc: 3
|
||||
pck3_presc: 4
|
||||
pck4_presc: 5
|
||||
pck5_presc: 6
|
||||
pck6_presc: 7
|
||||
pllack_arch_enable: true
|
||||
pllack_div: 1
|
||||
pllack_mul: 25
|
||||
pllack_ref_clock: Main Clock (MAINCK)
|
||||
systick_clk_clock_div: '8'
|
||||
systick_clk_clock_source: Master Clock Controller (PMC_MCKR)
|
||||
systick_clock_div: '8'
|
||||
upllck_arch_enable: true
|
||||
upllck_ref_clock: External 3-20MHz Oscillator (XOSC20M)
|
||||
upllckdiv_div: '2'
|
||||
upllckdiv_ref_clock: USB 480M Clock (UPLLCK)
|
||||
usb_48m_div: 1
|
||||
xosc20m_arch_enable: true
|
||||
xosc20m_bypass: The external crystal oscillator is not bypassed.
|
||||
xosc20m_selector: 12000000
|
||||
xosc20m_startup_time: 62
|
||||
xosc32k_arch_enable: false
|
||||
xosc32k_bypass: The 32kHz crystal oscillator is not bypassed.
|
||||
optional_signals: []
|
||||
variant: null
|
||||
clocks:
|
||||
domain_group:
|
||||
nodes:
|
||||
- name: CPU
|
||||
input: CPU
|
||||
external: false
|
||||
external_frequency: 0
|
||||
configuration: {}
|
||||
DELAY_0:
|
||||
user_label: DELAY_0
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::SysTick::driver_config_definition::Delay::HAL:Driver:Delay
|
||||
functionality: Delay
|
||||
api: HAL:Driver:Delay
|
||||
configuration:
|
||||
systick_arch_tickint: false
|
||||
optional_signals: []
|
||||
variant: null
|
||||
clocks:
|
||||
domain_group: null
|
||||
TARGET_IO:
|
||||
user_label: TARGET_IO
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::USART1::driver_config_definition::UART::HAL:Driver:USART.Sync
|
||||
functionality: USART
|
||||
api: HAL:Driver:USART_Sync
|
||||
configuration:
|
||||
usart_9bits_enable: false
|
||||
usart__inack: The NACK is not generated
|
||||
usart__oversampling_mode: 16 Oversampling
|
||||
usart_advanced: false
|
||||
usart_arch_fractional: 0
|
||||
usart_arch_msbf: LSB is transmitted first
|
||||
usart_baud_rate: 115200
|
||||
usart_channel_mode: Normal Mode
|
||||
usart_character_size: 8 bits
|
||||
usart_clock_output_select: The USART does not drive the SCK pin
|
||||
usart_dsnack: NACK is sent on the ISO line as soon as a parity error occurs
|
||||
usart_invdata: Data isn't inverted, nomal mode
|
||||
usart_manchester_filter_enable: false
|
||||
usart_manchester_synchronization_mode: The Manchester start bit is a 0 to 1
|
||||
transition
|
||||
usart_max_iteration: 0
|
||||
usart_parity: No parity
|
||||
usart_receive_filter_enable: false
|
||||
usart_start_frame_delimiter: Start frame delimiter is COMMAND or DATA SYNC
|
||||
usart_stop_bit: 1 stop bit
|
||||
variable_sync: User defined configuration
|
||||
optional_signals:
|
||||
- identifier: TARGET_IO:RXD/1
|
||||
pad: PA21
|
||||
mode: Enabled
|
||||
configuration: null
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::optional_signal_definition::USART1.RXD.1
|
||||
name: USART1/RXD/1
|
||||
label: RXD/1
|
||||
- identifier: TARGET_IO:TXD/1
|
||||
pad: PB4
|
||||
mode: Enabled
|
||||
configuration: null
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::optional_signal_definition::USART1.TXD.1
|
||||
name: USART1/TXD/1
|
||||
label: TXD/1
|
||||
variant: null
|
||||
clocks:
|
||||
domain_group:
|
||||
nodes:
|
||||
- name: USART
|
||||
input: Master Clock (MCK)
|
||||
external: false
|
||||
external_frequency: 0
|
||||
configuration:
|
||||
usart_clock_source: Master Clock (MCK)
|
||||
XDMAC:
|
||||
user_label: XDMAC
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::XDMAC::driver_config_definition::DMAC::HAL:HPL:DMAC
|
||||
functionality: System
|
||||
api: HAL:HPL:DMAC
|
||||
configuration:
|
||||
dma_des_interface_0: AHB_IF0
|
||||
dma_des_interface_1: AHB_IF0
|
||||
dma_des_interface_10: AHB_IF0
|
||||
dma_des_interface_11: AHB_IF0
|
||||
dma_des_interface_12: AHB_IF0
|
||||
dma_des_interface_13: AHB_IF0
|
||||
dma_des_interface_14: AHB_IF0
|
||||
dma_des_interface_15: AHB_IF0
|
||||
dma_des_interface_16: AHB_IF0
|
||||
dma_des_interface_17: AHB_IF0
|
||||
dma_des_interface_18: AHB_IF0
|
||||
dma_des_interface_19: AHB_IF0
|
||||
dma_des_interface_2: AHB_IF0
|
||||
dma_des_interface_20: AHB_IF0
|
||||
dma_des_interface_21: AHB_IF0
|
||||
dma_des_interface_22: AHB_IF0
|
||||
dma_des_interface_23: AHB_IF0
|
||||
dma_des_interface_3: AHB_IF0
|
||||
dma_des_interface_4: AHB_IF0
|
||||
dma_des_interface_5: AHB_IF0
|
||||
dma_des_interface_6: AHB_IF0
|
||||
dma_des_interface_7: AHB_IF0
|
||||
dma_des_interface_8: AHB_IF0
|
||||
dma_des_interface_9: AHB_IF0
|
||||
dma_src_interface_0: AHB_IF0
|
||||
dma_src_interface_1: AHB_IF0
|
||||
dma_src_interface_10: AHB_IF0
|
||||
dma_src_interface_11: AHB_IF0
|
||||
dma_src_interface_12: AHB_IF0
|
||||
dma_src_interface_13: AHB_IF0
|
||||
dma_src_interface_14: AHB_IF0
|
||||
dma_src_interface_15: AHB_IF0
|
||||
dma_src_interface_16: AHB_IF0
|
||||
dma_src_interface_17: AHB_IF0
|
||||
dma_src_interface_18: AHB_IF0
|
||||
dma_src_interface_19: AHB_IF0
|
||||
dma_src_interface_2: AHB_IF0
|
||||
dma_src_interface_20: AHB_IF0
|
||||
dma_src_interface_21: AHB_IF0
|
||||
dma_src_interface_22: AHB_IF0
|
||||
dma_src_interface_23: AHB_IF0
|
||||
dma_src_interface_3: AHB_IF0
|
||||
dma_src_interface_4: AHB_IF0
|
||||
dma_src_interface_5: AHB_IF0
|
||||
dma_src_interface_6: AHB_IF0
|
||||
dma_src_interface_7: AHB_IF0
|
||||
dma_src_interface_8: AHB_IF0
|
||||
dma_src_interface_9: AHB_IF0
|
||||
dma_trans_type_0: Memory to Memory Transfer
|
||||
dma_trans_type_1: Memory to Memory Transfer
|
||||
dma_trans_type_10: Memory to Memory Transfer
|
||||
dma_trans_type_11: Memory to Memory Transfer
|
||||
dma_trans_type_12: Memory to Memory Transfer
|
||||
dma_trans_type_13: Memory to Memory Transfer
|
||||
dma_trans_type_14: Memory to Memory Transfer
|
||||
dma_trans_type_15: Memory to Memory Transfer
|
||||
dma_trans_type_16: Memory to Memory Transfer
|
||||
dma_trans_type_17: Memory to Memory Transfer
|
||||
dma_trans_type_18: Memory to Memory Transfer
|
||||
dma_trans_type_19: Memory to Memory Transfer
|
||||
dma_trans_type_2: Memory to Memory Transfer
|
||||
dma_trans_type_20: Memory to Memory Transfer
|
||||
dma_trans_type_21: Memory to Memory Transfer
|
||||
dma_trans_type_22: Memory to Memory Transfer
|
||||
dma_trans_type_23: Memory to Memory Transfer
|
||||
dma_trans_type_3: Memory to Memory Transfer
|
||||
dma_trans_type_4: Memory to Memory Transfer
|
||||
dma_trans_type_5: Memory to Memory Transfer
|
||||
dma_trans_type_6: Memory to Memory Transfer
|
||||
dma_trans_type_7: Memory to Memory Transfer
|
||||
dma_trans_type_8: Memory to Memory Transfer
|
||||
dma_trans_type_9: Memory to Memory Transfer
|
||||
dmac_beatsize_0: 8-bit bus transfer
|
||||
dmac_beatsize_1: 8-bit bus transfer
|
||||
dmac_beatsize_10: 8-bit bus transfer
|
||||
dmac_beatsize_11: 8-bit bus transfer
|
||||
dmac_beatsize_12: 8-bit bus transfer
|
||||
dmac_beatsize_13: 8-bit bus transfer
|
||||
dmac_beatsize_14: 8-bit bus transfer
|
||||
dmac_beatsize_15: 8-bit bus transfer
|
||||
dmac_beatsize_16: 8-bit bus transfer
|
||||
dmac_beatsize_17: 8-bit bus transfer
|
||||
dmac_beatsize_18: 8-bit bus transfer
|
||||
dmac_beatsize_19: 8-bit bus transfer
|
||||
dmac_beatsize_2: 8-bit bus transfer
|
||||
dmac_beatsize_20: 8-bit bus transfer
|
||||
dmac_beatsize_21: 8-bit bus transfer
|
||||
dmac_beatsize_22: 8-bit bus transfer
|
||||
dmac_beatsize_23: 8-bit bus transfer
|
||||
dmac_beatsize_3: 8-bit bus transfer
|
||||
dmac_beatsize_4: 8-bit bus transfer
|
||||
dmac_beatsize_5: 8-bit bus transfer
|
||||
dmac_beatsize_6: 8-bit bus transfer
|
||||
dmac_beatsize_7: 8-bit bus transfer
|
||||
dmac_beatsize_8: 8-bit bus transfer
|
||||
dmac_beatsize_9: 8-bit bus transfer
|
||||
dmac_burstsize_0: 1 burst size
|
||||
dmac_burstsize_1: 1 burst size
|
||||
dmac_burstsize_10: 1 burst size
|
||||
dmac_burstsize_11: 1 burst size
|
||||
dmac_burstsize_12: 1 burst size
|
||||
dmac_burstsize_13: 1 burst size
|
||||
dmac_burstsize_14: 1 burst size
|
||||
dmac_burstsize_15: 1 burst size
|
||||
dmac_burstsize_16: 1 burst size
|
||||
dmac_burstsize_17: 1 burst size
|
||||
dmac_burstsize_18: 1 burst size
|
||||
dmac_burstsize_19: 1 burst size
|
||||
dmac_burstsize_2: 1 burst size
|
||||
dmac_burstsize_20: 1 burst size
|
||||
dmac_burstsize_21: 1 burst size
|
||||
dmac_burstsize_22: 1 burst size
|
||||
dmac_burstsize_23: 1 burst size
|
||||
dmac_burstsize_3: 1 burst size
|
||||
dmac_burstsize_4: 1 burst size
|
||||
dmac_burstsize_5: 1 burst size
|
||||
dmac_burstsize_6: 1 burst size
|
||||
dmac_burstsize_7: 1 burst size
|
||||
dmac_burstsize_8: 1 burst size
|
||||
dmac_burstsize_9: 1 burst size
|
||||
dmac_channel_0_settings: false
|
||||
dmac_channel_10_settings: false
|
||||
dmac_channel_11_settings: false
|
||||
dmac_channel_12_settings: false
|
||||
dmac_channel_13_settings: false
|
||||
dmac_channel_14_settings: false
|
||||
dmac_channel_15_settings: false
|
||||
dmac_channel_16_settings: false
|
||||
dmac_channel_17_settings: false
|
||||
dmac_channel_18_settings: false
|
||||
dmac_channel_19_settings: false
|
||||
dmac_channel_1_settings: false
|
||||
dmac_channel_20_settings: false
|
||||
dmac_channel_21_settings: false
|
||||
dmac_channel_22_settings: false
|
||||
dmac_channel_23_settings: false
|
||||
dmac_channel_2_settings: false
|
||||
dmac_channel_3_settings: false
|
||||
dmac_channel_4_settings: false
|
||||
dmac_channel_5_settings: false
|
||||
dmac_channel_6_settings: false
|
||||
dmac_channel_7_settings: false
|
||||
dmac_channel_8_settings: false
|
||||
dmac_channel_9_settings: false
|
||||
dmac_chunksize_0: 1 data transferred
|
||||
dmac_chunksize_1: 1 data transferred
|
||||
dmac_chunksize_10: 1 data transferred
|
||||
dmac_chunksize_11: 1 data transferred
|
||||
dmac_chunksize_12: 1 data transferred
|
||||
dmac_chunksize_13: 1 data transferred
|
||||
dmac_chunksize_14: 1 data transferred
|
||||
dmac_chunksize_15: 1 data transferred
|
||||
dmac_chunksize_16: 1 data transferred
|
||||
dmac_chunksize_17: 1 data transferred
|
||||
dmac_chunksize_18: 1 data transferred
|
||||
dmac_chunksize_19: 1 data transferred
|
||||
dmac_chunksize_2: 1 data transferred
|
||||
dmac_chunksize_20: 1 data transferred
|
||||
dmac_chunksize_21: 1 data transferred
|
||||
dmac_chunksize_22: 1 data transferred
|
||||
dmac_chunksize_23: 1 data transferred
|
||||
dmac_chunksize_3: 1 data transferred
|
||||
dmac_chunksize_4: 1 data transferred
|
||||
dmac_chunksize_5: 1 data transferred
|
||||
dmac_chunksize_6: 1 data transferred
|
||||
dmac_chunksize_7: 1 data transferred
|
||||
dmac_chunksize_8: 1 data transferred
|
||||
dmac_chunksize_9: 1 data transferred
|
||||
dmac_dstinc_0: false
|
||||
dmac_dstinc_1: false
|
||||
dmac_dstinc_10: false
|
||||
dmac_dstinc_11: false
|
||||
dmac_dstinc_12: false
|
||||
dmac_dstinc_13: false
|
||||
dmac_dstinc_14: false
|
||||
dmac_dstinc_15: false
|
||||
dmac_dstinc_16: false
|
||||
dmac_dstinc_17: false
|
||||
dmac_dstinc_18: false
|
||||
dmac_dstinc_19: false
|
||||
dmac_dstinc_2: false
|
||||
dmac_dstinc_20: false
|
||||
dmac_dstinc_21: false
|
||||
dmac_dstinc_22: false
|
||||
dmac_dstinc_23: false
|
||||
dmac_dstinc_3: false
|
||||
dmac_dstinc_4: false
|
||||
dmac_dstinc_5: false
|
||||
dmac_dstinc_6: false
|
||||
dmac_dstinc_7: false
|
||||
dmac_dstinc_8: false
|
||||
dmac_dstinc_9: false
|
||||
dmac_srcinc_0: false
|
||||
dmac_srcinc_1: false
|
||||
dmac_srcinc_10: false
|
||||
dmac_srcinc_11: false
|
||||
dmac_srcinc_12: false
|
||||
dmac_srcinc_13: false
|
||||
dmac_srcinc_14: false
|
||||
dmac_srcinc_15: false
|
||||
dmac_srcinc_16: false
|
||||
dmac_srcinc_17: false
|
||||
dmac_srcinc_18: false
|
||||
dmac_srcinc_19: false
|
||||
dmac_srcinc_2: false
|
||||
dmac_srcinc_20: false
|
||||
dmac_srcinc_21: false
|
||||
dmac_srcinc_22: false
|
||||
dmac_srcinc_23: false
|
||||
dmac_srcinc_3: false
|
||||
dmac_srcinc_4: false
|
||||
dmac_srcinc_5: false
|
||||
dmac_srcinc_6: false
|
||||
dmac_srcinc_7: false
|
||||
dmac_srcinc_8: false
|
||||
dmac_srcinc_9: false
|
||||
dmac_trifsrc_0: Software Trigger
|
||||
dmac_trifsrc_1: Software Trigger
|
||||
dmac_trifsrc_10: Software Trigger
|
||||
dmac_trifsrc_11: Software Trigger
|
||||
dmac_trifsrc_12: Software Trigger
|
||||
dmac_trifsrc_13: Software Trigger
|
||||
dmac_trifsrc_14: Software Trigger
|
||||
dmac_trifsrc_15: Software Trigger
|
||||
dmac_trifsrc_16: Software Trigger
|
||||
dmac_trifsrc_17: Software Trigger
|
||||
dmac_trifsrc_18: Software Trigger
|
||||
dmac_trifsrc_19: Software Trigger
|
||||
dmac_trifsrc_2: Software Trigger
|
||||
dmac_trifsrc_20: Software Trigger
|
||||
dmac_trifsrc_21: Software Trigger
|
||||
dmac_trifsrc_22: Software Trigger
|
||||
dmac_trifsrc_23: Software Trigger
|
||||
dmac_trifsrc_3: Software Trigger
|
||||
dmac_trifsrc_4: Software Trigger
|
||||
dmac_trifsrc_5: Software Trigger
|
||||
dmac_trifsrc_6: Software Trigger
|
||||
dmac_trifsrc_7: Software Trigger
|
||||
dmac_trifsrc_8: Software Trigger
|
||||
dmac_trifsrc_9: Software Trigger
|
||||
xdmac_enable: false
|
||||
optional_signals: []
|
||||
variant: null
|
||||
clocks:
|
||||
domain_group: null
|
||||
CAN_0:
|
||||
user_label: CAN_0
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::MCAN1::driver_config_definition::CAN::HAL:Driver:CAN.Async
|
||||
functionality: CAN
|
||||
api: HAL:Driver:CAN_Async
|
||||
configuration:
|
||||
can_cccr_niso: ISO11898_1
|
||||
can_dbtp_dbrp: 1
|
||||
can_dbtp_dsjw: 4
|
||||
can_dbtp_dtseg1: 31
|
||||
can_dbtp_dtseg2: 8
|
||||
can_dbtp_tdc: false
|
||||
can_gfc_anfe: Reject
|
||||
can_gfc_anfs: Reject
|
||||
can_gfc_rrfe: Filter remote frames with 29-bit standard IDs
|
||||
can_gfc_rrfs: Filter remote frames with 11-bit standard IDs
|
||||
can_ie_bo: true
|
||||
can_ie_do: true
|
||||
can_ie_ea: true
|
||||
can_ie_ep: true
|
||||
can_ie_ew: true
|
||||
can_nbtp_nbrp: 4
|
||||
can_nbtp_nsjw: 10
|
||||
can_nbtp_ntseg1: 31
|
||||
can_nbtp_ntseg2: 8
|
||||
can_rxesc_f0ds: 8 byte data field.
|
||||
can_rxf0c_f0om: blocking mode
|
||||
can_rxf0c_f0s: 32
|
||||
can_rxf0c_f0wm: 0
|
||||
can_sidfc_lss: 128
|
||||
can_tdcr_tdcf: 11
|
||||
can_tdcr_tdco: 11
|
||||
can_txbc_tfqs: 32
|
||||
can_txefc_efs: 32
|
||||
can_txefc_efwm: 0
|
||||
can_txesc_tbds: 8 byte data field.
|
||||
can_xidam_eidm: 0
|
||||
can_xidfc_lss: 64
|
||||
optional_signals:
|
||||
- identifier: CAN_0:CANRX/1
|
||||
pad: PC12
|
||||
mode: Enabled
|
||||
configuration: null
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::optional_signal_definition::MCAN1.CANRX.1
|
||||
name: MCAN1/CANRX/1
|
||||
label: CANRX/1
|
||||
- identifier: CAN_0:CANTX/1
|
||||
pad: PC14
|
||||
mode: Enabled
|
||||
configuration: null
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::optional_signal_definition::MCAN1.CANTX.1
|
||||
name: MCAN1/CANTX/1
|
||||
label: CANTX/1
|
||||
variant: null
|
||||
clocks:
|
||||
domain_group:
|
||||
nodes:
|
||||
- name: MCAN
|
||||
input: Programmable Clock Controller 5 (PMC_PCK5)
|
||||
external: false
|
||||
external_frequency: 0
|
||||
configuration:
|
||||
mcan_clock_source: Programmable Clock Controller 5 (PMC_PCK5)
|
||||
pads:
|
||||
PC12:
|
||||
name: PC12
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PC12
|
||||
mode: Peripheral IO
|
||||
user_label: PC12
|
||||
configuration: null
|
||||
PA21:
|
||||
name: PA21
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PA21
|
||||
mode: Peripheral IO
|
||||
user_label: PA21
|
||||
configuration: null
|
||||
SW0:
|
||||
name: PA11
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PA11
|
||||
mode: Digital input
|
||||
user_label: SW0
|
||||
configuration:
|
||||
pad_pull_config: Pull-up
|
||||
LED0:
|
||||
name: PC8
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PC8
|
||||
mode: Digital output
|
||||
user_label: LED0
|
||||
configuration:
|
||||
pad_initial_level: High
|
||||
PC14:
|
||||
name: PC14
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PC14
|
||||
mode: Peripheral IO
|
||||
user_label: PC14
|
||||
configuration: null
|
||||
PB4:
|
||||
name: PB4
|
||||
definition: Atmel:SAME70B_Drivers:0.0.1::ATSAME70Q21B-AN::pad::PB4
|
||||
mode: Peripheral IO
|
||||
user_label: PB4
|
||||
configuration: null
|
||||
toolchain_options: []
|
||||
static_files: []
|
||||
27
bsp/microchip/same70/bsp/atmel_start_pins.h
Normal file
27
bsp/microchip/same70/bsp/atmel_start_pins.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Code generated from Atmel Start.
|
||||
*
|
||||
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||
* Please copy examples or other code you want to keep to a separate file
|
||||
* to avoid losing it when reconfiguring.
|
||||
*/
|
||||
#ifndef ATMEL_START_PINS_H_INCLUDED
|
||||
#define ATMEL_START_PINS_H_INCLUDED
|
||||
|
||||
#include <hal_gpio.h>
|
||||
|
||||
// SAME70 has 4 pin functions
|
||||
|
||||
#define GPIO_PIN_FUNCTION_A 0
|
||||
#define GPIO_PIN_FUNCTION_B 1
|
||||
#define GPIO_PIN_FUNCTION_C 2
|
||||
#define GPIO_PIN_FUNCTION_D 3
|
||||
|
||||
#define SW0 GPIO(GPIO_PORTA, 11)
|
||||
#define PA21 GPIO(GPIO_PORTA, 21)
|
||||
#define PB4 GPIO(GPIO_PORTB, 4)
|
||||
#define LED0 GPIO(GPIO_PORTC, 8)
|
||||
#define PC12 GPIO(GPIO_PORTC, 12)
|
||||
#define PC14 GPIO(GPIO_PORTC, 14)
|
||||
|
||||
#endif // ATMEL_START_PINS_H_INCLUDED
|
||||
379
bsp/microchip/same70/bsp/config/hpl_mcan_config.h
Normal file
379
bsp/microchip/same70/bsp/config/hpl_mcan_config.h
Normal file
@@ -0,0 +1,379 @@
|
||||
/* Auto-generated config file hpl_mcan_config.h */
|
||||
#ifndef HPL_MCAN_CONFIG_H
|
||||
#define HPL_MCAN_CONFIG_H
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
#ifndef CONF_CAN1_ENABLED
|
||||
#define CONF_CAN1_ENABLED 1
|
||||
#endif
|
||||
// <h> Basic Configuration
|
||||
|
||||
// <o> CAN Mode Enable
|
||||
// <i> decide whether enable CAN FD mode
|
||||
// <0=> ISO11898_1
|
||||
// <1=> FD
|
||||
// <id> can_cccr_niso
|
||||
#ifndef CONF_CAN1_CCCR_NISO
|
||||
#define CONF_CAN1_CCCR_NISO 0
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> Normal Bit Timing and Prescaler Configuration
|
||||
|
||||
// <o> Baud Rate Prescaler <1-512>
|
||||
// <i> The value by which the oscillator frequency is divided for generating the CAN time quanta. CAN time quantum (tq) = (This value) x CAN core clock cycles (tcore clock)
|
||||
// <id> can_nbtp_nbrp
|
||||
#ifndef CONF_CAN1_NBTP_NBRP
|
||||
#define CONF_CAN1_NBTP_NBRP 4
|
||||
#endif
|
||||
|
||||
// <o> time segment before sample point <2-256>
|
||||
// <i> The duration of time segment = (This value) x CAN time quantum (tq)
|
||||
// <id> can_nbtp_ntseg1
|
||||
#ifndef CONF_CAN1_NBTP_NTSEG1
|
||||
#define CONF_CAN1_NBTP_NTSEG1 31
|
||||
#endif
|
||||
|
||||
// <o> time segment after sample point <2-128>
|
||||
// <i> The duration of time segment = (This value) x CAN time quantum (tq)
|
||||
// <id> can_nbtp_ntseg2
|
||||
#ifndef CONF_CAN1_NBTP_NTSEG2
|
||||
#define CONF_CAN1_NBTP_NTSEG2 8
|
||||
#endif
|
||||
|
||||
// <o> Data (Re)Syncronization Jump Width <1-128>
|
||||
// <i> The duration of a synchronization jump = (This value) x CAN time quantum (tq)
|
||||
// <id> can_nbtp_nsjw
|
||||
#ifndef CONF_CAN1_NBTP_NSJW
|
||||
#define CONF_CAN1_NBTP_NSJW 10
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
// <h> Data Bit Timing and Prescaler Configuration
|
||||
|
||||
// <o> Data Baud Rate Prescaler <1-32>
|
||||
// <i> The value by which the peripheral clock is divided for generating the bit time quanta. CAN time quantum (tq) = (This value) x CAN core clock cycles (tcore clock)
|
||||
// <id> can_dbtp_dbrp
|
||||
#ifndef CONF_CAN1_DBTP_DBRP
|
||||
#define CONF_CAN1_DBTP_DBRP 1
|
||||
#endif
|
||||
|
||||
// <o> Data time segment before sample point <2-32>
|
||||
// <i> The duration of time segment = (This value) x CAN time quantum (tq)
|
||||
// <id> can_dbtp_dtseg1
|
||||
#ifndef CONF_CAN1_DBTP_DTSEG1
|
||||
#define CONF_CAN1_DBTP_DTSEG1 31
|
||||
#endif
|
||||
|
||||
// <o> Data time segment after sample point <1-16>
|
||||
// <i> The duration of time segment = (This value) x CAN time quantum (tq)
|
||||
// <id> can_dbtp_dtseg2
|
||||
#ifndef CONF_CAN1_DBTP_DTSEG2
|
||||
#define CONF_CAN1_DBTP_DTSEG2 8
|
||||
#endif
|
||||
|
||||
// <o> Data (Re)Syncronization Jump Width <1-8>
|
||||
// <i> The duration of a synchronization jump = (This value) x CAN time quantum (tq)
|
||||
// <id> can_dbtp_dsjw
|
||||
#ifndef CONF_CAN1_DBTP_DSJW
|
||||
#define CONF_CAN1_DBTP_DSJW 4
|
||||
#endif
|
||||
|
||||
// <q> Transceiver Delay Compensation Enable
|
||||
// <i> Transceiver Delay Compensation Enable
|
||||
// <id> can_dbtp_tdc
|
||||
#ifndef CONF_CAN1_DBTP_TDC
|
||||
#define CONF_CAN1_DBTP_TDC 0
|
||||
#endif
|
||||
|
||||
// <o> Transceiver Delay Compensation Offset <0-127>
|
||||
// <i> Transceiver Delay Compensation Offset
|
||||
// <id> can_tdcr_tdco
|
||||
#ifndef CONF_CAN1_TDCR_TDCO
|
||||
#define CONF_CAN1_TDCR_TDCO 11
|
||||
#endif
|
||||
|
||||
// <o> Transmitter Delay Compensation Filter <0-127>
|
||||
// <i> Transmitter Delay Compensation Filter
|
||||
// <id> can_tdcr_tdcf
|
||||
#ifndef CONF_CAN1_TDCR_TDCF
|
||||
#define CONF_CAN1_TDCR_TDCF 11
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> RX FIFO Configuration
|
||||
|
||||
// <o> Operation Mode
|
||||
// <i> Select Operation Mode
|
||||
// <0=> blocking mode
|
||||
// <1=> overwrite mode
|
||||
// <id> can_rxf0c_f0om
|
||||
#ifndef CONF_CAN1_RXF0C_F0OM
|
||||
#define CONF_CAN1_RXF0C_F0OM 0
|
||||
#endif
|
||||
|
||||
// <o> Watermark <0-64>
|
||||
// <i> Watermark, 0 for disable watermark interrupt
|
||||
// <id> can_rxf0c_f0wm
|
||||
#ifndef CONF_CAN1_RXF0C_F0WM
|
||||
#define CONF_CAN1_RXF0C_F0WM 0
|
||||
#endif
|
||||
|
||||
// <o> Size <0-64>
|
||||
// <i> Number of Rx FIFO 0 element
|
||||
// <id> can_rxf0c_f0s
|
||||
#ifndef CONF_CAN1_RXF0C_F0S
|
||||
#define CONF_CAN1_RXF0C_F0S 32
|
||||
#endif
|
||||
|
||||
// <o> Data Field Size
|
||||
// <i> Rx FIFO 0 Data Field Size
|
||||
// <0=> 8 byte data field.
|
||||
// <1=> 12 byte data field.
|
||||
// <2=> 16 byte data field.
|
||||
// <3=> 20 byte data field.
|
||||
// <4=> 24 byte data field.
|
||||
// <5=> 32 byte data field.
|
||||
// <6=> 48 byte data field.
|
||||
// <7=> 64 byte data field.
|
||||
// <id> can_rxesc_f0ds
|
||||
#ifndef CONF_CAN1_RXESC_F0DS
|
||||
#define CONF_CAN1_RXESC_F0DS 0
|
||||
#endif
|
||||
|
||||
/* Bytes size for CAN FIFO 0 element, plus 8 bytes for R0,R1 */
|
||||
#undef CONF_CAN1_F0DS
|
||||
#define CONF_CAN1_F0DS \
|
||||
((CONF_CAN1_RXESC_F0DS < 5) ? ((CONF_CAN1_RXESC_F0DS << 2) + 16) : (40 + ((CONF_CAN1_RXESC_F0DS % 5) << 4)))
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> TX FIFO Configuration
|
||||
|
||||
// <o> Transmit FIFO Size <0-32>
|
||||
// <i> Number of Tx Buffers used for Tx FIFO
|
||||
// <id> can_txbc_tfqs
|
||||
#ifndef CONF_CAN1_TXBC_TFQS
|
||||
#define CONF_CAN1_TXBC_TFQS 32
|
||||
#endif
|
||||
|
||||
// <o> Tx Buffer Data Field Size
|
||||
// <i> Tx Buffer Data Field Size
|
||||
// <0=> 8 byte data field.
|
||||
// <1=> 12 byte data field.
|
||||
// <2=> 16 byte data field.
|
||||
// <3=> 20 byte data field.
|
||||
// <4=> 24 byte data field.
|
||||
// <5=> 32 byte data field.
|
||||
// <6=> 48 byte data field.
|
||||
// <7=> 64 byte data field.
|
||||
// <id> can_txesc_tbds
|
||||
#ifndef CONF_CAN1_TXESC_TBDS
|
||||
#define CONF_CAN1_TXESC_TBDS 0
|
||||
#endif
|
||||
|
||||
/* Bytes size for CAN Transmit Buffer element, plus 8 bytes for R0,R1 */
|
||||
#undef CONF_CAN1_TBDS
|
||||
#define CONF_CAN1_TBDS \
|
||||
((CONF_CAN1_TXESC_TBDS < 5) ? ((CONF_CAN1_TXESC_TBDS << 2) + 16) : (40 + ((CONF_CAN1_TXESC_TBDS % 5) << 4)))
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> TX Event Configuration
|
||||
|
||||
// <o> Watermark <0-32>
|
||||
// <i> Watermark, 0 for disable watermark interrupt
|
||||
// <id> can_txefc_efwm
|
||||
#ifndef CONF_CAN1_TXEFC_EFWM
|
||||
#define CONF_CAN1_TXEFC_EFWM 0
|
||||
#endif
|
||||
|
||||
// <o> Size <0-32>
|
||||
// <i> Number of Event FIFO element
|
||||
// <id> can_txefc_efs
|
||||
#ifndef CONF_CAN1_TXEFC_EFS
|
||||
#define CONF_CAN1_TXEFC_EFS 32
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> Filter Configuration
|
||||
|
||||
// <o> Accept Non-matching Frames Standard
|
||||
// <i> Defines how received messages with 11-bit IDs that do not match any
|
||||
// <i> element of the filter list are treated.
|
||||
// <0=> Accept in Rx FIFO 0
|
||||
// <1=> Accept in Rx FIFO 1
|
||||
// <2=> Reject
|
||||
// <id> can_gfc_anfs
|
||||
#ifndef CONF_CAN1_GFC_ANFS
|
||||
#define CONF_CAN1_GFC_ANFS 2
|
||||
#endif
|
||||
|
||||
// <o> Accept Non-matching Frames Extended
|
||||
// <i> Defines how received messages with 29-bit IDs that do not match any
|
||||
// <i> element of the filter list are treated.
|
||||
// <0=> Accept in Rx FIFO 0
|
||||
// <1=> Accept in Rx FIFO 1
|
||||
// <2=> Reject
|
||||
// <id> can_gfc_anfe
|
||||
#ifndef CONF_CAN1_GFC_ANFE
|
||||
#define CONF_CAN1_GFC_ANFE 2
|
||||
#endif
|
||||
|
||||
// <o> Reject Remote Frames Standard
|
||||
// <i> Defines how received remote frames with 11-bit standard IDs.
|
||||
// <0=> Filter remote frames with 11-bit standard IDs
|
||||
// <1=> Reject all remote frames with 11-bit standard IDs
|
||||
// <id> can_gfc_rrfs
|
||||
#ifndef CONF_CAN1_GFC_RRFS
|
||||
#define CONF_CAN1_GFC_RRFS 0
|
||||
#endif
|
||||
|
||||
// <o> Reject Remote Frames Extended
|
||||
// <i> Defines how received remote frames with 29-bit standard IDs.
|
||||
// <0=> Filter remote frames with 29-bit standard IDs
|
||||
// <1=> Reject all remote frames with 29-bit standard IDs
|
||||
// <id> can_gfc_rrfe
|
||||
#ifndef CONF_CAN1_GFC_RRFE
|
||||
#define CONF_CAN1_GFC_RRFE 0
|
||||
#endif
|
||||
|
||||
// <o> Number of standard Message ID filter elements <0-128>
|
||||
// <i> Number of standard Message ID filter elements
|
||||
// <id> can_sidfc_lss
|
||||
#ifndef CONF_CAN1_SIDFC_LSS
|
||||
#define CONF_CAN1_SIDFC_LSS 128
|
||||
#endif
|
||||
|
||||
// <o> Number of Extended Message ID filter elements <0-64>
|
||||
// <i> Number of Extended Message ID filter elements
|
||||
// <id> can_xidfc_lss
|
||||
#ifndef CONF_CAN1_XIDFC_LSS
|
||||
#define CONF_CAN1_XIDFC_LSS 64
|
||||
#endif
|
||||
|
||||
// <o> Extended ID Mask <0x0000-0x1FFFFFFF>
|
||||
// <i> For acceptance filtering of extended frames the Extended ID AND Mask is
|
||||
// <i> ANDed with the Message ID of a received frame. Intended for masking of
|
||||
// <i> 29-bit IDs in SAE J1939. With the reset value of all bits set to one the
|
||||
// <i> mask is not active.
|
||||
// <id> can_xidam_eidm
|
||||
#ifndef CONF_CAN1_XIDAM_EIDM
|
||||
#define CONF_CAN1_XIDAM_EIDM 0x0
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <h> Interrupt Configuration
|
||||
|
||||
// <q> Error Warning
|
||||
// <i> Indicates whether to not disable CAN error warning interrupt
|
||||
// <id> can_ie_ew
|
||||
#ifndef CONF_CAN1_IE_EW
|
||||
#define CONF_CAN1_IE_EW 1
|
||||
#endif
|
||||
|
||||
// <q> Error Active
|
||||
// <i> Indicates whether to not disable CAN error active interrupt
|
||||
// <id> can_ie_ea
|
||||
#ifndef CONF_CAN1_IE_EA
|
||||
#define CONF_CAN1_IE_EA 1
|
||||
#endif
|
||||
|
||||
// <q> Error Passive
|
||||
// <i> Indicates whether to not disable CAN error passive interrupt
|
||||
// <id> can_ie_ep
|
||||
#ifndef CONF_CAN1_IE_EP
|
||||
#define CONF_CAN1_IE_EP 1
|
||||
#endif
|
||||
|
||||
// <q> Bus Off
|
||||
// <i> Indicates whether to not disable CAN bus off interrupt
|
||||
// <id> can_ie_bo
|
||||
#ifndef CONF_CAN1_IE_BO
|
||||
#define CONF_CAN1_IE_BO 1
|
||||
#endif
|
||||
|
||||
// <q> Data Overrun
|
||||
// <i> Indicates whether to not disable CAN data overrun interrupt
|
||||
// <id> can_ie_do
|
||||
#ifndef CONF_CAN1_IE_DO
|
||||
#define CONF_CAN1_IE_DO 1
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
#ifndef CONF_CAN1_CCCR_REG
|
||||
#define CONF_CAN1_CCCR_REG (CONF_CAN1_CCCR_NISO << MCAN_CCCR_NISO_Pos)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_NBTP_REG
|
||||
#define CONF_CAN1_NBTP_REG \
|
||||
MCAN_NBTP_NBRP(CONF_CAN1_NBTP_NBRP - 1) | MCAN_NBTP_NTSEG1(CONF_CAN1_NBTP_NTSEG1 - 1) \
|
||||
| MCAN_NBTP_NTSEG2(CONF_CAN1_NBTP_NTSEG2 - 1) | MCAN_NBTP_NSJW(CONF_CAN1_NBTP_NSJW - 1)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_DBTP_REG
|
||||
#define CONF_CAN1_DBTP_REG \
|
||||
(CONF_CAN1_DBTP_TDC << MCAN_DBTP_TDC_Pos) | MCAN_DBTP_DBRP(CONF_CAN1_DBTP_DBRP - 1) \
|
||||
| MCAN_DBTP_DTSEG1(CONF_CAN1_DBTP_DTSEG1 - 1) | MCAN_DBTP_DTSEG2(CONF_CAN1_DBTP_DTSEG2 - 1) \
|
||||
| MCAN_DBTP_DSJW(CONF_CAN1_DBTP_DSJW - 1)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_TDCR_REG
|
||||
#define CONF_CAN1_TDCR_REG MCAN_TDCR_TDCF(CONF_CAN1_TDCR_TDCF) | MCAN_TDCR_TDCO(CONF_CAN1_TDCR_TDCO)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_RXF0C_REG
|
||||
#define CONF_CAN1_RXF0C_REG \
|
||||
(CONF_CAN1_RXF0C_F0OM << MCAN_RXF0C_F0OM_Pos) | MCAN_RXF0C_F0WM(CONF_CAN1_RXF0C_F0WM) \
|
||||
| MCAN_RXF0C_F0S(CONF_CAN1_RXF0C_F0S)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_RXESC_REG
|
||||
#define CONF_CAN1_RXESC_REG MCAN_RXESC_F0DS(CONF_CAN1_RXESC_F0DS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_TXESC_REG
|
||||
#define CONF_CAN1_TXESC_REG MCAN_TXESC_TBDS(CONF_CAN1_TXESC_TBDS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_TXBC_REG
|
||||
#define CONF_CAN1_TXBC_REG MCAN_TXBC_TFQS(CONF_CAN1_TXBC_TFQS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_TXEFC_REG
|
||||
#define CONF_CAN1_TXEFC_REG MCAN_TXEFC_EFWM(CONF_CAN1_TXEFC_EFWM) | MCAN_TXEFC_EFS(CONF_CAN1_TXEFC_EFS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_GFC_REG
|
||||
#define CONF_CAN1_GFC_REG \
|
||||
MCAN_GFC_ANFS(CONF_CAN1_GFC_ANFS) | MCAN_GFC_ANFE(CONF_CAN1_GFC_ANFE) | (CONF_CAN1_GFC_RRFS << MCAN_GFC_RRFS_Pos) \
|
||||
| (CONF_CAN1_GFC_RRFE << MCAN_GFC_RRFE_Pos)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_SIDFC_REG
|
||||
#define CONF_CAN1_SIDFC_REG MCAN_SIDFC_LSS(CONF_CAN1_SIDFC_LSS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_XIDFC_REG
|
||||
#define CONF_CAN1_XIDFC_REG MCAN_XIDFC_LSE(CONF_CAN1_XIDFC_LSS)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN1_XIDAM_REG
|
||||
#define CONF_CAN1_XIDAM_REG MCAN_XIDAM_EIDM(CONF_CAN1_XIDAM_EIDM)
|
||||
#endif
|
||||
|
||||
#ifndef CONF_CAN0_IE_REG
|
||||
#define CONF_CAN0_IE_REG \
|
||||
(CONF_CAN1_IE_EW << MCAN_IR_EW_Pos) | (CONF_CAN1_IE_EA << MCAN_IR_EP_Pos) | (CONF_CAN1_IE_EP << MCAN_IR_EP_Pos) \
|
||||
| (CONF_CAN1_IE_BO << MCAN_IR_BO_Pos) | (CONF_CAN1_IE_DO << MCAN_IR_RF0L_Pos)
|
||||
#endif
|
||||
|
||||
// <<< end of configuration section >>>
|
||||
|
||||
#endif // HPL_MCAN_CONFIG_H
|
||||
1053
bsp/microchip/same70/bsp/config/hpl_pmc_config.h
Normal file
1053
bsp/microchip/same70/bsp/config/hpl_pmc_config.h
Normal file
File diff suppressed because it is too large
Load Diff
18
bsp/microchip/same70/bsp/config/hpl_systick_ARMv7_config.h
Normal file
18
bsp/microchip/same70/bsp/config/hpl_systick_ARMv7_config.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Auto-generated config file hpl_systick_ARMv7_config.h */
|
||||
#ifndef HPL_SYSTICK_ARMV7_CONFIG_H
|
||||
#define HPL_SYSTICK_ARMV7_CONFIG_H
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Advanced settings
|
||||
// <q> SysTick exception request
|
||||
// <i> Indicates whether the generation of SysTick exception is enabled or not
|
||||
// <id> systick_arch_tickint
|
||||
#ifndef CONF_SYSTICK_TICKINT
|
||||
#define CONF_SYSTICK_TICKINT 0
|
||||
#endif
|
||||
// </h>
|
||||
|
||||
// <<< end of configuration section >>>
|
||||
|
||||
#endif // HPL_SYSTICK_ARMV7_CONFIG_H
|
||||
215
bsp/microchip/same70/bsp/config/hpl_usart_config.h
Normal file
215
bsp/microchip/same70/bsp/config/hpl_usart_config.h
Normal file
@@ -0,0 +1,215 @@
|
||||
/* Auto-generated config file hpl_usart_config.h */
|
||||
#ifndef HPL_USART_CONFIG_H
|
||||
#define HPL_USART_CONFIG_H
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
#include <peripheral_clk_config.h>
|
||||
|
||||
#ifndef CONF_USART_1_ENABLE
|
||||
#define CONF_USART_1_ENABLE 1
|
||||
#endif
|
||||
|
||||
// <h> Basic Configuration
|
||||
|
||||
// <o> Frame parity
|
||||
// <0x0=>Even parity
|
||||
// <0x1=>Odd parity
|
||||
// <0x2=>Parity forced to 0
|
||||
// <0x3=>Parity forced to 1
|
||||
// <0x4=>No parity
|
||||
// <i> Parity bit mode for USART frame
|
||||
// <id> usart_parity
|
||||
#ifndef CONF_USART_1_PARITY
|
||||
#define CONF_USART_1_PARITY 0x4
|
||||
#endif
|
||||
|
||||
// <o> Character Size
|
||||
// <0x0=>5 bits
|
||||
// <0x1=>6 bits
|
||||
// <0x2=>7 bits
|
||||
// <0x3=>8 bits
|
||||
// <i> Data character size in USART frame
|
||||
// <id> usart_character_size
|
||||
#ifndef CONF_USART_1_CHSIZE
|
||||
#define CONF_USART_1_CHSIZE 0x3
|
||||
#endif
|
||||
|
||||
// <o> Stop Bit
|
||||
// <0=>1 stop bit
|
||||
// <1=>1.5 stop bits
|
||||
// <2=>2 stop bits
|
||||
// <i> Number of stop bits in USART frame
|
||||
// <id> usart_stop_bit
|
||||
#ifndef CONF_USART_1_SBMODE
|
||||
#define CONF_USART_1_SBMODE 0
|
||||
#endif
|
||||
|
||||
// <o> Clock Output Select
|
||||
// <0=>The USART does not drive the SCK pin
|
||||
// <1=>The USART drives the SCK pin if USCLKS does not select the external clock SCK
|
||||
// <i> Clock Output Select in USART sck, if in usrt master mode, please drive SCK.
|
||||
// <id> usart_clock_output_select
|
||||
#ifndef CONF_USART_1_CLKO
|
||||
#define CONF_USART_1_CLKO 0
|
||||
#endif
|
||||
|
||||
// <o> Baud rate <1-3000000>
|
||||
// <i> USART baud rate setting
|
||||
// <id> usart_baud_rate
|
||||
#ifndef CONF_USART_1_BAUD
|
||||
#define CONF_USART_1_BAUD 115200
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
// <e> Advanced configuration
|
||||
// <id> usart_advanced
|
||||
#ifndef CONF_USART_1_ADVANCED_CONFIG
|
||||
#define CONF_USART_1_ADVANCED_CONFIG 1
|
||||
#endif
|
||||
|
||||
// <o> Channel Mode
|
||||
// <0=>Normal Mode
|
||||
// <1=>Automatic Echo
|
||||
// <2=>Local Loopback
|
||||
// <3=>Remote Loopback
|
||||
// <i> Channel mode in USART frame
|
||||
// <id> usart_channel_mode
|
||||
#ifndef CONF_USART_1_CHMODE
|
||||
#define CONF_USART_1_CHMODE 0
|
||||
#endif
|
||||
|
||||
// <q> 9 bits character enable
|
||||
// <i> Enable 9 bits character, this has high priority than 5/6/7/8 bits.
|
||||
// <id> usart_9bits_enable
|
||||
#ifndef CONF_USART_1_MODE9
|
||||
#define CONF_USART_1_MODE9 0
|
||||
#endif
|
||||
|
||||
// <o> Variable Sync
|
||||
// <0=>User defined configuration
|
||||
// <1=>sync field is updated when a character is written into US_THR
|
||||
// <i> Variable Synchronization of Command/Data Sync Start Frarm Delimiter
|
||||
// <id> variable_sync
|
||||
#ifndef CONF_USART_1_VAR_SYNC
|
||||
#define CONF_USART_1_VAR_SYNC 0
|
||||
#endif
|
||||
|
||||
// <o> Oversampling Mode
|
||||
// <0=>16 Oversampling
|
||||
// <1=>8 Oversampling
|
||||
// <i> Oversampling Mode in UART mode
|
||||
// <id> usart__oversampling_mode
|
||||
#ifndef CONF_USART_1_OVER
|
||||
#define CONF_USART_1_OVER 0
|
||||
#endif
|
||||
|
||||
// <o> Inhibit Non Ack
|
||||
// <0=>The NACK is generated
|
||||
// <1=>The NACK is not generated
|
||||
// <i> Inhibit Non Acknowledge
|
||||
// <id> usart__inack
|
||||
#ifndef CONF_USART_1_INACK
|
||||
#define CONF_USART_1_INACK 1
|
||||
#endif
|
||||
|
||||
// <o> Disable Successive NACK
|
||||
// <0=>NACK is sent on the ISO line as soon as a parity error occurs
|
||||
// <1=>Many parity errors generate a NACK on the ISO line
|
||||
// <i> Disable Successive NACK
|
||||
// <id> usart_dsnack
|
||||
#ifndef CONF_USART_1_DSNACK
|
||||
#define CONF_USART_1_DSNACK 0
|
||||
#endif
|
||||
|
||||
// <o> Inverted Data
|
||||
// <0=>Data isn't inverted, nomal mode
|
||||
// <1=>Data is inverted
|
||||
// <i> Inverted Data
|
||||
// <id> usart_invdata
|
||||
#ifndef CONF_USART_1_INVDATA
|
||||
#define CONF_USART_1_INVDATA 0
|
||||
#endif
|
||||
|
||||
// <o> Maximum Number of Automatic Iteration <0-7>
|
||||
// <i> Defines the maximum number of iterations in mode ISO7816, protocol T = 0.
|
||||
// <id> usart_max_iteration
|
||||
#ifndef CONF_USART_1_MAX_ITERATION
|
||||
#define CONF_USART_1_MAX_ITERATION 0
|
||||
#endif
|
||||
|
||||
// <q> Receive Line Filter enable
|
||||
// <i> whether the USART filters the receive line using a three-sample filter
|
||||
// <id> usart_receive_filter_enable
|
||||
#ifndef CONF_USART_1_FILTER
|
||||
#define CONF_USART_1_FILTER 0
|
||||
#endif
|
||||
|
||||
// <q> Manchester Encoder/Decoder Enable
|
||||
// <i> whether the USART Manchester Encoder/Decoder
|
||||
// <id> usart_manchester_filter_enable
|
||||
#ifndef CONF_USART_1_MAN
|
||||
#define CONF_USART_1_MAN 0
|
||||
#endif
|
||||
|
||||
// <o> Manchester Synchronization Mode
|
||||
// <0=>The Manchester start bit is a 0 to 1 transition
|
||||
// <1=>The Manchester start bit is a 1 to 0 transition
|
||||
// <i> Manchester Synchronization Mode
|
||||
// <id> usart_manchester_synchronization_mode
|
||||
#ifndef CONF_USART_1_MODSYNC
|
||||
#define CONF_USART_1_MODSYNC 0
|
||||
#endif
|
||||
|
||||
// <o> Start Frame Delimiter Selector
|
||||
// <0=>Start frame delimiter is COMMAND or DATA SYNC
|
||||
// <1=>Start frame delimiter is one bit
|
||||
// <i> Start Frame Delimiter Selector
|
||||
// <id> usart_start_frame_delimiter
|
||||
#ifndef CONF_USART_1_ONEBIT
|
||||
#define CONF_USART_1_ONEBIT 0
|
||||
#endif
|
||||
|
||||
// <o> Fractional Part <0-7>
|
||||
// <i> Fractional part of the baud rate if baud rate generator is in fractional mode
|
||||
// <id> usart_arch_fractional
|
||||
#ifndef CONF_USART_1_FRACTIONAL
|
||||
#define CONF_USART_1_FRACTIONAL 0x0
|
||||
#endif
|
||||
|
||||
// <o> Data Order
|
||||
// <0=>LSB is transmitted first
|
||||
// <1=>MSB is transmitted first
|
||||
// <i> Data order of the data bits in the frame
|
||||
// <id> usart_arch_msbf
|
||||
#ifndef CONF_USART_1_MSBF
|
||||
#define CONF_USART_1_MSBF 0
|
||||
#endif
|
||||
|
||||
// </e>
|
||||
|
||||
#define CONF_USART_1_MODE 0x0
|
||||
|
||||
// Calculate BAUD register value in UART mode
|
||||
#if CONF_USART1_CK_SRC < 3
|
||||
#ifndef CONF_USART_1_BAUD_CD
|
||||
#define CONF_USART_1_BAUD_CD ((CONF_USART1_FREQUENCY) / CONF_USART_1_BAUD / 8 / (2 - CONF_USART_1_OVER))
|
||||
#endif
|
||||
#ifndef CONF_USART_1_BAUD_FP
|
||||
#define CONF_USART_1_BAUD_FP \
|
||||
((CONF_USART1_FREQUENCY) / CONF_USART_1_BAUD / (2 - CONF_USART_1_OVER) - 8 * CONF_USART_1_BAUD_CD)
|
||||
#endif
|
||||
#elif CONF_USART1_CK_SRC == 3
|
||||
// No division is active. The value written in US_BRGR has no effect.
|
||||
#ifndef CONF_USART_1_BAUD_CD
|
||||
#define CONF_USART_1_BAUD_CD 1
|
||||
#endif
|
||||
#ifndef CONF_USART_1_BAUD_FP
|
||||
#define CONF_USART_1_BAUD_FP 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// <<< end of configuration section >>>
|
||||
|
||||
#endif // HPL_USART_CONFIG_H
|
||||
4400
bsp/microchip/same70/bsp/config/hpl_xdmac_config.h
Normal file
4400
bsp/microchip/same70/bsp/config/hpl_xdmac_config.h
Normal file
File diff suppressed because it is too large
Load Diff
99
bsp/microchip/same70/bsp/config/peripheral_clk_config.h
Normal file
99
bsp/microchip/same70/bsp/config/peripheral_clk_config.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/* Auto-generated config file peripheral_clk_config.h */
|
||||
#ifndef PERIPHERAL_CLK_CONFIG_H
|
||||
#define PERIPHERAL_CLK_CONFIG_H
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
/**
|
||||
* \def CONF_HCLK_FREQUENCY
|
||||
* \brief HCLK's Clock frequency
|
||||
*/
|
||||
#ifndef CONF_HCLK_FREQUENCY
|
||||
#define CONF_HCLK_FREQUENCY 300000000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \def CONF_FCLK_FREQUENCY
|
||||
* \brief FCLK's Clock frequency
|
||||
*/
|
||||
#ifndef CONF_FCLK_FREQUENCY
|
||||
#define CONF_FCLK_FREQUENCY 300000000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \def CONF_CPU_FREQUENCY
|
||||
* \brief CPU's Clock frequency
|
||||
*/
|
||||
#ifndef CONF_CPU_FREQUENCY
|
||||
#define CONF_CPU_FREQUENCY 300000000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \def CONF_SLCK_FREQUENCY
|
||||
* \brief Slow Clock frequency
|
||||
*/
|
||||
#define CONF_SLCK_FREQUENCY 0
|
||||
|
||||
/**
|
||||
* \def CONF_MCK_FREQUENCY
|
||||
* \brief Master Clock frequency
|
||||
*/
|
||||
#define CONF_MCK_FREQUENCY 150000000
|
||||
|
||||
/**
|
||||
* \def CONF_PCK6_FREQUENCY
|
||||
* \brief Programmable Clock Controller 6 frequency
|
||||
*/
|
||||
#define CONF_PCK6_FREQUENCY 1714285
|
||||
|
||||
// <h> USART Clock Settings
|
||||
// <o> USART Clock source
|
||||
|
||||
// <0=> Master Clock (MCK)
|
||||
// <1=> MCK / 8 for USART
|
||||
// <2=> Programmable Clock Controller 4 (PMC_PCK4)
|
||||
// <3=> External Clock
|
||||
// <i> This defines the clock source for the USART
|
||||
// <id> usart_clock_source
|
||||
#ifndef CONF_USART1_CK_SRC
|
||||
#define CONF_USART1_CK_SRC 0
|
||||
#endif
|
||||
|
||||
// <o> USART External Clock Input on SCK <1-4294967295>
|
||||
// <i> Inputs the external clock frequency on SCK
|
||||
// <id> usart_clock_freq
|
||||
#ifndef CONF_USART1_SCK_FREQ
|
||||
#define CONF_USART1_SCK_FREQ 10000000
|
||||
#endif
|
||||
|
||||
// </h>
|
||||
|
||||
/**
|
||||
* \def USART FREQUENCY
|
||||
* \brief USART's Clock frequency
|
||||
*/
|
||||
#ifndef CONF_USART1_FREQUENCY
|
||||
#define CONF_USART1_FREQUENCY 150000000
|
||||
#endif
|
||||
|
||||
// <h> MCAN Clock Settings
|
||||
// <y> MCAN Clock source
|
||||
// <CONF_SRC_PCK5"> Programmable Clock Controller 5 (PMC_PCK5)
|
||||
// <i> This defines the clock source for the MCAN
|
||||
// <id> mcan_clock_source
|
||||
#ifndef CONF_MCAN1_SRC
|
||||
#define CONF_MCAN1_SRC CONF_SRC_PCK5
|
||||
#endif
|
||||
// </h>
|
||||
|
||||
/**
|
||||
* \def MCAN FREQUENCY
|
||||
* \brief MCAN's Clock frequency
|
||||
*/
|
||||
#ifndef CONF_MCAN1_FREQUENCY
|
||||
#define CONF_MCAN1_FREQUENCY 40000000
|
||||
#endif
|
||||
|
||||
// <<< end of configuration section >>>
|
||||
|
||||
#endif // PERIPHERAL_CLK_CONFIG_H
|
||||
11
bsp/microchip/same70/bsp/documentation/led_switcher.rst
Normal file
11
bsp/microchip/same70/bsp/documentation/led_switcher.rst
Normal file
@@ -0,0 +1,11 @@
|
||||
===========
|
||||
LED Flasher
|
||||
===========
|
||||
|
||||
This example toggles the on-board LED marked as LED0 every time the button SW0
|
||||
is pressed.
|
||||
|
||||
Drivers
|
||||
-------
|
||||
* GPIO
|
||||
* Delay
|
||||
124
bsp/microchip/same70/bsp/driver_init.c
Normal file
124
bsp/microchip/same70/bsp/driver_init.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Code generated from Atmel Start.
|
||||
*
|
||||
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||
* Please copy examples or other code you want to keep to a separate file
|
||||
* to avoid losing it when reconfiguring.
|
||||
*/
|
||||
|
||||
#include "driver_init.h"
|
||||
#include <hal_init.h>
|
||||
#include <hpl_pmc.h>
|
||||
#include <peripheral_clk_config.h>
|
||||
#include <utils.h>
|
||||
#include <hpl_usart_base.h>
|
||||
|
||||
struct can_async_descriptor CAN_0;
|
||||
|
||||
struct usart_sync_descriptor TARGET_IO;
|
||||
|
||||
void delay_driver_init(void)
|
||||
{
|
||||
delay_init(SysTick);
|
||||
}
|
||||
|
||||
void TARGET_IO_PORT_init(void)
|
||||
{
|
||||
|
||||
gpio_set_pin_function(PA21, MUX_PA21A_USART1_RXD1);
|
||||
|
||||
gpio_set_pin_function(PB4, MUX_PB4D_USART1_TXD1);
|
||||
}
|
||||
|
||||
void TARGET_IO_CLOCK_init(void)
|
||||
{
|
||||
_pmc_enable_periph_clock(ID_USART1);
|
||||
}
|
||||
|
||||
void TARGET_IO_init(void)
|
||||
{
|
||||
TARGET_IO_CLOCK_init();
|
||||
TARGET_IO_PORT_init();
|
||||
usart_sync_init(&TARGET_IO, USART1, _usart_get_usart_sync());
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief MCAN Clock initialization function
|
||||
*
|
||||
* Enables register interface and peripheral clock
|
||||
*/
|
||||
void CAN_0_CLOCK_init()
|
||||
{
|
||||
_pmc_enable_periph_clock(ID_MCAN1);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief MCAN pinmux initialization function
|
||||
*
|
||||
* Set each required pin to MCAN functionality
|
||||
*/
|
||||
void CAN_0_PORT_init(void)
|
||||
{
|
||||
|
||||
gpio_set_pin_function(PC12, MUX_PC12C_MCAN1_CANRX1);
|
||||
|
||||
gpio_set_pin_function(PC14, MUX_PC14C_MCAN1_CANTX1);
|
||||
}
|
||||
/**
|
||||
* \brief CAN initialization function
|
||||
*
|
||||
* Enables CAN peripheral, clocks and initializes CAN driver
|
||||
*/
|
||||
void CAN_0_init(void)
|
||||
{
|
||||
CAN_0_CLOCK_init();
|
||||
CAN_0_PORT_init();
|
||||
can_async_init(&CAN_0, MCAN1);
|
||||
}
|
||||
|
||||
void system_init(void)
|
||||
{
|
||||
init_mcu();
|
||||
|
||||
_pmc_enable_periph_clock(ID_PIOA);
|
||||
|
||||
_pmc_enable_periph_clock(ID_PIOC);
|
||||
|
||||
/* Disable Watchdog */
|
||||
hri_wdt_set_MR_WDDIS_bit(WDT);
|
||||
|
||||
/* GPIO on PA11 */
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(SW0, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(SW0,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_UP);
|
||||
|
||||
gpio_set_pin_function(SW0, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
/* GPIO on PC8 */
|
||||
|
||||
gpio_set_pin_level(LED0,
|
||||
// <y> Initial level
|
||||
// <id> pad_initial_level
|
||||
// <false"> Low
|
||||
// <true"> High
|
||||
true);
|
||||
|
||||
// Set pin direction to output
|
||||
gpio_set_pin_direction(LED0, GPIO_DIRECTION_OUT);
|
||||
|
||||
gpio_set_pin_function(LED0, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
delay_driver_init();
|
||||
|
||||
TARGET_IO_init();
|
||||
|
||||
CAN_0_init();
|
||||
}
|
||||
53
bsp/microchip/same70/bsp/driver_init.h
Normal file
53
bsp/microchip/same70/bsp/driver_init.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Code generated from Atmel Start.
|
||||
*
|
||||
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||
* Please copy examples or other code you want to keep to a separate file
|
||||
* to avoid losing it when reconfiguring.
|
||||
*/
|
||||
#ifndef DRIVER_INIT_H_INCLUDED
|
||||
#define DRIVER_INIT_H_INCLUDED
|
||||
|
||||
#include "atmel_start_pins.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <hal_atomic.h>
|
||||
#include <hal_delay.h>
|
||||
#include <hal_gpio.h>
|
||||
#include <hal_init.h>
|
||||
#include <hal_io.h>
|
||||
#include <hal_sleep.h>
|
||||
|
||||
#include <hal_delay.h>
|
||||
|
||||
#include <hal_usart_sync.h>
|
||||
|
||||
#include <hal_can_async.h>
|
||||
|
||||
extern struct usart_sync_descriptor TARGET_IO;
|
||||
extern struct can_async_descriptor CAN_0;
|
||||
|
||||
void delay_driver_init(void);
|
||||
|
||||
void TARGET_IO_PORT_init(void);
|
||||
void TARGET_IO_CLOCK_init(void);
|
||||
void TARGET_IO_init(void);
|
||||
|
||||
void CAN_0_PORT_init(void);
|
||||
void CAN_0_CLOCK_init(void);
|
||||
void CAN_0_init(void);
|
||||
void CAN_0_example(void);
|
||||
|
||||
/**
|
||||
* \brief Perform system initialization, initialize pins and clocks for
|
||||
* peripherals
|
||||
*/
|
||||
void system_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif // DRIVER_INIT_H_INCLUDED
|
||||
89
bsp/microchip/same70/bsp/examples/driver_examples.c
Normal file
89
bsp/microchip/same70/bsp/examples/driver_examples.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Code generated from Atmel Start.
|
||||
*
|
||||
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||
* Please copy examples or other code you want to keep to a separate file
|
||||
* to avoid losing it when reconfiguring.
|
||||
*/
|
||||
|
||||
#include "driver_examples.h"
|
||||
#include "driver_init.h"
|
||||
#include "utils.h"
|
||||
|
||||
void delay_example(void)
|
||||
{
|
||||
delay_ms(5000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Example of using TARGET_IO to write "Hello World" using the IO abstraction.
|
||||
*/
|
||||
void TARGET_IO_example(void)
|
||||
{
|
||||
struct io_descriptor *io;
|
||||
usart_sync_get_io_descriptor(&TARGET_IO, &io);
|
||||
usart_sync_enable(&TARGET_IO);
|
||||
|
||||
io_write(io, (uint8_t *)"Hello World!", 12);
|
||||
}
|
||||
|
||||
void CAN_0_tx_callback(struct can_async_descriptor *const descr)
|
||||
{
|
||||
(void)descr;
|
||||
}
|
||||
void CAN_0_rx_callback(struct can_async_descriptor *const descr)
|
||||
{
|
||||
struct can_message msg;
|
||||
uint8_t data[64];
|
||||
msg.data = data;
|
||||
can_async_read(descr, &msg);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Example of using CAN_0 to Encrypt/Decrypt datas.
|
||||
*/
|
||||
void CAN_0_example(void)
|
||||
{
|
||||
struct can_message msg;
|
||||
struct can_filter filter;
|
||||
uint8_t send_data[4];
|
||||
send_data[0] = 0x00;
|
||||
send_data[1] = 0x01;
|
||||
send_data[2] = 0x02;
|
||||
send_data[3] = 0x03;
|
||||
|
||||
msg.id = 0x45A;
|
||||
msg.type = CAN_TYPE_DATA;
|
||||
msg.data = send_data;
|
||||
msg.len = 4;
|
||||
msg.fmt = CAN_FMT_STDID;
|
||||
can_async_register_callback(&CAN_0, CAN_ASYNC_TX_CB, (FUNC_PTR)CAN_0_tx_callback);
|
||||
can_async_enable(&CAN_0);
|
||||
/**
|
||||
* CAN_0_tx_callback callback should be invoked after call
|
||||
* can_async_write, and remote device should recieve message with ID=0x45A
|
||||
*/
|
||||
can_async_write(&CAN_0, &msg);
|
||||
|
||||
msg.id = 0x100000A5;
|
||||
msg.fmt = CAN_FMT_EXTID;
|
||||
/**
|
||||
* remote device should recieve message with ID=0x100000A5
|
||||
*/
|
||||
can_async_write(&CAN_0, &msg);
|
||||
|
||||
/**
|
||||
* CAN_0_rx_callback callback should be invoked after call
|
||||
* can_async_set_filter and remote device send CAN Message with the same
|
||||
* content as the filter.
|
||||
*/
|
||||
can_async_register_callback(&CAN_0, CAN_ASYNC_RX_CB, (FUNC_PTR)CAN_0_rx_callback);
|
||||
filter.id = 0x469;
|
||||
filter.mask = 0;
|
||||
can_async_set_filter(&CAN_0, 0, CAN_FMT_STDID, &filter);
|
||||
|
||||
filter.id = 0x10000096;
|
||||
filter.mask = 0;
|
||||
can_async_set_filter(&CAN_0, 1, CAN_FMT_EXTID, &filter);
|
||||
}
|
||||
29
bsp/microchip/same70/bsp/examples/driver_examples.h
Normal file
29
bsp/microchip/same70/bsp/examples/driver_examples.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Code generated from Atmel Start.
|
||||
*
|
||||
* This file will be overwritten when reconfiguring your Atmel Start project.
|
||||
* Please copy examples or other code you want to keep to a separate file
|
||||
* to avoid losing it when reconfiguring.
|
||||
*/
|
||||
|
||||
#include "atmel_start.h"
|
||||
#include "utils.h"
|
||||
|
||||
#ifndef DRIVER_EXAMPLES_H_INCLUDED
|
||||
#define DRIVER_EXAMPLES_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void delay_example(void);
|
||||
|
||||
void TARGET_IO_example(void);
|
||||
|
||||
void CAN_0_example(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DRIVER_EXAMPLES_H_INCLUDEDD
|
||||
42
bsp/microchip/same70/bsp/hal/documentation/can_async.rst
Normal file
42
bsp/microchip/same70/bsp/hal/documentation/can_async.rst
Normal file
@@ -0,0 +1,42 @@
|
||||
=================================================
|
||||
CAN (Controller Area Network) Asynchronous Driver
|
||||
=================================================
|
||||
|
||||
The Controller Area Network (CAN) performs communication according to
|
||||
ISO11898-1 (Bosch CAN specification 2.0 part A,B)
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Initialization/de-initialization
|
||||
* Enabling/disabling
|
||||
* CAN message transfer: transmission, reception
|
||||
* Callback on message transmited, recepted, error
|
||||
* Callback on error warning, error active, error passive, bus off, data overrun
|
||||
* Set CAN mode: normal, monitoring
|
||||
|
||||
Applications
|
||||
------------
|
||||
|
||||
Transmission and reception CAN meesage in a CAN Network.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
CAN capable hardware compatible with the ISO11898-1 (Bosch CAN specification
|
||||
2.0 part A,B)
|
||||
|
||||
Concurrency
|
||||
-----------
|
||||
|
||||
N/A
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
N/A
|
||||
|
||||
Known issues and workarounds
|
||||
----------------------------
|
||||
|
||||
N/A
|
||||
58
bsp/microchip/same70/bsp/hal/documentation/usart_sync.rst
Normal file
58
bsp/microchip/same70/bsp/hal/documentation/usart_sync.rst
Normal file
@@ -0,0 +1,58 @@
|
||||
The USART Synchronous Driver
|
||||
============================
|
||||
|
||||
The universal synchronous and asynchronous receiver and transmitter
|
||||
(USART) is usually used to transfer data from one device to the other.
|
||||
|
||||
User can set action for flow control pins by function usart_set_flow_control,
|
||||
if the flow control is enabled. All the available states are defined in union
|
||||
usart_flow_control_state.
|
||||
|
||||
Note that user can set state of flow control pins only if automatic support of
|
||||
the flow control is not supported by the hardware.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Initialization/de-initialization
|
||||
* Enabling/disabling
|
||||
* Control of the following settings:
|
||||
|
||||
* Baudrate
|
||||
* UART or USRT communication mode
|
||||
* Character size
|
||||
* Data order
|
||||
* Flow control
|
||||
* Data transfer: transmission, reception
|
||||
|
||||
Applications
|
||||
------------
|
||||
|
||||
They are commonly used in a terminal application or low-speed communication
|
||||
between devices.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
USART capable hardware.
|
||||
|
||||
Concurrency
|
||||
-----------
|
||||
|
||||
Write buffer should not be changed while data is being sent.
|
||||
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
* The driver does not support 9-bit character size.
|
||||
* The "USART with ISO7816" mode can be only used in ISO7816 capable devices.
|
||||
And the SCK pin can't be set directly. Application can use a GCLK output PIN
|
||||
to generate SCK. For example to communicate with a SMARTCARD with ISO7816
|
||||
(F = 372 ; D = 1), and baudrate=9600, the SCK pin output frequency should be
|
||||
config as 372*9600=3571200Hz. More information can be refer to ISO7816 Specification.
|
||||
|
||||
Known issues and workarounds
|
||||
----------------------------
|
||||
|
||||
N/A
|
||||
120
bsp/microchip/same70/bsp/hal/include/hal_atomic.h
Normal file
120
bsp/microchip/same70/bsp/hal/include/hal_atomic.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Critical sections related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HAL_ATOMIC_H_INCLUDED
|
||||
#define _HAL_ATOMIC_H_INCLUDED
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_helper_atomic
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Type for the register holding global interrupt enable flag
|
||||
*/
|
||||
typedef uint32_t hal_atomic_t;
|
||||
|
||||
/**
|
||||
* \brief Helper macro for entering critical sections
|
||||
*
|
||||
* This macro is recommended to be used instead of a direct call
|
||||
* hal_enterCritical() function to enter critical
|
||||
* sections. No semicolon is required after the macro.
|
||||
*
|
||||
* \section atomic_usage Usage Example
|
||||
* \code
|
||||
* CRITICAL_SECTION_ENTER()
|
||||
* Critical code
|
||||
* CRITICAL_SECTION_LEAVE()
|
||||
* \endcode
|
||||
*/
|
||||
#define CRITICAL_SECTION_ENTER() \
|
||||
{ \
|
||||
volatile hal_atomic_t __atomic; \
|
||||
atomic_enter_critical(&__atomic);
|
||||
|
||||
/**
|
||||
* \brief Helper macro for leaving critical sections
|
||||
*
|
||||
* This macro is recommended to be used instead of a direct call
|
||||
* hal_leaveCritical() function to leave critical
|
||||
* sections. No semicolon is required after the macro.
|
||||
*/
|
||||
#define CRITICAL_SECTION_LEAVE() \
|
||||
atomic_leave_critical(&__atomic); \
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Disable interrupts, enter critical section
|
||||
*
|
||||
* Disables global interrupts. Supports nested critical sections,
|
||||
* so that global interrupts are only re-enabled
|
||||
* upon leaving the outermost nested critical section.
|
||||
*
|
||||
* \param[out] atomic The pointer to a variable to store the value of global
|
||||
* interrupt enable flag
|
||||
*/
|
||||
void atomic_enter_critical(hal_atomic_t volatile *atomic);
|
||||
|
||||
/**
|
||||
* \brief Exit atomic section
|
||||
*
|
||||
* Enables global interrupts. Supports nested critical sections,
|
||||
* so that global interrupts are only re-enabled
|
||||
* upon leaving the outermost nested critical section.
|
||||
*
|
||||
* \param[in] atomic The pointer to a variable, which stores the latest stored
|
||||
* value of the global interrupt enable flag
|
||||
*/
|
||||
void atomic_leave_critical(hal_atomic_t volatile *atomic);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version.
|
||||
*/
|
||||
uint32_t atomic_get_version(void);
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HAL_ATOMIC_H_INCLUDED */
|
||||
219
bsp/microchip/same70/bsp/hal/include/hal_can_async.h
Normal file
219
bsp/microchip/same70/bsp/hal/include/hal_can_async.h
Normal file
@@ -0,0 +1,219 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Control Area Network(CAN) functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HAL_CAN_ASYNC_H_INCLUDED
|
||||
#define HAL_CAN_ASYNC_H_INCLUDED
|
||||
|
||||
#include <hpl_can.h>
|
||||
#include <hpl_can_async.h>
|
||||
#include <utils_assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_can_async
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief CAN Asynchronous descriptor
|
||||
*
|
||||
* The CAN descriptor forward declaration.
|
||||
*/
|
||||
struct can_async_descriptor;
|
||||
|
||||
/**
|
||||
* Callback for CAN interrupt
|
||||
*/
|
||||
typedef void (*can_cb_t)(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief CAN callbacks
|
||||
*/
|
||||
struct can_callbacks {
|
||||
can_cb_t tx_done;
|
||||
can_cb_t rx_done;
|
||||
void (*irq_handler)(struct can_async_descriptor *const descr, enum can_async_interrupt_type type);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN descriptor
|
||||
*/
|
||||
struct can_async_descriptor {
|
||||
struct _can_async_device dev; /*!< CAN HPL device descriptor */
|
||||
struct can_callbacks cb; /*!< CAN Interrupt Callbacks handler */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Initialize CAN.
|
||||
*
|
||||
* This function initializes the given CAN descriptor.
|
||||
*
|
||||
* \param[in, out] descr A CAN descriptor to initialize.
|
||||
* \param[in] hw The pointer to hardware instance.
|
||||
*
|
||||
* \return Initialization status.
|
||||
*/
|
||||
int32_t can_async_init(struct can_async_descriptor *const descr, void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize CAN.
|
||||
*
|
||||
* This function deinitializes the given CAN descriptor.
|
||||
*
|
||||
* \param[in, out] descr The CAN descriptor to deinitialize.
|
||||
*
|
||||
* \return De-initialization status.
|
||||
*/
|
||||
int32_t can_async_deinit(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Enable CAN
|
||||
*
|
||||
* This function enables CAN by the given can descriptor.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor to enable.
|
||||
*
|
||||
* \return Enabling status.
|
||||
*/
|
||||
int32_t can_async_enable(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Disable CAN
|
||||
*
|
||||
* This function disables CAN by the given can descriptor.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor to disable.
|
||||
*
|
||||
* \return Disabling status.
|
||||
*/
|
||||
int32_t can_async_disable(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Read a CAN message
|
||||
*
|
||||
* \param[in] descr The CAN descriptor to read message.
|
||||
* \param[in] msg The CAN message to read to.
|
||||
*
|
||||
* \return The status of read message.
|
||||
*/
|
||||
int32_t can_async_read(struct can_async_descriptor *const descr, struct can_message *msg);
|
||||
|
||||
/**
|
||||
* \brief Write a CAN message
|
||||
*
|
||||
* \param[in] descr The CAN descriptor to write message.
|
||||
* \param[in] msg The CAN message to write.
|
||||
*
|
||||
* \return The status of write message.
|
||||
*/
|
||||
int32_t can_async_write(struct can_async_descriptor *const descr, struct can_message *msg);
|
||||
|
||||
/**
|
||||
* \brief Register CAN callback function to interrupt
|
||||
*
|
||||
* \param[in] descr The CAN descriptor
|
||||
* \param[in] type Callback type
|
||||
* \param[in] cb A callback function, passing NULL will de-register any
|
||||
* registered callback
|
||||
*
|
||||
* \return The status of callback assignment.
|
||||
*/
|
||||
int32_t can_async_register_callback(struct can_async_descriptor *const descr, enum can_async_callback_type type,
|
||||
FUNC_PTR cb);
|
||||
|
||||
/**
|
||||
* \brief Return number of read errors
|
||||
*
|
||||
* This function returns the number of read errors.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor pointer
|
||||
*
|
||||
* \return The number of read errors.
|
||||
*/
|
||||
uint8_t can_async_get_rxerr(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Return number of write errors
|
||||
*
|
||||
* This function returns the number of write errors.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor pointer
|
||||
*
|
||||
* \return The number of write errors.
|
||||
*/
|
||||
uint8_t can_async_get_txerr(struct can_async_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Set CAN to the specified mode
|
||||
*
|
||||
* This function sets CAN to a specified mode.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor pointer
|
||||
* \param[in] mode The CAN operation mode
|
||||
*
|
||||
* \return Status of the operation.
|
||||
*/
|
||||
int32_t can_async_set_mode(struct can_async_descriptor *const descr, enum can_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set CAN Filter
|
||||
*
|
||||
* This function sets CAN to a specified mode.
|
||||
*
|
||||
* \param[in] descr The CAN descriptor pointer
|
||||
* \param[in] index Index of Filter list
|
||||
* \param[in] fmt CAN Indentify Type
|
||||
* \param[in] filter CAN Filter struct, NULL for clear filter
|
||||
*
|
||||
* \return Status of the operation.
|
||||
*/
|
||||
int32_t can_async_set_filter(struct can_async_descriptor *const descr, uint8_t index, enum can_format fmt,
|
||||
struct can_filter *filter);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return The current driver version.
|
||||
*/
|
||||
uint32_t can_async_get_version(void);
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HAL_CAN_ASYNC_H_INCLUDED */
|
||||
89
bsp/microchip/same70/bsp/hal/include/hal_delay.h
Normal file
89
bsp/microchip/same70/bsp/hal/include/hal_delay.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief HAL delay related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include <hpl_irq.h>
|
||||
#include <hpl_reset.h>
|
||||
#include <hpl_sleep.h>
|
||||
|
||||
#ifndef _HAL_DELAY_H_INCLUDED
|
||||
#define _HAL_DELAY_H_INCLUDED
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_delay Delay Driver
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Initialize Delay driver
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*/
|
||||
void delay_init(void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Perform delay in us
|
||||
*
|
||||
* This function performs delay for the given amount of microseconds.
|
||||
*
|
||||
* \param[in] us The amount delay in us
|
||||
*/
|
||||
void delay_us(const uint16_t us);
|
||||
|
||||
/**
|
||||
* \brief Perform delay in ms
|
||||
*
|
||||
* This function performs delay for the given amount of milliseconds.
|
||||
*
|
||||
* \param[in] ms The amount delay in ms
|
||||
*/
|
||||
void delay_ms(const uint16_t ms);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version.
|
||||
*/
|
||||
uint32_t delay_get_version(void);
|
||||
|
||||
/**@}*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _HAL_DELAY_H_INCLUDED */
|
||||
201
bsp/microchip/same70/bsp/hal/include/hal_gpio.h
Normal file
201
bsp/microchip/same70/bsp/hal/include/hal_gpio.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Port
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*/
|
||||
#ifndef _HAL_GPIO_INCLUDED_
|
||||
#define _HAL_GPIO_INCLUDED_
|
||||
|
||||
#include <hpl_gpio.h>
|
||||
#include <utils_assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Set gpio pull mode
|
||||
*
|
||||
* Set pin pull mode, non existing pull modes throws an fatal assert
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
* \param[in] pull_mode GPIO_PULL_DOWN = Pull pin low with internal resistor
|
||||
* GPIO_PULL_UP = Pull pin high with internal resistor
|
||||
* GPIO_PULL_OFF = Disable pin pull mode
|
||||
*/
|
||||
static inline void gpio_set_pin_pull_mode(const uint8_t pin, const enum gpio_pull_mode pull_mode)
|
||||
{
|
||||
_gpio_set_pin_pull_mode((enum gpio_port)GPIO_PORT(pin), pin & 0x1F, pull_mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set pin function
|
||||
*
|
||||
* Select which function a pin will be used for
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
* \param[in] function The pin function is given by a 32-bit wide bitfield
|
||||
* found in the header files for the device
|
||||
*
|
||||
*/
|
||||
static inline void gpio_set_pin_function(const uint32_t pin, uint32_t function)
|
||||
{
|
||||
_gpio_set_pin_function(pin, function);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set port data direction
|
||||
*
|
||||
* Select if the pin data direction is input, output or disabled.
|
||||
* If disabled state is not possible, this function throws an assert.
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means apply direction setting to the
|
||||
* corresponding pin
|
||||
* \param[in] direction GPIO_DIRECTION_IN = Data direction in
|
||||
* GPIO_DIRECTION_OUT = Data direction out
|
||||
* GPIO_DIRECTION_OFF = Disables the pin
|
||||
* (low power state)
|
||||
*/
|
||||
static inline void gpio_set_port_direction(const enum gpio_port port, const uint32_t mask,
|
||||
const enum gpio_direction direction)
|
||||
{
|
||||
_gpio_set_direction(port, mask, direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set gpio data direction
|
||||
*
|
||||
* Select if the pin data direction is input, output or disabled.
|
||||
* If disabled state is not possible, this function throws an assert.
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
* \param[in] direction GPIO_DIRECTION_IN = Data direction in
|
||||
* GPIO_DIRECTION_OUT = Data direction out
|
||||
* GPIO_DIRECTION_OFF = Disables the pin
|
||||
* (low power state)
|
||||
*/
|
||||
static inline void gpio_set_pin_direction(const uint8_t pin, const enum gpio_direction direction)
|
||||
{
|
||||
_gpio_set_direction((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), direction);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set port level
|
||||
*
|
||||
* Sets output level on the pins defined by the bit mask
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means apply port level to the corresponding
|
||||
* pin
|
||||
* \param[in] level true = Pin levels set to "high" state
|
||||
* false = Pin levels set to "low" state
|
||||
*/
|
||||
static inline void gpio_set_port_level(const enum gpio_port port, const uint32_t mask, const bool level)
|
||||
{
|
||||
_gpio_set_level(port, mask, level);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set gpio level
|
||||
*
|
||||
* Sets output level on a pin
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
* \param[in] level true = Pin level set to "high" state
|
||||
* false = Pin level set to "low" state
|
||||
*/
|
||||
static inline void gpio_set_pin_level(const uint8_t pin, const bool level)
|
||||
{
|
||||
_gpio_set_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin), level);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Toggle out level on pins
|
||||
*
|
||||
* Toggle the pin levels on pins defined by bit mask
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means toggle pin level to the corresponding
|
||||
* pin
|
||||
*/
|
||||
static inline void gpio_toggle_port_level(const enum gpio_port port, const uint32_t mask)
|
||||
{
|
||||
_gpio_toggle_level(port, mask);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Toggle output level on pin
|
||||
*
|
||||
* Toggle the pin levels on pins defined by bit mask
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
*/
|
||||
static inline void gpio_toggle_pin_level(const uint8_t pin)
|
||||
{
|
||||
_gpio_toggle_level((enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get input level on pins
|
||||
*
|
||||
* Read the input level on pins connected to a port
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
*/
|
||||
static inline uint32_t gpio_get_port_level(const enum gpio_port port)
|
||||
{
|
||||
return _gpio_get_level(port);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get level on pin
|
||||
*
|
||||
* Reads the level on pins connected to a port
|
||||
*
|
||||
* \param[in] pin The pin number for device
|
||||
*/
|
||||
static inline bool gpio_get_pin_level(const uint8_t pin)
|
||||
{
|
||||
return (bool)(_gpio_get_level((enum gpio_port)GPIO_PORT(pin)) & (0x01U << GPIO_PIN(pin)));
|
||||
}
|
||||
/**
|
||||
* \brief Get current driver version
|
||||
*/
|
||||
uint32_t gpio_get_version(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
72
bsp/microchip/same70/bsp/hal/include/hal_init.h
Normal file
72
bsp/microchip/same70/bsp/hal/include/hal_init.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief HAL initialization related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HAL_INIT_H_INCLUDED
|
||||
#define _HAL_INIT_H_INCLUDED
|
||||
|
||||
#include <hpl_init.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_helper_init Init Driver
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Initialize the hardware abstraction layer
|
||||
*
|
||||
* This function calls the various initialization functions.
|
||||
* Currently the following initialization functions are supported:
|
||||
* - System clock initialization
|
||||
*/
|
||||
static inline void init_mcu(void)
|
||||
{
|
||||
_init_chip();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version.
|
||||
*/
|
||||
uint32_t init_get_version(void);
|
||||
|
||||
/**@}*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _HAL_INIT_H_INCLUDED */
|
||||
110
bsp/microchip/same70/bsp/hal/include/hal_io.h
Normal file
110
bsp/microchip/same70/bsp/hal/include/hal_io.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief I/O related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HAL_IO_INCLUDED
|
||||
#define _HAL_IO_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_helper_io I/O Driver
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief I/O descriptor
|
||||
*
|
||||
* The I/O descriptor forward declaration.
|
||||
*/
|
||||
struct io_descriptor;
|
||||
|
||||
/**
|
||||
* \brief I/O write function pointer type
|
||||
*/
|
||||
typedef int32_t (*io_write_t)(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief I/O read function pointer type
|
||||
*/
|
||||
typedef int32_t (*io_read_t)(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief I/O descriptor
|
||||
*/
|
||||
struct io_descriptor {
|
||||
io_write_t write; /*! The write function pointer. */
|
||||
io_read_t read; /*! The read function pointer. */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief I/O write interface
|
||||
*
|
||||
* This function writes up to \p length of bytes to a given I/O descriptor.
|
||||
* It returns the number of bytes actually write.
|
||||
*
|
||||
* \param[in] descr An I/O descriptor to write
|
||||
* \param[in] buf The buffer pointer to story the write data
|
||||
* \param[in] length The number of bytes to write
|
||||
*
|
||||
* \return The number of bytes written
|
||||
*/
|
||||
int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief I/O read interface
|
||||
*
|
||||
* This function reads up to \p length bytes from a given I/O descriptor, and
|
||||
* stores it in the buffer pointed to by \p buf. It returns the number of bytes
|
||||
* actually read.
|
||||
*
|
||||
* \param[in] descr An I/O descriptor to read
|
||||
* \param[in] buf The buffer pointer to story the read data
|
||||
* \param[in] length The number of bytes to read
|
||||
*
|
||||
* \return The number of bytes actually read. This number can be less than the
|
||||
* requested length. E.g., in a driver that uses ring buffer for
|
||||
* reception, it may depend on the availability of data in the
|
||||
* ring buffer.
|
||||
*/
|
||||
int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HAL_IO_INCLUDED */
|
||||
74
bsp/microchip/same70/bsp/hal/include/hal_sleep.h
Normal file
74
bsp/microchip/same70/bsp/hal/include/hal_sleep.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Sleep related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HAL_SLEEP_H_INCLUDED
|
||||
#define _HAL_SLEEP_H_INCLUDED
|
||||
|
||||
#include <hpl_sleep.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_helper_sleep
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Set the sleep mode of the device and put the MCU to sleep
|
||||
*
|
||||
* For an overview of which systems are disabled in sleep for the different
|
||||
* sleep modes, see the data sheet.
|
||||
*
|
||||
* \param[in] mode Sleep mode to use
|
||||
*
|
||||
* \return The status of a sleep request
|
||||
* \retval -1 The requested sleep mode was invalid or not available
|
||||
* \retval 0 The operation completed successfully, returned after leaving the
|
||||
* sleep
|
||||
*/
|
||||
int sleep(const uint8_t mode);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version.
|
||||
*/
|
||||
uint32_t sleep_get_version(void);
|
||||
/**@}*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _HAL_SLEEP_H_INCLUDED */
|
||||
247
bsp/microchip/same70/bsp/hal/include/hal_usart_sync.h
Normal file
247
bsp/microchip/same70/bsp/hal/include/hal_usart_sync.h
Normal file
@@ -0,0 +1,247 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief USART related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HAL_SYNC_USART_H_INCLUDED
|
||||
#define _HAL_SYNC_USART_H_INCLUDED
|
||||
|
||||
#include "hal_io.h"
|
||||
#include <hpl_usart_sync.h>
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_usart_sync
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Synchronous USART descriptor
|
||||
*/
|
||||
struct usart_sync_descriptor {
|
||||
struct io_descriptor io;
|
||||
struct _usart_sync_device device;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Initialize USART interface
|
||||
*
|
||||
* This function initializes the given I/O descriptor to be used
|
||||
* as USART interface descriptor.
|
||||
* It checks if the given hardware is not initialized and
|
||||
* if the given hardware is permitted to be initialized.
|
||||
*
|
||||
* \param[out] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
* \param[in] func The pointer to as set of functions pointers
|
||||
*
|
||||
* \return Initialization status.
|
||||
*/
|
||||
int32_t usart_sync_init(struct usart_sync_descriptor *const descr, void *const hw, void *const func);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize USART interface
|
||||
*
|
||||
* This function deinitializes the given I/O descriptor.
|
||||
* It checks if the given hardware is initialized and
|
||||
* if the given hardware is permitted to be deinitialized.
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
*
|
||||
* \return De-initialization status.
|
||||
*/
|
||||
int32_t usart_sync_deinit(struct usart_sync_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Enable USART interface
|
||||
*
|
||||
* Enables the USART interface
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
*
|
||||
* \return Enabling status.
|
||||
*/
|
||||
int32_t usart_sync_enable(struct usart_sync_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Disable USART interface
|
||||
*
|
||||
* Disables the USART interface
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
*
|
||||
* \return Disabling status.
|
||||
*/
|
||||
int32_t usart_sync_disable(struct usart_sync_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Retrieve I/O descriptor
|
||||
*
|
||||
* This function retrieves the I/O descriptor of the given USART descriptor.
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[out] io An I/O descriptor to retrieve
|
||||
*
|
||||
* \return The status of the I/O descriptor retrieving.
|
||||
*/
|
||||
int32_t usart_sync_get_io_descriptor(struct usart_sync_descriptor *const descr, struct io_descriptor **io);
|
||||
|
||||
/**
|
||||
* \brief Specify action for flow control pins
|
||||
*
|
||||
* This function sets the action (or state) for the flow control pins
|
||||
* if the flow control is enabled.
|
||||
* It sets the state of flow control pins only if the automatic support of
|
||||
* the flow control is not supported by the hardware.
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] state A state to set the flow control pins
|
||||
*
|
||||
* \return The status of flow control action setup.
|
||||
*/
|
||||
int32_t usart_sync_set_flow_control(struct usart_sync_descriptor *const descr,
|
||||
const union usart_flow_control_state state);
|
||||
|
||||
/**
|
||||
* \brief Set USART baud rate
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] baud_rate A baud rate to set
|
||||
*
|
||||
* \return The status of baud rate setting.
|
||||
*/
|
||||
int32_t usart_sync_set_baud_rate(struct usart_sync_descriptor *const descr, const uint32_t baud_rate);
|
||||
|
||||
/**
|
||||
* \brief Set USART data order
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] data_order A data order to set
|
||||
*
|
||||
* \return The status of data order setting.
|
||||
*/
|
||||
int32_t usart_sync_set_data_order(struct usart_sync_descriptor *const descr, const enum usart_data_order data_order);
|
||||
|
||||
/**
|
||||
* \brief Set USART mode
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] mode A mode to set
|
||||
*
|
||||
* \return The status of mode setting.
|
||||
*/
|
||||
int32_t usart_sync_set_mode(struct usart_sync_descriptor *const descr, const enum usart_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set USART parity
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] parity A parity to set
|
||||
*
|
||||
* \return The status of parity setting.
|
||||
*/
|
||||
int32_t usart_sync_set_parity(struct usart_sync_descriptor *const descr, const enum usart_parity parity);
|
||||
|
||||
/**
|
||||
* \brief Set USART stop bits
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] stop_bits Stop bits to set
|
||||
*
|
||||
* \return The status of stop bits setting.
|
||||
*/
|
||||
int32_t usart_sync_set_stopbits(struct usart_sync_descriptor *const descr, const enum usart_stop_bits stop_bits);
|
||||
|
||||
/**
|
||||
* \brief Set USART character size
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[in] size A character size to set
|
||||
*
|
||||
* \return The status of character size setting.
|
||||
*/
|
||||
int32_t usart_sync_set_character_size(struct usart_sync_descriptor *const descr, const enum usart_character_size size);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the state of flow control pins
|
||||
*
|
||||
* This function retrieves the of flow control pins
|
||||
* if the flow control is enabled.
|
||||
* Function can return USART_FLOW_CONTROL_STATE_UNAVAILABLE in case
|
||||
* if the flow control is done by the hardware
|
||||
* and the pins state cannot be read out.
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
* \param[out] state The state of flow control pins
|
||||
*
|
||||
* \return The status of flow control state reading.
|
||||
*/
|
||||
int32_t usart_sync_flow_control_status(const struct usart_sync_descriptor *const descr,
|
||||
union usart_flow_control_state *const state);
|
||||
|
||||
/**
|
||||
* \brief Check if the USART transmitter is empty
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
*
|
||||
* \return The status of USART TX empty checking.
|
||||
* \retval 0 The USART transmitter is not empty
|
||||
* \retval 1 The USART transmitter is empty
|
||||
*/
|
||||
int32_t usart_sync_is_tx_empty(const struct usart_sync_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Check if the USART receiver is not empty
|
||||
*
|
||||
* \param[in] descr A USART descriptor which is used to communicate via USART
|
||||
*
|
||||
* \return The status of USART RX empty checking.
|
||||
* \retval 1 The USART receiver is not empty
|
||||
* \retval 0 The USART receiver is empty
|
||||
*/
|
||||
int32_t usart_sync_is_rx_not_empty(const struct usart_sync_descriptor *const descr);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version.
|
||||
*/
|
||||
uint32_t usart_sync_get_version(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HAL_SYNC_USART_H_INCLUDED */
|
||||
115
bsp/microchip/same70/bsp/hal/include/hpl_can.h
Normal file
115
bsp/microchip/same70/bsp/hal/include/hpl_can.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Control Area Network(CAN) functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HPL_CAN_H_INCLUDED
|
||||
#define HPL_CAN_H_INCLUDED
|
||||
|
||||
#include <utils_assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup hpl_can CAN Common declaration
|
||||
*
|
||||
* \section can_rev Revision History
|
||||
* - v0.0.0.1 Initial Commit
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief CAN Message Format
|
||||
*/
|
||||
enum can_format {
|
||||
CAN_FMT_STDID, /*!< Standard Format, 11 bits identifier */
|
||||
CAN_FMT_EXTID /*!< Extended Format, 29 bits identifier */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN Message Type
|
||||
*/
|
||||
enum can_type {
|
||||
CAN_TYPE_DATA, /*!< A DATA FRAME carries data from a transmitter to the
|
||||
receivers.*/
|
||||
CAN_TYPE_REMOTE /*!< A REMOTE FRAME is transmitted by a bus unit to request
|
||||
the transmission of the DATA FRAME with the same
|
||||
IDENTIFIER */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN Bus Mode
|
||||
*/
|
||||
enum can_mode {
|
||||
/** Normal operation Mode */
|
||||
CAN_MODE_NORMAL,
|
||||
/** In Bus Monitoring mode (see ISO11898-1, 10.12 Bus monitoring), the CAN
|
||||
* is able to receive valid data frames and valid remote frames, but
|
||||
* cannot start a transmission. In this mode, it sends only recessive bits
|
||||
* on the CAN bus. If the CAN is required to send a dominant bit (ACK bit,
|
||||
* overload flag, active error flag), the bit is rerouted internally so
|
||||
* that the CAN monitors this dominant bit, although the CAN bus may
|
||||
* remain in recessive state.
|
||||
* The Bus Monitoring mode can be used to analyze the traffic on a CAN bus
|
||||
* without affecting it by the transmission of dominant bits.
|
||||
*/
|
||||
CAN_MODE_MONITORING
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN Message
|
||||
*/
|
||||
struct can_message {
|
||||
uint32_t id; /* Message identifier */
|
||||
enum can_type type; /* Message Type */
|
||||
uint8_t * data; /* Pointer to Message Data */
|
||||
uint8_t len; /* Message Length */
|
||||
enum can_format fmt; /* Identifier format, CAN_STD, CAN_EXT */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN Filter
|
||||
*/
|
||||
struct can_filter {
|
||||
uint32_t id; /* Message identifier */
|
||||
uint32_t mask; /* The mask applied to the id */
|
||||
};
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HPL_CAN_H_INCLUDED */
|
||||
245
bsp/microchip/same70/bsp/hal/include/hpl_can_async.h
Normal file
245
bsp/microchip/same70/bsp/hal/include/hpl_can_async.h
Normal file
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Control Area Network(CAN) functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HPL_CAN_ASYNC_H_INCLUDED
|
||||
#define HPL_CAN_ASYNC_H_INCLUDED
|
||||
|
||||
#include <utils.h>
|
||||
#include <hpl_can.h>
|
||||
#include <hpl_irq.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup hpl_can_async CAN HPL Driver
|
||||
*
|
||||
* \section can_rev Revision History
|
||||
* - v0.0.0.1 Initial Commit
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief CAN device descriptor forware declaration
|
||||
*/
|
||||
struct _can_async_device;
|
||||
|
||||
/**
|
||||
* \brief CAN callback types
|
||||
*/
|
||||
enum can_async_callback_type {
|
||||
CAN_ASYNC_RX_CB, /*!< A new message arrived */
|
||||
CAN_ASYNC_TX_CB, /*!< A message transmitted */
|
||||
CAN_ASYNC_IRQ_CB /*!< Message error of some kind on the CAN bus IRQ */
|
||||
};
|
||||
|
||||
enum can_async_interrupt_type {
|
||||
CAN_IRQ_EW, /*!< Error warning, Error counter has reached the
|
||||
error warning limit of 96, An error count value
|
||||
greater than about 96 indicates a heavily disturbed
|
||||
bus. It may be of advantage to provide means to test
|
||||
for this condition. Refer to ISO 11898-1 (Bosch CAN
|
||||
specification 2.0 part A,B)
|
||||
*/
|
||||
CAN_IRQ_EA, /*!< Error Active State, The CAN node normally take
|
||||
part in bus communication and sends an ACTIVE ERROR
|
||||
FLAG when an error has been detected.
|
||||
Refer to ISO 11898-1 (7)
|
||||
*/
|
||||
CAN_IRQ_EP, /*!< Error Passive State, The Can node goes into error
|
||||
passive state if at least one of its error counters is
|
||||
greater than 127. It still takes part in bus
|
||||
activities, but it sends a passive error frame only,
|
||||
on errors. Refer to ISO 11898-1 (7)
|
||||
*/
|
||||
CAN_IRQ_BO, /*!< Bus Off State, The CAN node is 'bus off' when the
|
||||
TRANSMIT ERROR COUNT is greater than or equal to 256.
|
||||
Refer to ISO 11898-1 (7)
|
||||
*/
|
||||
CAN_IRQ_DO /*!< Data Overrun in receive queue. A message was lost
|
||||
because the messages in the queue was not reading and
|
||||
releasing fast enough. There is not enough space for
|
||||
a new message in receive queue.
|
||||
*/
|
||||
};
|
||||
/**
|
||||
* \brief CAN interrupt handlers structure
|
||||
*/
|
||||
struct _can_async_callback {
|
||||
void (*tx_done)(struct _can_async_device *dev);
|
||||
void (*rx_done)(struct _can_async_device *dev);
|
||||
void (*irq_handler)(struct _can_async_device *dev, enum can_async_interrupt_type type);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief CAN device descriptor
|
||||
*/
|
||||
struct _can_async_device {
|
||||
void * hw; /*!< CAN hardware pointer */
|
||||
struct _can_async_callback cb; /*!< CAN interrupt handler */
|
||||
struct _irq_descriptor irq; /*!< Interrupt descriptor */
|
||||
void * context; /*!< CAN hardware context */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Initialize CAN.
|
||||
*
|
||||
* This function initializes the given CAN device descriptor.
|
||||
*
|
||||
* \param[in, out] dev A CAN device descriptor to initialize
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*
|
||||
* \return Initialization status.
|
||||
*/
|
||||
int32_t _can_async_init(struct _can_async_device *const dev, void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize CAN.
|
||||
*
|
||||
* This function deinitializes the given can device descriptor.
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor to deinitialize
|
||||
*
|
||||
* \return De-initialization status.
|
||||
*/
|
||||
int32_t _can_async_deinit(struct _can_async_device *const dev);
|
||||
|
||||
/**
|
||||
* \brief Enable CAN
|
||||
*
|
||||
* This function enable CAN by the given can device descriptor.
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor to enable
|
||||
*
|
||||
* \return Enabling status.
|
||||
*/
|
||||
int32_t _can_async_enable(struct _can_async_device *const dev);
|
||||
|
||||
/**
|
||||
* \brief Disable CAN
|
||||
*
|
||||
* This function disable CAN by the given can device descriptor.
|
||||
*
|
||||
* \param[in] dev The CAN descriptor to disable
|
||||
*
|
||||
* \return Disabling status.
|
||||
*/
|
||||
int32_t _can_async_disable(struct _can_async_device *const dev);
|
||||
|
||||
/**
|
||||
* \brief Read a CAN message
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor to read message.
|
||||
* \param[in] msg The CAN message to read to.
|
||||
*
|
||||
* \return The status of read message.
|
||||
*/
|
||||
int32_t _can_async_read(struct _can_async_device *const dev, struct can_message *msg);
|
||||
|
||||
/**
|
||||
* \brief Write a CAN message
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor to write message.
|
||||
* \param[in] msg The CAN message to write.
|
||||
*
|
||||
* \return The status of write message.
|
||||
*/
|
||||
int32_t _can_async_write(struct _can_async_device *const dev, struct can_message *msg);
|
||||
|
||||
/**
|
||||
* \brief Set CAN Interrupt State
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor
|
||||
* \param[in] type Callback type
|
||||
* \param[in] state ture for enable or false for disable
|
||||
*
|
||||
*/
|
||||
void _can_async_set_irq_state(struct _can_async_device *const dev, enum can_async_callback_type type, bool state);
|
||||
|
||||
/**
|
||||
* \brief Return number of read errors
|
||||
*
|
||||
* This function return number of read errors
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor pointer
|
||||
*
|
||||
* \return Number of read errors.
|
||||
*/
|
||||
uint8_t _can_async_get_rxerr(struct _can_async_device *const dev);
|
||||
|
||||
/**
|
||||
* \brief Return number of write errors
|
||||
*
|
||||
* This function return number of write errors
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor pointer
|
||||
*
|
||||
* \return Number of write errors.
|
||||
*/
|
||||
uint8_t _can_async_get_txerr(struct _can_async_device *const dev);
|
||||
|
||||
/**
|
||||
* \brief Set CAN to the specified mode
|
||||
*
|
||||
* This function set CAN to a specified mode
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor pointer
|
||||
* \param[in] mode CAN operation mode
|
||||
*
|
||||
* \return Status of the operation
|
||||
*/
|
||||
int32_t _can_async_set_mode(struct _can_async_device *const dev, enum can_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set CAN to the specified mode
|
||||
*
|
||||
* This function set CAN to a specified mode
|
||||
*
|
||||
* \param[in] dev The CAN device descriptor pointer
|
||||
* \param[in] index Index of Filter list
|
||||
* \param[in] filter CAN Filter struct, NULL for clear filter
|
||||
*
|
||||
* \return Status of the operation
|
||||
*/
|
||||
int32_t _can_async_set_filter(struct _can_async_device *const dev, uint8_t index, enum can_format fmt,
|
||||
struct can_filter *filter);
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HPL_CAN_ASYNC_H_INCLUDED */
|
||||
56
bsp/microchip/same70/bsp/hal/include/hpl_core.h
Normal file
56
bsp/microchip/same70/bsp/hal/include/hpl_core.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief CPU core related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_CORE_H_INCLUDED
|
||||
#define _HPL_CORE_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Core
|
||||
*
|
||||
* \section hpl_core_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include "hpl_core_port.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_CORE_H_INCLUDED */
|
||||
97
bsp/microchip/same70/bsp/hal/include/hpl_delay.h
Normal file
97
bsp/microchip/same70/bsp/hal/include/hpl_delay.h
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Delay related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_DELAY_H_INCLUDED
|
||||
#define _HPL_DELAY_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Delay
|
||||
*
|
||||
* \section hpl_delay_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#ifndef _UNIT_TEST_
|
||||
#include <compiler.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
|
||||
/**
|
||||
* \brief Initialize delay functionality
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*/
|
||||
void _delay_init(void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the amount of cycles to delay for the given amount of us
|
||||
*
|
||||
* \param[in] us The amount of us to delay for
|
||||
*
|
||||
* \return The amount of cycles
|
||||
*/
|
||||
uint32_t _get_cycles_for_us(const uint16_t us);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the amount of cycles to delay for the given amount of ms
|
||||
*
|
||||
* \param[in] ms The amount of ms to delay for
|
||||
*
|
||||
* \return The amount of cycles
|
||||
*/
|
||||
uint32_t _get_cycles_for_ms(const uint16_t ms);
|
||||
|
||||
/**
|
||||
* \brief Delay loop to delay n number of cycles
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
* \param[in] cycles The amount of cycles to delay for
|
||||
*/
|
||||
void _delay_cycles(void *const hw, uint32_t cycles);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_DELAY_H_INCLUDED */
|
||||
176
bsp/microchip/same70/bsp/hal/include/hpl_dma.h
Normal file
176
bsp/microchip/same70/bsp/hal/include/hpl_dma.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief DMA related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_DMA_H_INCLUDED
|
||||
#define _HPL_DMA_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL DMA
|
||||
*
|
||||
* \section hpl_dma_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
#include <hpl_irq.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _dma_resource;
|
||||
|
||||
/**
|
||||
* \brief DMA callback types
|
||||
*/
|
||||
enum _dma_callback_type { DMA_TRANSFER_COMPLETE_CB, DMA_TRANSFER_ERROR_CB };
|
||||
|
||||
/**
|
||||
* \brief DMA interrupt callbacks
|
||||
*/
|
||||
struct _dma_callbacks {
|
||||
void (*transfer_done)(struct _dma_resource *resource);
|
||||
void (*error)(struct _dma_resource *resource);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief DMA resource structure
|
||||
*/
|
||||
struct _dma_resource {
|
||||
struct _dma_callbacks dma_cb;
|
||||
void * back;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Initialize DMA
|
||||
*
|
||||
* This function does low level DMA configuration.
|
||||
*
|
||||
* \return initialize status
|
||||
*/
|
||||
int32_t _dma_init(void);
|
||||
|
||||
/**
|
||||
* \brief Set destination address
|
||||
*
|
||||
* \param[in] channel DMA channel to set destination address for
|
||||
* \param[in] dst Destination address
|
||||
*
|
||||
* \return setting status
|
||||
*/
|
||||
int32_t _dma_set_destination_address(const uint8_t channel, const void *const dst);
|
||||
|
||||
/**
|
||||
* \brief Set source address
|
||||
*
|
||||
* \param[in] channel DMA channel to set source address for
|
||||
* \param[in] src Source address
|
||||
*
|
||||
* \return setting status
|
||||
*/
|
||||
int32_t _dma_set_source_address(const uint8_t channel, const void *const src);
|
||||
|
||||
/**
|
||||
* \brief Set next descriptor address
|
||||
*
|
||||
* \param[in] current_channel Current DMA channel to set next descriptor address
|
||||
* \param[in] next_channel Next DMA channel used as next descriptor
|
||||
*
|
||||
* \return setting status
|
||||
*/
|
||||
int32_t _dma_set_next_descriptor(const uint8_t current_channel, const uint8_t next_channel);
|
||||
|
||||
/**
|
||||
* \brief Enable/disable source address incrementation during DMA transaction
|
||||
*
|
||||
* \param[in] channel DMA channel to set source address for
|
||||
* \param[in] enable True to enable, false to disable
|
||||
*
|
||||
* \return status of operation
|
||||
*/
|
||||
int32_t _dma_srcinc_enable(const uint8_t channel, const bool enable);
|
||||
|
||||
/**
|
||||
* \brief Enable/disable Destination address incrementation during DMA transaction
|
||||
*
|
||||
* \param[in] channel DMA channel to set destination address for
|
||||
* \param[in] enable True to enable, false to disable
|
||||
*
|
||||
* \return status of operation
|
||||
*/
|
||||
int32_t _dma_dstinc_enable(const uint8_t channel, const bool enable);
|
||||
/**
|
||||
* \brief Set the amount of data to be transfered per transaction
|
||||
*
|
||||
* \param[in] channel DMA channel to set data amount for
|
||||
* \param[in] amount Data amount
|
||||
*
|
||||
* \return status of operation
|
||||
*/
|
||||
int32_t _dma_set_data_amount(const uint8_t channel, const uint32_t amount);
|
||||
|
||||
/**
|
||||
* \brief Trigger DMA transaction on the given channel
|
||||
*
|
||||
* \param[in] channel DMA channel to trigger transaction on
|
||||
*
|
||||
* \return status of operation
|
||||
*/
|
||||
int32_t _dma_enable_transaction(const uint8_t channel, const bool software_trigger);
|
||||
|
||||
/**
|
||||
* \brief Retrieves DMA resource structure
|
||||
*
|
||||
* \param[out] resource The resource to be retrieved
|
||||
* \param[in] channel DMA channel to retrieve structure for
|
||||
*
|
||||
* \return status of operation
|
||||
*/
|
||||
int32_t _dma_get_channel_resource(struct _dma_resource **resource, const uint8_t channel);
|
||||
|
||||
/**
|
||||
* \brief Enable/disable DMA interrupt
|
||||
*
|
||||
* \param[in] channel DMA channel to enable/disable interrupt for
|
||||
* \param[in] type The type of interrupt to disable/enable if applicable
|
||||
* \param[in] state Enable or disable
|
||||
*/
|
||||
void _dma_set_irq_state(const uint8_t channel, const enum _dma_callback_type type, const bool state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HPL_DMA_H_INCLUDED */
|
||||
95
bsp/microchip/same70/bsp/hal/include/hpl_ext_irq.h
Normal file
95
bsp/microchip/same70/bsp/hal/include/hpl_ext_irq.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief External IRQ related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_EXT_IRQ_H_INCLUDED
|
||||
#define _HPL_EXT_IRQ_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL EXT IRQ
|
||||
*
|
||||
* \section hpl_ext_irq_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initialize external interrupt module
|
||||
*
|
||||
* This function does low level external interrupt configuration.
|
||||
*
|
||||
* \param[in] cb The pointer to callback function from external interrupt
|
||||
*
|
||||
* \return Initialization status.
|
||||
* \retval -1 External irq module is already initialized
|
||||
* \retval 0 The initialization is completed successfully
|
||||
*/
|
||||
int32_t _ext_irq_init(void (*cb)(const uint32_t pin));
|
||||
|
||||
/**
|
||||
* \brief Deinitialize external interrupt module
|
||||
*
|
||||
* \return Initialization status.
|
||||
* \retval -1 External irq module is already deinitialized
|
||||
* \retval 0 The de-initialization is completed successfully
|
||||
*/
|
||||
int32_t _ext_irq_deinit(void);
|
||||
|
||||
/**
|
||||
* \brief Enable / disable external irq
|
||||
*
|
||||
* \param[in] pin Pin to enable external irq on
|
||||
* \param[in] enable True to enable, false to disable
|
||||
*
|
||||
* \return Status of external irq enabling / disabling
|
||||
* \retval -1 External irq module can't be enabled / disabled
|
||||
* \retval 0 External irq module is enabled / disabled successfully
|
||||
*/
|
||||
int32_t _ext_irq_enable(const uint32_t pin, const bool enable);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_EXT_IRQ_H_INCLUDED */
|
||||
185
bsp/microchip/same70/bsp/hal/include/hpl_gpio.h
Normal file
185
bsp/microchip/same70/bsp/hal/include/hpl_gpio.h
Normal file
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Port related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_GPIO_H_INCLUDED
|
||||
#define _HPL_GPIO_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Port
|
||||
*
|
||||
* \section hpl_port_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/**
|
||||
* \brief Macros for the pin and port group, lower 5
|
||||
* bits stands for pin number in the group, higher 3
|
||||
* bits stands for port group
|
||||
*/
|
||||
#define GPIO_PIN(n) (((n)&0x1Fu) << 0)
|
||||
#define GPIO_PORT(n) ((n) >> 5)
|
||||
#define GPIO(port, pin) ((((port)&0x7u) << 5) + ((pin)&0x1Fu))
|
||||
#define GPIO_PIN_FUNCTION_OFF 0xffffffff
|
||||
|
||||
/**
|
||||
* \brief PORT pull mode settings
|
||||
*/
|
||||
enum gpio_pull_mode { GPIO_PULL_OFF, GPIO_PULL_UP, GPIO_PULL_DOWN };
|
||||
|
||||
/**
|
||||
* \brief PORT direction settins
|
||||
*/
|
||||
enum gpio_direction { GPIO_DIRECTION_OFF, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT };
|
||||
|
||||
/**
|
||||
* \brief PORT group abstraction
|
||||
*/
|
||||
|
||||
enum gpio_port { GPIO_PORTA, GPIO_PORTB, GPIO_PORTC, GPIO_PORTD, GPIO_PORTE };
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Port initialization function
|
||||
*
|
||||
* Port initialization function should setup the port module based
|
||||
* on a static configuration file, this function should normally
|
||||
* not be called directly, but is a part of hal_init()
|
||||
*/
|
||||
void _gpio_init(void);
|
||||
|
||||
/**
|
||||
* \brief Set direction on port with mask
|
||||
*
|
||||
* Set data direction for each pin, or disable the pin
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means apply direction setting to the
|
||||
* corresponding pin
|
||||
* \param[in] direction GPIO_DIRECTION_OFF = set pin direction to input
|
||||
* and disable input buffer to disable the pin
|
||||
* GPIO_DIRECTION_IN = set pin direction to input
|
||||
* and enable input buffer to enable the pin
|
||||
* GPIO_DIRECTION_OUT = set pin direction to output
|
||||
* and disable input buffer
|
||||
*/
|
||||
static inline void _gpio_set_direction(const enum gpio_port port, const uint32_t mask,
|
||||
const enum gpio_direction direction);
|
||||
|
||||
/**
|
||||
* \brief Set output level on port with mask
|
||||
*
|
||||
* Sets output state on pin to high or low with pin masking
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means apply direction setting to
|
||||
* the corresponding pin
|
||||
* \param[in] level true = pin level is set to 1
|
||||
* false = pin level is set to 0
|
||||
*/
|
||||
static inline void _gpio_set_level(const enum gpio_port port, const uint32_t mask, const bool level);
|
||||
|
||||
/**
|
||||
* \brief Change output level to the opposite with mask
|
||||
*
|
||||
* Change pin output level to the opposite with pin masking
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] mask Bit mask where 1 means apply direction setting to
|
||||
* the corresponding pin
|
||||
*/
|
||||
static inline void _gpio_toggle_level(const enum gpio_port port, const uint32_t mask);
|
||||
|
||||
/**
|
||||
* \brief Get input levels on all port pins
|
||||
*
|
||||
* Get input level on all port pins, will read IN register if configured to
|
||||
* input and OUT register if configured as output
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
*/
|
||||
static inline uint32_t _gpio_get_level(const enum gpio_port port);
|
||||
|
||||
/**
|
||||
* \brief Set pin pull mode
|
||||
*
|
||||
* Set pull mode on a single pin
|
||||
*
|
||||
* \notice This function will automatically change pin direction to input
|
||||
*
|
||||
* \param[in] port Ports are grouped into groups of maximum 32 pins,
|
||||
* GPIO_PORTA = group 0, GPIO_PORTB = group 1, etc
|
||||
* \param[in] pin The pin in the group that pull mode should be selected
|
||||
* for
|
||||
* \param[in] pull_mode GPIO_PULL_OFF = pull resistor on pin is disabled
|
||||
* GPIO_PULL_DOWN = pull resistor on pin will pull pin
|
||||
* level to ground level
|
||||
* GPIO_PULL_UP = pull resistor on pin will pull pin
|
||||
* level to VCC
|
||||
*/
|
||||
static inline void _gpio_set_pin_pull_mode(const enum gpio_port port, const uint8_t pin,
|
||||
const enum gpio_pull_mode pull_mode);
|
||||
|
||||
/**
|
||||
* \brief Set gpio function
|
||||
*
|
||||
* Select which function a gpio is used for
|
||||
*
|
||||
* \param[in] gpio The gpio to set function for
|
||||
* \param[in] function The gpio function is given by a 32-bit wide bitfield
|
||||
* found in the header files for the device
|
||||
*
|
||||
*/
|
||||
static inline void _gpio_set_pin_function(const uint32_t gpio, const uint32_t function);
|
||||
|
||||
#include <hpl_gpio_base.h>
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_GPIO_H_INCLUDED */
|
||||
124
bsp/microchip/same70/bsp/hal/include/hpl_init.h
Normal file
124
bsp/microchip/same70/bsp/hal/include/hpl_init.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Init related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_INIT_H_INCLUDED
|
||||
#define _HPL_INIT_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Init
|
||||
*
|
||||
* \section hpl_init_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initializes clock sources
|
||||
*/
|
||||
void _sysctrl_init_sources(void);
|
||||
|
||||
/**
|
||||
* \brief Initializes Power Manager
|
||||
*/
|
||||
void _pm_init(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize generators
|
||||
*/
|
||||
void _gclk_init_generators(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize 32 kHz clock sources
|
||||
*/
|
||||
void _osc32kctrl_init_sources(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize clock sources
|
||||
*/
|
||||
void _oscctrl_init_sources(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize clock sources that need input reference clocks
|
||||
*/
|
||||
void _sysctrl_init_referenced_generators(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize clock sources that need input reference clocks
|
||||
*/
|
||||
void _oscctrl_init_referenced_generators(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize master clock generator
|
||||
*/
|
||||
void _mclk_init(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize clock generator
|
||||
*/
|
||||
void _lpmcu_misc_regs_init(void);
|
||||
|
||||
/**
|
||||
* \brief Initialize clock generator
|
||||
*/
|
||||
void _pmc_init(void);
|
||||
|
||||
/**
|
||||
* \brief Set performance level
|
||||
*
|
||||
* \param[in] level The performance level to set
|
||||
*/
|
||||
void _set_performance_level(const uint8_t level);
|
||||
|
||||
/**
|
||||
* \brief Initialize the chip
|
||||
*/
|
||||
void _init_chip(void);
|
||||
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_INIT_H_INCLUDED */
|
||||
116
bsp/microchip/same70/bsp/hal/include/hpl_irq.h
Normal file
116
bsp/microchip/same70/bsp/hal/include/hpl_irq.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief IRQ related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_IRQ_H_INCLUDED
|
||||
#define _HPL_IRQ_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL IRQ
|
||||
*
|
||||
* \section hpl_irq_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief IRQ descriptor
|
||||
*/
|
||||
struct _irq_descriptor {
|
||||
void (*handler)(void *parameter);
|
||||
void *parameter;
|
||||
};
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Retrieve current IRQ number
|
||||
*
|
||||
* \return The current IRQ number
|
||||
*/
|
||||
uint8_t _irq_get_current(void);
|
||||
|
||||
/**
|
||||
* \brief Disable the given IRQ
|
||||
*
|
||||
* \param[in] n The number of IRQ to disable
|
||||
*/
|
||||
void _irq_disable(uint8_t n);
|
||||
|
||||
/**
|
||||
* \brief Set the given IRQ
|
||||
*
|
||||
* \param[in] n The number of IRQ to set
|
||||
*/
|
||||
void _irq_set(uint8_t n);
|
||||
|
||||
/**
|
||||
* \brief Clear the given IRQ
|
||||
*
|
||||
* \param[in] n The number of IRQ to clear
|
||||
*/
|
||||
void _irq_clear(uint8_t n);
|
||||
|
||||
/**
|
||||
* \brief Enable the given IRQ
|
||||
*
|
||||
* \param[in] n The number of IRQ to enable
|
||||
*/
|
||||
void _irq_enable(uint8_t n);
|
||||
|
||||
/**
|
||||
* \brief Register IRQ handler
|
||||
*
|
||||
* \param[in] number The number registered IRQ
|
||||
* \param[in] irq The pointer to irq handler to register
|
||||
*
|
||||
* \return The status of IRQ handler registering
|
||||
* \retval -1 Passed parameters were invalid
|
||||
* \retval 0 The registering is completed successfully
|
||||
*/
|
||||
void _irq_register(const uint8_t number, struct _irq_descriptor *const irq);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_IRQ_H_INCLUDED */
|
||||
37
bsp/microchip/same70/bsp/hal/include/hpl_missing_features.h
Normal file
37
bsp/microchip/same70/bsp/hal/include/hpl_missing_features.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Family-dependent missing features expected by HAL
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_MISSING_FEATURES
|
||||
#define _HPL_MISSING_FEATURES
|
||||
|
||||
#endif /* _HPL_MISSING_FEATURES */
|
||||
93
bsp/microchip/same70/bsp/hal/include/hpl_reset.h
Normal file
93
bsp/microchip/same70/bsp/hal/include/hpl_reset.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Reset related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_RESET_H_INCLUDED
|
||||
#define _HPL_RESET_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Reset
|
||||
*
|
||||
* \section hpl_reset_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#ifndef _UNIT_TEST_
|
||||
#include <compiler.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Reset reason enumeration
|
||||
*
|
||||
* The list of possible reset reasons.
|
||||
*/
|
||||
enum reset_reason {
|
||||
|
||||
RESET_TYPE_GENERAL = 0,
|
||||
RESET_TYPE_BACKUP = 1,
|
||||
RESET_TYPE_WDT = 2,
|
||||
RESET_TYPE_SOFT = 3,
|
||||
RESET_TYPE_USER = 4,
|
||||
RESET_TYPE_CPU_FAIL = 6,
|
||||
RESET_TYPE_SLCK_XTA = 7
|
||||
};
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Retrieve the reset reason
|
||||
*
|
||||
* Retrieves the reset reason of the last MCU reset.
|
||||
*
|
||||
*\return An enum value indicating the reason of the last reset.
|
||||
*/
|
||||
enum reset_reason _get_reset_reason(void);
|
||||
|
||||
/**
|
||||
* \brief Reset MCU
|
||||
*/
|
||||
void _reset_mcu(void);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_RESET_H_INCLUDED */
|
||||
88
bsp/microchip/same70/bsp/hal/include/hpl_sleep.h
Normal file
88
bsp/microchip/same70/bsp/hal/include/hpl_sleep.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Sleep related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_SLEEP_H_INCLUDED
|
||||
#define _HPL_SLEEP_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Sleep
|
||||
*
|
||||
* \section hpl_sleep_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#ifndef _UNIT_TEST_
|
||||
#include <compiler.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Set the sleep mode for the device
|
||||
*
|
||||
* This function sets the sleep mode for the device.
|
||||
* For an overview of which systems are disabled in sleep for the different
|
||||
* sleep modes see datasheet.
|
||||
*
|
||||
* \param[in] mode Sleep mode to use
|
||||
*
|
||||
* \return the status of a sleep request
|
||||
* \retval -1 The requested sleep mode was invalid
|
||||
* \retval 0 The operation completed successfully, sleep mode is set
|
||||
*/
|
||||
int32_t _set_sleep_mode(const uint8_t mode);
|
||||
|
||||
/**
|
||||
* \brief Reset MCU
|
||||
*/
|
||||
void _reset_mcu(void);
|
||||
|
||||
/**
|
||||
* \brief Put MCU to sleep
|
||||
*/
|
||||
void _go_to_sleep(void);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_SLEEP_H_INCLUDED */
|
||||
94
bsp/microchip/same70/bsp/hal/include/hpl_time_measure.h
Normal file
94
bsp/microchip/same70/bsp/hal/include/hpl_time_measure.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Time measure related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_TIME_MEASURE_H_INCLUDED
|
||||
#define _HPL_TIME_MEASURE_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL Time measure
|
||||
*
|
||||
* \section hpl_time_measure_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief System time type
|
||||
*/
|
||||
typedef uint32_t system_time_t;
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initialize system time module
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance to initialize
|
||||
*/
|
||||
void _system_time_init(void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize system time module
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance to initialize
|
||||
*/
|
||||
void _system_time_deinit(void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Get system time
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance to initialize
|
||||
*/
|
||||
system_time_t _system_time_get(const void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Get maximum possible system time
|
||||
*
|
||||
* \param[in] hw The pointer to hardware instance to initialize
|
||||
*/
|
||||
system_time_t _system_time_get_max_time_value(const void *const hw);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_TIME_MEASURE_H_INCLUDED */
|
||||
113
bsp/microchip/same70/bsp/hal/include/hpl_usart.h
Normal file
113
bsp/microchip/same70/bsp/hal/include/hpl_usart.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief USART related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_USART_H_INCLUDED
|
||||
#define _HPL_USART_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL USART SYNC
|
||||
*
|
||||
* \section hpl_usart_sync_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief USART flow control state
|
||||
*/
|
||||
union usart_flow_control_state {
|
||||
struct {
|
||||
uint8_t cts : 1;
|
||||
uint8_t rts : 1;
|
||||
uint8_t unavailable : 1;
|
||||
uint8_t reserved : 5;
|
||||
} bit;
|
||||
uint8_t value;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief USART baud rate mode
|
||||
*/
|
||||
enum usart_baud_rate_mode { USART_BAUDRATE_ASYNCH_ARITHMETIC, USART_BAUDRATE_ASYNCH_FRACTIONAL, USART_BAUDRATE_SYNCH };
|
||||
|
||||
/**
|
||||
* \brief USART data order
|
||||
*/
|
||||
enum usart_data_order { USART_DATA_ORDER_MSB = 0, USART_DATA_ORDER_LSB = 1 };
|
||||
|
||||
/**
|
||||
* \brief USART mode
|
||||
*/
|
||||
enum usart_mode { USART_MODE_ASYNCHRONOUS = 0, USART_MODE_SYNCHRONOUS = 1 };
|
||||
|
||||
/**
|
||||
* \brief USART parity
|
||||
*/
|
||||
enum usart_parity {
|
||||
USART_PARITY_EVEN = 0,
|
||||
USART_PARITY_ODD = 1,
|
||||
USART_PARITY_NONE = 2,
|
||||
USART_PARITY_SPACE = 3,
|
||||
USART_PARITY_MARK = 4
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief USART stop bits mode
|
||||
*/
|
||||
enum usart_stop_bits { USART_STOP_BITS_ONE = 0, USART_STOP_BITS_TWO = 1, USART_STOP_BITS_ONE_P_FIVE = 2 };
|
||||
|
||||
/**
|
||||
* \brief USART character size
|
||||
*/
|
||||
enum usart_character_size {
|
||||
USART_CHARACTER_SIZE_8BITS = 0,
|
||||
USART_CHARACTER_SIZE_9BITS = 1,
|
||||
USART_CHARACTER_SIZE_5BITS = 5,
|
||||
USART_CHARACTER_SIZE_6BITS = 6,
|
||||
USART_CHARACTER_SIZE_7BITS = 7
|
||||
};
|
||||
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_USART_H_INCLUDED */
|
||||
270
bsp/microchip/same70/bsp/hal/include/hpl_usart_async.h
Normal file
270
bsp/microchip/same70/bsp/hal/include/hpl_usart_async.h
Normal file
@@ -0,0 +1,270 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief USART related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_USART_ASYNC_H_INCLUDED
|
||||
#define _HPL_USART_ASYNC_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL USART
|
||||
*
|
||||
* \section hpl_usart_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include "hpl_usart.h"
|
||||
#include "hpl_irq.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief USART callback types
|
||||
*/
|
||||
enum _usart_async_callback_type { USART_ASYNC_BYTE_SENT, USART_ASYNC_RX_DONE, USART_ASYNC_TX_DONE, USART_ASYNC_ERROR };
|
||||
|
||||
/**
|
||||
* \brief USART device structure
|
||||
*
|
||||
* The USART device structure forward declaration.
|
||||
*/
|
||||
struct _usart_async_device;
|
||||
|
||||
/**
|
||||
* \brief USART interrupt callbacks
|
||||
*/
|
||||
struct _usart_async_callbacks {
|
||||
void (*tx_byte_sent)(struct _usart_async_device *device);
|
||||
void (*rx_done_cb)(struct _usart_async_device *device, uint8_t data);
|
||||
void (*tx_done_cb)(struct _usart_async_device *device);
|
||||
void (*error_cb)(struct _usart_async_device *device);
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief USART descriptor device structure
|
||||
*/
|
||||
struct _usart_async_device {
|
||||
struct _usart_async_callbacks usart_cb;
|
||||
struct _irq_descriptor irq;
|
||||
void * hw;
|
||||
};
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initialize asynchronous USART
|
||||
*
|
||||
* This function does low level USART configuration.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*
|
||||
* \return Initialization status
|
||||
*/
|
||||
int32_t _usart_async_init(struct _usart_async_device *const device, void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize USART
|
||||
*
|
||||
* This function closes the given USART by disabling its clock.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_async_deinit(struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable usart module
|
||||
*
|
||||
* This function will enable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_async_enable(struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Disable usart module
|
||||
*
|
||||
* This function will disable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_async_disable(struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Calculate baud rate register value
|
||||
*
|
||||
* \param[in] baud Required baud rate
|
||||
* \param[in] clock_rate clock frequency
|
||||
* \param[in] samples The number of samples
|
||||
* \param[in] mode USART mode
|
||||
* \param[in] fraction A fraction value
|
||||
*
|
||||
* \return Calculated baud rate register value
|
||||
*/
|
||||
uint16_t _usart_async_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
|
||||
const enum usart_baud_rate_mode mode, const uint8_t fraction);
|
||||
|
||||
/**
|
||||
* \brief Set baud rate
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] baud_rate A baud rate to set
|
||||
*/
|
||||
void _usart_async_set_baud_rate(struct _usart_async_device *const device, const uint32_t baud_rate);
|
||||
|
||||
/**
|
||||
* \brief Set data order
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] order A data order to set
|
||||
*/
|
||||
void _usart_async_set_data_order(struct _usart_async_device *const device, const enum usart_data_order order);
|
||||
|
||||
/**
|
||||
* \brief Set mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] mode A mode to set
|
||||
*/
|
||||
void _usart_async_set_mode(struct _usart_async_device *const device, const enum usart_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set parity
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] parity A parity to set
|
||||
*/
|
||||
void _usart_async_set_parity(struct _usart_async_device *const device, const enum usart_parity parity);
|
||||
|
||||
/**
|
||||
* \brief Set stop bits mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] stop_bits A stop bits mode to set
|
||||
*/
|
||||
void _usart_async_set_stop_bits(struct _usart_async_device *const device, const enum usart_stop_bits stop_bits);
|
||||
|
||||
/**
|
||||
* \brief Set character size
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] size A character size to set
|
||||
*/
|
||||
void _usart_async_set_character_size(struct _usart_async_device *const device, const enum usart_character_size size);
|
||||
|
||||
/**
|
||||
* \brief Retrieve usart status
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
uint32_t _usart_async_get_status(const struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Write a byte to the given USART instance
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] data Data to write
|
||||
*/
|
||||
void _usart_async_write_byte(struct _usart_async_device *const device, uint8_t data);
|
||||
|
||||
/**
|
||||
* \brief Check if USART is ready to send next byte
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return Status of the ready check.
|
||||
* \retval true if the USART is ready to send next byte
|
||||
* \retval false if the USART is not ready to send next byte
|
||||
*/
|
||||
bool _usart_async_is_byte_sent(const struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Set the state of flow control pins
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] state - A state of flow control pins to set
|
||||
*/
|
||||
void _usart_async_set_flow_control_state(struct _usart_async_device *const device,
|
||||
const union usart_flow_control_state state);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the state of flow control pins
|
||||
*
|
||||
* This function retrieves the of flow control pins.
|
||||
*
|
||||
* \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
|
||||
*/
|
||||
union usart_flow_control_state _usart_async_get_flow_control_state(const struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable data register empty interrupt
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_async_enable_byte_sent_irq(struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable transmission complete interrupt
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_async_enable_tx_done_irq(struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Retrieve ordinal number of the given USART hardware instance
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return The ordinal number of the given USART hardware instance
|
||||
*/
|
||||
uint8_t _usart_async_get_hardware_index(const struct _usart_async_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable/disable USART interrupt
|
||||
*
|
||||
* param[in] device The pointer to USART device instance
|
||||
* param[in] type The type of interrupt to disable/enable if applicable
|
||||
* param[in] state Enable or disable
|
||||
*/
|
||||
void _usart_async_set_irq_state(struct _usart_async_device *const device, const enum _usart_async_callback_type type,
|
||||
const bool state);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_USART_ASYNC_H_INCLUDED */
|
||||
243
bsp/microchip/same70/bsp/hal/include/hpl_usart_dma.h
Normal file
243
bsp/microchip/same70/bsp/hal/include/hpl_usart_dma.h
Normal file
@@ -0,0 +1,243 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief USART related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_USART_DMA_H_INCLUDED
|
||||
#define _HPL_USART_DMA_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL USART
|
||||
*
|
||||
* \section hpl_usart_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include "hpl_usart.h"
|
||||
#include "hpl_irq.h"
|
||||
#include <hpl_dma.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief USART callback types
|
||||
*/
|
||||
enum usart_dma_callback_type { USART_DMA_RX_DONE, USART_DMA_TX_DONE, USART_DMA_ERROR };
|
||||
|
||||
/**
|
||||
* \brief USART device structure
|
||||
*
|
||||
* The USART device structure forward declaration.
|
||||
*/
|
||||
struct _usart_dma_device;
|
||||
|
||||
/**
|
||||
* \brief The prototype for callback on USART DMA.
|
||||
*/
|
||||
typedef void (*usart_dma_cb_t)(struct _dma_resource *resource);
|
||||
|
||||
/**
|
||||
* \brief USART interrupt callbacks
|
||||
*/
|
||||
struct _usart_dma_callbacks {
|
||||
usart_dma_cb_t tx_done_cb;
|
||||
usart_dma_cb_t rx_done_cb;
|
||||
usart_dma_cb_t error_cb;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief USART descriptor device structure
|
||||
*/
|
||||
struct _usart_dma_device {
|
||||
struct _usart_dma_callbacks usart_cb;
|
||||
void * hw;
|
||||
struct _dma_resource * resource;
|
||||
};
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initialize dmahronous USART
|
||||
*
|
||||
* This function does low level USART configuration.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*
|
||||
* \return Initialization status
|
||||
*/
|
||||
int32_t _usart_dma_init(struct _usart_dma_device *const device, void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize USART
|
||||
*
|
||||
* This function closes the given USART by disabling its clock.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_dma_deinit(struct _usart_dma_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable usart module
|
||||
*
|
||||
* This function will enable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_dma_enable(struct _usart_dma_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Disable usart module
|
||||
*
|
||||
* This function will disable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_dma_disable(struct _usart_dma_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Calculate baud rate register value
|
||||
*
|
||||
* \param[in] baud Required baud rate
|
||||
* \param[in] clock_rate clock frequency
|
||||
* \param[in] samples The number of samples
|
||||
* \param[in] mode USART mode
|
||||
* \param[in] fraction A fraction value
|
||||
*
|
||||
* \return Calculated baud rate register value
|
||||
*/
|
||||
uint16_t _usart_dma_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
|
||||
const enum usart_baud_rate_mode mode, const uint8_t fraction);
|
||||
|
||||
/**
|
||||
* \brief Set baud rate
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] baud_rate A baud rate to set
|
||||
*/
|
||||
void _usart_dma_set_baud_rate(struct _usart_dma_device *const device, const uint32_t baud_rate);
|
||||
|
||||
/**
|
||||
* \brief Set data order
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] order A data order to set
|
||||
*/
|
||||
void _usart_dma_set_data_order(struct _usart_dma_device *const device, const enum usart_data_order order);
|
||||
|
||||
/**
|
||||
* \brief Set mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] mode A mode to set
|
||||
*/
|
||||
void _usart_dma_set_mode(struct _usart_dma_device *const device, const enum usart_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set parity
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] parity A parity to set
|
||||
*/
|
||||
void _usart_dma_set_parity(struct _usart_dma_device *const device, const enum usart_parity parity);
|
||||
|
||||
/**
|
||||
* \brief Set stop bits mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] stop_bits A stop bits mode to set
|
||||
*/
|
||||
void _usart_dma_set_stop_bits(struct _usart_dma_device *const device, const enum usart_stop_bits stop_bits);
|
||||
|
||||
/**
|
||||
* \brief Set character size
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] size A character size to set
|
||||
*/
|
||||
void _usart_dma_set_character_size(struct _usart_dma_device *const device, const enum usart_character_size size);
|
||||
|
||||
/**
|
||||
* \brief Set the state of flow control pins
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] state - A state of flow control pins to set
|
||||
*/
|
||||
void _usart_dma_set_flow_control_state(struct _usart_dma_device *const device,
|
||||
const union usart_flow_control_state state);
|
||||
|
||||
/**
|
||||
* \brief Eanble dma write
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] txbuf Pointer to the transfer information
|
||||
* \param[in] length spi transfer data length
|
||||
*
|
||||
* \return Operation status
|
||||
* \retval ERR_NONE Success
|
||||
* \retval ERR_INVALID_DATA Invalid data
|
||||
*/
|
||||
int32_t _usart_dma_write(struct _usart_dma_device *const device, uint8_t const *txbuf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief Eanble dma read
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[out] rxbuf Pointer to the receiver information
|
||||
* \param[in] length spi receiver data length
|
||||
*
|
||||
* \return Operation status
|
||||
* \retval ERR_NONE Success
|
||||
* \retval ERR_INVALID_DATA Invalid data
|
||||
*/
|
||||
int32_t _usart_dma_read(struct _usart_dma_device *const device, uint8_t *const rxbuf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief Enable/disable USART interrupt
|
||||
*
|
||||
* param[in] device The pointer to USART device instance
|
||||
* param[in] type The type of interrupt to disable/enable if applicable
|
||||
* param[in] state Enable or disable
|
||||
*/
|
||||
void _usart_dma_register_callback(struct _usart_dma_device *const device, const enum usart_dma_callback_type type,
|
||||
usart_dma_cb_t cb);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_USART_DMA_H_INCLUDED */
|
||||
254
bsp/microchip/same70/bsp/hal/include/hpl_usart_sync.h
Normal file
254
bsp/microchip/same70/bsp/hal/include/hpl_usart_sync.h
Normal file
@@ -0,0 +1,254 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief USART related functionality declaration.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HPL_SYNC_USART_H_INCLUDED
|
||||
#define _HPL_SYNC_USART_H_INCLUDED
|
||||
|
||||
/**
|
||||
* \addtogroup HPL USART SYNC
|
||||
*
|
||||
* \section hpl_usart_sync_rev Revision History
|
||||
* - v1.0.0 Initial Release
|
||||
*
|
||||
*@{
|
||||
*/
|
||||
|
||||
#include <hpl_usart.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief USART descriptor device structure
|
||||
*/
|
||||
struct _usart_sync_device {
|
||||
void *hw;
|
||||
};
|
||||
|
||||
/**
|
||||
* \name HPL functions
|
||||
*/
|
||||
//@{
|
||||
/**
|
||||
* \brief Initialize synchronous USART
|
||||
*
|
||||
* This function does low level USART configuration.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] hw The pointer to hardware instance
|
||||
*
|
||||
* \return Initialization status
|
||||
*/
|
||||
int32_t _usart_sync_init(struct _usart_sync_device *const device, void *const hw);
|
||||
|
||||
/**
|
||||
* \brief Deinitialize USART
|
||||
*
|
||||
* This function closes the given USART by disabling its clock.
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_sync_deinit(struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Enable usart module
|
||||
*
|
||||
* This function will enable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_sync_enable(struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Disable usart module
|
||||
*
|
||||
* This function will disable the usart module
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
void _usart_sync_disable(struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Calculate baud rate register value
|
||||
*
|
||||
* \param[in] baud Required baud rate
|
||||
* \param[in] clock_rate clock frequency
|
||||
* \param[in] samples The number of samples
|
||||
* \param[in] mode USART mode
|
||||
* \param[in] fraction A fraction value
|
||||
*
|
||||
* \return Calculated baud rate register value
|
||||
*/
|
||||
uint16_t _usart_sync_calculate_baud_rate(const uint32_t baud, const uint32_t clock_rate, const uint8_t samples,
|
||||
const enum usart_baud_rate_mode mode, const uint8_t fraction);
|
||||
|
||||
/**
|
||||
* \brief Set baud rate
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] baud_rate A baud rate to set
|
||||
*/
|
||||
void _usart_sync_set_baud_rate(struct _usart_sync_device *const device, const uint32_t baud_rate);
|
||||
|
||||
/**
|
||||
* \brief Set data order
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] order A data order to set
|
||||
*/
|
||||
void _usart_sync_set_data_order(struct _usart_sync_device *const device, const enum usart_data_order order);
|
||||
|
||||
/**
|
||||
* \brief Set mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] mode A mode to set
|
||||
*/
|
||||
void _usart_sync_set_mode(struct _usart_sync_device *const device, const enum usart_mode mode);
|
||||
|
||||
/**
|
||||
* \brief Set parity
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] parity A parity to set
|
||||
*/
|
||||
void _usart_sync_set_parity(struct _usart_sync_device *const device, const enum usart_parity parity);
|
||||
|
||||
/**
|
||||
* \brief Set stop bits mode
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] stop_bits A stop bits mode to set
|
||||
*/
|
||||
void _usart_sync_set_stop_bits(struct _usart_sync_device *const device, const enum usart_stop_bits stop_bits);
|
||||
|
||||
/**
|
||||
* \brief Set character size
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] size A character size to set
|
||||
*/
|
||||
void _usart_sync_set_character_size(struct _usart_sync_device *const device, const enum usart_character_size size);
|
||||
|
||||
/**
|
||||
* \brief Retrieve usart status
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*/
|
||||
uint32_t _usart_sync_get_status(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Write a byte to the given USART instance
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] data Data to write
|
||||
*/
|
||||
void _usart_sync_write_byte(struct _usart_sync_device *const device, uint8_t data);
|
||||
|
||||
/**
|
||||
* \brief Read a byte from the given USART instance
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] data Data to write
|
||||
*
|
||||
* \return Data received via USART interface.
|
||||
*/
|
||||
uint8_t _usart_sync_read_byte(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Check if USART is ready to send next byte
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return Status of the ready check.
|
||||
* \retval true if the USART is ready to send next byte
|
||||
* \retval false if the USART is not ready to send next byte
|
||||
*/
|
||||
bool _usart_sync_is_ready_to_send(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Check if USART transmitter has sent the byte
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return Status of the ready check.
|
||||
* \retval true if the USART transmitter has sent the byte
|
||||
* \retval false if the USART transmitter has not send the byte
|
||||
*/
|
||||
bool _usart_sync_is_transmit_done(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Check if there is data received by USART
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return Status of the data received check.
|
||||
* \retval true if the USART has received a byte
|
||||
* \retval false if the USART has not received a byte
|
||||
*/
|
||||
bool _usart_sync_is_byte_received(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Set the state of flow control pins
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
* \param[in] state - A state of flow control pins to set
|
||||
*/
|
||||
void _usart_sync_set_flow_control_state(struct _usart_sync_device *const device,
|
||||
const union usart_flow_control_state state);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the state of flow control pins
|
||||
*
|
||||
* This function retrieves the of flow control pins.
|
||||
*
|
||||
* \return USART_FLOW_CONTROL_STATE_UNAVAILABLE.
|
||||
*/
|
||||
union usart_flow_control_state _usart_sync_get_flow_control_state(const struct _usart_sync_device *const device);
|
||||
|
||||
/**
|
||||
* \brief Retrieve ordinal number of the given USART hardware instance
|
||||
*
|
||||
* \param[in] device The pointer to USART device instance
|
||||
*
|
||||
* \return The ordinal number of the given USART hardware instance
|
||||
*/
|
||||
uint8_t _usart_sync_get_hardware_index(const struct _usart_sync_device *const device);
|
||||
//@}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif /* _HPL_SYNC_USART_H_INCLUDED */
|
||||
66
bsp/microchip/same70/bsp/hal/src/hal_atomic.c
Normal file
66
bsp/microchip/same70/bsp/hal/src/hal_atomic.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Critical sections related functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hal_atomic.h"
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
/**
|
||||
* \brief Disable interrupts, enter critical section
|
||||
*/
|
||||
void atomic_enter_critical(hal_atomic_t volatile *atomic)
|
||||
{
|
||||
*atomic = __get_PRIMASK();
|
||||
__disable_irq();
|
||||
__DMB();
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Exit atomic section
|
||||
*/
|
||||
void atomic_leave_critical(hal_atomic_t volatile *atomic)
|
||||
{
|
||||
__DMB();
|
||||
__set_PRIMASK(*atomic);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*/
|
||||
uint32_t atomic_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
230
bsp/microchip/same70/bsp/hal/src/hal_can_async.c
Normal file
230
bsp/microchip/same70/bsp/hal/src/hal_can_async.c
Normal file
@@ -0,0 +1,230 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Control Area Network(CAN) functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
#include <hal_can_async.h>
|
||||
#include <utils_assert.h>
|
||||
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
/**
|
||||
* \internal Callback of CAN Message Write finished
|
||||
*
|
||||
* \param[in] dev The pointer to CAN device structure
|
||||
*/
|
||||
static void can_tx_done(struct _can_async_device *dev);
|
||||
/**
|
||||
* \internal Callback of CAN Message Read finished
|
||||
*
|
||||
* \param[in] dev The pointer to CAN device structure
|
||||
*/
|
||||
static void can_rx_done(struct _can_async_device *dev);
|
||||
/**
|
||||
* \internal Callback of CAN Interrupt
|
||||
*
|
||||
* \param[in] dev The pointer to CAN device structure
|
||||
* \param[in] type Interrupt source type
|
||||
*/
|
||||
static void can_irq_handler(struct _can_async_device *dev, enum can_async_interrupt_type type);
|
||||
|
||||
/**
|
||||
* \brief Initialize CAN.
|
||||
*/
|
||||
int32_t can_async_init(struct can_async_descriptor *const descr, void *const hw)
|
||||
{
|
||||
int32_t rc;
|
||||
|
||||
ASSERT(descr && hw);
|
||||
|
||||
rc = _can_async_init(&descr->dev, hw);
|
||||
if (rc) {
|
||||
return rc;
|
||||
}
|
||||
descr->dev.cb.tx_done = can_tx_done;
|
||||
descr->dev.cb.rx_done = can_rx_done;
|
||||
descr->dev.cb.irq_handler = can_irq_handler;
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Deinitialize CAN.
|
||||
*/
|
||||
int32_t can_async_deinit(struct can_async_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_deinit(&descr->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Enable CAN
|
||||
*/
|
||||
int32_t can_async_enable(struct can_async_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_enable(&descr->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Disable CAN
|
||||
*/
|
||||
int32_t can_async_disable(struct can_async_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_disable(&descr->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Read a CAN message
|
||||
*/
|
||||
int32_t can_async_read(struct can_async_descriptor *const descr, struct can_message *msg)
|
||||
{
|
||||
ASSERT(descr && msg);
|
||||
return _can_async_read(&descr->dev, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Write a CAN message
|
||||
*/
|
||||
int32_t can_async_write(struct can_async_descriptor *const descr, struct can_message *msg)
|
||||
{
|
||||
ASSERT(descr && msg);
|
||||
return _can_async_write(&descr->dev, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Register CAN callback function to interrupt
|
||||
*/
|
||||
int32_t can_async_register_callback(struct can_async_descriptor *const descr, enum can_async_callback_type type,
|
||||
FUNC_PTR cb)
|
||||
{
|
||||
ASSERT(descr);
|
||||
|
||||
switch (type) {
|
||||
case CAN_ASYNC_RX_CB:
|
||||
descr->cb.rx_done = (cb != NULL) ? (can_cb_t)cb : NULL;
|
||||
break;
|
||||
case CAN_ASYNC_TX_CB:
|
||||
descr->cb.tx_done = (cb != NULL) ? (can_cb_t)cb : NULL;
|
||||
break;
|
||||
case CAN_ASYNC_IRQ_CB:
|
||||
descr->cb.irq_handler
|
||||
= (cb != NULL) ? (void (*)(struct can_async_descriptor *const, enum can_async_interrupt_type))cb : NULL;
|
||||
break;
|
||||
default:
|
||||
return ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
_can_async_set_irq_state(&descr->dev, type, NULL != cb);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return number of read errors
|
||||
*/
|
||||
uint8_t can_async_get_rxerr(struct can_async_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_get_rxerr(&descr->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return number of write errors
|
||||
*/
|
||||
uint8_t can_async_get_txerr(struct can_async_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_get_txerr(&descr->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set CAN to the specified mode
|
||||
*/
|
||||
int32_t can_async_set_mode(struct can_async_descriptor *const descr, enum can_mode mode)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_set_mode(&descr->dev, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set CAN filter
|
||||
*/
|
||||
int32_t can_async_set_filter(struct can_async_descriptor *const descr, uint8_t index, enum can_format fmt,
|
||||
struct can_filter *filter)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _can_async_set_filter(&descr->dev, index, fmt, filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*/
|
||||
uint32_t can_async_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* \internal Callback of CAN Message Write finished
|
||||
*/
|
||||
static void can_tx_done(struct _can_async_device *dev)
|
||||
{
|
||||
struct can_async_descriptor *const descr = CONTAINER_OF(dev, struct can_async_descriptor, dev);
|
||||
|
||||
if (descr->cb.tx_done) {
|
||||
descr->cb.tx_done(descr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \internal Callback of CAN Message Read finished
|
||||
*/
|
||||
static void can_rx_done(struct _can_async_device *dev)
|
||||
{
|
||||
struct can_async_descriptor *const descr = CONTAINER_OF(dev, struct can_async_descriptor, dev);
|
||||
|
||||
if (descr->cb.rx_done) {
|
||||
descr->cb.rx_done(descr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \internal Callback of CAN Interrupt
|
||||
*/
|
||||
static void can_irq_handler(struct _can_async_device *dev, enum can_async_interrupt_type type)
|
||||
{
|
||||
struct can_async_descriptor *const descr = CONTAINER_OF(dev, struct can_async_descriptor, dev);
|
||||
|
||||
if (descr->cb.irq_handler) {
|
||||
descr->cb.irq_handler(descr, type);
|
||||
}
|
||||
}
|
||||
80
bsp/microchip/same70/bsp/hal/src/hal_delay.c
Normal file
80
bsp/microchip/same70/bsp/hal/src/hal_delay.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief HAL delay related functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include <hpl_irq.h>
|
||||
#include <hpl_reset.h>
|
||||
#include <hpl_sleep.h>
|
||||
#include "hal_delay.h"
|
||||
#include <hpl_delay.h>
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
/**
|
||||
* \brief The pointer to a hardware instance used by the driver.
|
||||
*/
|
||||
static void *hardware;
|
||||
|
||||
/**
|
||||
* \brief Initialize Delay driver
|
||||
*/
|
||||
void delay_init(void *const hw)
|
||||
{
|
||||
_delay_init(hardware = hw);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Perform delay in us
|
||||
*/
|
||||
void delay_us(const uint16_t us)
|
||||
{
|
||||
_delay_cycles(hardware, _get_cycles_for_us(us));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Perform delay in ms
|
||||
*/
|
||||
void delay_ms(const uint16_t ms)
|
||||
{
|
||||
_delay_cycles(hardware, _get_cycles_for_ms(ms));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*/
|
||||
uint32_t delay_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
44
bsp/microchip/same70/bsp/hal/src/hal_gpio.c
Normal file
44
bsp/microchip/same70/bsp/hal/src/hal_gpio.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Port
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hal_gpio.h"
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
uint32_t gpio_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
47
bsp/microchip/same70/bsp/hal/src/hal_init.c
Normal file
47
bsp/microchip/same70/bsp/hal/src/hal_init.c
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief HAL initialization related functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hal_init.h"
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define HAL_INIT_VERSION 0x00000001u
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*/
|
||||
uint32_t init_get_version(void)
|
||||
{
|
||||
return HAL_INIT_VERSION;
|
||||
}
|
||||
63
bsp/microchip/same70/bsp/hal/src/hal_io.c
Normal file
63
bsp/microchip/same70/bsp/hal/src/hal_io.c
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief I/O functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include <hal_io.h>
|
||||
#include <utils_assert.h>
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
uint32_t io_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief I/O write interface
|
||||
*/
|
||||
int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length)
|
||||
{
|
||||
ASSERT(io_descr && buf);
|
||||
return io_descr->write(io_descr, buf, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief I/O read interface
|
||||
*/
|
||||
int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length)
|
||||
{
|
||||
ASSERT(io_descr && buf);
|
||||
return io_descr->read(io_descr, buf, length);
|
||||
}
|
||||
73
bsp/microchip/same70/bsp/hal/src/hal_sleep.c
Normal file
73
bsp/microchip/same70/bsp/hal/src/hal_sleep.c
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Sleep related functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hal_sleep.h"
|
||||
#include <hpl_sleep.h>
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
/**
|
||||
* \brief Set the sleep mode of the device and put the MCU to sleep
|
||||
*
|
||||
* For an overview of which systems are disabled in sleep for the different
|
||||
* sleep modes, see the data sheet.
|
||||
*
|
||||
* \param[in] mode Sleep mode to use
|
||||
*
|
||||
* \return The status of a sleep request
|
||||
* \retval -1 The requested sleep mode was invalid or not available
|
||||
* \retval 0 The operation completed successfully, returned after leaving the
|
||||
* sleep
|
||||
*/
|
||||
int sleep(const uint8_t mode)
|
||||
{
|
||||
if (ERR_NONE != _set_sleep_mode(mode))
|
||||
return ERR_INVALID_ARG;
|
||||
|
||||
_go_to_sleep();
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*
|
||||
* \return Current driver version
|
||||
*/
|
||||
uint32_t sleep_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
276
bsp/microchip/same70/bsp/hal/src/hal_usart_sync.c
Normal file
276
bsp/microchip/same70/bsp/hal/src/hal_usart_sync.c
Normal file
@@ -0,0 +1,276 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief I/O USART related functionality implementation.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hal_usart_sync.h"
|
||||
#include <utils_assert.h>
|
||||
#include <utils.h>
|
||||
|
||||
/**
|
||||
* \brief Driver version
|
||||
*/
|
||||
#define DRIVER_VERSION 0x00000001u
|
||||
|
||||
static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length);
|
||||
static int32_t usart_sync_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length);
|
||||
|
||||
/**
|
||||
* \brief Initialize usart interface
|
||||
*/
|
||||
int32_t usart_sync_init(struct usart_sync_descriptor *const descr, void *const hw, void *const func)
|
||||
{
|
||||
int32_t init_status;
|
||||
ASSERT(descr && hw);
|
||||
init_status = _usart_sync_init(&descr->device, hw);
|
||||
if (init_status) {
|
||||
return init_status;
|
||||
}
|
||||
|
||||
descr->io.read = usart_sync_read;
|
||||
descr->io.write = usart_sync_write;
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Uninitialize usart interface
|
||||
*/
|
||||
int32_t usart_sync_deinit(struct usart_sync_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_deinit(&descr->device);
|
||||
|
||||
descr->io.read = NULL;
|
||||
descr->io.write = NULL;
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Enable usart interface
|
||||
*/
|
||||
int32_t usart_sync_enable(struct usart_sync_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_enable(&descr->device);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Disable usart interface
|
||||
*/
|
||||
int32_t usart_sync_disable(struct usart_sync_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_disable(&descr->device);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve I/O descriptor
|
||||
*/
|
||||
int32_t usart_sync_get_io_descriptor(struct usart_sync_descriptor *const descr, struct io_descriptor **io)
|
||||
{
|
||||
ASSERT(descr && io);
|
||||
|
||||
*io = &descr->io;
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Specify action for flow control pins
|
||||
*/
|
||||
int32_t usart_sync_set_flow_control(struct usart_sync_descriptor *const descr,
|
||||
const union usart_flow_control_state state)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_flow_control_state(&descr->device, state);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart baud rate
|
||||
*/
|
||||
int32_t usart_sync_set_baud_rate(struct usart_sync_descriptor *const descr, const uint32_t baud_rate)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_baud_rate(&descr->device, baud_rate);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart data order
|
||||
*/
|
||||
int32_t usart_sync_set_data_order(struct usart_sync_descriptor *const descr, const enum usart_data_order data_order)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_data_order(&descr->device, data_order);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart mode
|
||||
*/
|
||||
int32_t usart_sync_set_mode(struct usart_sync_descriptor *const descr, const enum usart_mode mode)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_mode(&descr->device, mode);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart parity
|
||||
*/
|
||||
int32_t usart_sync_set_parity(struct usart_sync_descriptor *const descr, const enum usart_parity parity)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_parity(&descr->device, parity);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart stop bits
|
||||
*/
|
||||
int32_t usart_sync_set_stopbits(struct usart_sync_descriptor *const descr, const enum usart_stop_bits stop_bits)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_stop_bits(&descr->device, stop_bits);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set usart character size
|
||||
*/
|
||||
int32_t usart_sync_set_character_size(struct usart_sync_descriptor *const descr, const enum usart_character_size size)
|
||||
{
|
||||
ASSERT(descr);
|
||||
_usart_sync_set_character_size(&descr->device, size);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the state of flow control pins
|
||||
*/
|
||||
int32_t usart_sync_flow_control_status(const struct usart_sync_descriptor *const descr,
|
||||
union usart_flow_control_state *const state)
|
||||
{
|
||||
ASSERT(descr && state);
|
||||
*state = _usart_sync_get_flow_control_state(&descr->device);
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Check if the usart transmitter is empty
|
||||
*/
|
||||
int32_t usart_sync_is_tx_empty(const struct usart_sync_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _usart_sync_is_ready_to_send(&descr->device);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Check if the usart receiver is not empty
|
||||
*/
|
||||
int32_t usart_sync_is_rx_not_empty(const struct usart_sync_descriptor *const descr)
|
||||
{
|
||||
ASSERT(descr);
|
||||
return _usart_sync_is_byte_received(&descr->device);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Retrieve the current driver version
|
||||
*/
|
||||
uint32_t usart_sync_get_version(void)
|
||||
{
|
||||
return DRIVER_VERSION;
|
||||
}
|
||||
|
||||
/*
|
||||
* \internal Write the given data to usart interface
|
||||
*
|
||||
* \param[in] descr The pointer to an io descriptor
|
||||
* \param[in] buf Data to write to usart
|
||||
* \param[in] length The number of bytes to write
|
||||
*
|
||||
* \return The number of bytes written.
|
||||
*/
|
||||
static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length)
|
||||
{
|
||||
uint32_t offset = 0;
|
||||
struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io);
|
||||
|
||||
ASSERT(io_descr && buf && length);
|
||||
while (!_usart_sync_is_ready_to_send(&descr->device))
|
||||
;
|
||||
do {
|
||||
_usart_sync_write_byte(&descr->device, buf[offset]);
|
||||
while (!_usart_sync_is_ready_to_send(&descr->device))
|
||||
;
|
||||
} while (++offset < length);
|
||||
while (!_usart_sync_is_transmit_done(&descr->device))
|
||||
;
|
||||
return (int32_t)offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* \internal Read data from usart interface
|
||||
*
|
||||
* \param[in] descr The pointer to an io descriptor
|
||||
* \param[in] buf A buffer to read data to
|
||||
* \param[in] length The size of a buffer
|
||||
*
|
||||
* \return The number of bytes read.
|
||||
*/
|
||||
static int32_t usart_sync_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length)
|
||||
{
|
||||
uint32_t offset = 0;
|
||||
struct usart_sync_descriptor *descr = CONTAINER_OF(io_descr, struct usart_sync_descriptor, io);
|
||||
|
||||
ASSERT(io_descr && buf && length);
|
||||
do {
|
||||
while (!_usart_sync_is_byte_received(&descr->device))
|
||||
;
|
||||
buf[offset] = _usart_sync_read_byte(&descr->device);
|
||||
} while (++offset < length);
|
||||
|
||||
return (int32_t)offset;
|
||||
}
|
||||
64
bsp/microchip/same70/bsp/hal/utils/include/compiler.h
Normal file
64
bsp/microchip/same70/bsp/hal/utils/include/compiler.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Header
|
||||
*
|
||||
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* compiler.h
|
||||
*
|
||||
* Created: 05.05.2014
|
||||
* Author: N. Fomin
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef _COMPILER_H
|
||||
#define _COMPILER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef _UNIT_TEST_
|
||||
#include "parts.h"
|
||||
#endif
|
||||
#include "err_codes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _COMPILER_H */
|
||||
73
bsp/microchip/same70/bsp/hal/utils/include/err_codes.h
Normal file
73
bsp/microchip/same70/bsp/hal/utils/include/err_codes.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Error code definitions.
|
||||
*
|
||||
* This file defines various status codes returned by functions,
|
||||
* indicating success or failure as well as what kind of failure.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ERROR_CODES_H_INCLUDED
|
||||
#define ERROR_CODES_H_INCLUDED
|
||||
|
||||
#define ERR_NONE 0
|
||||
#define ERR_INVALID_DATA -1
|
||||
#define ERR_NO_CHANGE -2
|
||||
#define ERR_ABORTED -3
|
||||
#define ERR_BUSY -4
|
||||
#define ERR_SUSPEND -5
|
||||
#define ERR_IO -6
|
||||
#define ERR_REQ_FLUSHED -7
|
||||
#define ERR_TIMEOUT -8
|
||||
#define ERR_BAD_DATA -9
|
||||
#define ERR_NOT_FOUND -10
|
||||
#define ERR_UNSUPPORTED_DEV -11
|
||||
#define ERR_NO_MEMORY -12
|
||||
#define ERR_INVALID_ARG -13
|
||||
#define ERR_BAD_ADDRESS -14
|
||||
#define ERR_BAD_FORMAT -15
|
||||
#define ERR_BAD_FRQ -16
|
||||
#define ERR_DENIED -17
|
||||
#define ERR_ALREADY_INITIALIZED -18
|
||||
#define ERR_OVERFLOW -19
|
||||
#define ERR_NOT_INITIALIZED -20
|
||||
#define ERR_SAMPLERATE_UNAVAILABLE -21
|
||||
#define ERR_RESOLUTION_UNAVAILABLE -22
|
||||
#define ERR_BAUDRATE_UNAVAILABLE -23
|
||||
#define ERR_PACKET_COLLISION -24
|
||||
#define ERR_PROTOCOL -25
|
||||
#define ERR_PIN_MUX_INVALID -26
|
||||
#define ERR_UNSUPPORTED_OP -27
|
||||
#define ERR_NO_RESOURCE -28
|
||||
#define ERR_NOT_READY -29
|
||||
#define ERR_FAILURE -30
|
||||
#define ERR_WRONG_LENGTH -31
|
||||
|
||||
#endif
|
||||
54
bsp/microchip/same70/bsp/hal/utils/include/events.h
Normal file
54
bsp/microchip/same70/bsp/hal/utils/include/events.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Events declaration.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EVENTS_H_INCLUDED
|
||||
#define _EVENTS_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
/**
|
||||
* \brief List of events. Must start with 0, be unique and follow numerical order.
|
||||
*/
|
||||
#define EVENT_IS_READY_TO_SLEEP_ID 0
|
||||
#define EVENT_PREPARE_TO_SLEEP_ID 1
|
||||
#define EVENT_WOKEN_UP_ID 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _EVENTS_H_INCLUDED */
|
||||
41
bsp/microchip/same70/bsp/hal/utils/include/parts.h
Normal file
41
bsp/microchip/same70/bsp/hal/utils/include/parts.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Atmel part identification macros
|
||||
*
|
||||
* Copyright (c) 2015-2019 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ATMEL_PARTS_H
|
||||
#define ATMEL_PARTS_H
|
||||
|
||||
#include "sam.h"
|
||||
|
||||
#include "hri_e70b.h"
|
||||
|
||||
#endif /* ATMEL_PARTS_H */
|
||||
368
bsp/microchip/same70/bsp/hal/utils/include/utils.h
Normal file
368
bsp/microchip/same70/bsp/hal/utils/include/utils.h
Normal file
@@ -0,0 +1,368 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Different macros.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UTILS_H_INCLUDED
|
||||
#define UTILS_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \addtogroup doc_driver_hal_utils_macro
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Retrieve pointer to parent structure
|
||||
*/
|
||||
#define CONTAINER_OF(ptr, type, field_name) ((type *)(((uint8_t *)ptr) - offsetof(type, field_name)))
|
||||
|
||||
/**
|
||||
* \brief Retrieve array size
|
||||
*/
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
/**
|
||||
* \brief Emit the compiler pragma \a arg.
|
||||
*
|
||||
* \param[in] arg The pragma directive as it would appear after \e \#pragma
|
||||
* (i.e. not stringified).
|
||||
*/
|
||||
#define COMPILER_PRAGMA(arg) _Pragma(#arg)
|
||||
|
||||
/**
|
||||
* \def COMPILER_PACK_SET(alignment)
|
||||
* \brief Set maximum alignment for subsequent struct and union definitions to \a alignment.
|
||||
*/
|
||||
#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment))
|
||||
|
||||
/**
|
||||
* \def COMPILER_PACK_RESET()
|
||||
* \brief Set default alignment for subsequent struct and union definitions.
|
||||
*/
|
||||
#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
|
||||
|
||||
/**
|
||||
* \brief Set aligned boundary.
|
||||
*/
|
||||
#if defined __GNUC__
|
||||
#define COMPILER_ALIGNED(a) __attribute__((__aligned__(a)))
|
||||
#elif defined __ICCARM__
|
||||
#define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a)
|
||||
#elif defined __CC_ARM
|
||||
#define COMPILER_ALIGNED(a) __attribute__((__aligned__(a)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Flash located data macros
|
||||
*/
|
||||
#if defined __GNUC__
|
||||
#define PROGMEM_DECLARE(type, name) const type name
|
||||
#define PROGMEM_T const
|
||||
#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
|
||||
#define PROGMEM_PTR_T const *
|
||||
#define PROGMEM_STRING_T const uint8_t *
|
||||
#elif defined __ICCARM__
|
||||
#define PROGMEM_DECLARE(type, name) const type name
|
||||
#define PROGMEM_T const
|
||||
#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
|
||||
#define PROGMEM_PTR_T const *
|
||||
#define PROGMEM_STRING_T const uint8_t *
|
||||
#elif defined __CC_ARM
|
||||
#define PROGMEM_DECLARE(type, name) const type name
|
||||
#define PROGMEM_T const
|
||||
#define PROGMEM_READ_BYTE(x) *((uint8_t *)(x))
|
||||
#define PROGMEM_PTR_T const *
|
||||
#define PROGMEM_STRING_T const uint8_t *
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Optimization
|
||||
*/
|
||||
#if defined __GNUC__
|
||||
#define OPTIMIZE_HIGH __attribute__((optimize(s)))
|
||||
#elif defined __CC_ARM
|
||||
#define OPTIMIZE_HIGH _Pragma("O3")
|
||||
#elif defined __ICCARM__
|
||||
#define OPTIMIZE_HIGH _Pragma("optimize=high")
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief RAM located function attribute
|
||||
*/
|
||||
#if defined(__CC_ARM) /* Keil ?Vision 4 */
|
||||
#define RAMFUNC __attribute__((section(".ramfunc")))
|
||||
#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */
|
||||
#define RAMFUNC __ramfunc
|
||||
#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */
|
||||
#define RAMFUNC __attribute__((section(".ramfunc")))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief No-init section.
|
||||
* Place a data object or a function in a no-init section.
|
||||
*/
|
||||
#if defined(__CC_ARM)
|
||||
#define NO_INIT(a) __attribute__((zero_init))
|
||||
#elif defined(__ICCARM__)
|
||||
#define NO_INIT(a) __no_init
|
||||
#elif defined(__GNUC__)
|
||||
#define NO_INIT(a) __attribute__((section(".no_init")))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Set user-defined section.
|
||||
* Place a data object or a function in a user-defined section.
|
||||
*/
|
||||
#if defined(__CC_ARM)
|
||||
#define COMPILER_SECTION(a) __attribute__((__section__(a)))
|
||||
#elif defined(__ICCARM__)
|
||||
#define COMPILER_SECTION(a) COMPILER_PRAGMA(location = a)
|
||||
#elif defined(__GNUC__)
|
||||
#define COMPILER_SECTION(a) __attribute__((__section__(a)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Define WEAK attribute.
|
||||
*/
|
||||
#if defined(__CC_ARM) /* Keil ?Vision 4 */
|
||||
#define WEAK __attribute__((weak))
|
||||
#elif defined(__ICCARM__) /* IAR Ewarm 5.41+ */
|
||||
#define WEAK __weak
|
||||
#elif defined(__GNUC__) /* GCC CS3 2009q3-68 */
|
||||
#define WEAK __attribute__((weak))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Pointer to function
|
||||
*/
|
||||
typedef void (*FUNC_PTR)(void);
|
||||
|
||||
#define LE_BYTE0(a) ((uint8_t)(a))
|
||||
#define LE_BYTE1(a) ((uint8_t)((a) >> 8))
|
||||
#define LE_BYTE2(a) ((uint8_t)((a) >> 16))
|
||||
#define LE_BYTE3(a) ((uint8_t)((a) >> 24))
|
||||
|
||||
#define LE_2_U16(p) ((p)[0] + ((p)[1] << 8))
|
||||
#define LE_2_U32(p) ((p)[0] + ((p)[1] << 8) + ((p)[2] << 16) + ((p)[3] << 24))
|
||||
|
||||
/** \name Zero-Bit Counting
|
||||
*
|
||||
* Under GCC, __builtin_clz and __builtin_ctz behave like macros when
|
||||
* applied to constant expressions (values known at compile time), so they are
|
||||
* more optimized than the use of the corresponding assembly instructions and
|
||||
* they can be used as constant expressions e.g. to initialize objects having
|
||||
* static storage duration, and like the corresponding assembly instructions
|
||||
* when applied to non-constant expressions (values unknown at compile time), so
|
||||
* they are more optimized than an assembly periphrasis. Hence, clz and ctz
|
||||
* ensure a possible and optimized behavior for both constant and non-constant
|
||||
* expressions.
|
||||
*
|
||||
* @{ */
|
||||
|
||||
/** \brief Counts the leading zero bits of the given value considered as a 32-bit integer.
|
||||
*
|
||||
* \param[in] u Value of which to count the leading zero bits.
|
||||
*
|
||||
* \return The count of leading zero bits in \a u.
|
||||
*/
|
||||
#if (defined __GNUC__) || (defined __CC_ARM)
|
||||
#define clz(u) __builtin_clz(u)
|
||||
#else
|
||||
#define clz(u) \
|
||||
( \
|
||||
((u) == 0) \
|
||||
? 32 \
|
||||
: ((u) & (1ul << 31)) \
|
||||
? 0 \
|
||||
: ((u) & (1ul << 30)) \
|
||||
? 1 \
|
||||
: ((u) & (1ul << 29)) \
|
||||
? 2 \
|
||||
: ((u) & (1ul << 28)) \
|
||||
? 3 \
|
||||
: ((u) & (1ul << 27)) \
|
||||
? 4 \
|
||||
: ((u) & (1ul << 26)) \
|
||||
? 5 \
|
||||
: ((u) & (1ul << 25)) \
|
||||
? 6 \
|
||||
: ((u) & (1ul << 24)) \
|
||||
? 7 \
|
||||
: ((u) & (1ul << 23)) \
|
||||
? 8 \
|
||||
: ((u) & (1ul << 22)) \
|
||||
? 9 \
|
||||
: ((u) & (1ul << 21)) \
|
||||
? 10 \
|
||||
: ((u) & (1ul << 20)) \
|
||||
? 11 \
|
||||
: ((u) & (1ul << 19)) \
|
||||
? 12 \
|
||||
: ((u) & (1ul << 18)) \
|
||||
? 13 \
|
||||
: ((u) & (1ul << 17)) ? 14 \
|
||||
: ((u) & (1ul << 16)) ? 15 \
|
||||
: ((u) & (1ul << 15)) ? 16 \
|
||||
: ((u) & (1ul << 14)) ? 17 \
|
||||
: ((u) & (1ul << 13)) ? 18 \
|
||||
: ((u) & (1ul << 12)) ? 19 \
|
||||
: ((u) \
|
||||
& (1ul \
|
||||
<< 11)) \
|
||||
? 20 \
|
||||
: ((u) \
|
||||
& (1ul \
|
||||
<< 10)) \
|
||||
? 21 \
|
||||
: ((u) \
|
||||
& (1ul \
|
||||
<< 9)) \
|
||||
? 22 \
|
||||
: ((u) \
|
||||
& (1ul \
|
||||
<< 8)) \
|
||||
? 23 \
|
||||
: ((u) & (1ul << 7)) ? 24 \
|
||||
: ((u) & (1ul << 6)) ? 25 \
|
||||
: ((u) \
|
||||
& (1ul \
|
||||
<< 5)) \
|
||||
? 26 \
|
||||
: ((u) & (1ul << 4)) ? 27 \
|
||||
: ((u) & (1ul << 3)) ? 28 \
|
||||
: ((u) & (1ul << 2)) ? 29 \
|
||||
: ( \
|
||||
(u) & (1ul << 1)) \
|
||||
? 30 \
|
||||
: 31)
|
||||
#endif
|
||||
|
||||
/** \brief Counts the trailing zero bits of the given value considered as a 32-bit integer.
|
||||
*
|
||||
* \param[in] u Value of which to count the trailing zero bits.
|
||||
*
|
||||
* \return The count of trailing zero bits in \a u.
|
||||
*/
|
||||
#if (defined __GNUC__) || (defined __CC_ARM)
|
||||
#define ctz(u) __builtin_ctz(u)
|
||||
#else
|
||||
#define ctz(u) \
|
||||
( \
|
||||
(u) & (1ul << 0) \
|
||||
? 0 \
|
||||
: (u) & (1ul << 1) \
|
||||
? 1 \
|
||||
: (u) & (1ul << 2) \
|
||||
? 2 \
|
||||
: (u) & (1ul << 3) \
|
||||
? 3 \
|
||||
: (u) & (1ul << 4) \
|
||||
? 4 \
|
||||
: (u) & (1ul << 5) \
|
||||
? 5 \
|
||||
: (u) & (1ul << 6) \
|
||||
? 6 \
|
||||
: (u) & (1ul << 7) \
|
||||
? 7 \
|
||||
: (u) & (1ul << 8) \
|
||||
? 8 \
|
||||
: (u) & (1ul << 9) \
|
||||
? 9 \
|
||||
: (u) & (1ul << 10) \
|
||||
? 10 \
|
||||
: (u) & (1ul << 11) \
|
||||
? 11 \
|
||||
: (u) & (1ul << 12) \
|
||||
? 12 \
|
||||
: (u) & (1ul << 13) \
|
||||
? 13 \
|
||||
: (u) & (1ul << 14) \
|
||||
? 14 \
|
||||
: (u) & (1ul << 15) \
|
||||
? 15 \
|
||||
: (u) & (1ul << 16) \
|
||||
? 16 \
|
||||
: (u) & (1ul << 17) \
|
||||
? 17 \
|
||||
: (u) & (1ul << 18) \
|
||||
? 18 \
|
||||
: (u) & (1ul << 19) ? 19 \
|
||||
: (u) & (1ul << 20) ? 20 \
|
||||
: (u) & (1ul << 21) ? 21 \
|
||||
: (u) & (1ul << 22) ? 22 \
|
||||
: (u) & (1ul << 23) ? 23 \
|
||||
: (u) & (1ul << 24) ? 24 \
|
||||
: (u) & (1ul << 25) ? 25 \
|
||||
: (u) & (1ul << 26) ? 26 \
|
||||
: (u) & (1ul << 27) ? 27 \
|
||||
: (u) & (1ul << 28) ? 28 : (u) & (1ul << 29) ? 29 : (u) & (1ul << 30) ? 30 : (u) & (1ul << 31) ? 31 : 32)
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* \brief Counts the number of bits in a mask (no more than 32 bits)
|
||||
* \param[in] mask Mask of which to count the bits.
|
||||
*/
|
||||
#define size_of_mask(mask) (32 - clz(mask) - ctz(mask))
|
||||
|
||||
/**
|
||||
* \brief Retrieve the start position of bits mask (no more than 32 bits)
|
||||
* \param[in] mask Mask of which to retrieve the start position.
|
||||
*/
|
||||
#define pos_of_mask(mask) ctz(mask)
|
||||
|
||||
/**
|
||||
* \brief Return division result of a/b and round up the result to the closest
|
||||
* number divisible by "b"
|
||||
*/
|
||||
#define round_up(a, b) (((a)-1) / (b) + 1)
|
||||
|
||||
/**
|
||||
* \brief Get the minimum of x and y
|
||||
*/
|
||||
#define min(x, y) ((x) > (y) ? (y) : (x))
|
||||
|
||||
/**
|
||||
* \brief Get the maximum of x and y
|
||||
*/
|
||||
#define max(x, y) ((x) > (y) ? (x) : (y))
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* UTILS_H_INCLUDED */
|
||||
93
bsp/microchip/same70/bsp/hal/utils/include/utils_assert.h
Normal file
93
bsp/microchip/same70/bsp/hal/utils/include/utils_assert.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Asserts related functionality.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ASSERT_H_INCLUDED
|
||||
#define _ASSERT_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <compiler.h>
|
||||
|
||||
#ifndef USE_SIMPLE_ASSERT
|
||||
//# define USE_SIMPLE_ASSERT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Assert macro
|
||||
*
|
||||
* This macro is used to throw asserts. It can be mapped to different function
|
||||
* based on debug level.
|
||||
*
|
||||
* \param[in] condition A condition to be checked;
|
||||
* assert is thrown if the given condition is false
|
||||
*/
|
||||
#define ASSERT(condition) ASSERT_IMPL((condition), __FILE__, __LINE__)
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#ifdef USE_SIMPLE_ASSERT
|
||||
#define ASSERT_IMPL(condition, file, line) \
|
||||
if (!(condition)) \
|
||||
__asm("BKPT #0");
|
||||
#else
|
||||
#define ASSERT_IMPL(condition, file, line) assert((condition), file, line)
|
||||
#endif
|
||||
|
||||
#else /* DEBUG */
|
||||
|
||||
#ifdef USE_SIMPLE_ASSERT
|
||||
#define ASSERT_IMPL(condition, file, line) ((void)0)
|
||||
#else
|
||||
#define ASSERT_IMPL(condition, file, line) ((void)0)
|
||||
#endif
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
/**
|
||||
* \brief Assert function
|
||||
*
|
||||
* This function is used to throw asserts.
|
||||
*
|
||||
* \param[in] condition A condition to be checked; assert is thrown if the given
|
||||
* condition is false
|
||||
* \param[in] file File name
|
||||
* \param[in] line Line number
|
||||
*/
|
||||
void assert(const bool condition, const char *const file, const int line);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _ASSERT_H_INCLUDED */
|
||||
115
bsp/microchip/same70/bsp/hal/utils/include/utils_event.h
Normal file
115
bsp/microchip/same70/bsp/hal/utils/include/utils_event.h
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Events declaration.
|
||||
*
|
||||
* Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UTILS_EVENT_H_INCLUDED
|
||||
#define _UTILS_EVENT_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <utils.h>
|
||||
#include <utils_list.h>
|
||||
#include <events.h>
|
||||
|
||||
/**
|
||||
* \brief The maximum amount of events
|
||||
*/
|
||||
#define EVENT_MAX_AMOUNT 8
|
||||
|
||||
/**
|
||||
* \brief The size of event mask used, it is EVENT_MAX_AMOUNT rounded up to the
|
||||
* closest number divisible by 8.
|
||||
*/
|
||||
#define EVENT_MASK_SIZE (round_up(EVENT_MAX_AMOUNT, 8))
|
||||
|
||||
/**
|
||||
* \brief The type of event ID. IDs should start with 0 and be in numerical order.
|
||||
*/
|
||||
typedef uint8_t event_id_t;
|
||||
|
||||
/**
|
||||
* \brief The type of returned parameter. This type is big enough to contain
|
||||
* pointer to data on any platform.
|
||||
*/
|
||||
typedef uintptr_t event_data_t;
|
||||
|
||||
/**
|
||||
* \brief The type of returned parameter. This type is big enough to contain
|
||||
* pointer to data on any platform.
|
||||
*/
|
||||
typedef void (*event_cb_t)(event_id_t id, event_data_t data);
|
||||
|
||||
/**
|
||||
* \brief Event structure
|
||||
*/
|
||||
struct event {
|
||||
struct list_element elem; /*! The pointer to next event */
|
||||
uint8_t mask[EVENT_MASK_SIZE]; /*! Mask of event IDs callback is called for */
|
||||
event_cb_t cb; /*! Callback to be called when an event occurs */
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Subscribe to event
|
||||
*
|
||||
* \param[in] event The pointer to event structure
|
||||
* \param[in] id The event ID to subscribe to
|
||||
* \param[in] cb The callback function to call when the given event occurs
|
||||
*
|
||||
* \return The status of subscription
|
||||
*/
|
||||
int32_t event_subscribe(struct event *const event, const event_id_t id, event_cb_t cb);
|
||||
|
||||
/**
|
||||
* \brief Remove event from subscription
|
||||
*
|
||||
* \param[in] event The pointer to event structure
|
||||
* \param[in] id The event ID to remove subscription from
|
||||
*
|
||||
* \return The status of subscription removing
|
||||
*/
|
||||
int32_t event_unsubscribe(struct event *const event, const event_id_t id);
|
||||
|
||||
/**
|
||||
* \brief Post event
|
||||
*
|
||||
* \param[in] id The event ID to post
|
||||
* \param[in] data The event data to be passed to event subscribers
|
||||
*/
|
||||
void event_post(const event_id_t id, const event_data_t data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _UTILS_EVENT_H_INCLUDED */
|
||||
@@ -0,0 +1,308 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief Increment macro.
|
||||
*
|
||||
* Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* Subject to your compliance with these terms, you may use Microchip
|
||||
* software and any derivatives exclusively with Microchip products.
|
||||
* It is your responsibility to comply with third party license terms applicable
|
||||
* to your use of third party software (including open source software) that
|
||||
* may accompany Microchip software.
|
||||
*
|
||||
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
|
||||
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
|
||||
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
|
||||
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
|
||||
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
|
||||
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
|
||||
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
|
||||
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
|
||||
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
|
||||
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UTILS_INCREMENT_MACRO_H
|
||||
#define _UTILS_INCREMENT_MACRO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Compile time increment, result value is entire integer literal
|
||||
*
|
||||
* \param[in] val - value to be incremented (254 max)
|
||||
*/
|
||||
#define INC_VALUE(val) SP_INC_##val
|
||||
|
||||
// Preprocessor increment implementation
|
||||
#define SP_INC_0 1
|
||||
#define SP_INC_1 2
|
||||
#define SP_INC_2 3
|
||||
#define SP_INC_3 4
|
||||
#define SP_INC_4 5
|
||||
#define SP_INC_5 6
|
||||
#define SP_INC_6 7
|
||||
#define SP_INC_7 8
|
||||
#define SP_INC_8 9
|
||||
#define SP_INC_9 10
|
||||
#define SP_INC_10 11
|
||||
#define SP_INC_11 12
|
||||
#define SP_INC_12 13
|
||||
#define SP_INC_13 14
|
||||
#define SP_INC_14 15
|
||||
#define SP_INC_15 16
|
||||
#define SP_INC_16 17
|
||||
#define SP_INC_17 18
|
||||
#define SP_INC_18 19
|
||||
#define SP_INC_19 20
|
||||
#define SP_INC_20 21
|
||||
#define SP_INC_21 22
|
||||
#define SP_INC_22 23
|
||||
#define SP_INC_23 24
|
||||
#define SP_INC_24 25
|
||||
#define SP_INC_25 26
|
||||
#define SP_INC_26 27
|
||||
#define SP_INC_27 28
|
||||
#define SP_INC_28 29
|
||||
#define SP_INC_29 30
|
||||
#define SP_INC_30 31
|
||||
#define SP_INC_31 32
|
||||
#define SP_INC_32 33
|
||||
#define SP_INC_33 34
|
||||
#define SP_INC_34 35
|
||||
#define SP_INC_35 36
|
||||
#define SP_INC_36 37
|
||||
#define SP_INC_37 38
|
||||
#define SP_INC_38 39
|
||||
#define SP_INC_39 40
|
||||
#define SP_INC_40 41
|
||||
#define SP_INC_41 42
|
||||
#define SP_INC_42 43
|
||||
#define SP_INC_43 44
|
||||
#define SP_INC_44 45
|
||||
#define SP_INC_45 46
|
||||
#define SP_INC_46 47
|
||||
#define SP_INC_47 48
|
||||
#define SP_INC_48 49
|
||||
#define SP_INC_49 50
|
||||
#define SP_INC_50 51
|
||||
#define SP_INC_51 52
|
||||
#define SP_INC_52 53
|
||||
#define SP_INC_53 54
|
||||
#define SP_INC_54 55
|
||||
#define SP_INC_55 56
|
||||
#define SP_INC_56 57
|
||||
#define SP_INC_57 58
|
||||
#define SP_INC_58 59
|
||||
#define SP_INC_59 60
|
||||
#define SP_INC_60 61
|
||||
#define SP_INC_61 62
|
||||
#define SP_INC_62 63
|
||||
#define SP_INC_63 64
|
||||
#define SP_INC_64 65
|
||||
#define SP_INC_65 66
|
||||
#define SP_INC_66 67
|
||||
#define SP_INC_67 68
|
||||
#define SP_INC_68 69
|
||||
#define SP_INC_69 70
|
||||
#define SP_INC_70 71
|
||||
#define SP_INC_71 72
|
||||
#define SP_INC_72 73
|
||||
#define SP_INC_73 74
|
||||
#define SP_INC_74 75
|
||||
#define SP_INC_75 76
|
||||
#define SP_INC_76 77
|
||||
#define SP_INC_77 78
|
||||
#define SP_INC_78 79
|
||||
#define SP_INC_79 80
|
||||
#define SP_INC_80 81
|
||||
#define SP_INC_81 82
|
||||
#define SP_INC_82 83
|
||||
#define SP_INC_83 84
|
||||
#define SP_INC_84 85
|
||||
#define SP_INC_85 86
|
||||
#define SP_INC_86 87
|
||||
#define SP_INC_87 88
|
||||
#define SP_INC_88 89
|
||||
#define SP_INC_89 90
|
||||
#define SP_INC_90 91
|
||||
#define SP_INC_91 92
|
||||
#define SP_INC_92 93
|
||||
#define SP_INC_93 94
|
||||
#define SP_INC_94 95
|
||||
#define SP_INC_95 96
|
||||
#define SP_INC_96 97
|
||||
#define SP_INC_97 98
|
||||
#define SP_INC_98 99
|
||||
#define SP_INC_99 100
|
||||
#define SP_INC_100 101
|
||||
#define SP_INC_101 102
|
||||
#define SP_INC_102 103
|
||||
#define SP_INC_103 104
|
||||
#define SP_INC_104 105
|
||||
#define SP_INC_105 106
|
||||
#define SP_INC_106 107
|
||||
#define SP_INC_107 108
|
||||
#define SP_INC_108 109
|
||||
#define SP_INC_109 110
|
||||
#define SP_INC_110 111
|
||||
#define SP_INC_111 112
|
||||
#define SP_INC_112 113
|
||||
#define SP_INC_113 114
|
||||
#define SP_INC_114 115
|
||||
#define SP_INC_115 116
|
||||
#define SP_INC_116 117
|
||||
#define SP_INC_117 118
|
||||
#define SP_INC_118 119
|
||||
#define SP_INC_119 120
|
||||
#define SP_INC_120 121
|
||||
#define SP_INC_121 122
|
||||
#define SP_INC_122 123
|
||||
#define SP_INC_123 124
|
||||
#define SP_INC_124 125
|
||||
#define SP_INC_125 126
|
||||
#define SP_INC_126 127
|
||||
#define SP_INC_127 128
|
||||
#define SP_INC_128 129
|
||||
#define SP_INC_129 130
|
||||
#define SP_INC_130 131
|
||||
#define SP_INC_131 132
|
||||
#define SP_INC_132 133
|
||||
#define SP_INC_133 134
|
||||
#define SP_INC_134 135
|
||||
#define SP_INC_135 136
|
||||
#define SP_INC_136 137
|
||||
#define SP_INC_137 138
|
||||
#define SP_INC_138 139
|
||||
#define SP_INC_139 140
|
||||
#define SP_INC_140 141
|
||||
#define SP_INC_141 142
|
||||
#define SP_INC_142 143
|
||||
#define SP_INC_143 144
|
||||
#define SP_INC_144 145
|
||||
#define SP_INC_145 146
|
||||
#define SP_INC_146 147
|
||||
#define SP_INC_147 148
|
||||
#define SP_INC_148 149
|
||||
#define SP_INC_149 150
|
||||
#define SP_INC_150 151
|
||||
#define SP_INC_151 152
|
||||
#define SP_INC_152 153
|
||||
#define SP_INC_153 154
|
||||
#define SP_INC_154 155
|
||||
#define SP_INC_155 156
|
||||
#define SP_INC_156 157
|
||||
#define SP_INC_157 158
|
||||
#define SP_INC_158 159
|
||||
#define SP_INC_159 160
|
||||
#define SP_INC_160 161
|
||||
#define SP_INC_161 162
|
||||
#define SP_INC_162 163
|
||||
#define SP_INC_163 164
|
||||
#define SP_INC_164 165
|
||||
#define SP_INC_165 166
|
||||
#define SP_INC_166 167
|
||||
#define SP_INC_167 168
|
||||
#define SP_INC_168 169
|
||||
#define SP_INC_169 170
|
||||
#define SP_INC_170 171
|
||||
#define SP_INC_171 172
|
||||
#define SP_INC_172 173
|
||||
#define SP_INC_173 174
|
||||
#define SP_INC_174 175
|
||||
#define SP_INC_175 176
|
||||
#define SP_INC_176 177
|
||||
#define SP_INC_177 178
|
||||
#define SP_INC_178 179
|
||||
#define SP_INC_179 180
|
||||
#define SP_INC_180 181
|
||||
#define SP_INC_181 182
|
||||
#define SP_INC_182 183
|
||||
#define SP_INC_183 184
|
||||
#define SP_INC_184 185
|
||||
#define SP_INC_185 186
|
||||
#define SP_INC_186 187
|
||||
#define SP_INC_187 188
|
||||
#define SP_INC_188 189
|
||||
#define SP_INC_189 190
|
||||
#define SP_INC_190 191
|
||||
#define SP_INC_191 192
|
||||
#define SP_INC_192 193
|
||||
#define SP_INC_193 194
|
||||
#define SP_INC_194 195
|
||||
#define SP_INC_195 196
|
||||
#define SP_INC_196 197
|
||||
#define SP_INC_197 198
|
||||
#define SP_INC_198 199
|
||||
#define SP_INC_199 200
|
||||
#define SP_INC_200 201
|
||||
#define SP_INC_201 202
|
||||
#define SP_INC_202 203
|
||||
#define SP_INC_203 204
|
||||
#define SP_INC_204 205
|
||||
#define SP_INC_205 206
|
||||
#define SP_INC_206 207
|
||||
#define SP_INC_207 208
|
||||
#define SP_INC_208 209
|
||||
#define SP_INC_209 210
|
||||
#define SP_INC_210 211
|
||||
#define SP_INC_211 212
|
||||
#define SP_INC_212 213
|
||||
#define SP_INC_213 214
|
||||
#define SP_INC_214 215
|
||||
#define SP_INC_215 216
|
||||
#define SP_INC_216 217
|
||||
#define SP_INC_217 218
|
||||
#define SP_INC_218 219
|
||||
#define SP_INC_219 220
|
||||
#define SP_INC_220 221
|
||||
#define SP_INC_221 222
|
||||
#define SP_INC_222 223
|
||||
#define SP_INC_223 224
|
||||
#define SP_INC_224 225
|
||||
#define SP_INC_225 226
|
||||
#define SP_INC_226 227
|
||||
#define SP_INC_227 228
|
||||
#define SP_INC_228 229
|
||||
#define SP_INC_229 230
|
||||
#define SP_INC_230 231
|
||||
#define SP_INC_231 232
|
||||
#define SP_INC_232 233
|
||||
#define SP_INC_233 234
|
||||
#define SP_INC_234 235
|
||||
#define SP_INC_235 236
|
||||
#define SP_INC_236 237
|
||||
#define SP_INC_237 238
|
||||
#define SP_INC_238 239
|
||||
#define SP_INC_239 240
|
||||
#define SP_INC_240 241
|
||||
#define SP_INC_241 242
|
||||
#define SP_INC_242 243
|
||||
#define SP_INC_243 244
|
||||
#define SP_INC_244 245
|
||||
#define SP_INC_245 246
|
||||
#define SP_INC_246 247
|
||||
#define SP_INC_247 248
|
||||
#define SP_INC_248 249
|
||||
#define SP_INC_249 250
|
||||
#define SP_INC_250 251
|
||||
#define SP_INC_251 252
|
||||
#define SP_INC_252 253
|
||||
#define SP_INC_253 254
|
||||
#define SP_INC_254 255
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _UTILS_INCREMENT_MACRO_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user