latest :)
This commit is contained in:
parent
5a5b9880a0
commit
6fd972e774
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_2D_dimension_withFrame_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_2D_dimension_withFrame_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
69964
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_3D_en.stp
vendored
Normal file
69964
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_3D_en.stp
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_Detailed-product-description_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_Detailed-product-description_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_datasheet_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/motors-ac-3p/1kw/2KJ3601-5EK23-9AP1-Z_D14+K01+K07+L00+M55+N6C+P91_datasheet_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/siemens/motors-ac-3p/2kw/1LE1001-1AC62-1FK4-Z H02+H08+L23+P02+Q23+R22_RT-Profile.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/motors-ac-3p/2kw/1LE1001-1AC62-1FK4-Z H02+H08+L23+P02+Q23+R22_RT-Profile.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
47406
vendor/siemens/motors-ac-3p/2kw/1LE1001-1AC62-1FK4-Z_H02+H08+L23+P02+Q23+R22_3D_en.STP
vendored
Normal file
47406
vendor/siemens/motors-ac-3p/2kw/1LE1001-1AC62-1FK4-Z_H02+H08+L23+P02+Q23+R22_3D_en.STP
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
vendor/siemens/motors-ac-3p/2kw/A5E33321514A_AK_U162_KE_1LE1_1PC13_LVD_RoHS_ErP.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/motors-ac-3p/2kw/A5E33321514A_AK_U162_KE_1LE1_1PC13_LVD_RoHS_ErP.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_2D_dimension_withFrame_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_2D_dimension_withFrame_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
30311
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_3D_en.STP
vendored
Normal file
30311
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_3D_en.STP
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_datasheet_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_datasheet_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_motorcurves_en.pdf
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/siemens/servos/ft7/1FT7044-5AF71-0LG1-Z_J09+L03_motorcurves_en.pdf
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.EPRT
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.EPRT
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.IGS
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.IGS
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.STEP
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.STEP
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.x_t
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-LS.x_t
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.EPRT
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.EPRT
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.IGS
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.IGS
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.STEP
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.STEP
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.x_t
(Stored with Git LFS)
vendored
Normal file
BIN
vendor/teknic/CPM-232x/CPM-232x_-Q.x_t
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitattributes
vendored
Normal file
1
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.exe filter=lfs diff=lfs merge=lfs -text
|
||||
40
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitignore
vendored
Normal file
40
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitignore
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
.vs/
|
||||
Release/
|
||||
Debug/
|
||||
drivers/signinf.cmd
|
||||
drivers/verifyinf.cmd
|
||||
*.zip
|
||||
*.componentinfo.xml
|
||||
jlink.*
|
||||
30
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab-ci.yml
vendored
Normal file
30
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab-ci.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
stages:
|
||||
- ClearCore
|
||||
|
||||
ClearCore:
|
||||
stage: ClearCore
|
||||
script:
|
||||
- cd %USERPROFILE%\AppData\Local\Arduino15\packages\ClearCore
|
||||
- rmdir /S /Q hardware\sam\1.0.1
|
||||
- rmdir /S /Q hardware\sam\1.0.2
|
||||
- rmdir /S /Q hardware\sam\1.0.3
|
||||
- rmdir /S /Q hardware\sam\1.0.4
|
||||
- rmdir /S /Q hardware\sam\1.0.5
|
||||
- rmdir /S /Q hardware\sam\1.0.6
|
||||
- rmdir /S /Q hardware\sam\1.0.7
|
||||
- rmdir /S /Q hardware\sam\1.0.8
|
||||
- rmdir /S /Q hardware\sam\1.0.9
|
||||
- rmdir /S /Q hardware\sam\1.0.10
|
||||
- rmdir /S /Q hardware\sam\1.0.11
|
||||
- rmdir /S /Q hardware\sam\1.0.12
|
||||
- rmdir /S /Q hardware\sam\1.0.13
|
||||
- git clone git@git-server.teknic.com:CustomerPackages/ClearCore_Arduino.git --branch "%CI_COMMIT_REF_NAME%" --single-branch "hardware\sam\1.0.13" || ( git clone git@git-server.teknic.com:CustomerPackages/ClearCore_Arduino.git --branch "develop" --single-branch "hardware\sam\1.0.13" )
|
||||
- git clone git@git-server.teknic.com:CustomerPackages/libClearCore.git --branch "%CI_COMMIT_REF_NAME%" --single-branch "hardware\sam\1.0.13\Teknic\libClearCore" || ( git clone git@git-server.teknic.com:CustomerPackages/libClearCore.git --branch "develop" --single-branch "hardware\sam\1.0.13\Teknic\libClearCore" )
|
||||
- git clone git@git-server.teknic.com:CustomerPackages/same53.git --branch "master" --single-branch "hardware\sam\1.0.13\variants\clearcore\Third Party\SAME53"
|
||||
- git clone git@git-server.teknic.com:CustomerPackages/LwIP.git --branch "master" --single-branch "hardware\sam\1.0.13\Teknic\LwIP"
|
||||
- git clone git@git-server.teknic.com:CustomerPackages/uf2-builder.git --branch "master" --single-branch "hardware\sam\1.0.13\Teknic\Tools\uf2-builder"
|
||||
- cd "hardware\sam\1.0.13"
|
||||
- mkdir TestSketch
|
||||
- echo void setup(){} void loop(){} > TestSketch/TestSketch.ino
|
||||
- atmelstudio.exe ClearCore.atsln /build debug /out output.txt || ( type output.txt & EXIT /B 1 )
|
||||
- python build.py -c -b
|
||||
32
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Bug.md
vendored
Normal file
32
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Bug.md
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
**Summary**
|
||||
|
||||
(Summarize the bug encountered concisely)
|
||||
|
||||
|
||||
**What is the current bug behavior?**
|
||||
|
||||
(What actually happens)
|
||||
|
||||
|
||||
**What is the expected correct behavior?**
|
||||
|
||||
(What you should see instead)
|
||||
|
||||
|
||||
**Steps to reproduce**
|
||||
|
||||
(How one can reproduce the issue - this is very important)
|
||||
|
||||
|
||||
**Example code**
|
||||
|
||||
```
|
||||
(If possible, please include example code that exhibits the problematic behaviour)
|
||||
```
|
||||
|
||||
**Relevant logs and/or screenshots**
|
||||
|
||||
(Paste any relevant logs)
|
||||
|
||||
|
||||
/label ~Bug
|
||||
15
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Discussion.md
vendored
Normal file
15
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Discussion.md
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
**Summary**
|
||||
|
||||
(Summarize the topic for the discussion)
|
||||
|
||||
|
||||
**Who is required to participate?**
|
||||
|
||||
|
||||
**What is the estimated time for the discussion?**
|
||||
|
||||
|
||||
**Provide any additional details or background information for the discussion**
|
||||
|
||||
|
||||
/label ~Discussion
|
||||
30
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Feature Request.md
vendored
Normal file
30
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Feature Request.md
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
**Summary**
|
||||
|
||||
(Summarize the feature requested concisely)
|
||||
|
||||
|
||||
**Who is the requesting Customer?**
|
||||
|
||||
Customer name -
|
||||
Project Name -
|
||||
Expected Annual volume -
|
||||
|
||||
|
||||
**What is the closest current solution with our products?**
|
||||
|
||||
|
||||
**What is the likely project outcome if the feature is not implemented?**
|
||||
|
||||
|
||||
**What is the "best" expected solution?**
|
||||
|
||||
|
||||
|
||||
|
||||
**Relevant logs and/or screenshots**
|
||||
|
||||
(Please attach any relevant screenshots/pictures/documentation describing the desired behavior etc.)
|
||||
|
||||
|
||||
|
||||
/label ~Feature Request
|
||||
21
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Text Change.md
vendored
Normal file
21
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitlab/issue_templates/Text Change.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
**Location**
|
||||
|
||||
(Where is the location of the intended change?)
|
||||
|
||||
|
||||
**What is the error?**
|
||||
|
||||
(Specifically state what the problem with the text is whether it's a typo, a grammatical error, a formatting error, or just unclear text descriptions)
|
||||
|
||||
|
||||
**Steps to reproduce?**
|
||||
|
||||
(If there was any setup to illicit the typo/formatting error/grammatical error, list them)
|
||||
|
||||
|
||||
**What is the suggested correction?**
|
||||
|
||||
(Specifically state your suggestion to correct the spelling or make the text more clear)
|
||||
|
||||
|
||||
/label ~Text Change
|
||||
3
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitmodules
vendored
Normal file
3
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "Teknic"]
|
||||
path = Teknic
|
||||
url = https://github.com/Teknic-Inc/ClearCore-library.git
|
||||
49
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/ClearCore.atsln
vendored
Normal file
49
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/ClearCore.atsln
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Atmel Studio Solution File, Format Version 11.00
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "ClearCoreArduino", "ClearCoreArduino.cppproj", "{DC06454F-445D-4E8C-A03E-22236431B9DE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C373696C-5D45-4B91-AD62-A21552361596} = {C373696C-5D45-4B91-AD62-A21552361596}
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088} = {2530D5B1-8A40-4A55-95CA-2EC0B63E2088}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "ClearCore", "Teknic\libClearCore\ClearCore.cppproj", "{2530D5B1-8A40-4A55-95CA-2EC0B63E2088}"
|
||||
EndProject
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "LwIP", "Teknic\LwIP\LwIP.cppproj", "{C373696C-5D45-4B91-AD62-A21552361596}"
|
||||
EndProject
|
||||
Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "TestSketch", "TestSketch\TestSketch.cppproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DC06454F-445D-4E8C-A03E-22236431B9DE} = {DC06454F-445D-4E8C-A03E-22236431B9DE}
|
||||
{C373696C-5D45-4B91-AD62-A21552361596} = {C373696C-5D45-4B91-AD62-A21552361596}
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088} = {2530D5B1-8A40-4A55-95CA-2EC0B63E2088}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Release|ARM = Release|ARM
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DC06454F-445D-4E8C-A03E-22236431B9DE}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{DC06454F-445D-4E8C-A03E-22236431B9DE}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{DC06454F-445D-4E8C-A03E-22236431B9DE}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{DC06454F-445D-4E8C-A03E-22236431B9DE}.Release|ARM.Build.0 = Release|ARM
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{2530D5B1-8A40-4A55-95CA-2EC0B63E2088}.Release|ARM.Build.0 = Release|ARM
|
||||
{C373696C-5D45-4B91-AD62-A21552361596}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{C373696C-5D45-4B91-AD62-A21552361596}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{C373696C-5D45-4B91-AD62-A21552361596}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{C373696C-5D45-4B91-AD62-A21552361596}.Release|ARM.Build.0 = Release|ARM
|
||||
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
876
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/ClearCoreArduino.cppproj
vendored
Normal file
876
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/ClearCoreArduino.cppproj
vendored
Normal file
@ -0,0 +1,876 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>7.0</ProjectVersion>
|
||||
<ToolchainName>com.Atmel.ARMGCC.CPP</ToolchainName>
|
||||
<ProjectGuid>{dc06454f-445d-4e8c-a03e-22236431b9de}</ProjectGuid>
|
||||
<avrdevice>ATSAME53N19A</avrdevice>
|
||||
<avrdeviceseries>none</avrdeviceseries>
|
||||
<OutputType>Executable</OutputType>
|
||||
<Language>CPP</Language>
|
||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||
<OutputFileExtension>.elf</OutputFileExtension>
|
||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||
<AssemblyName>ClearCoreArduino</AssemblyName>
|
||||
<Name>ClearCoreArduino</Name>
|
||||
<RootNamespace>ClearCoreArduino</RootNamespace>
|
||||
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<CacheFlash>true</CacheFlash>
|
||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||
<RamSnippetAddress>0x20000000</RamSnippetAddress>
|
||||
<UncachedRange />
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<OverrideVtorValue>exception_table</OverrideVtorValue>
|
||||
<BootSegment>2</BootSegment>
|
||||
<ResetRule>0</ResetRule>
|
||||
<eraseonlaunchrule>1</eraseonlaunchrule>
|
||||
<EraseKey />
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data xmlns="">
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.40.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
<avrtool>custom</avrtool>
|
||||
<avrtoolserialnumber>
|
||||
</avrtoolserialnumber>
|
||||
<avrdeviceexpectedsignature>0x61830303</avrdeviceexpectedsignature>
|
||||
<avrtoolinterface>
|
||||
</avrtoolinterface>
|
||||
<com_atmel_avrdbg_tool_atmelice>
|
||||
<ToolOptions>
|
||||
<InterfaceProperties>
|
||||
<SwdClock>2000000</SwdClock>
|
||||
</InterfaceProperties>
|
||||
<InterfaceName>SWD</InterfaceName>
|
||||
</ToolOptions>
|
||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
||||
<ToolNumber>J41800072707</ToolNumber>
|
||||
<ToolName>Atmel-ICE</ToolName>
|
||||
</com_atmel_avrdbg_tool_atmelice>
|
||||
<avrtoolinterfaceclock>2000000</avrtoolinterfaceclock>
|
||||
<com_atmel_avrdbg_tool_samice>
|
||||
<ToolOptions>
|
||||
<InterfaceProperties>
|
||||
<SwdClock>4000000</SwdClock>
|
||||
</InterfaceProperties>
|
||||
<InterfaceName>SWD</InterfaceName>
|
||||
<JlinkConfigFile>C:\git\clearcore_atmelstudio.git\ClearCoreArduino\jlink.config</JlinkConfigFile>
|
||||
</ToolOptions>
|
||||
<ToolType>com.atmel.avrdbg.tool.samice</ToolType>
|
||||
<ToolNumber>504501883</ToolNumber>
|
||||
<ToolName>J-Link</ToolName>
|
||||
</com_atmel_avrdbg_tool_samice>
|
||||
<custom>
|
||||
<ToolOptions>
|
||||
<InterfaceProperties>
|
||||
<SwdClock>4000000</SwdClock>
|
||||
</InterfaceProperties>
|
||||
<InterfaceName>
|
||||
</InterfaceName>
|
||||
</ToolOptions>
|
||||
<ToolType>custom</ToolType>
|
||||
<ToolNumber>
|
||||
</ToolNumber>
|
||||
<ToolName>Custom Programming Tool</ToolName>
|
||||
</custom>
|
||||
<CustomProgrammingToolCommand>"$(MSBuildProjectDirectory)\Teknic\Tools\flash_clearcore.cmd" "$(OutputDirectory)\$(OutputFileName).bin"</CustomProgrammingToolCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>False</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>False</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>False</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>False</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>False</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>USBCON</Value>
|
||||
<Value>__CLEARCORE__</Value>
|
||||
<Value>USB_CONFIG_POWER=0</Value>
|
||||
<Value>__SAME53N19A__</Value>
|
||||
<Value>ARM_MATH_CM4</Value>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.DefaultIncludePath>False</armgcc.compiler.directories.DefaultIncludePath>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../cores/arduino</Value>
|
||||
<Value>../cores/arduino/api</Value>
|
||||
<Value>../variants/clearcore</Value>
|
||||
<Value>../variants/clearcore/Third Party/SAME53/CMSIS/Device/Include</Value>
|
||||
<Value>../Teknic/libClearCore/inc</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/port/include</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/src/include</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize most (-O3)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.optimization.PrepareDataForGarbageCollection>True</armgcc.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcc.compiler.optimization.EnableLongCalls>False</armgcc.compiler.optimization.EnableLongCalls>
|
||||
<armgcc.compiler.optimization.DebugLevel>Default (-g2)</armgcc.compiler.optimization.DebugLevel>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.warnings.ExtraWarnings>True</armgcc.compiler.warnings.ExtraWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu11 --param max-inline-insns-single=50 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>__CLEARCORE__</Value>
|
||||
<Value>USBCON</Value>
|
||||
<Value>USB_CONFIG_POWER=0</Value>
|
||||
<Value>ARM_MATH_CM4</Value>
|
||||
<Value>DEBUG</Value>
|
||||
<Value>__FPU_PRESENT=1</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.DefaultIncludePath>False</armgcccpp.compiler.directories.DefaultIncludePath>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../cores/arduino</Value>
|
||||
<Value>../cores/arduino/api</Value>
|
||||
<Value>../variants/clearcore</Value>
|
||||
<Value>../variants/clearcore/Third Party/SAME53/CMSIS/Device/Include</Value>
|
||||
<Value>../Teknic/libClearCore/inc</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/src/include</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/port/include</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize most (-O3)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.EnableLongCalls>False</armgcccpp.compiler.optimization.EnableLongCalls>
|
||||
<armgcccpp.compiler.optimization.DebugLevel>Default (-g2)</armgcccpp.compiler.optimization.DebugLevel>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.warnings.ExtraWarnings>True</armgcccpp.compiler.warnings.ExtraWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.general.AdditionalSpecs>Use rdimon (semihosting) library (--specs=rdimon.specs)</armgcccpp.linker.general.AdditionalSpecs>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>arm_cortexM4lf_math</Value>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../variants/clearcore/linker_scripts/gcc</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.memorysettings.ExternalRAM />
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>-Tflash_with_bootloader.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.assembler.general.AssemblerFlags>--fpu=softvfp</armgcccpp.assembler.general.AssemblerFlags>
|
||||
<armgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.assembler.general.IncludePaths>
|
||||
<armgcccpp.assembler.debugging.DebugLevel>Default (-g)</armgcccpp.assembler.debugging.DebugLevel>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<armgcccpp.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcccpp.preprocessingassembler.debugging.DebugLevel>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
<OutputFileName>libClearCoreArduino</OutputFileName>
|
||||
<OutputFileExtension>.a</OutputFileExtension>
|
||||
<OutputType>StaticLibrary</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>False</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>False</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>False</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>False</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>False</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>USBCON</Value>
|
||||
<Value>__CLEARCORE__</Value>
|
||||
<Value>USB_CONFIG_POWER=0</Value>
|
||||
<Value>__SAME53N19A__</Value>
|
||||
<Value>ARM_MATH_CM4</Value>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.DefaultIncludePath>False</armgcc.compiler.directories.DefaultIncludePath>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../cores/arduino</Value>
|
||||
<Value>../cores/arduino/api</Value>
|
||||
<Value>../variants/clearcore</Value>
|
||||
<Value>../variants/clearcore/Third Party/SAME53/CMSIS/Device/Include</Value>
|
||||
<Value>../Teknic/libClearCore/inc</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/port/include</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/src/include</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize most (-O3)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.optimization.PrepareDataForGarbageCollection>True</armgcc.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcc.compiler.optimization.EnableLongCalls>False</armgcc.compiler.optimization.EnableLongCalls>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.warnings.ExtraWarnings>True</armgcc.compiler.warnings.ExtraWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu11 --param max-inline-insns-single=50 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>__CLEARCORE__</Value>
|
||||
<Value>USBCON</Value>
|
||||
<Value>USB_CONFIG_POWER=0</Value>
|
||||
<Value>ARM_MATH_CM4</Value>
|
||||
<Value>NDEBUG</Value>
|
||||
<Value>__FPU_PRESENT=1</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.DefaultIncludePath>False</armgcccpp.compiler.directories.DefaultIncludePath>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../cores/arduino</Value>
|
||||
<Value>../cores/arduino/api</Value>
|
||||
<Value>../variants/clearcore</Value>
|
||||
<Value>../variants/clearcore/Third Party/SAME53/CMSIS/Device/Include</Value>
|
||||
<Value>../Teknic/libClearCore/inc</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/src/include</Value>
|
||||
<Value>../Teknic/LwIP/LwIP/port/include</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize most (-O3)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.EnableLongCalls>False</armgcccpp.compiler.optimization.EnableLongCalls>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.warnings.ExtraWarnings>True</armgcccpp.compiler.warnings.ExtraWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.general.AdditionalSpecs>Use rdimon (semihosting) library (--specs=rdimon.specs)</armgcccpp.linker.general.AdditionalSpecs>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>arm_cortexM4lf_math</Value>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>../variants/clearcore/linker_scripts/gcc</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.memorysettings.ExternalRAM />
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>-Tflash_with_bootloader.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.assembler.general.AssemblerFlags>--fpu=softvfp</armgcccpp.assembler.general.AssemblerFlags>
|
||||
<armgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.assembler.general.IncludePaths>
|
||||
<armgcccpp.assembler.debugging.DebugLevel>Default (-g)</armgcccpp.assembler.debugging.DebugLevel>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\cmsis\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<armgcccpp.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcccpp.preprocessingassembler.debugging.DebugLevel>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<OutputFileName>libClearCoreArduino</OutputFileName>
|
||||
<OutputFileExtension>.a</OutputFileExtension>
|
||||
<OutputType>StaticLibrary</OutputType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="cores\" />
|
||||
<Folder Include="cores\arduino\" />
|
||||
<Folder Include="cores\arduino\api\" />
|
||||
<Folder Include="cores\arduino\api\deprecated-avr-comp\" />
|
||||
<Folder Include="cores\arduino\api\deprecated-avr-comp\avr\" />
|
||||
<Folder Include="cores\arduino\api\deprecated\" />
|
||||
<Folder Include="variants\" />
|
||||
<Folder Include="variants\clearcore\" />
|
||||
<Folder Include="variants\clearcore\linker_scripts\" />
|
||||
<Folder Include="variants\clearcore\linker_scripts\gcc\" />
|
||||
<Folder Include="variants\clearcore\Third Party\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\" />
|
||||
<Folder Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="cores\arduino\abi.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\ArduinoAPI.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\ArduinoString.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Binary.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Client.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Common.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Common.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated-avr-comp\avr\dtostrf.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated-avr-comp\avr\interrupt.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated-avr-comp\avr\pgmspace.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Client.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\HardwareSerial.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\IPAddress.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Print.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Printable.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Server.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Stream.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\Udp.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\deprecated\WString.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\dtostrf.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\HardwareI2C.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\HardwareSerial.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Interrupts.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\IPAddress.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\IPAddress.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\itoa.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Print.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Print.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Printable.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Server.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\SPI.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\SPI.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Stream.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Stream.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\String.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\Udp.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\api\WCharacter.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Arduino.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\delay.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\delay.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Ethernet.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Ethernet.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\EthernetClient.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\EthernetServer.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\EthernetUDP.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\hooks.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\main.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\new.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Reset.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Reset.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\SERCOM.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\SERCOM.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\startup_same53.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Tone.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Uart.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Uart.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\Udp.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\wiring_analog.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\wiring_digital.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\wiring_digital.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\wiring_shift.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\WMath.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="cores\arduino\WVariant.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\pins_arduino.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\sync.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component-version.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\ac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\adc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\aes.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\ccl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\cmcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\dac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\dmac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\dsu.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\eic.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\evsys.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\freqm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\gclk.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\gmac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\hmatrixb.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\i2s.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\icm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\mclk.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\nvmctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\osc32kctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\oscctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\pac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\pcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\pdec.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\pm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\port.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\qspi.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\ramecc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\rstc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\rtc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\sdhc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\sercom.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\supc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\tc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\tcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\trng.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\usb.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\component\wdt.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\ac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\adc0.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\adc1.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\aes.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\ccl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\cmcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\dac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\dmac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\dsu.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\eic.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\evsys.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\freqm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\gclk.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\gmac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\hmatrix.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\i2s.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\icm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\mclk.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\nvmctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\osc32kctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\oscctrl.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\pac.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\pcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\pdec.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\pm.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\port.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\pukcc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\qspi.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\ramecc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\rstc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\rtc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sdhc0.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sdhc1.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom0.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom1.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom2.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom3.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom4.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom5.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom6.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\sercom7.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\supc.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc0.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc1.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc2.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc3.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc4.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc5.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc6.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tc7.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tcc0.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tcc1.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tcc2.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tcc3.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\tcc4.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\trng.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\usb.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\instance\wdt.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\same53j18a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\same53j19a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\same53j20a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\same53n19a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\pio\same53n20a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\sam.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53j18a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53j19a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53j20a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53n19a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\same53n20a.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\Third Party\SAME53\CMSIS\Device\Include\system_same53.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\variant.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="variants\clearcore\variant.h">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="variants\clearcore\linker_scripts\gcc\flash_without_bootloader.ld">
|
||||
<SubType>compile</SubType>
|
||||
</None>
|
||||
<None Include="variants\clearcore\linker_scripts\gcc\flash_with_bootloader.ld">
|
||||
<SubType>compile</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Teknic\libClearCore\ClearCore.cppproj">
|
||||
<Name>ClearCore</Name>
|
||||
<Project>{2530d5b1-8a40-4a55-95ca-2ec0b63e2088}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Teknic\LwIP\LwIP.cppproj">
|
||||
<Name>LwIP</Name>
|
||||
<Project>{c373696c-5d45-4b91-ad62-a21552361596}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
</Project>
|
||||
15
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/README.md
vendored
Normal file
15
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/README.md
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# ClearCore-Arduino-wrapper
|
||||
|
||||
This repository contains the source code for the ClearCore Arduino Wrapper, which allows users to interact with a Teknic ClearCore using common Arduino functions.
|
||||
|
||||
Instead of interfacing directly to the processor pins, the ClearCore Arduino Wrapper uses the ClearCore libraries and provides an interface to the ClearCore connectors. This leverages all of the ClearCore library features with the ease of programming in the Arduino IDE.
|
||||
|
||||
Installation of the ClearCore board within the Arduino IDE should be performed using the Arduino board manager. This repository is intended for building new packages for use with the board manager.
|
||||
|
||||
### Installers and Resources
|
||||
|
||||
https://www.teknic.com/downloads/
|
||||
|
||||
### Example Programs
|
||||
|
||||
To help you quickly get started programming your ClearCore application, several ClearCore examples are included. Once you have the Teknic ClearCore selected as the active board, the Arduino File/Examples menu will include examples demonstrating how to use various features of the ClearCore, as well as the standard examples.
|
||||
36
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/README.txt
vendored
Normal file
36
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/README.txt
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
Code Style Tool Guide:
|
||||
|
||||
================================================================================
|
||||
TL;DR
|
||||
0. (Do this once for your system) Install cppcheck by downloading it from
|
||||
the interwebs.
|
||||
1. Execute the run_[toolname].bat script from the desired project directory
|
||||
(e.g. ClearCore/run_cppcheck.bat). cppcheck puts its suggestions in
|
||||
a file called issues.txt. Astyle just makes its changes without getting
|
||||
your permission.
|
||||
|
||||
================================================================================
|
||||
Tool Overview:
|
||||
|
||||
Astyle: A syntax formatter that conforms to the C/C++ Style guide. (Yes,
|
||||
it corrects your files for you, so be careful)
|
||||
http://astyle.sourceforge.net/astyle.html
|
||||
|
||||
Astyle edits files to conform to the Software team's coding styles.
|
||||
Its configuration file is in ClearCore/configuration. Astyle's
|
||||
purpose is to make the code for the project look like it was all
|
||||
written by one person. It does not change the meaning (semantics)
|
||||
of what's going on. The extent of its changes is purely cosmetic.
|
||||
Cppcheck: A semantic checker that makes sure you don't do something dumb
|
||||
like plowing off the end of an array, or tickling null pointers.
|
||||
http://cppcheck.sourceforge.net/
|
||||
|
||||
NOTE: Cppcheck must be installed on your system by by downloading it
|
||||
from the interwebs. The other application is a standalone exe file.
|
||||
|
||||
Cppcheck doesn't care about how the code is formatted--that's
|
||||
Astyle's job. Cppcheck does not make any changes for you.
|
||||
It simply dumps its suggestions in a file called issues.txt
|
||||
(in the same directory you execute run_cppcheck.bat from).
|
||||
|
||||
================================================================================
|
||||
40
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/astyle.cfg
vendored
Normal file
40
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/astyle.cfg
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
# Don't make copies of every file in the project
|
||||
--suffix=none
|
||||
|
||||
# Brace style
|
||||
--style=attach # "same-line" braces
|
||||
--add-braces # require braces on all blocks even if the contents
|
||||
# are a single line.
|
||||
#--break-one-line-headers # annihilate things like if (foo) { bar(); }
|
||||
--break-closing-braces # makes a newline between the end of an if
|
||||
# and its else.
|
||||
|
||||
# Sane Indentation options
|
||||
# --indent-preproc-block
|
||||
--indent-switches
|
||||
|
||||
# Pointer operator alignment
|
||||
--align-pointer=name # make pointer ops touch the name-- *foo, &foo, etc.
|
||||
--align-reference=name # make & and -> touch the name
|
||||
|
||||
# General operator alignment
|
||||
--pad-oper # surround math operators with spaces on both sides
|
||||
--pad-comma # Make sure commas have a trailing space, and no
|
||||
# leading space.
|
||||
--pad-header # Add a space between if/while/for and (. e.g.:
|
||||
# while(foo) { ...
|
||||
# becomes
|
||||
# while (foo) { ...
|
||||
|
||||
# Whitespace options
|
||||
--indent=spaces=4 # tabstop = 4 spaces
|
||||
--convert-tabs # substitute 4 spaces for tabs
|
||||
# --max-code-length=80 # enforce 80 characters maximum per line
|
||||
--break-after-logical # make it so && or || ends the line if wrapping
|
||||
--unpad-paren # Remove extra spaces around parenthesis
|
||||
# if ( ( bar() == baz ) ) { ...
|
||||
# becomes
|
||||
# if ((bar() == baz)) { ...
|
||||
#--break-blocks # put whitespace lines around if/for/while blocks
|
||||
#--delete-empty-lines # delete empty lines within a function or method
|
||||
# (except those inserted with break-blocks)
|
||||
176
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/cppcheck_rules.xml
vendored
Normal file
176
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/cppcheck_rules.xml
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- all.rule
|
||||
This file contains all of the Teknic Software Team's custom cppcheck
|
||||
rules. The value enclosed in <pattern> tags is a regular expression
|
||||
that matches an undesirable section of the code. cppcheck preprocesses
|
||||
the code before running analysis on it, so there will be no comments,
|
||||
and no preprocessor directives. In addition, all of the cppcheck input is
|
||||
in a standardized padded format. This file does NOT enforce any concrete
|
||||
syntax formatting rules.
|
||||
|
||||
@author: Cody Burrows -->
|
||||
|
||||
|
||||
<!-- Avoid using multiple inheritance, because it makes the code more difficult
|
||||
to understand. -->
|
||||
<rule version="1">
|
||||
<pattern>class [^:]+ : [^{]*,[^{]* {</pattern>
|
||||
<message>
|
||||
<id>multipleInheritance</id>
|
||||
<severity>style</severity>
|
||||
<summary>Multiple Inheritance. Single inheritance is preferred; consider revising. </summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Avoid using private inheritance, because it makes the code more difficult
|
||||
to understand -->
|
||||
<rule version="1">
|
||||
<pattern>class [^:]+ : [^{]*(private|protected)[^{]* {</pattern>
|
||||
<message>
|
||||
<id>nonpublicInheritance</id>
|
||||
<severity>style</severity>
|
||||
<summary>Non-public inheritance. Consider including a base class as a member instead.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Avoid overloading the && (boolean AND) operator to prevent
|
||||
mass confusion. -->
|
||||
<rule version="1">
|
||||
<pattern>\boperator&& \(</pattern>
|
||||
<message>
|
||||
<id>overloadBooleanAnd</id>
|
||||
<severity>error</severity>
|
||||
<summary>Do not overload the && (boolean AND) operator.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Avoid overloading the || (boolean OR) operator to prevent
|
||||
mass confusion. -->
|
||||
<rule version="1">
|
||||
<pattern>\boperator\|\| \(</pattern>
|
||||
<message>
|
||||
<id>overloadBooleanOR</id>
|
||||
<severity>error</severity>
|
||||
<summary>Do not overload the || (boolean OR) operator.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Avoid overloading the & (bitwise AND) operator to prevent
|
||||
mass confusion. -->
|
||||
<rule version="1">
|
||||
<pattern>\boperator& \(</pattern>
|
||||
<message>
|
||||
<id>overloadBitwiseAnd</id>
|
||||
<severity>error</severity>
|
||||
<summary>Do not overload the & (bitwise AND) operator.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Don't make user-defined literals. -->
|
||||
<rule version="1">
|
||||
<pattern>\boperator "" [^{]+ {</pattern>
|
||||
<message>
|
||||
<id>userDefinedLiteral</id>
|
||||
<severity>error</severity>
|
||||
<summary>Please do not introduce user-defined literals.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Don't overload the comma operator because scary and bad things will
|
||||
happen. -->
|
||||
<rule version="1">
|
||||
<pattern>\boperator, \(</pattern>
|
||||
<message>
|
||||
<id>overloadComma</id>
|
||||
<severity>error</severity>
|
||||
<summary>Do not overload the , (comma) operator.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Self-explanatory. -->
|
||||
<rule version="1">
|
||||
<pattern>\bgoto\b</pattern>
|
||||
<message>
|
||||
<id>usedGoto</id>
|
||||
<severity>error</severity>
|
||||
<summary>Are you kidding me? Do not use goto.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Don't use continue unless you're using it in an otherwise empty loop. -->
|
||||
<rule version="1">
|
||||
<pattern>(while|for|do)[^{]+{[^{;]+; continue ; }</pattern>
|
||||
<message>
|
||||
<id>continueInNonemptyLoop</id>
|
||||
<severity>style</severity>
|
||||
<summary>Continue statement in non-empty loop. Please only use continue statements for empty loops.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Prevent empty while loops that do nothing. For completeness, add a single
|
||||
continue statement. -->
|
||||
<rule version="1">
|
||||
<pattern>while \([^{}]+\) { }</pattern>
|
||||
<message>
|
||||
<id>emptyWhile</id>
|
||||
<severity>style</severity>
|
||||
<summary>While loop with empty body. Please add a single continue statement to it.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Use stdint.h types to make the size of the data more clear. -->
|
||||
<rule version="1">
|
||||
<pattern>\blong\b</pattern>
|
||||
<message>
|
||||
<id>usedLongKeyword</id>
|
||||
<severity>portability</severity>
|
||||
<summary>Used long keyword. Please use types defined in stdint.h such as int32_t, uint64_t, etc.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
<rule version="1">
|
||||
<pattern>\bshort\b</pattern>
|
||||
<message>
|
||||
<id>usedShortKeyword</id>
|
||||
<severity>portability</severity>
|
||||
<summary>Used short keyword. Please use types defined in stdint.h such as int8_t, uint16_t, etc.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
<rule version="1">
|
||||
<pattern>\bint\b</pattern>
|
||||
<message>
|
||||
<id>usedIntKeyword</id>
|
||||
<severity>portability</severity>
|
||||
<summary>Used int keyword. Please use types defined in stdint.h such as int8_t, uint16_t, etc.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
<rule version="1">
|
||||
<pattern>\bsize_t\b</pattern>
|
||||
<message>
|
||||
<id>usedIntKeyword</id>
|
||||
<severity>portability</severity>
|
||||
<summary>Used size_t keyword. Please use types defined in stdint.h such as int8_t, uint16_t, etc.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<!-- Don't use break unless you're using it to separate switch statements. -->
|
||||
<!-- Can create false positives if cppcheck discards some syntax during its preprocessing step -->
|
||||
<!-- <rule version="1">
|
||||
<pattern>\b(?!switch\b)\b\w+ \([^{]+\) {[^{]* break [^{]*}</pattern>
|
||||
<message>
|
||||
<id>breakOutsideSwitch</id>
|
||||
<severity>style</severity>
|
||||
<summary>Break used in a context other than a switch statement. Please only use break in switch statements.</summary>
|
||||
</message>
|
||||
</rule> -->
|
||||
|
||||
<!-- Always include a default case in switch statements. -->
|
||||
<!-- Sometimes creates false positives if there are no statements in the default case
|
||||
due to the preprocessed nature of the data cppcheck looks at -->
|
||||
<!-- <rule version="1">
|
||||
<pattern>\bswitch \( [^{ ]+ \) {(?:(?!\bdefault\b).)*?}</pattern>
|
||||
<message>
|
||||
<id>switchMissingDefault</id>
|
||||
<severity>style</severity>
|
||||
<summary>Switch missing default case. Please add one.</summary>
|
||||
</message>
|
||||
</rule> -->
|
||||
19
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/cppcheck_suppressions.xml
vendored
Normal file
19
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/configuration/cppcheck_suppressions.xml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<suppressions>
|
||||
<!-- It's a library, of course there will be "unused" functions -->
|
||||
<suppress><id>unusedFunction</id></suppress>
|
||||
|
||||
<!-- Don't show errors for cppcheck being dumb -->
|
||||
<suppress><id>ConfigurationNotChecked</id></suppress>
|
||||
|
||||
<!-- Don't complain about this -- sometimes the hardware requires this to signal certain events -->
|
||||
<suppress><id>redundantAssignment</id></suppress>
|
||||
<suppress><id>selfAssignment</id></suppress>
|
||||
|
||||
<!-- Sometimes multiple inheritance IS preferred -->
|
||||
<suppress><id>multipleInheritance</id></suppress>
|
||||
|
||||
<!-- Arduino's codebase uses an insane amount of longs and ints, isn't worth it to go through and change them all. Comment these out to scan other projects -->
|
||||
<suppress><id>usedLongKeyword</id></suppress>
|
||||
<suppress><id>usedIntKeyword</id></suppress>
|
||||
</suppressions>
|
||||
8
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/run_astyle.bat
vendored
Normal file
8
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/run_astyle.bat
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
SET version=1.0.12
|
||||
|
||||
SET root_teknic="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\libClearCore"
|
||||
SET root_atmel_examples="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\Atmel_Examples"
|
||||
SET root_arduino_examples="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\libraries"
|
||||
SET root_arduino="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\cores\arduino"
|
||||
|
||||
.\tools\AStyle.exe --options=configuration\astyle.cfg -r "%root_teknic%\inc\*.h" "%root_teknic%\src\*.cpp" "%root_teknic%\UnitTests\src\*.cpp" "%root_arduino%\*.h" "%root_arduino%\*.cpp" "%root_arduino_examples%\*.ino" "%root_atmel_examples%\*.cpp"
|
||||
28
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/run_cppcheck.bat
vendored
Normal file
28
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/Style/run_cppcheck.bat
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
SET version=1.0.12
|
||||
|
||||
SET src="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\libClearCore\src"
|
||||
SET inc="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\libClearCore\inc"
|
||||
SET libClearCore_issues="cppCheck_issues_libClearCore.txt"
|
||||
|
||||
SET unitTests="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\libClearCore\UnitTests\src"
|
||||
SET unitTests_issues="cppCheck_issues_unitTests.txt"
|
||||
|
||||
SET examples="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\Teknic\Atmel_Examples"
|
||||
SET examples_issues="cppCheck_issues_examples.txt"
|
||||
|
||||
SET arduino_src="%LOCALAPPDATA%\Arduino15\packages\ClearCore\hardware\sam\%version%\cores\arduino"
|
||||
SET arduino_issues="cppCheck_issues_arduino.txt"
|
||||
|
||||
SET cppCheck="C:\Program Files\Cppcheck\cppcheck.exe"
|
||||
|
||||
mkdir clearcore_build_dir
|
||||
|
||||
%cppCheck% -I "%inc%" --cppcheck-build-dir="clearcore_build_dir" --enable=all --rule-file="configuration\cppcheck_rules.xml" --output-file="%libClearCore_issues%" --suppress-xml="configuration\cppcheck_suppressions.xml" "%src%"
|
||||
|
||||
%cppCheck% --cppcheck-build-dir="clearcore_build_dir" --enable=all --rule-file="configuration\cppcheck_rules.xml" --output-file="%unitTests_issues%" --suppress-xml="configuration\cppcheck_suppressions.xml" "%unitTests%"
|
||||
|
||||
%cppCheck% --cppcheck-build-dir="clearcore_build_dir" --enable=all --rule-file="configuration\cppcheck_rules.xml" --output-file="%examples_issues%" --suppress-xml="configuration\cppcheck_suppressions.xml" "%examples%"
|
||||
|
||||
%cppCheck% --cppcheck-build-dir="clearcore_build_dir" --enable=all --rule-file="configuration\cppcheck_rules.xml" --output-file="%arduino_issues%" --suppress-xml="configuration\cppcheck_suppressions.xml" "%arduino_src%"
|
||||
|
||||
rmdir /s /q clearcore_build_dir
|
||||
@ -0,0 +1,217 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* Linker script to configure memory regions.
|
||||
* Need modifying for a specific board.
|
||||
* FLASH.ORIGIN: starting address of flash
|
||||
* FLASH.LENGTH: length of flash
|
||||
* RAM.ORIGIN: starting address of RAM bank 0
|
||||
* RAM.LENGTH: length of RAM bank 0
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x80000-0x4000 /* First 16KB used by bootloader */
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x30000
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
EXTERN(exception_table)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__text_start__ = .;
|
||||
|
||||
KEEP(*(.sketch_boot))
|
||||
|
||||
. = ALIGN(0x4000);
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(16);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
*(.heap*)
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
*(.stack*)
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
||||
@ -0,0 +1,216 @@
|
||||
/*
|
||||
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* Linker script to configure memory regions.
|
||||
* Need modifying for a specific board.
|
||||
* FLASH.ORIGIN: starting address of flash
|
||||
* FLASH.LENGTH: length of flash
|
||||
* RAM.ORIGIN: starting address of RAM bank 0
|
||||
* RAM.LENGTH: length of RAM bank 0
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000
|
||||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x30000
|
||||
}
|
||||
|
||||
/* Linker script to place sections and symbol values. Should be used together
|
||||
* with other linker script that defines memory regions FLASH and RAM.
|
||||
* It references following symbols, which must be defined in code:
|
||||
* Reset_Handler : Entry of reset handler
|
||||
*
|
||||
* It defines following symbols, which code can use without definition:
|
||||
* __exidx_start
|
||||
* __exidx_end
|
||||
* __copy_table_start__
|
||||
* __copy_table_end__
|
||||
* __zero_table_start__
|
||||
* __zero_table_end__
|
||||
* __etext
|
||||
* __data_start__
|
||||
* __preinit_array_start
|
||||
* __preinit_array_end
|
||||
* __init_array_start
|
||||
* __init_array_end
|
||||
* __fini_array_start
|
||||
* __fini_array_end
|
||||
* __data_end__
|
||||
* __bss_start__
|
||||
* __bss_end__
|
||||
* __end__
|
||||
* end
|
||||
* __HeapLimit
|
||||
* __StackLimit
|
||||
* __StackTop
|
||||
* __stack
|
||||
* __ram_end__
|
||||
*/
|
||||
ENTRY(Reset_Handler)
|
||||
EXTERN(exception_table)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__text_start__ = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.vectors))
|
||||
*(.text*)
|
||||
|
||||
KEEP(*(.init))
|
||||
KEEP(*(.fini))
|
||||
|
||||
/* .ctors */
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
/* .dtors */
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
*(.rodata*)
|
||||
|
||||
KEEP(*(.eh_frame*))
|
||||
} > FLASH
|
||||
|
||||
.ARM.extab :
|
||||
{
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} > FLASH
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* To copy multiple ROM to RAM sections,
|
||||
* uncomment .copy.table section and,
|
||||
* define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.copy.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__copy_table_start__ = .;
|
||||
LONG (__etext)
|
||||
LONG (__data_start__)
|
||||
LONG (__data_end__ - __data_start__)
|
||||
LONG (__etext2)
|
||||
LONG (__data2_start__)
|
||||
LONG (__data2_end__ - __data2_start__)
|
||||
__copy_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
/* To clear multiple BSS sections,
|
||||
* uncomment .zero.table section and,
|
||||
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
|
||||
/*
|
||||
.zero.table :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__zero_table_start__ = .;
|
||||
LONG (__bss_start__)
|
||||
LONG (__bss_end__ - __bss_start__)
|
||||
LONG (__bss2_start__)
|
||||
LONG (__bss2_end__ - __bss2_start__)
|
||||
__zero_table_end__ = .;
|
||||
} > FLASH
|
||||
*/
|
||||
|
||||
__etext = .;
|
||||
|
||||
.data : AT (__etext)
|
||||
{
|
||||
__data_start__ = .;
|
||||
*(vtable)
|
||||
*(.data*)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* preinit data */
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP(*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* init data */
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
|
||||
|
||||
. = ALIGN(4);
|
||||
/* finit data */
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
|
||||
KEEP(*(.jcr*))
|
||||
. = ALIGN(16);
|
||||
/* All data end */
|
||||
__data_end__ = .;
|
||||
|
||||
} > RAM
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start__ = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
__bss_end__ = .;
|
||||
} > RAM
|
||||
|
||||
.heap (COPY):
|
||||
{
|
||||
__end__ = .;
|
||||
PROVIDE(end = .);
|
||||
*(.heap*)
|
||||
__HeapLimit = .;
|
||||
} > RAM
|
||||
|
||||
/* .stack_dummy section doesn't contains any symbols. It is only
|
||||
* used for linker to calculate size of stack sections, and assign
|
||||
* values to stack symbols later */
|
||||
.stack_dummy (COPY):
|
||||
{
|
||||
*(.stack*)
|
||||
} > RAM
|
||||
|
||||
/* Set stack top to end of RAM, and stack limit move down by
|
||||
* size of stack_dummy section */
|
||||
__StackTop = ORIGIN(RAM) + LENGTH(RAM) ;
|
||||
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
|
||||
PROVIDE(__stack = __StackTop);
|
||||
|
||||
__ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ;
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
}
|
||||
504
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/Device_Startup/startup_same53.c
vendored
Normal file
504
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/Device_Startup/startup_same53.c
vendored
Normal file
@ -0,0 +1,504 @@
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* \brief gcc starttup file for SAME53
|
||||
*
|
||||
* Copyright (c) 2019 Microchip Technology Inc.
|
||||
*
|
||||
* \asf_license_start
|
||||
*
|
||||
* \page License
|
||||
*
|
||||
* 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 Licence 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.
|
||||
*
|
||||
* \asf_license_stop
|
||||
*
|
||||
*/
|
||||
|
||||
#include "same53.h"
|
||||
|
||||
/* Initialize segments */
|
||||
extern uint32_t _sfixed;
|
||||
extern uint32_t _efixed;
|
||||
extern uint32_t _etext;
|
||||
extern uint32_t _srelocate;
|
||||
extern uint32_t _erelocate;
|
||||
extern uint32_t _szero;
|
||||
extern uint32_t _ezero;
|
||||
extern uint32_t _sstack;
|
||||
extern uint32_t __StackTop;
|
||||
|
||||
/** \cond DOXYGEN_SHOULD_SKIP_THIS */
|
||||
int main(void);
|
||||
/** \endcond */
|
||||
|
||||
void __libc_init_array(void);
|
||||
|
||||
/* Default empty handler */
|
||||
void Dummy_Handler(void);
|
||||
|
||||
/* Cortex-M4 core handlers */
|
||||
void NonMaskableInt_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void MemManagement_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void SVCall_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void DebugMonitor_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
|
||||
/* Peripherals handlers */
|
||||
void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void MCLK_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void OSCCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
|
||||
void OSCCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
|
||||
void OSCCTRL_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
|
||||
void OSCCTRL_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
|
||||
void OSCCTRL_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
|
||||
void OSC32KCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void SUPC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
|
||||
void SUPC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_BOD12DET, SUPC_BOD33DET */
|
||||
void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void EIC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_0 */
|
||||
void EIC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_1 */
|
||||
void EIC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_2 */
|
||||
void EIC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_3 */
|
||||
void EIC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_4 */
|
||||
void EIC_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_5 */
|
||||
void EIC_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_6 */
|
||||
void EIC_7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_7 */
|
||||
void EIC_8_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_8 */
|
||||
void EIC_9_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_9 */
|
||||
void EIC_10_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_10 */
|
||||
void EIC_11_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_11 */
|
||||
void EIC_12_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_12 */
|
||||
void EIC_13_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_13 */
|
||||
void EIC_14_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_14 */
|
||||
void EIC_15_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_15 */
|
||||
void FREQM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void NVMCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
|
||||
void NVMCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
|
||||
void DMAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
|
||||
void DMAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
|
||||
void DMAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
|
||||
void DMAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
|
||||
void DMAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
|
||||
void EVSYS_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_0, EVSYS_OVR_0 */
|
||||
void EVSYS_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_1, EVSYS_OVR_1 */
|
||||
void EVSYS_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_2, EVSYS_OVR_2 */
|
||||
void EVSYS_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_3, EVSYS_OVR_3 */
|
||||
void EVSYS_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
|
||||
void PAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void RAMECC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void SERCOM0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_0 */
|
||||
void SERCOM0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_1 */
|
||||
void SERCOM0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_2 */
|
||||
void SERCOM0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
|
||||
void SERCOM1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_0 */
|
||||
void SERCOM1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_1 */
|
||||
void SERCOM1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_2 */
|
||||
void SERCOM1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
|
||||
void SERCOM2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_0 */
|
||||
void SERCOM2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_1 */
|
||||
void SERCOM2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_2 */
|
||||
void SERCOM2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
|
||||
void SERCOM3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_0 */
|
||||
void SERCOM3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_1 */
|
||||
void SERCOM3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_2 */
|
||||
void SERCOM3_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
|
||||
#ifdef ID_SERCOM4
|
||||
void SERCOM4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_0 */
|
||||
void SERCOM4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_1 */
|
||||
void SERCOM4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_2 */
|
||||
void SERCOM4_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
|
||||
#endif
|
||||
#ifdef ID_SERCOM5
|
||||
void SERCOM5_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_0 */
|
||||
void SERCOM5_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_1 */
|
||||
void SERCOM5_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_2 */
|
||||
void SERCOM5_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
|
||||
#endif
|
||||
#ifdef ID_SERCOM6
|
||||
void SERCOM6_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_0 */
|
||||
void SERCOM6_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_1 */
|
||||
void SERCOM6_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_2 */
|
||||
void SERCOM6_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
|
||||
#endif
|
||||
#ifdef ID_SERCOM7
|
||||
void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_0 */
|
||||
void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_1 */
|
||||
void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_2 */
|
||||
void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
|
||||
#endif
|
||||
#ifdef ID_CAN0
|
||||
void CAN0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_CAN1
|
||||
void CAN1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_USB
|
||||
void USB_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
|
||||
void USB_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_SOF_HSOF */
|
||||
void USB_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
|
||||
void USB_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
|
||||
#endif
|
||||
#ifdef ID_GMAC
|
||||
void GMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
void TCC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
|
||||
void TCC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_0 */
|
||||
void TCC0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_1 */
|
||||
void TCC0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_2 */
|
||||
void TCC0_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_3 */
|
||||
void TCC0_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_4 */
|
||||
void TCC0_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_5 */
|
||||
void TCC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
|
||||
void TCC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_0 */
|
||||
void TCC1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_1 */
|
||||
void TCC1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_2 */
|
||||
void TCC1_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_3 */
|
||||
void TCC2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
|
||||
void TCC2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_0 */
|
||||
void TCC2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_1 */
|
||||
void TCC2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_2 */
|
||||
#ifdef ID_TCC3
|
||||
void TCC3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
|
||||
void TCC3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_0 */
|
||||
void TCC3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_1 */
|
||||
#endif
|
||||
#ifdef ID_TCC4
|
||||
void TCC4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
|
||||
void TCC4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_0 */
|
||||
void TCC4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_1 */
|
||||
#endif
|
||||
void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void TC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#ifdef ID_TC4
|
||||
void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_TC5
|
||||
void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_TC6
|
||||
void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_TC7
|
||||
void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
void PDEC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
|
||||
void PDEC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_0 */
|
||||
void PDEC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_1 */
|
||||
void ADC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_OVERRUN, ADC0_WINMON */
|
||||
void ADC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_RESRDY */
|
||||
void ADC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_OVERRUN, ADC1_WINMON */
|
||||
void ADC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_RESRDY */
|
||||
void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void DAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
|
||||
void DAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_0 */
|
||||
void DAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_1 */
|
||||
void DAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_0 */
|
||||
void DAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_1 */
|
||||
#ifdef ID_I2S
|
||||
void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
void PCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void AES_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
void TRNG_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#ifdef ID_ICM
|
||||
void ICM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_PUKCC
|
||||
void PUKCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
void QSPI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#ifdef ID_SDHC0
|
||||
void SDHC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
#ifdef ID_SDHC1
|
||||
void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
|
||||
#endif
|
||||
|
||||
/* Exception Table */
|
||||
__attribute__ ((section(".vectors")))
|
||||
const DeviceVectors exception_table = {
|
||||
|
||||
/* Configure Initial Stack Pointer, using linker-generated symbols */
|
||||
.pvStack = (void*) (&__StackTop),
|
||||
|
||||
.pfnReset_Handler = (void*) Reset_Handler,
|
||||
.pfnNonMaskableInt_Handler = (void*) NonMaskableInt_Handler,
|
||||
.pfnHardFault_Handler = (void*) HardFault_Handler,
|
||||
.pfnMemManagement_Handler = (void*) MemManagement_Handler,
|
||||
.pfnBusFault_Handler = (void*) BusFault_Handler,
|
||||
.pfnUsageFault_Handler = (void*) UsageFault_Handler,
|
||||
.pvReservedM9 = (void*) (0UL), /* Reserved */
|
||||
.pvReservedM8 = (void*) (0UL), /* Reserved */
|
||||
.pvReservedM7 = (void*) (0UL), /* Reserved */
|
||||
.pvReservedM6 = (void*) (0UL), /* Reserved */
|
||||
.pfnSVCall_Handler = (void*) SVCall_Handler,
|
||||
.pfnDebugMonitor_Handler = (void*) DebugMonitor_Handler,
|
||||
.pvReservedM3 = (void*) (0UL), /* Reserved */
|
||||
.pfnPendSV_Handler = (void*) PendSV_Handler,
|
||||
.pfnSysTick_Handler = (void*) SysTick_Handler,
|
||||
|
||||
/* Configurable interrupts */
|
||||
.pfnPM_Handler = (void*) PM_Handler, /* 0 Power Manager */
|
||||
.pfnMCLK_Handler = (void*) MCLK_Handler, /* 1 Main Clock */
|
||||
.pfnOSCCTRL_0_Handler = (void*) OSCCTRL_0_Handler, /* 2 OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */
|
||||
.pfnOSCCTRL_1_Handler = (void*) OSCCTRL_1_Handler, /* 3 OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */
|
||||
.pfnOSCCTRL_2_Handler = (void*) OSCCTRL_2_Handler, /* 4 OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */
|
||||
.pfnOSCCTRL_3_Handler = (void*) OSCCTRL_3_Handler, /* 5 OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */
|
||||
.pfnOSCCTRL_4_Handler = (void*) OSCCTRL_4_Handler, /* 6 OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */
|
||||
.pfnOSC32KCTRL_Handler = (void*) OSC32KCTRL_Handler, /* 7 32kHz Oscillators Control */
|
||||
.pfnSUPC_0_Handler = (void*) SUPC_0_Handler, /* 8 SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */
|
||||
.pfnSUPC_1_Handler = (void*) SUPC_1_Handler, /* 9 SUPC_BOD12DET, SUPC_BOD33DET */
|
||||
.pfnWDT_Handler = (void*) WDT_Handler, /* 10 Watchdog Timer */
|
||||
.pfnRTC_Handler = (void*) RTC_Handler, /* 11 Real-Time Counter */
|
||||
.pfnEIC_0_Handler = (void*) EIC_0_Handler, /* 12 EIC_EXTINT_0 */
|
||||
.pfnEIC_1_Handler = (void*) EIC_1_Handler, /* 13 EIC_EXTINT_1 */
|
||||
.pfnEIC_2_Handler = (void*) EIC_2_Handler, /* 14 EIC_EXTINT_2 */
|
||||
.pfnEIC_3_Handler = (void*) EIC_3_Handler, /* 15 EIC_EXTINT_3 */
|
||||
.pfnEIC_4_Handler = (void*) EIC_4_Handler, /* 16 EIC_EXTINT_4 */
|
||||
.pfnEIC_5_Handler = (void*) EIC_5_Handler, /* 17 EIC_EXTINT_5 */
|
||||
.pfnEIC_6_Handler = (void*) EIC_6_Handler, /* 18 EIC_EXTINT_6 */
|
||||
.pfnEIC_7_Handler = (void*) EIC_7_Handler, /* 19 EIC_EXTINT_7 */
|
||||
.pfnEIC_8_Handler = (void*) EIC_8_Handler, /* 20 EIC_EXTINT_8 */
|
||||
.pfnEIC_9_Handler = (void*) EIC_9_Handler, /* 21 EIC_EXTINT_9 */
|
||||
.pfnEIC_10_Handler = (void*) EIC_10_Handler, /* 22 EIC_EXTINT_10 */
|
||||
.pfnEIC_11_Handler = (void*) EIC_11_Handler, /* 23 EIC_EXTINT_11 */
|
||||
.pfnEIC_12_Handler = (void*) EIC_12_Handler, /* 24 EIC_EXTINT_12 */
|
||||
.pfnEIC_13_Handler = (void*) EIC_13_Handler, /* 25 EIC_EXTINT_13 */
|
||||
.pfnEIC_14_Handler = (void*) EIC_14_Handler, /* 26 EIC_EXTINT_14 */
|
||||
.pfnEIC_15_Handler = (void*) EIC_15_Handler, /* 27 EIC_EXTINT_15 */
|
||||
.pfnFREQM_Handler = (void*) FREQM_Handler, /* 28 Frequency Meter */
|
||||
.pfnNVMCTRL_0_Handler = (void*) NVMCTRL_0_Handler, /* 29 NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */
|
||||
.pfnNVMCTRL_1_Handler = (void*) NVMCTRL_1_Handler, /* 30 NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */
|
||||
.pfnDMAC_0_Handler = (void*) DMAC_0_Handler, /* 31 DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */
|
||||
.pfnDMAC_1_Handler = (void*) DMAC_1_Handler, /* 32 DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */
|
||||
.pfnDMAC_2_Handler = (void*) DMAC_2_Handler, /* 33 DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */
|
||||
.pfnDMAC_3_Handler = (void*) DMAC_3_Handler, /* 34 DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */
|
||||
.pfnDMAC_4_Handler = (void*) DMAC_4_Handler, /* 35 DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */
|
||||
.pfnEVSYS_0_Handler = (void*) EVSYS_0_Handler, /* 36 EVSYS_EVD_0, EVSYS_OVR_0 */
|
||||
.pfnEVSYS_1_Handler = (void*) EVSYS_1_Handler, /* 37 EVSYS_EVD_1, EVSYS_OVR_1 */
|
||||
.pfnEVSYS_2_Handler = (void*) EVSYS_2_Handler, /* 38 EVSYS_EVD_2, EVSYS_OVR_2 */
|
||||
.pfnEVSYS_3_Handler = (void*) EVSYS_3_Handler, /* 39 EVSYS_EVD_3, EVSYS_OVR_3 */
|
||||
.pfnEVSYS_4_Handler = (void*) EVSYS_4_Handler, /* 40 EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */
|
||||
.pfnPAC_Handler = (void*) PAC_Handler, /* 41 Peripheral Access Controller */
|
||||
.pvReserved42 = (void*) (0UL), /* 42 Reserved */
|
||||
.pvReserved43 = (void*) (0UL), /* 43 Reserved */
|
||||
.pvReserved44 = (void*) (0UL), /* 44 Reserved */
|
||||
.pfnRAMECC_Handler = (void*) RAMECC_Handler, /* 45 RAM ECC */
|
||||
.pfnSERCOM0_0_Handler = (void*) SERCOM0_0_Handler, /* 46 SERCOM0_0 */
|
||||
.pfnSERCOM0_1_Handler = (void*) SERCOM0_1_Handler, /* 47 SERCOM0_1 */
|
||||
.pfnSERCOM0_2_Handler = (void*) SERCOM0_2_Handler, /* 48 SERCOM0_2 */
|
||||
.pfnSERCOM0_3_Handler = (void*) SERCOM0_3_Handler, /* 49 SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */
|
||||
.pfnSERCOM1_0_Handler = (void*) SERCOM1_0_Handler, /* 50 SERCOM1_0 */
|
||||
.pfnSERCOM1_1_Handler = (void*) SERCOM1_1_Handler, /* 51 SERCOM1_1 */
|
||||
.pfnSERCOM1_2_Handler = (void*) SERCOM1_2_Handler, /* 52 SERCOM1_2 */
|
||||
.pfnSERCOM1_3_Handler = (void*) SERCOM1_3_Handler, /* 53 SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */
|
||||
.pfnSERCOM2_0_Handler = (void*) SERCOM2_0_Handler, /* 54 SERCOM2_0 */
|
||||
.pfnSERCOM2_1_Handler = (void*) SERCOM2_1_Handler, /* 55 SERCOM2_1 */
|
||||
.pfnSERCOM2_2_Handler = (void*) SERCOM2_2_Handler, /* 56 SERCOM2_2 */
|
||||
.pfnSERCOM2_3_Handler = (void*) SERCOM2_3_Handler, /* 57 SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */
|
||||
.pfnSERCOM3_0_Handler = (void*) SERCOM3_0_Handler, /* 58 SERCOM3_0 */
|
||||
.pfnSERCOM3_1_Handler = (void*) SERCOM3_1_Handler, /* 59 SERCOM3_1 */
|
||||
.pfnSERCOM3_2_Handler = (void*) SERCOM3_2_Handler, /* 60 SERCOM3_2 */
|
||||
.pfnSERCOM3_3_Handler = (void*) SERCOM3_3_Handler, /* 61 SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */
|
||||
#ifdef ID_SERCOM4
|
||||
.pfnSERCOM4_0_Handler = (void*) SERCOM4_0_Handler, /* 62 SERCOM4_0 */
|
||||
.pfnSERCOM4_1_Handler = (void*) SERCOM4_1_Handler, /* 63 SERCOM4_1 */
|
||||
.pfnSERCOM4_2_Handler = (void*) SERCOM4_2_Handler, /* 64 SERCOM4_2 */
|
||||
.pfnSERCOM4_3_Handler = (void*) SERCOM4_3_Handler, /* 65 SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */
|
||||
#else
|
||||
.pvReserved62 = (void*) (0UL), /* 62 Reserved */
|
||||
.pvReserved63 = (void*) (0UL), /* 63 Reserved */
|
||||
.pvReserved64 = (void*) (0UL), /* 64 Reserved */
|
||||
.pvReserved65 = (void*) (0UL), /* 65 Reserved */
|
||||
#endif
|
||||
#ifdef ID_SERCOM5
|
||||
.pfnSERCOM5_0_Handler = (void*) SERCOM5_0_Handler, /* 66 SERCOM5_0 */
|
||||
.pfnSERCOM5_1_Handler = (void*) SERCOM5_1_Handler, /* 67 SERCOM5_1 */
|
||||
.pfnSERCOM5_2_Handler = (void*) SERCOM5_2_Handler, /* 68 SERCOM5_2 */
|
||||
.pfnSERCOM5_3_Handler = (void*) SERCOM5_3_Handler, /* 69 SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */
|
||||
#else
|
||||
.pvReserved66 = (void*) (0UL), /* 66 Reserved */
|
||||
.pvReserved67 = (void*) (0UL), /* 67 Reserved */
|
||||
.pvReserved68 = (void*) (0UL), /* 68 Reserved */
|
||||
.pvReserved69 = (void*) (0UL), /* 69 Reserved */
|
||||
#endif
|
||||
#ifdef ID_SERCOM6
|
||||
.pfnSERCOM6_0_Handler = (void*) SERCOM6_0_Handler, /* 70 SERCOM6_0 */
|
||||
.pfnSERCOM6_1_Handler = (void*) SERCOM6_1_Handler, /* 71 SERCOM6_1 */
|
||||
.pfnSERCOM6_2_Handler = (void*) SERCOM6_2_Handler, /* 72 SERCOM6_2 */
|
||||
.pfnSERCOM6_3_Handler = (void*) SERCOM6_3_Handler, /* 73 SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */
|
||||
#else
|
||||
.pvReserved70 = (void*) (0UL), /* 70 Reserved */
|
||||
.pvReserved71 = (void*) (0UL), /* 71 Reserved */
|
||||
.pvReserved72 = (void*) (0UL), /* 72 Reserved */
|
||||
.pvReserved73 = (void*) (0UL), /* 73 Reserved */
|
||||
#endif
|
||||
#ifdef ID_SERCOM7
|
||||
.pfnSERCOM7_0_Handler = (void*) SERCOM7_0_Handler, /* 74 SERCOM7_0 */
|
||||
.pfnSERCOM7_1_Handler = (void*) SERCOM7_1_Handler, /* 75 SERCOM7_1 */
|
||||
.pfnSERCOM7_2_Handler = (void*) SERCOM7_2_Handler, /* 76 SERCOM7_2 */
|
||||
.pfnSERCOM7_3_Handler = (void*) SERCOM7_3_Handler, /* 77 SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */
|
||||
#else
|
||||
.pvReserved74 = (void*) (0UL), /* 74 Reserved */
|
||||
.pvReserved75 = (void*) (0UL), /* 75 Reserved */
|
||||
.pvReserved76 = (void*) (0UL), /* 76 Reserved */
|
||||
.pvReserved77 = (void*) (0UL), /* 77 Reserved */
|
||||
#endif
|
||||
#ifdef ID_CAN0
|
||||
.pfnCAN0_Handler = (void*) CAN0_Handler, /* 78 Control Area Network 0 */
|
||||
#else
|
||||
.pvReserved78 = (void*) (0UL), /* 78 Reserved */
|
||||
#endif
|
||||
#ifdef ID_CAN1
|
||||
.pfnCAN1_Handler = (void*) CAN1_Handler, /* 79 Control Area Network 1 */
|
||||
#else
|
||||
.pvReserved79 = (void*) (0UL), /* 79 Reserved */
|
||||
#endif
|
||||
#ifdef ID_USB
|
||||
.pfnUSB_0_Handler = (void*) USB_0_Handler, /* 80 USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */
|
||||
.pfnUSB_1_Handler = (void*) USB_1_Handler, /* 81 USB_SOF_HSOF */
|
||||
.pfnUSB_2_Handler = (void*) USB_2_Handler, /* 82 USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */
|
||||
.pfnUSB_3_Handler = (void*) USB_3_Handler, /* 83 USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */
|
||||
#else
|
||||
.pvReserved80 = (void*) (0UL), /* 80 Reserved */
|
||||
.pvReserved81 = (void*) (0UL), /* 81 Reserved */
|
||||
.pvReserved82 = (void*) (0UL), /* 82 Reserved */
|
||||
.pvReserved83 = (void*) (0UL), /* 83 Reserved */
|
||||
#endif
|
||||
#ifdef ID_GMAC
|
||||
.pfnGMAC_Handler = (void*) GMAC_Handler, /* 84 Ethernet MAC */
|
||||
#else
|
||||
.pvReserved84 = (void*) (0UL), /* 84 Reserved */
|
||||
#endif
|
||||
.pfnTCC0_0_Handler = (void*) TCC0_0_Handler, /* 85 TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */
|
||||
.pfnTCC0_1_Handler = (void*) TCC0_1_Handler, /* 86 TCC0_MC_0 */
|
||||
.pfnTCC0_2_Handler = (void*) TCC0_2_Handler, /* 87 TCC0_MC_1 */
|
||||
.pfnTCC0_3_Handler = (void*) TCC0_3_Handler, /* 88 TCC0_MC_2 */
|
||||
.pfnTCC0_4_Handler = (void*) TCC0_4_Handler, /* 89 TCC0_MC_3 */
|
||||
.pfnTCC0_5_Handler = (void*) TCC0_5_Handler, /* 90 TCC0_MC_4 */
|
||||
.pfnTCC0_6_Handler = (void*) TCC0_6_Handler, /* 91 TCC0_MC_5 */
|
||||
.pfnTCC1_0_Handler = (void*) TCC1_0_Handler, /* 92 TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */
|
||||
.pfnTCC1_1_Handler = (void*) TCC1_1_Handler, /* 93 TCC1_MC_0 */
|
||||
.pfnTCC1_2_Handler = (void*) TCC1_2_Handler, /* 94 TCC1_MC_1 */
|
||||
.pfnTCC1_3_Handler = (void*) TCC1_3_Handler, /* 95 TCC1_MC_2 */
|
||||
.pfnTCC1_4_Handler = (void*) TCC1_4_Handler, /* 96 TCC1_MC_3 */
|
||||
.pfnTCC2_0_Handler = (void*) TCC2_0_Handler, /* 97 TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */
|
||||
.pfnTCC2_1_Handler = (void*) TCC2_1_Handler, /* 98 TCC2_MC_0 */
|
||||
.pfnTCC2_2_Handler = (void*) TCC2_2_Handler, /* 99 TCC2_MC_1 */
|
||||
.pfnTCC2_3_Handler = (void*) TCC2_3_Handler, /* 100 TCC2_MC_2 */
|
||||
#ifdef ID_TCC3
|
||||
.pfnTCC3_0_Handler = (void*) TCC3_0_Handler, /* 101 TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */
|
||||
.pfnTCC3_1_Handler = (void*) TCC3_1_Handler, /* 102 TCC3_MC_0 */
|
||||
.pfnTCC3_2_Handler = (void*) TCC3_2_Handler, /* 103 TCC3_MC_1 */
|
||||
#else
|
||||
.pvReserved101 = (void*) (0UL), /* 101 Reserved */
|
||||
.pvReserved102 = (void*) (0UL), /* 102 Reserved */
|
||||
.pvReserved103 = (void*) (0UL), /* 103 Reserved */
|
||||
#endif
|
||||
#ifdef ID_TCC4
|
||||
.pfnTCC4_0_Handler = (void*) TCC4_0_Handler, /* 104 TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */
|
||||
.pfnTCC4_1_Handler = (void*) TCC4_1_Handler, /* 105 TCC4_MC_0 */
|
||||
.pfnTCC4_2_Handler = (void*) TCC4_2_Handler, /* 106 TCC4_MC_1 */
|
||||
#else
|
||||
.pvReserved104 = (void*) (0UL), /* 104 Reserved */
|
||||
.pvReserved105 = (void*) (0UL), /* 105 Reserved */
|
||||
.pvReserved106 = (void*) (0UL), /* 106 Reserved */
|
||||
#endif
|
||||
.pfnTC0_Handler = (void*) TC0_Handler, /* 107 Basic Timer Counter 0 */
|
||||
.pfnTC1_Handler = (void*) TC1_Handler, /* 108 Basic Timer Counter 1 */
|
||||
.pfnTC2_Handler = (void*) TC2_Handler, /* 109 Basic Timer Counter 2 */
|
||||
.pfnTC3_Handler = (void*) TC3_Handler, /* 110 Basic Timer Counter 3 */
|
||||
#ifdef ID_TC4
|
||||
.pfnTC4_Handler = (void*) TC4_Handler, /* 111 Basic Timer Counter 4 */
|
||||
#else
|
||||
.pvReserved111 = (void*) (0UL), /* 111 Reserved */
|
||||
#endif
|
||||
#ifdef ID_TC5
|
||||
.pfnTC5_Handler = (void*) TC5_Handler, /* 112 Basic Timer Counter 5 */
|
||||
#else
|
||||
.pvReserved112 = (void*) (0UL), /* 112 Reserved */
|
||||
#endif
|
||||
#ifdef ID_TC6
|
||||
.pfnTC6_Handler = (void*) TC6_Handler, /* 113 Basic Timer Counter 6 */
|
||||
#else
|
||||
.pvReserved113 = (void*) (0UL), /* 113 Reserved */
|
||||
#endif
|
||||
#ifdef ID_TC7
|
||||
.pfnTC7_Handler = (void*) TC7_Handler, /* 114 Basic Timer Counter 7 */
|
||||
#else
|
||||
.pvReserved114 = (void*) (0UL), /* 114 Reserved */
|
||||
#endif
|
||||
.pfnPDEC_0_Handler = (void*) PDEC_0_Handler, /* 115 PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */
|
||||
.pfnPDEC_1_Handler = (void*) PDEC_1_Handler, /* 116 PDEC_MC_0 */
|
||||
.pfnPDEC_2_Handler = (void*) PDEC_2_Handler, /* 117 PDEC_MC_1 */
|
||||
.pfnADC0_0_Handler = (void*) ADC0_0_Handler, /* 118 ADC0_OVERRUN, ADC0_WINMON */
|
||||
.pfnADC0_1_Handler = (void*) ADC0_1_Handler, /* 119 ADC0_RESRDY */
|
||||
.pfnADC1_0_Handler = (void*) ADC1_0_Handler, /* 120 ADC1_OVERRUN, ADC1_WINMON */
|
||||
.pfnADC1_1_Handler = (void*) ADC1_1_Handler, /* 121 ADC1_RESRDY */
|
||||
.pfnAC_Handler = (void*) AC_Handler, /* 122 Analog Comparators */
|
||||
.pfnDAC_0_Handler = (void*) DAC_0_Handler, /* 123 DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */
|
||||
.pfnDAC_1_Handler = (void*) DAC_1_Handler, /* 124 DAC_EMPTY_0 */
|
||||
.pfnDAC_2_Handler = (void*) DAC_2_Handler, /* 125 DAC_EMPTY_1 */
|
||||
.pfnDAC_3_Handler = (void*) DAC_3_Handler, /* 126 DAC_RESRDY_0 */
|
||||
.pfnDAC_4_Handler = (void*) DAC_4_Handler, /* 127 DAC_RESRDY_1 */
|
||||
#ifdef ID_I2S
|
||||
.pfnI2S_Handler = (void*) I2S_Handler, /* 128 Inter-IC Sound Interface */
|
||||
#else
|
||||
.pvReserved128 = (void*) (0UL), /* 128 Reserved */
|
||||
#endif
|
||||
.pfnPCC_Handler = (void*) PCC_Handler, /* 129 Parallel Capture Controller */
|
||||
.pfnAES_Handler = (void*) AES_Handler, /* 130 Advanced Encryption Standard */
|
||||
.pfnTRNG_Handler = (void*) TRNG_Handler, /* 131 True Random Generator */
|
||||
#ifdef ID_ICM
|
||||
.pfnICM_Handler = (void*) ICM_Handler, /* 132 Integrity Check Monitor */
|
||||
#else
|
||||
.pvReserved132 = (void*) (0UL), /* 132 Reserved */
|
||||
#endif
|
||||
#ifdef ID_PUKCC
|
||||
.pfnPUKCC_Handler = (void*) PUKCC_Handler, /* 133 PUblic-Key Cryptography Controller */
|
||||
#else
|
||||
.pvReserved133 = (void*) (0UL), /* 133 Reserved */
|
||||
#endif
|
||||
.pfnQSPI_Handler = (void*) QSPI_Handler, /* 134 Quad SPI interface */
|
||||
#ifdef ID_SDHC0
|
||||
.pfnSDHC0_Handler = (void*) SDHC0_Handler, /* 135 SD/MMC Host Controller 0 */
|
||||
#else
|
||||
.pvReserved135 = (void*) (0UL), /* 135 Reserved */
|
||||
#endif
|
||||
#ifdef ID_SDHC1
|
||||
.pfnSDHC1_Handler = (void*) SDHC1_Handler /* 136 SD/MMC Host Controller 1 */
|
||||
#else
|
||||
.pvReserved136 = (void*) (0UL) /* 136 Reserved */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Default interrupt handler for unused IRQs.
|
||||
*/
|
||||
void Dummy_Handler(void)
|
||||
{
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
19
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/TestSketch.cpp
vendored
Normal file
19
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/TestSketch.cpp
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
#include "Arduino.h"
|
||||
#include "ClearCore.h"
|
||||
|
||||
bool outputState = false;
|
||||
|
||||
void setup() {
|
||||
// Put your setup code here, it will run once:
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// Put your main code here, it will run repeatedly:
|
||||
|
||||
// Toggle and write the digital output state.
|
||||
outputState = !outputState;
|
||||
digitalWrite(LED_BUILTIN, outputState);
|
||||
|
||||
// Wait a second, then repeat.
|
||||
delay(1000);
|
||||
}
|
||||
284
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/TestSketch.cppproj
vendored
Normal file
284
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/TestSketch/TestSketch.cppproj
vendored
Normal file
@ -0,0 +1,284 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>7.0</ProjectVersion>
|
||||
<ToolchainName>com.Atmel.ARMGCC.CPP</ToolchainName>
|
||||
<ProjectGuid>dce6c7e3-ee26-4d79-826b-08594b9ad897</ProjectGuid>
|
||||
<avrdevice>ATSAME53N19A</avrdevice>
|
||||
<avrdeviceseries>none</avrdeviceseries>
|
||||
<OutputType>Executable</OutputType>
|
||||
<Language>CPP</Language>
|
||||
<OutputFileName>$(MSBuildProjectName)</OutputFileName>
|
||||
<OutputFileExtension>.elf</OutputFileExtension>
|
||||
<OutputDirectory>$(MSBuildProjectDirectory)\$(Configuration)</OutputDirectory>
|
||||
<AssemblyName>TestSketch</AssemblyName>
|
||||
<Name>TestSketch</Name>
|
||||
<RootNamespace>TestSketch</RootNamespace>
|
||||
<ToolchainFlavour>Native</ToolchainFlavour>
|
||||
<KeepTimersRunning>true</KeepTimersRunning>
|
||||
<OverrideVtor>false</OverrideVtor>
|
||||
<CacheFlash>true</CacheFlash>
|
||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||
<RamSnippetAddress>0x20000000</RamSnippetAddress>
|
||||
<UncachedRange />
|
||||
<preserveEEPROM>true</preserveEEPROM>
|
||||
<OverrideVtorValue>exception_table</OverrideVtorValue>
|
||||
<BootSegment>2</BootSegment>
|
||||
<ResetRule>0</ResetRule>
|
||||
<eraseonlaunchrule>4</eraseonlaunchrule>
|
||||
<EraseKey />
|
||||
<AsfFrameworkConfig>
|
||||
<framework-data>
|
||||
<options />
|
||||
<configurations />
|
||||
<files />
|
||||
<documentation help="" />
|
||||
<offline-documentation help="" />
|
||||
<dependencies>
|
||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.39.0" />
|
||||
</dependencies>
|
||||
</framework-data>
|
||||
</AsfFrameworkConfig>
|
||||
<avrtool>custom</avrtool>
|
||||
<avrtoolserialnumber>
|
||||
</avrtoolserialnumber>
|
||||
<avrdeviceexpectedsignature>0x61830303</avrdeviceexpectedsignature>
|
||||
<avrtoolinterface>SWD</avrtoolinterface>
|
||||
<com_atmel_avrdbg_tool_atmelice>
|
||||
<ToolOptions>
|
||||
<InterfaceProperties>
|
||||
<SwdClock>0</SwdClock>
|
||||
</InterfaceProperties>
|
||||
<InterfaceName>SWD</InterfaceName>
|
||||
</ToolOptions>
|
||||
<ToolType>com.atmel.avrdbg.tool.atmelice</ToolType>
|
||||
<ToolNumber>J41800072707</ToolNumber>
|
||||
<ToolName>Atmel-ICE</ToolName>
|
||||
</com_atmel_avrdbg_tool_atmelice>
|
||||
<avrtoolinterfaceclock>0</avrtoolinterfaceclock>
|
||||
<custom>
|
||||
<ToolOptions xmlns="">
|
||||
<InterfaceProperties>
|
||||
</InterfaceProperties>
|
||||
<InterfaceName>SWD</InterfaceName>
|
||||
</ToolOptions>
|
||||
<ToolType xmlns="">custom</ToolType>
|
||||
<ToolNumber xmlns="">
|
||||
</ToolNumber>
|
||||
<ToolName xmlns="">Custom Programming Tool</ToolName>
|
||||
</custom>
|
||||
<CustomProgrammingToolCommand>"$(MSBuildProjectDirectory)\..\Teknic\Tools\flash_clearcore.cmd" "$(OutputDirectory)\$(OutputFileName).bin"</CustomProgrammingToolCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>False</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>False</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>False</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>False</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.DefaultIncludePath>False</armgcc.compiler.directories.DefaultIncludePath>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize most (-O3)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.optimization.PrepareDataForGarbageCollection>True</armgcc.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcc.compiler.optimization.EnableLongCalls>False</armgcc.compiler.optimization.EnableLongCalls>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.warnings.ExtraWarnings>True</armgcc.compiler.warnings.ExtraWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu11 --param max-inline-insns-single=50 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>NDEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.DefaultIncludePath>False</armgcccpp.compiler.directories.DefaultIncludePath>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>../../Teknic/libClearCore/inc</Value>
|
||||
<Value>../../Teknic/LwIP/LwIP/port/include</Value>
|
||||
<Value>../../Teknic/LwIP/LwIP/src/include</Value>
|
||||
<Value>../../cores/arduino</Value>
|
||||
<Value>../../cores/arduino/api</Value>
|
||||
<Value>../../variants/clearcore</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize most (-O3)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.EnableLongCalls>False</armgcccpp.compiler.optimization.EnableLongCalls>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.warnings.ExtraWarnings>True</armgcccpp.compiler.warnings.ExtraWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.general.AdditionalSpecs>Use rdimon (semihosting) library (--specs=rdimon.specs)</armgcccpp.linker.general.AdditionalSpecs>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>arm_cortexM4lf_math</Value>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
<Value>%24(ProjectDir)\Device_Startup</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Lib\GCC</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.memorysettings.ExternalRAM />
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>-Tflash_with_bootloader.ld -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.assembler.general.IncludePaths>
|
||||
<armgcccpp.assembler.debugging.DebugLevel>Default (-g)</armgcccpp.assembler.debugging.DebugLevel>
|
||||
<armgcccpp.preprocessingassembler.general.DefaultIncludePath>False</armgcccpp.preprocessingassembler.general.DefaultIncludePath>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<armgcccpp.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcccpp.preprocessingassembler.debugging.DebugLevel>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
<PostBuildEvent>"$(SolutionDir)\Teknic\Tools\uf2-builder\Release\uf2-builder.exe" "$(OutputDirectory)\$(OutputFileName).bin" "$(OutputDirectory)\$(OutputFileName).uf2"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<ToolchainSettings>
|
||||
<ArmGccCpp>
|
||||
<armgcc.common.outputfiles.hex>False</armgcc.common.outputfiles.hex>
|
||||
<armgcc.common.outputfiles.lss>False</armgcc.common.outputfiles.lss>
|
||||
<armgcc.common.outputfiles.eep>False</armgcc.common.outputfiles.eep>
|
||||
<armgcc.common.outputfiles.bin>True</armgcc.common.outputfiles.bin>
|
||||
<armgcc.common.outputfiles.srec>False</armgcc.common.outputfiles.srec>
|
||||
<armgcc.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.symbols.DefSymbols>
|
||||
<armgcc.compiler.directories.DefaultIncludePath>False</armgcc.compiler.directories.DefaultIncludePath>
|
||||
<armgcc.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcc.compiler.directories.IncludePaths>
|
||||
<armgcc.compiler.optimization.level>Optimize most (-O3)</armgcc.compiler.optimization.level>
|
||||
<armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcc.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcc.compiler.optimization.PrepareDataForGarbageCollection>True</armgcc.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcc.compiler.optimization.EnableLongCalls>False</armgcc.compiler.optimization.EnableLongCalls>
|
||||
<armgcc.compiler.optimization.DebugLevel>Default (-g2)</armgcc.compiler.optimization.DebugLevel>
|
||||
<armgcc.compiler.warnings.AllWarnings>True</armgcc.compiler.warnings.AllWarnings>
|
||||
<armgcc.compiler.warnings.ExtraWarnings>True</armgcc.compiler.warnings.ExtraWarnings>
|
||||
<armgcc.compiler.miscellaneous.OtherFlags>-std=gnu11 --param max-inline-insns-single=50 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcc.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.compiler.symbols.DefSymbols>
|
||||
<ListValues>
|
||||
<Value>DEBUG</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.symbols.DefSymbols>
|
||||
<armgcccpp.compiler.directories.DefaultIncludePath>False</armgcccpp.compiler.directories.DefaultIncludePath>
|
||||
<armgcccpp.compiler.directories.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>../../Teknic/libClearCore/inc</Value>
|
||||
<Value>../../Teknic/LwIP/LwIP/port/include</Value>
|
||||
<Value>../../Teknic/LwIP/LwIP/src/include</Value>
|
||||
<Value>../../cores/arduino</Value>
|
||||
<Value>../../cores/arduino/api</Value>
|
||||
<Value>../../variants/clearcore</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.compiler.directories.IncludePaths>
|
||||
<armgcccpp.compiler.optimization.level>Optimize most (-O3)</armgcccpp.compiler.optimization.level>
|
||||
<armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareFunctionsForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>True</armgcccpp.compiler.optimization.PrepareDataForGarbageCollection>
|
||||
<armgcccpp.compiler.optimization.EnableLongCalls>False</armgcccpp.compiler.optimization.EnableLongCalls>
|
||||
<armgcccpp.compiler.optimization.DebugLevel>Default (-g2)</armgcccpp.compiler.optimization.DebugLevel>
|
||||
<armgcccpp.compiler.warnings.AllWarnings>True</armgcccpp.compiler.warnings.AllWarnings>
|
||||
<armgcccpp.compiler.warnings.ExtraWarnings>True</armgcccpp.compiler.warnings.ExtraWarnings>
|
||||
<armgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.compiler.miscellaneous.OtherFlags>
|
||||
<armgcccpp.linker.general.AdditionalSpecs>Use rdimon (semihosting) library (--specs=rdimon.specs)</armgcccpp.linker.general.AdditionalSpecs>
|
||||
<armgcccpp.linker.libraries.Libraries>
|
||||
<ListValues>
|
||||
<Value>arm_cortexM4lf_math</Value>
|
||||
<Value>libm</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.Libraries>
|
||||
<armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<ListValues>
|
||||
<Value>%24(ProjectDir)\Device_Startup</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Lib\GCC</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.linker.libraries.LibrarySearchPaths>
|
||||
<armgcccpp.linker.optimization.GarbageCollectUnusedSections>True</armgcccpp.linker.optimization.GarbageCollectUnusedSections>
|
||||
<armgcccpp.linker.memorysettings.ExternalRAM />
|
||||
<armgcccpp.linker.miscellaneous.LinkerFlags>-Tflash_with_bootloader.ld -mfloat-abi=hard -mfpu=fpv4-sp-d16</armgcccpp.linker.miscellaneous.LinkerFlags>
|
||||
<armgcccpp.assembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.assembler.general.IncludePaths>
|
||||
<armgcccpp.assembler.debugging.DebugLevel>Default (-g)</armgcccpp.assembler.debugging.DebugLevel>
|
||||
<armgcccpp.preprocessingassembler.general.DefaultIncludePath>False</armgcccpp.preprocessingassembler.general.DefaultIncludePath>
|
||||
<armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<ListValues>
|
||||
<Value>%24(PackRepoDir)\atmel\SAME53_DFP\1.1.118\include</Value>
|
||||
<Value>%24(PackRepoDir)\arm\CMSIS\4.5.0\CMSIS\Include\</Value>
|
||||
</ListValues>
|
||||
</armgcccpp.preprocessingassembler.general.IncludePaths>
|
||||
<armgcccpp.preprocessingassembler.debugging.DebugLevel>Default (-Wa,-g)</armgcccpp.preprocessingassembler.debugging.DebugLevel>
|
||||
</ArmGccCpp>
|
||||
</ToolchainSettings>
|
||||
<PostBuildEvent>"$(SolutionDir)\Teknic\Tools\uf2-builder\Release\uf2-builder.exe" "$(OutputDirectory)\$(OutputFileName).bin" "$(OutputDirectory)\$(OutputFileName).uf2"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Device_Startup\flash_with_bootloader.ld">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Device_Startup\startup_same53.c">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TestSketch.cpp">
|
||||
<SubType>compile</SubType>
|
||||
</Compile>
|
||||
<None Include="Device_Startup\flash_without_bootloader.ld">
|
||||
<SubType>compile</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Device_Startup\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ClearCore-Arduino-wrapper\ClearCoreArduino.cppproj">
|
||||
<Name>ClearCoreArduino</Name>
|
||||
<Project>{dc06454f-445d-4e8c-a03e-22236431b9de}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Teknic\libClearCore\ClearCore.cppproj">
|
||||
<Name>ClearCore</Name>
|
||||
<Project>{2530d5b1-8a40-4a55-95ca-2ec0b63e2088}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Teknic\LwIP\LwIP.cppproj">
|
||||
<Name>LwIP</Name>
|
||||
<Project>{c373696c-5d45-4b91-ad62-a21552361596}</Project>
|
||||
<Private>True</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AVRSTUDIO_EXE_PATH)\\Vs\\Compiler.targets" />
|
||||
</Project>
|
||||
41
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/boards.txt
vendored
Normal file
41
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/boards.txt
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# See: http://code.google.com/p/arduino/wiki/Platforms
|
||||
|
||||
menu.cpu=Processor
|
||||
|
||||
##############################################################
|
||||
|
||||
clearcore.name=Teknic ClearCore
|
||||
clearcore.vid.0=0x2890
|
||||
clearcore.pid.0=0x0022
|
||||
clearcore.vid.1=0x2890
|
||||
clearcore.pid.1=0x8022
|
||||
|
||||
clearcore.upload.tool=bossac
|
||||
clearcore.upload.protocol=sam-ba
|
||||
clearcore.upload.maximum_size=507904
|
||||
clearcore.upload.use_1200bps_touch=true
|
||||
clearcore.upload.wait_for_upload_port=true
|
||||
clearcore.upload.native_usb=true
|
||||
clearcore.upload.offset=0x4000
|
||||
clearcore.tools.bossac.upload.params.verbose=-i -d -a
|
||||
|
||||
clearcore.bootloader.tool=openocd
|
||||
clearcore.bootloader.unlock_bits=0x3F
|
||||
clearcore.bootloader.lock_bits=0x2F
|
||||
|
||||
clearcore.build.mcu=cortex-m4
|
||||
clearcore.build.float=hard
|
||||
clearcore.build.fpu=fpv4-sp-d16
|
||||
clearcore.build.f_cpu=120000000L
|
||||
clearcore.build.vid=0x2890
|
||||
clearcore.build.pid=0x0022
|
||||
clearcore.build.usb_product="Teknic ClearCore"
|
||||
clearcore.build.usb_manufacturer="Teknic, Inc."
|
||||
clearcore.build.board=ARM_ClearCore
|
||||
clearcore.build.core=arduino
|
||||
clearcore.build.variant=clearcore
|
||||
clearcore.build.extra_flags={build.usb_flags} -lc -DDEBUG
|
||||
clearcore.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
|
||||
|
||||
##############################################################
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
53
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Arduino.h
vendored
Normal file
53
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Arduino.h
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
Arduino.h - Main include file for the Arduino SDK
|
||||
Copyright (c) 2014 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef Arduino_h
|
||||
#define Arduino_h
|
||||
|
||||
#include <sam.h>
|
||||
#include <ArduinoAPI.h>
|
||||
|
||||
#define clockCyclesPerMicrosecond() (SystemCoreClock / 1000000L)
|
||||
#define clockCyclesToMicroseconds(a) (((a) * 1000L) / (SystemCoreClock / 1000L))
|
||||
#define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L))
|
||||
|
||||
#include "WVariant.h"
|
||||
#include "delay.h"
|
||||
|
||||
typedef enum {
|
||||
AR_INTERNAL,
|
||||
AR_INTVCC0 = 2, // 1/2 VDDANA
|
||||
AR_INTVCC1 = 3, // VDDANA
|
||||
AR_EXTERNAL_A = 4,
|
||||
AR_EXTERNAL_B = 5,
|
||||
AR_EXTERNAL_C = 6,
|
||||
} eAnalogReference ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
void init(void);
|
||||
void delay(unsigned long ms);
|
||||
void setup(void);
|
||||
void loop(void);
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // Arduino_h
|
||||
163
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Ethernet.cpp
vendored
Normal file
163
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Ethernet.cpp
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
/* Copyright 2018 Paul Stoffregen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "Ethernet.h"
|
||||
#include "EthernetManager.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/dns.h"
|
||||
|
||||
namespace ClearCore {
|
||||
extern EthernetManager &EthernetMgr;
|
||||
}
|
||||
|
||||
int EthernetClass::begin(uint8_t *mac) {
|
||||
(void)mac; // Disallow setting the MAC address.
|
||||
|
||||
ClearCore::EthernetMgr.Setup();
|
||||
|
||||
int dhcpSuccess = ClearCore::EthernetMgr.DhcpBegin();
|
||||
if (dhcpSuccess) {
|
||||
const ip_addr_t *dns = dns_getserver(0);
|
||||
ClearCore::EthernetMgr.DnsIp(dns->addr);
|
||||
}
|
||||
return dhcpSuccess;
|
||||
}
|
||||
|
||||
// Begin functions assume that the DNS server and/or gateway will be on the
|
||||
// same network with the provided IP with the last value being 1.
|
||||
void EthernetClass::begin(uint8_t *mac, IPAddress ip) {
|
||||
IPAddress dns = IPAddress(ip[0], ip[1], ip[2], 1);
|
||||
begin(mac, ip, dns);
|
||||
}
|
||||
|
||||
void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns) {
|
||||
IPAddress gateway = IPAddress(ip[0], ip[1], ip[2], 1);
|
||||
begin(mac, ip, dns, gateway);
|
||||
}
|
||||
|
||||
void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns,
|
||||
IPAddress gateway) {
|
||||
IPAddress subnet(255, 255, 255, 0);
|
||||
begin(mac, ip, dns, gateway, subnet);
|
||||
}
|
||||
|
||||
void EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns,
|
||||
IPAddress gateway, IPAddress subnet) {
|
||||
(void)mac; // Disallow setting the MAC address.
|
||||
|
||||
ClearCore::EthernetMgr.Setup();
|
||||
|
||||
ClearCore::EthernetMgr.LocalIp(
|
||||
ClearCore::IpAddress(uint32_t(ip)));
|
||||
ClearCore::EthernetMgr.GatewayIp(
|
||||
ClearCore::IpAddress(uint32_t(gateway)));
|
||||
ClearCore::EthernetMgr.NetmaskIp(
|
||||
ClearCore::IpAddress(uint32_t(subnet)));
|
||||
ClearCore::EthernetMgr.DnsIp(
|
||||
ClearCore::IpAddress(uint32_t(dns)));
|
||||
}
|
||||
|
||||
void EthernetClass::init(uint8_t sspin) {
|
||||
(void)sspin; // Nothing to implement here.
|
||||
}
|
||||
|
||||
EthernetLinkStatus EthernetClass::linkStatus() {
|
||||
return ClearCore::EthernetMgr.PhyLinkActive() ? LinkON : LinkOFF;
|
||||
}
|
||||
|
||||
EthernetHardwareStatus EthernetClass::hardwareStatus() {
|
||||
return EthernetBuiltIn;
|
||||
}
|
||||
|
||||
int EthernetClass::maintain() {
|
||||
ClearCore::EthernetMgr.Refresh();
|
||||
// lwIP handles all DHCP state changes (renewal, rebind, etc.)
|
||||
// in the background via sys_check_timeouts()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void EthernetClass::MACAddress(uint8_t *mac_address) {
|
||||
memcpy(mac_address, ClearCore::EthernetMgr.MacAddress(), 6);
|
||||
}
|
||||
|
||||
IPAddress EthernetClass::localIP() {
|
||||
return IPAddress(uint32_t(ClearCore::EthernetMgr.LocalIp()));
|
||||
}
|
||||
|
||||
IPAddress EthernetClass::subnetMask() {
|
||||
return IPAddress(uint32_t(ClearCore::EthernetMgr.NetmaskIp()));
|
||||
}
|
||||
|
||||
IPAddress EthernetClass::gatewayIP() {
|
||||
return IPAddress(uint32_t(ClearCore::EthernetMgr.GatewayIp()));
|
||||
}
|
||||
|
||||
IPAddress EthernetClass::dnsServerIP() {
|
||||
return IPAddress(uint32_t(ClearCore::EthernetMgr.DnsIp()));
|
||||
}
|
||||
|
||||
void EthernetClass::setMACAddress(const uint8_t *mac) {
|
||||
(void)mac; // Disallow setting the MAC address.
|
||||
}
|
||||
|
||||
void EthernetClass::setLocalIP(const IPAddress local_ip) {
|
||||
ClearCore::EthernetMgr.LocalIp(uint32_t(local_ip));
|
||||
}
|
||||
|
||||
void EthernetClass::setSubnetMask(const IPAddress subnet) {
|
||||
ClearCore::EthernetMgr.NetmaskIp(uint32_t(subnet));
|
||||
}
|
||||
|
||||
void EthernetClass::setGatewayIP(const IPAddress gateway) {
|
||||
ClearCore::EthernetMgr.GatewayIp(uint32_t(gateway));
|
||||
}
|
||||
|
||||
void EthernetClass::setDnsServerIP(const IPAddress dns) {
|
||||
ClearCore::EthernetMgr.DnsIp(uint32_t(dns));
|
||||
}
|
||||
|
||||
void EthernetClass::setRetransmissionTimeout(uint16_t milliseconds) {
|
||||
milliseconds = constrain(milliseconds, 1, 6553);
|
||||
ClearCore::EthernetMgr.RetransmissionTimeout(milliseconds);
|
||||
}
|
||||
|
||||
void EthernetClass::setRetransmissionCount(uint8_t number) {
|
||||
if (number == 0) {
|
||||
number = 1; // We should try at least once.
|
||||
}
|
||||
|
||||
ClearCore::EthernetMgr.RetransmissionCount(number);
|
||||
}
|
||||
|
||||
IPAddress EthernetClass::convertIp(ip_addr_t *ip) {
|
||||
IPAddress ipAddr = IPAddress(ip->addr);
|
||||
return ipAddr;
|
||||
}
|
||||
|
||||
ip_addr_t EthernetClass::convertIp(IPAddress ip) {
|
||||
ip_addr_t ipAddr = {};
|
||||
IP4_ADDR(&ipAddr, ip[0], ip[1], ip[2], ip[3]);
|
||||
return ipAddr;
|
||||
}
|
||||
|
||||
EthernetClass Ethernet;
|
||||
284
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Ethernet.h
vendored
Normal file
284
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Ethernet.h
vendored
Normal file
@ -0,0 +1,284 @@
|
||||
/* Copyright 2018 Paul Stoffregen
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ethernet_h_
|
||||
#define ethernet_h_
|
||||
|
||||
// All symbols exposed to Arduino sketches are contained in this header file
|
||||
//
|
||||
// Older versions had much of this stuff in EthernetClient.h, EthernetServer.h,
|
||||
// and socket.h. Including headers in different order could cause trouble, so
|
||||
// these "friend" classes are now defined in the same header file. socket.h
|
||||
// was removed to avoid possible conflict with the C library header files.
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "EthernetUdp.h"
|
||||
#include "EthernetTcp.h"
|
||||
#include "EthernetTcpClient.h"
|
||||
#include "EthernetTcpServer.h"
|
||||
#include "Client.h"
|
||||
#include "Server.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
enum EthernetLinkStatus {
|
||||
Unknown,
|
||||
LinkON,
|
||||
LinkOFF
|
||||
};
|
||||
|
||||
enum EthernetHardwareStatus {
|
||||
EthernetNoHardware, // No WIZnet hardware...
|
||||
EthernetW5100,
|
||||
EthernetW5200,
|
||||
EthernetW5500,
|
||||
EthernetBuiltIn
|
||||
};
|
||||
|
||||
class EthernetUDP;
|
||||
class EthernetClient;
|
||||
class EthernetServer;
|
||||
class DhcpClass;
|
||||
|
||||
class EthernetClass {
|
||||
public:
|
||||
// Initialize the Ethernet shield to use the provided MAC address and
|
||||
// gain the rest of the configuration through DHCP.
|
||||
// Returns 0 if the DHCP configuration failed, and 1 if it succeeded.
|
||||
int begin(uint8_t *mac);
|
||||
int maintain();
|
||||
EthernetLinkStatus linkStatus();
|
||||
EthernetHardwareStatus hardwareStatus();
|
||||
|
||||
// Manual configuration
|
||||
void begin(uint8_t *mac, IPAddress ip);
|
||||
void begin(uint8_t *mac, IPAddress ip, IPAddress dns);
|
||||
void begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway);
|
||||
void begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPAddress gateway,
|
||||
IPAddress subnet);
|
||||
void init(uint8_t sspin);
|
||||
|
||||
void MACAddress(uint8_t *mac_address);
|
||||
IPAddress localIP();
|
||||
IPAddress subnetMask();
|
||||
IPAddress gatewayIP();
|
||||
IPAddress dnsServerIP();
|
||||
|
||||
void setMACAddress(const uint8_t *mac);
|
||||
void setLocalIP(const IPAddress local_ip);
|
||||
void setSubnetMask(const IPAddress subnet);
|
||||
void setGatewayIP(const IPAddress gateway);
|
||||
void setDnsServerIP(const IPAddress dns);
|
||||
void setRetransmissionTimeout(uint16_t milliseconds);
|
||||
void setRetransmissionCount(uint8_t number);
|
||||
|
||||
// Convert an lwIP IP address type to an Arduino IP address type (IPv4).
|
||||
IPAddress convertIp(ip_addr_t *ip);
|
||||
|
||||
// Convert an Arduino IP address type to an lwIP IP address type (IPv4).
|
||||
ip_addr_t convertIp(IPAddress ip);
|
||||
|
||||
friend class EthernetClient;
|
||||
friend class EthernetServer;
|
||||
friend class EthernetUDP;
|
||||
};
|
||||
|
||||
extern EthernetClass Ethernet;
|
||||
|
||||
class EthernetUDP : public UDP {
|
||||
public:
|
||||
EthernetUDP();
|
||||
// Initialize the UDP library and network settings.
|
||||
// Start listening on the localPort. Returns 1 if successful,
|
||||
// 0 if there are no sockets available to use.
|
||||
virtual uint8_t begin(uint16_t localPort);
|
||||
|
||||
// initialize, start listening on specified multicast IP address and port.
|
||||
// Returns 1 if successful, 0 on failure.
|
||||
virtual uint8_t beginMulticast(IPAddress, uint16_t) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Disconnect from the server. Release any resource being used during the
|
||||
// UDP session.
|
||||
virtual void stop();
|
||||
|
||||
// Sending UDP datagrams
|
||||
|
||||
// Start a connection to write UDP data to the remote connection given by
|
||||
// remoteIp and remotePort. Returns 1 if successful, 0 if there was a
|
||||
// problem resolving the IP or port.
|
||||
virtual int beginPacket(IPAddress remoteIp, uint16_t remotePort);
|
||||
// Use DNS to resolve the given hostname to an IP address then start
|
||||
// a UDP connection.
|
||||
virtual int beginPacket(const char *host, uint16_t remotePort);
|
||||
// Call after writing UDP data to the remote connection with write() to send
|
||||
// the UDP packet started with beginPacket(). Returns 1 if the packet was
|
||||
// sent successfully, 0 if there was an error.
|
||||
virtual int endPacket();
|
||||
|
||||
// Write UDP data to the outgoing packet set up with beginPacket(). The
|
||||
// packet will not be sent until endPacket() is called.
|
||||
// Returns the actual number of bytes written.
|
||||
|
||||
// Write a single byte into the outgoing packet.
|
||||
virtual size_t write(uint8_t);
|
||||
// Write size bytes from the buffer into the outgoing packet.
|
||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||
|
||||
using Print::write;
|
||||
|
||||
// Receiving UDP datagrams
|
||||
|
||||
// Check for the presence of a UDP packet and return the size in bytes.
|
||||
// parsePacket() must be called before reading the packet with read().
|
||||
virtual int parsePacket();
|
||||
// The number of bytes available for reading from the buffer.
|
||||
// parsePacket() must be called before calling available().
|
||||
virtual int available();
|
||||
|
||||
// Read UDP data. Returns the number of bytes read.
|
||||
// parsePacket() must be called before read().
|
||||
|
||||
// Read one byte/character from the received packet.
|
||||
virtual int read();
|
||||
// Read up to len bytes from the received packet and put them into buffer.
|
||||
virtual int read(unsigned char *buffer, size_t len);
|
||||
virtual int read(char *buffer, size_t len) {
|
||||
return read((unsigned char *)buffer, len);
|
||||
};
|
||||
// Return the next byte from the current packet without moving on to the
|
||||
// next byte.
|
||||
virtual int peek();
|
||||
// Finish reading the current packet.
|
||||
virtual void flush();
|
||||
|
||||
// The IP address of the remote connection. Must be called after parsePacket().
|
||||
virtual IPAddress remoteIP();
|
||||
// The port of the remote connection. Must be called after parsePacket().
|
||||
virtual uint16_t remotePort();
|
||||
|
||||
private:
|
||||
ClearCore::EthernetUdp m_udp;
|
||||
};
|
||||
|
||||
class EthernetServer : public Server {
|
||||
public:
|
||||
// Create a server that listens for incoming connections on the specified port.
|
||||
EthernetServer(uint16_t port = 80);
|
||||
|
||||
// Tell the server to begin listening for incoming connections.
|
||||
virtual void begin();
|
||||
|
||||
// Get a client connected to the server that has data available for reading.
|
||||
// The connection persists; close it by calling stop() on the client.
|
||||
EthernetClient available();
|
||||
|
||||
// Get a client connected to the server. The caller must keep track of the
|
||||
// returned client, since accept() will return it only once.
|
||||
virtual EthernetClient accept();
|
||||
|
||||
// Write data to all the clients connected to a server.
|
||||
virtual size_t write(uint8_t);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
|
||||
// This allows you to use "if (server)" to check if the supplied
|
||||
// EthernetServer server is started and connected.
|
||||
virtual operator bool();
|
||||
|
||||
using Print::write;
|
||||
|
||||
private:
|
||||
ClearCore::EthernetTcpServer m_tcpServer;
|
||||
};
|
||||
|
||||
class EthernetClient : public Client {
|
||||
public:
|
||||
// Create a client which can connect to a specified internet IP address
|
||||
// and port (defined via connect()).
|
||||
EthernetClient();
|
||||
EthernetClient(ClearCore::EthernetTcpClient tcpClient);
|
||||
|
||||
// Connects to a specified IP address and port. Supports DNS lookups
|
||||
// when using a domain name.
|
||||
// Return value indicates connection status:
|
||||
// 1: SUCCESS
|
||||
// -1: TIMED_OUT
|
||||
// -2: INVALID_SERVER
|
||||
// -3: TRUNCATED
|
||||
// -4: INVALID_RESPONSE
|
||||
virtual int connect(IPAddress ip, uint16_t port);
|
||||
virtual int connect(const char *host, uint16_t port);
|
||||
|
||||
// Write data to the server the client is connected to.
|
||||
virtual size_t write(uint8_t val);
|
||||
virtual size_t write(const uint8_t *buf, size_t size);
|
||||
|
||||
// Return the number of bytes available for reading (the amount of data that
|
||||
// has been written to the client by the server it is connected to).
|
||||
virtual int available();
|
||||
|
||||
// Read the next byte received from the server the client is connected to.
|
||||
virtual int read();
|
||||
// Read size bytes into the supplied buf from the associated server.
|
||||
virtual int read(uint8_t *buf, size_t size);
|
||||
|
||||
// Wait until all outgoing characters in buffer have been sent.
|
||||
virtual void flush();
|
||||
// Disconnect from the server.
|
||||
virtual void stop();
|
||||
// Return whether the client is connected. (The client is still considered
|
||||
// connected if the connection has been closed but there is still unread
|
||||
// data.)
|
||||
virtual uint8_t connected();
|
||||
// Peek at the first character received from the server.
|
||||
virtual int peek();
|
||||
|
||||
// Return the local port number the client is connected to.
|
||||
virtual uint16_t localPort();
|
||||
// Return the IP address of the client. (Not the server's IP?)
|
||||
virtual IPAddress remoteIP();
|
||||
// Return the remote port number of the server the client is connected to.
|
||||
virtual uint16_t remotePort();
|
||||
// Set the timeout for connect() and stop(), in milliseconds. The initial
|
||||
// value is 1000 ms.
|
||||
virtual void setConnectionTimeout(uint16_t milliseconds);
|
||||
|
||||
virtual operator bool();
|
||||
virtual bool operator==(const bool value) {
|
||||
return bool() == value;
|
||||
}
|
||||
virtual bool operator!=(const bool value) {
|
||||
return bool() != value;
|
||||
}
|
||||
virtual bool operator==(const EthernetClient &);
|
||||
virtual bool operator!=(const EthernetClient &rhs) {
|
||||
return !this->operator==(rhs);
|
||||
};
|
||||
|
||||
friend class EthernetServer;
|
||||
|
||||
using Print::write;
|
||||
protected:
|
||||
ClearCore::EthernetTcpClient m_tcpClient;
|
||||
bool m_dnsInitialized;
|
||||
};
|
||||
|
||||
#endif
|
||||
115
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetClient.cpp
vendored
Normal file
115
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetClient.cpp
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
#include <Ethernet.h>
|
||||
#include "EthernetUtils.h"
|
||||
#include "IpAddress.h"
|
||||
|
||||
EthernetClient::EthernetClient()
|
||||
: m_tcpClient(),
|
||||
m_dnsInitialized(false) {}
|
||||
|
||||
EthernetClient::EthernetClient(ClearCore::EthernetTcpClient tcpClient)
|
||||
: m_tcpClient(tcpClient),
|
||||
m_dnsInitialized(false) {}
|
||||
|
||||
int EthernetClient::connect(IPAddress ip, uint16_t port) {
|
||||
ClearCore::IpAddress nativeIp = ClearCore::IpAddress(uint32_t(ip));
|
||||
return m_tcpClient.Connect(nativeIp, port) ? 1 : 0;
|
||||
}
|
||||
|
||||
int EthernetClient::connect(const char *host, uint16_t port) {
|
||||
int result = -1;
|
||||
// Attempt to resolve the host.
|
||||
ip_addr_t remoteIp = {};
|
||||
err_t err = ClearCore::DnsGetHostByName(host, &remoteIp);
|
||||
IPAddress ip = Ethernet.convertIp(&remoteIp);
|
||||
|
||||
switch (err) {
|
||||
case ERR_OK:
|
||||
if (connect(ip, port) == 1) {
|
||||
result = 1; // SUCCESS
|
||||
}
|
||||
else {
|
||||
result = -4; // INVALID_RESPONSE
|
||||
}
|
||||
break;
|
||||
case ERR_INPROGRESS:
|
||||
result = -1; // TIMED_OUT
|
||||
break;
|
||||
case ERR_VAL:
|
||||
result = -2; // INVALID_SERVER
|
||||
break;
|
||||
case ERR_MEM:
|
||||
result = -3; // TRUNCATED
|
||||
break;
|
||||
case ERR_ARG:
|
||||
default:
|
||||
result = -4; // INVALID_RESPONSE
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
size_t EthernetClient::write(uint8_t c) {
|
||||
return write(&c, 1);
|
||||
}
|
||||
|
||||
size_t EthernetClient::write(const uint8_t *buffer, size_t size) {
|
||||
return m_tcpClient.Send(buffer, size);
|
||||
}
|
||||
|
||||
int EthernetClient::available() {
|
||||
return m_tcpClient.BytesAvailable();
|
||||
}
|
||||
|
||||
int EthernetClient::read() {
|
||||
return m_tcpClient.Read();
|
||||
}
|
||||
|
||||
int EthernetClient::read(uint8_t *buf, size_t size) {
|
||||
return m_tcpClient.Read(buf, size);
|
||||
}
|
||||
|
||||
// wait until all outgoing data to the client has been sent
|
||||
void EthernetClient::flush() {
|
||||
m_tcpClient.Flush();
|
||||
}
|
||||
|
||||
void EthernetClient::stop() {
|
||||
m_tcpClient.Close();
|
||||
}
|
||||
|
||||
// A client is considered connected if the connection has been closed but
|
||||
// there is still unread data.
|
||||
uint8_t EthernetClient::connected() {
|
||||
if (m_tcpClient.BytesAvailable() > 0 || m_tcpClient.Connected()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EthernetClient::peek() {
|
||||
return m_tcpClient.Peek();
|
||||
}
|
||||
|
||||
uint16_t EthernetClient::localPort() {
|
||||
return m_tcpClient.LocalPort();
|
||||
}
|
||||
|
||||
IPAddress EthernetClient::remoteIP() {
|
||||
IPAddress ip = IPAddress(uint32_t(m_tcpClient.RemoteIp()));
|
||||
return ip;
|
||||
}
|
||||
|
||||
uint16_t EthernetClient::remotePort() {
|
||||
return m_tcpClient.RemotePort();
|
||||
}
|
||||
|
||||
void EthernetClient::setConnectionTimeout(uint16_t milliseconds) {
|
||||
m_tcpClient.ConnectionTimeout(milliseconds);
|
||||
}
|
||||
EthernetClient::operator bool() {
|
||||
return m_tcpClient.ConnectionState() != nullptr;
|
||||
}
|
||||
|
||||
bool EthernetClient::operator==(const EthernetClient &client) {
|
||||
return m_tcpClient == client.m_tcpClient;
|
||||
}
|
||||
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetServer.cpp
vendored
Normal file
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetServer.cpp
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
#include <Ethernet.h>
|
||||
|
||||
EthernetServer::EthernetServer(uint16_t port/* = 80*/) : m_tcpServer(port) {}
|
||||
|
||||
void EthernetServer::begin() {
|
||||
m_tcpServer.Begin();
|
||||
}
|
||||
|
||||
// EthernetServer gives a client only once, regardless of it it has sent data.
|
||||
// Then, the user is responsible for keeping track of connected clients.
|
||||
EthernetClient EthernetServer::accept() {
|
||||
return EthernetClient(m_tcpServer.Accept());
|
||||
}
|
||||
|
||||
// EthernetServer manages the clients. A client is only identified and returned
|
||||
// when data has been received from the client and is available for reading.
|
||||
EthernetClient EthernetServer::available() {
|
||||
return EthernetClient(m_tcpServer.Available());
|
||||
}
|
||||
|
||||
size_t EthernetServer::write(uint8_t c) {
|
||||
return write(&c, 1);
|
||||
}
|
||||
|
||||
size_t EthernetServer::write(const uint8_t *buf, size_t size) {
|
||||
return m_tcpServer.Send(buf, size);
|
||||
}
|
||||
|
||||
EthernetServer::operator bool() {
|
||||
return m_tcpServer.Ready();
|
||||
}
|
||||
78
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetUDP.cpp
vendored
Normal file
78
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/EthernetUDP.cpp
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
#include <Ethernet.h>
|
||||
#include "EthernetUdp.h"
|
||||
#include "EthernetUtils.h"
|
||||
#include "IpAddress.h"
|
||||
|
||||
|
||||
EthernetUDP::EthernetUDP(): m_udp() {}
|
||||
|
||||
uint8_t EthernetUDP::begin(uint16_t localPort) {
|
||||
return m_udp.Begin(localPort) ? 1 : 0;
|
||||
}
|
||||
|
||||
void EthernetUDP::stop() {
|
||||
m_udp.End();
|
||||
}
|
||||
|
||||
int EthernetUDP::beginPacket(IPAddress ip, uint16_t port) {
|
||||
ClearCore::IpAddress nativeIp = ClearCore::IpAddress(uint32_t(ip));
|
||||
return m_udp.Connect(nativeIp, port) ? 1 : 0;
|
||||
}
|
||||
|
||||
int EthernetUDP::beginPacket(const char *host, uint16_t remotePort) {
|
||||
// Attempt to resolve the host.
|
||||
ip_addr_t remoteIp = {};
|
||||
if (ClearCore::DnsGetHostByName(host, &remoteIp) != ERR_OK) {
|
||||
return 0; // Unable to resolve hostname or timed out.
|
||||
}
|
||||
|
||||
IPAddress ip = Ethernet.convertIp(&remoteIp);
|
||||
|
||||
return beginPacket(ip, remotePort);
|
||||
}
|
||||
|
||||
int EthernetUDP::endPacket() {
|
||||
return m_udp.PacketSend() ? 1 : 0;
|
||||
}
|
||||
|
||||
size_t EthernetUDP::write(uint8_t c) {
|
||||
return write(&c, 1);
|
||||
}
|
||||
|
||||
size_t EthernetUDP::write(const uint8_t *buffer, size_t size) {
|
||||
return m_udp.PacketWrite(buffer, size);
|
||||
}
|
||||
|
||||
int EthernetUDP::parsePacket() {
|
||||
return m_udp.PacketParse();
|
||||
}
|
||||
|
||||
int EthernetUDP::available() {
|
||||
return m_udp.BytesAvailable();
|
||||
}
|
||||
|
||||
int EthernetUDP::read() {
|
||||
unsigned char c;
|
||||
return (read(&c, 1) == 1) ? c : -1;
|
||||
}
|
||||
|
||||
int EthernetUDP::read(unsigned char *buffer, size_t len) {
|
||||
return m_udp.PacketRead(buffer, len);
|
||||
}
|
||||
|
||||
int EthernetUDP::peek() {
|
||||
return m_udp.Peek();
|
||||
}
|
||||
|
||||
void EthernetUDP::flush() {
|
||||
m_udp.PacketFlush();
|
||||
}
|
||||
|
||||
IPAddress EthernetUDP::remoteIP() {
|
||||
IPAddress ip = IPAddress(uint32_t(m_udp.RemoteIp()));
|
||||
return ip;
|
||||
}
|
||||
|
||||
uint16_t EthernetUDP::remotePort() {
|
||||
return m_udp.RemotePort();
|
||||
}
|
||||
100
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Reset.cpp
vendored
Normal file
100
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Reset.cpp
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "Reset.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NVM_MEMORY ((volatile uint16_t *)0x000000)
|
||||
|
||||
#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10610)
|
||||
|
||||
extern const uint32_t __text_start__;
|
||||
#define APP_START ((volatile uint32_t)(&__text_start__) + 4)
|
||||
|
||||
#else
|
||||
#define APP_START 0x00002004
|
||||
#endif
|
||||
|
||||
static inline bool nvmReady(void) {
|
||||
return NVMCTRL->STATUS.bit.READY;
|
||||
}
|
||||
|
||||
__attribute__((long_call, section(".ramfunc")))
|
||||
static void banzai() {
|
||||
// Disable all interrupts
|
||||
__disable_irq();
|
||||
|
||||
// Get a copy of the NVM "user page"
|
||||
uint32_t userspace = *((uint32_t *)NVMCTRL_FUSES_BOOTPROT_ADDR);
|
||||
uint32_t bootsize = NVMCTRL_BLOCK_SIZE *
|
||||
(15 - ((userspace & NVMCTRL_FUSES_BOOTPROT_Msk)
|
||||
>> NVMCTRL_FUSES_BOOTPROT_Pos));
|
||||
// Avoid erasing the application if APP_START is < than the minimum
|
||||
// bootloader sizea
|
||||
// This could happen if without_bootloader linker script was chosen
|
||||
if ((APP_START - 4) < bootsize) {
|
||||
goto reset;
|
||||
}
|
||||
|
||||
// Erase application
|
||||
while (!nvmReady()) {
|
||||
continue;
|
||||
}
|
||||
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK;
|
||||
// Set address to starting address
|
||||
NVMCTRL->ADDR.reg = (APP_START - 4);
|
||||
NVMCTRL->CTRLB.reg = NVMCTRL_CTRLB_CMD_EB | NVMCTRL_CTRLB_CMDEX_KEY;
|
||||
while (!nvmReady()) {
|
||||
continue;
|
||||
}
|
||||
reset:
|
||||
// Reset the device
|
||||
NVIC_SystemReset() ;
|
||||
|
||||
while (true) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
static int ticks = -1;
|
||||
|
||||
void initiateReset(int _ticks) {
|
||||
ticks = _ticks;
|
||||
}
|
||||
|
||||
void cancelReset() {
|
||||
ticks = -1;
|
||||
}
|
||||
|
||||
void tickReset() {
|
||||
if (ticks == -1) {
|
||||
return;
|
||||
}
|
||||
ticks--;
|
||||
if (ticks == 0) {
|
||||
banzai();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Reset.h
vendored
Normal file
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Reset.h
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void initiateReset(int ms);
|
||||
void tickReset();
|
||||
void cancelReset();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
687
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/SERCOM.cpp
vendored
Normal file
687
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/SERCOM.cpp
vendored
Normal file
@ -0,0 +1,687 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "SERCOM.h"
|
||||
#include "variant.h"
|
||||
|
||||
#ifndef WIRE_RISE_TIME_NANOSECONDS
|
||||
// Default rise time in nanoseconds, based on 4.7K ohm pull up resistors
|
||||
// you can override this value in your variant if needed
|
||||
#define WIRE_RISE_TIME_NANOSECONDS 125
|
||||
#endif
|
||||
|
||||
SERCOM::SERCOM(Sercom *s) {
|
||||
sercom = s;
|
||||
}
|
||||
|
||||
/* =========================
|
||||
* ====== Sercom UART ======
|
||||
* =========================
|
||||
*/
|
||||
void SERCOM::initUART(SercomUartMode mode, SercomUartSampleRate sampleRate,
|
||||
uint32_t baudrate) {
|
||||
initClockNVIC();
|
||||
resetUART();
|
||||
|
||||
//Setting the CTRLA register
|
||||
sercom->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE(mode) |
|
||||
SERCOM_USART_CTRLA_SAMPR(sampleRate);
|
||||
|
||||
//Setting the Interrupt register
|
||||
sercom->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC | //Rx complete
|
||||
SERCOM_USART_INTENSET_ERROR;//All others errors
|
||||
|
||||
if (mode == UART_INT_CLOCK) {
|
||||
uint16_t sampleRateValue;
|
||||
|
||||
if (sampleRate == SAMPLE_RATE_x16) {
|
||||
sampleRateValue = 16;
|
||||
}
|
||||
else {
|
||||
sampleRateValue = 8;
|
||||
}
|
||||
|
||||
// Asynchronous fractional mode (Table 24-2 in datasheet)
|
||||
// BAUD = fref / (sampleRateValue * fbaud)
|
||||
// (multiply by 8, to calculate fractional piece)
|
||||
uint32_t baudTimes8 = (SystemCoreClock * 8) /
|
||||
(sampleRateValue * baudrate);
|
||||
|
||||
sercom->USART.BAUD.FRAC.FP = (baudTimes8 % 8);
|
||||
sercom->USART.BAUD.FRAC.BAUD = (baudTimes8 / 8);
|
||||
}
|
||||
}
|
||||
void SERCOM::initFrame(SercomUartCharSize charSize,
|
||||
SercomDataOrder dataOrder, SercomParityMode parityMode,
|
||||
SercomNumberStopBit nbStopBits) {
|
||||
//Setting the CTRLA register
|
||||
sercom->USART.CTRLA.reg |=
|
||||
SERCOM_USART_CTRLA_FORM((parityMode == SERCOM_NO_PARITY ? 0 : 1)) |
|
||||
dataOrder << SERCOM_USART_CTRLA_DORD_Pos;
|
||||
|
||||
//Setting the CTRLB register
|
||||
sercom->USART.CTRLB.reg |=
|
||||
SERCOM_USART_CTRLB_CHSIZE(charSize) |
|
||||
nbStopBits << SERCOM_USART_CTRLB_SBMODE_Pos |
|
||||
(parityMode == SERCOM_NO_PARITY ? 0 : parityMode)
|
||||
<< SERCOM_USART_CTRLB_PMODE_Pos; // If no parity use default value
|
||||
}
|
||||
|
||||
void SERCOM::initPads(SercomUartTXPad txPad, SercomRXPad rxPad) {
|
||||
//Setting the CTRLA register
|
||||
sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(txPad) |
|
||||
SERCOM_USART_CTRLA_RXPO(rxPad);
|
||||
|
||||
// Enable Transceiver and Receiver
|
||||
sercom->USART.CTRLB.reg |=
|
||||
SERCOM_USART_CTRLB_TXEN |
|
||||
SERCOM_USART_CTRLB_RXEN;
|
||||
}
|
||||
|
||||
void SERCOM::resetUART() {
|
||||
// Start the Software Reset
|
||||
sercom->USART.CTRLA.bit.SWRST = 1 ;
|
||||
|
||||
while (sercom->USART.CTRLA.bit.SWRST || sercom->USART.SYNCBUSY.bit.SWRST) {
|
||||
// Wait for both bits Software Reset from CTRLA and SYNCBUSY coming back
|
||||
// to 0
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::enableUART() {
|
||||
//Setting the enable bit to 1
|
||||
sercom->USART.CTRLA.bit.ENABLE = 0x1u;
|
||||
|
||||
//Wait for then enable bit from SYNCBUSY is equal to 0;
|
||||
while (sercom->USART.SYNCBUSY.bit.ENABLE) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::flushUART() {
|
||||
// Skip checking transmission completion if data register is empty
|
||||
if (isDataRegisterEmptyUART()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for transmission to complete
|
||||
while (!sercom->USART.INTFLAG.bit.TXC) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::clearStatusUART() {
|
||||
//Reset (with 0) the STATUS register
|
||||
sercom->USART.STATUS.reg = SERCOM_USART_STATUS_RESETVALUE;
|
||||
}
|
||||
|
||||
bool SERCOM::availableDataUART() {
|
||||
//RXC : Receive Complete
|
||||
return sercom->USART.INTFLAG.bit.RXC;
|
||||
}
|
||||
|
||||
bool SERCOM::isUARTError() {
|
||||
return sercom->USART.INTFLAG.bit.ERROR;
|
||||
}
|
||||
|
||||
void SERCOM::acknowledgeUARTError() {
|
||||
sercom->USART.INTFLAG.bit.ERROR = 1;
|
||||
}
|
||||
|
||||
bool SERCOM::isBufferOverflowErrorUART() {
|
||||
//BUFOVF : Buffer Overflow
|
||||
return sercom->USART.STATUS.bit.BUFOVF;
|
||||
}
|
||||
|
||||
bool SERCOM::isFrameErrorUART() {
|
||||
//FERR : Frame Error
|
||||
return sercom->USART.STATUS.bit.FERR;
|
||||
}
|
||||
|
||||
void SERCOM::clearFrameErrorUART() {
|
||||
// clear FERR bit writing 1 status bit
|
||||
sercom->USART.STATUS.bit.FERR = 1;
|
||||
}
|
||||
|
||||
bool SERCOM::isParityErrorUART() {
|
||||
//PERR : Parity Error
|
||||
return sercom->USART.STATUS.bit.PERR;
|
||||
}
|
||||
|
||||
bool SERCOM::isDataRegisterEmptyUART() {
|
||||
//DRE : Data Register Empty
|
||||
return sercom->USART.INTFLAG.bit.DRE;
|
||||
}
|
||||
|
||||
uint8_t SERCOM::readDataUART() {
|
||||
return sercom->USART.DATA.bit.DATA;
|
||||
}
|
||||
|
||||
int SERCOM::writeDataUART(uint8_t data) {
|
||||
// Wait for data register to be empty
|
||||
while (!isDataRegisterEmptyUART()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Put data into DATA register
|
||||
sercom->USART.DATA.reg = (uint16_t)data;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SERCOM::enableDataRegisterEmptyInterruptUART() {
|
||||
sercom->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE;
|
||||
}
|
||||
|
||||
void SERCOM::disableDataRegisterEmptyInterruptUART() {
|
||||
sercom->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE;
|
||||
}
|
||||
|
||||
/* =========================
|
||||
* ====== Sercom SPI =======
|
||||
* =========================
|
||||
*/
|
||||
void SERCOM::initSPI(SercomSpiTXPad mosi, SercomRXPad miso,
|
||||
SercomSpiCharSize charSize, SercomDataOrder dataOrder) {
|
||||
resetSPI();
|
||||
initClockNVIC();
|
||||
|
||||
//Setting the CTRLA register
|
||||
sercom->SPI.CTRLA.bit.MODE = 3; // SPI master operation
|
||||
sercom->SPI.CTRLA.bit.DOPO = mosi; // Data out pinout: MOSI
|
||||
sercom->SPI.CTRLA.bit.DIPO = miso; // Data in pinout: MISO
|
||||
sercom->SPI.CTRLA.bit.DORD = dataOrder; // Data order
|
||||
|
||||
//Setting the CTRLB register
|
||||
sercom->SPI.CTRLB.reg = SERCOM_SPI_CTRLB_CHSIZE(charSize) |
|
||||
SERCOM_SPI_CTRLB_RXEN; //Active the SPI receiver.
|
||||
}
|
||||
|
||||
void SERCOM::initSPIClock(SercomSpiClockMode clockMode, uint32_t baudrate) {
|
||||
//Extract data from clockMode
|
||||
int cpha, cpol;
|
||||
|
||||
if ((clockMode & (0x1ul)) == 0) {
|
||||
cpha = 0;
|
||||
}
|
||||
else {
|
||||
cpha = 1;
|
||||
}
|
||||
|
||||
if ((clockMode & (0x2ul)) == 0) {
|
||||
cpol = 0;
|
||||
}
|
||||
else {
|
||||
cpol = 1;
|
||||
}
|
||||
|
||||
//Setting the CTRLA register
|
||||
sercom->SPI.CTRLA.reg |= (cpha << SERCOM_SPI_CTRLA_CPHA_Pos) |
|
||||
(cpol << SERCOM_SPI_CTRLA_CPOL_Pos);
|
||||
|
||||
//Synchronous arithmetic
|
||||
sercom->SPI.BAUD.reg = calculateBaudrateSynchronous(baudrate);
|
||||
}
|
||||
|
||||
void SERCOM::resetSPI() {
|
||||
//Setting the Software Reset bit to 1
|
||||
sercom->SPI.CTRLA.bit.SWRST = 1;
|
||||
|
||||
//Wait both bits Software Reset from CTRLA and SYNCBUSY are equal to 0
|
||||
while (sercom->SPI.CTRLA.bit.SWRST || sercom->SPI.SYNCBUSY.bit.SWRST) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::enableSPI() {
|
||||
//Setting the enable bit to 1
|
||||
sercom->SPI.CTRLA.bit.ENABLE = 1;
|
||||
|
||||
while (sercom->SPI.SYNCBUSY.bit.ENABLE) {
|
||||
//Waiting then enable bit from SYNCBUSY is equal to 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::disableSPI() {
|
||||
while (sercom->SPI.SYNCBUSY.bit.ENABLE) {
|
||||
//Waiting then enable bit from SYNCBUSY is equal to 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
//Setting the enable bit to 0
|
||||
sercom->SPI.CTRLA.bit.ENABLE = 0;
|
||||
}
|
||||
|
||||
void SERCOM::setDataOrderSPI(SercomDataOrder dataOrder) {
|
||||
//Register enable-protected
|
||||
disableSPI();
|
||||
|
||||
sercom->SPI.CTRLA.bit.DORD = dataOrder;
|
||||
|
||||
enableSPI();
|
||||
}
|
||||
|
||||
SercomDataOrder SERCOM::getDataOrderSPI() {
|
||||
return (sercom->SPI.CTRLA.bit.DORD ? LSB_FIRST : MSB_FIRST);
|
||||
}
|
||||
|
||||
void SERCOM::setBaudrateSPI(uint8_t divider) {
|
||||
//Can't divide by 0
|
||||
if (divider == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Register enable-protected
|
||||
disableSPI();
|
||||
|
||||
sercom->SPI.BAUD.reg =
|
||||
calculateBaudrateSynchronous(SERCOM_FREQ_REF / divider);
|
||||
|
||||
enableSPI();
|
||||
}
|
||||
|
||||
void SERCOM::setClockModeSPI(SercomSpiClockMode clockMode) {
|
||||
int cpha, cpol;
|
||||
if ((clockMode & (0x1ul)) == 0) {
|
||||
cpha = 0;
|
||||
}
|
||||
else {
|
||||
cpha = 1;
|
||||
}
|
||||
|
||||
if ((clockMode & (0x2ul)) == 0) {
|
||||
cpol = 0;
|
||||
}
|
||||
else {
|
||||
cpol = 1;
|
||||
}
|
||||
|
||||
//Register enable-protected
|
||||
disableSPI();
|
||||
|
||||
sercom->SPI.CTRLA.bit.CPOL = cpol;
|
||||
sercom->SPI.CTRLA.bit.CPHA = cpha;
|
||||
|
||||
enableSPI();
|
||||
}
|
||||
|
||||
uint8_t SERCOM::transferDataSPI(uint8_t data) {
|
||||
sercom->SPI.DATA.bit.DATA = data; // Writing data into Data register
|
||||
|
||||
while (sercom->SPI.INTFLAG.bit.RXC == 0) {
|
||||
// Waiting Complete Reception
|
||||
continue;
|
||||
}
|
||||
|
||||
return sercom->SPI.DATA.bit.DATA; // Reading data
|
||||
}
|
||||
|
||||
bool SERCOM::isBufferOverflowErrorSPI() {
|
||||
return sercom->SPI.STATUS.bit.BUFOVF;
|
||||
}
|
||||
|
||||
bool SERCOM::isDataRegisterEmptySPI() {
|
||||
//DRE : Data Register Empty
|
||||
return sercom->SPI.INTFLAG.bit.DRE;
|
||||
}
|
||||
|
||||
uint8_t SERCOM::calculateBaudrateSynchronous(uint32_t baudrate) {
|
||||
return SERCOM_FREQ_REF / (2 * baudrate) - 1;
|
||||
}
|
||||
|
||||
|
||||
/* =========================
|
||||
* ====== Sercom WIRE ======
|
||||
* =========================
|
||||
*/
|
||||
void SERCOM::resetWIRE() {
|
||||
//I2CM OR I2CS, no matter SWRST is the same bit.
|
||||
|
||||
//Setting the Software bit to 1
|
||||
sercom->I2CM.CTRLA.bit.SWRST = 1;
|
||||
|
||||
//Wait both bits Software Reset from CTRLA and SYNCBUSY are equal to 0
|
||||
while (sercom->I2CM.CTRLA.bit.SWRST || sercom->I2CM.SYNCBUSY.bit.SWRST) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::enableWIRE() {
|
||||
// I2C Master and Slave modes share the ENABLE bit function.
|
||||
|
||||
// Enable the I2C master mode
|
||||
sercom->I2CM.CTRLA.bit.ENABLE = 1 ;
|
||||
|
||||
while (sercom->I2CM.SYNCBUSY.bit.ENABLE != 0) {
|
||||
// Waiting the enable bit from SYNCBUSY is equal to 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Setting bus idle mode
|
||||
sercom->I2CM.STATUS.bit.BUSSTATE = 1 ;
|
||||
|
||||
while (sercom->I2CM.SYNCBUSY.bit.SYSOP != 0) {
|
||||
// Wait the SYSOP bit from SYNCBUSY coming back to 0
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::disableWIRE() {
|
||||
// I2C Master and Slave modes share the ENABLE bit function.
|
||||
|
||||
// Enable the I2C master mode
|
||||
sercom->I2CM.CTRLA.bit.ENABLE = 0 ;
|
||||
|
||||
while (sercom->I2CM.SYNCBUSY.bit.ENABLE != 0) {
|
||||
// Waiting the enable bit from SYNCBUSY is equal to 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::initSlaveWIRE(uint8_t ucAddress, bool enableGeneralCall) {
|
||||
// Initialize the peripheral clock and interruption
|
||||
initClockNVIC() ;
|
||||
resetWIRE() ;
|
||||
|
||||
// Set slave mode
|
||||
sercom->I2CS.CTRLA.bit.MODE = I2C_SLAVE_OPERATION;
|
||||
|
||||
// 0x7F, select only 7 bits
|
||||
sercom->I2CS.ADDR.reg = SERCOM_I2CS_ADDR_ADDR(ucAddress & 0x7Ful) |
|
||||
// 0x00, only match exact address
|
||||
SERCOM_I2CS_ADDR_ADDRMASK(0x00ul);
|
||||
if (enableGeneralCall) {
|
||||
// enable general call (address 0x00)
|
||||
sercom->I2CS.ADDR.reg |= SERCOM_I2CS_ADDR_GENCEN;
|
||||
}
|
||||
|
||||
// Set the interrupt register
|
||||
sercom->I2CS.INTENSET.reg = SERCOM_I2CS_INTENSET_PREC | // Stop
|
||||
SERCOM_I2CS_INTENSET_AMATCH | // Address Match
|
||||
SERCOM_I2CS_INTENSET_DRDY; // Data Ready
|
||||
|
||||
while (sercom->I2CM.SYNCBUSY.bit.SYSOP != 0) {
|
||||
// Wait the SYSOP bit from SYNCBUSY to come back to 0
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::initMasterWIRE(uint32_t baudrate) {
|
||||
// Initialize the peripheral clock and interruption
|
||||
initClockNVIC() ;
|
||||
|
||||
resetWIRE() ;
|
||||
|
||||
// Set master mode and enable SCL Clock Stretch mode (stretch after ACK bit)
|
||||
sercom->I2CM.CTRLA.reg = SERCOM_I2CM_CTRLA_MODE(I2C_MASTER_OPERATION);
|
||||
|
||||
// Synchronous arithmetic baudrate
|
||||
sercom->I2CM.BAUD.bit.BAUD = SystemCoreClock / (2 * baudrate) - 5 -
|
||||
(((SystemCoreClock / 1000000) * WIRE_RISE_TIME_NANOSECONDS) /
|
||||
(2 * 1000));
|
||||
}
|
||||
|
||||
void SERCOM::prepareNackBitWIRE(void) {
|
||||
if (isMasterWIRE()) {
|
||||
// Send a NACK
|
||||
sercom->I2CM.CTRLB.bit.ACKACT = 1;
|
||||
}
|
||||
else {
|
||||
sercom->I2CS.CTRLB.bit.ACKACT = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::prepareAckBitWIRE(void) {
|
||||
if (isMasterWIRE()) {
|
||||
// Send an ACK
|
||||
sercom->I2CM.CTRLB.bit.ACKACT = 0;
|
||||
}
|
||||
else {
|
||||
sercom->I2CS.CTRLB.bit.ACKACT = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::prepareCommandBitsWire(uint8_t cmd) {
|
||||
if (isMasterWIRE()) {
|
||||
sercom->I2CM.CTRLB.bit.CMD = cmd;
|
||||
|
||||
while (sercom->I2CM.SYNCBUSY.bit.SYSOP) {
|
||||
// Waiting for synchronization
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sercom->I2CS.CTRLB.bit.CMD = cmd;
|
||||
}
|
||||
}
|
||||
|
||||
bool SERCOM::startTransmissionWIRE(uint8_t address,
|
||||
SercomWireReadWriteFlag flag) {
|
||||
// 7-bits address + 1-bits R/W
|
||||
address = (address << 0x1ul) | flag;
|
||||
|
||||
// Wait idle or owner bus mode
|
||||
while (!isBusIdleWIRE() && !isBusOwnerWIRE()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Send start and address
|
||||
sercom->I2CM.ADDR.bit.ADDR = address;
|
||||
|
||||
// Address Transmitted
|
||||
if (flag == WIRE_WRITE_FLAG) { // Write mode
|
||||
while (!sercom->I2CM.INTFLAG.bit.MB) {
|
||||
// Wait transmission complete
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {// Read mode
|
||||
while (!sercom->I2CM.INTFLAG.bit.SB) {
|
||||
// If the slave NACKS the address, the MB bit will be set.
|
||||
// In that case, send a stop condition and return false.
|
||||
if (sercom->I2CM.INTFLAG.bit.MB) {
|
||||
sercom->I2CM.CTRLB.bit.CMD = 3; // Stop condition
|
||||
return false;
|
||||
}
|
||||
// Wait transmission complete
|
||||
}
|
||||
}
|
||||
|
||||
//ACK received (0: ACK, 1: NACK)
|
||||
if (sercom->I2CM.STATUS.bit.RXNACK) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SERCOM::sendDataMasterWIRE(uint8_t data) {
|
||||
//Send data
|
||||
sercom->I2CM.DATA.bit.DATA = data;
|
||||
|
||||
//Wait transmission successful
|
||||
while (!sercom->I2CM.INTFLAG.bit.MB) {
|
||||
|
||||
// If a bus error occurs, the MB bit may never be set.
|
||||
// Check the bus error bit and bail if it's set.
|
||||
if (sercom->I2CM.STATUS.bit.BUSERR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Problems on line? nack received?
|
||||
if (sercom->I2CM.STATUS.bit.RXNACK) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SERCOM::sendDataSlaveWIRE(uint8_t data) {
|
||||
//Send data
|
||||
sercom->I2CS.DATA.bit.DATA = data;
|
||||
|
||||
//Problems on line? nack received?
|
||||
if (!sercom->I2CS.INTFLAG.bit.DRDY || sercom->I2CS.STATUS.bit.RXNACK) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool SERCOM::isMasterWIRE(void) {
|
||||
return sercom->I2CS.CTRLA.bit.MODE == I2C_MASTER_OPERATION;
|
||||
}
|
||||
|
||||
bool SERCOM::isSlaveWIRE(void) {
|
||||
return sercom->I2CS.CTRLA.bit.MODE == I2C_SLAVE_OPERATION;
|
||||
}
|
||||
|
||||
bool SERCOM::isBusIdleWIRE(void) {
|
||||
return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_IDLE_STATE;
|
||||
}
|
||||
|
||||
bool SERCOM::isBusOwnerWIRE(void) {
|
||||
return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_OWNER_STATE;
|
||||
}
|
||||
|
||||
bool SERCOM::isDataReadyWIRE(void) {
|
||||
return sercom->I2CS.INTFLAG.bit.DRDY;
|
||||
}
|
||||
|
||||
bool SERCOM::isStopDetectedWIRE(void) {
|
||||
return sercom->I2CS.INTFLAG.bit.PREC;
|
||||
}
|
||||
|
||||
bool SERCOM::isRestartDetectedWIRE(void) {
|
||||
return sercom->I2CS.STATUS.bit.SR;
|
||||
}
|
||||
|
||||
bool SERCOM::isAddressMatch(void) {
|
||||
return sercom->I2CS.INTFLAG.bit.AMATCH;
|
||||
}
|
||||
|
||||
bool SERCOM::isMasterReadOperationWIRE(void) {
|
||||
return sercom->I2CS.STATUS.bit.DIR;
|
||||
}
|
||||
|
||||
bool SERCOM::isRXNackReceivedWIRE(void) {
|
||||
return sercom->I2CM.STATUS.bit.RXNACK;
|
||||
}
|
||||
|
||||
int SERCOM::availableWIRE(void) {
|
||||
if (isMasterWIRE()) {
|
||||
return sercom->I2CM.INTFLAG.bit.SB;
|
||||
}
|
||||
else {
|
||||
return sercom->I2CS.INTFLAG.bit.DRDY;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t SERCOM::readDataWIRE(void) {
|
||||
if (isMasterWIRE()) {
|
||||
while (sercom->I2CM.INTFLAG.bit.SB == 0) {
|
||||
// Waiting complete receive
|
||||
continue;
|
||||
}
|
||||
|
||||
return sercom->I2CM.DATA.bit.DATA ;
|
||||
}
|
||||
else {
|
||||
return sercom->I2CS.DATA.reg ;
|
||||
}
|
||||
}
|
||||
|
||||
void SERCOM::initClockNVIC(void) {
|
||||
uint8_t clockId = 0;
|
||||
// Dummy init to intercept potential error later
|
||||
IRQn_Type IdNvic = PendSV_IRQn ;
|
||||
|
||||
if (sercom == SERCOM0) {
|
||||
clockId = SERCOM0_GCLK_ID_CORE;
|
||||
IdNvic = SERCOM0_0_IRQn;
|
||||
}
|
||||
else if (sercom == SERCOM1) {
|
||||
clockId = 8;
|
||||
IdNvic = SERCOM1_0_IRQn;
|
||||
}
|
||||
else if (sercom == SERCOM2) {
|
||||
clockId = 23;
|
||||
IdNvic = SERCOM2_0_IRQn;
|
||||
}
|
||||
else if (sercom == SERCOM3) {
|
||||
clockId = 24;
|
||||
IdNvic = SERCOM3_0_IRQn;
|
||||
}
|
||||
#if defined(SERCOM4)
|
||||
else if (sercom == SERCOM4) {
|
||||
clockId = 34;
|
||||
IdNvic = SERCOM4_0_IRQn;
|
||||
}
|
||||
#endif // SERCOM4
|
||||
#if defined(SERCOM5)
|
||||
else if (sercom == SERCOM5) {
|
||||
clockId = 35;
|
||||
IdNvic = SERCOM5_0_IRQn;
|
||||
}
|
||||
#endif // SERCOM5
|
||||
#if defined(SERCOM6)
|
||||
else if (sercom == SERCOM6) {
|
||||
clockId = 36;
|
||||
IdNvic = SERCOM6_0_IRQn;
|
||||
}
|
||||
#endif // SERCOM6
|
||||
#if defined(SERCOM7)
|
||||
else if (sercom == SERCOM7) {
|
||||
clockId = 37;
|
||||
IdNvic = SERCOM7_0_IRQn;
|
||||
}
|
||||
#endif // SERCOM7
|
||||
|
||||
if (IdNvic == PendSV_IRQn) {
|
||||
// We got a problem here
|
||||
return ;
|
||||
}
|
||||
|
||||
// Setting NVIC
|
||||
NVIC_EnableIRQ((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_DRE_Pos)); /* Data Register Empty Interrupt */
|
||||
NVIC_SetPriority((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_DRE_Pos), SERCOM_NVIC_PRIORITY); /* set Priority */
|
||||
NVIC_EnableIRQ((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_RXC_Pos)); /* Receive Complete Interrupt */
|
||||
NVIC_SetPriority((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_RXC_Pos), SERCOM_NVIC_PRIORITY); /* set Priority */
|
||||
NVIC_EnableIRQ((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_RXS_Pos)); /* Receive Start Interrupt and errors */
|
||||
NVIC_SetPriority((IRQn_Type)(IdNvic +
|
||||
SERCOM_USART_INTFLAG_RXS_Pos), SERCOM_NVIC_PRIORITY); /* set Priority */
|
||||
|
||||
//Setting clock, Generic Clock Generator 0 is source
|
||||
GCLK->PCHCTRL[clockId].reg = GCLK_PCHCTRL_GEN_GCLK0 |
|
||||
GCLK_PCHCTRL_CHEN ;
|
||||
|
||||
while (GCLK->SYNCBUSY.bit.GENCTRL0) {
|
||||
/* Wait for synchronization */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
210
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/SERCOM.h
vendored
Normal file
210
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/SERCOM.h
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _SERCOM_CLASS_
|
||||
#define _SERCOM_CLASS_
|
||||
|
||||
#include "sam.h"
|
||||
|
||||
#define SERCOM_FREQ_REF 48000000
|
||||
#ifndef SERCOM_NVIC_PRIORITY
|
||||
#define SERCOM_NVIC_PRIORITY ((1 << __NVIC_PRIO_BITS) - 1)
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
UART_EXT_CLOCK = 0,
|
||||
UART_INT_CLOCK = 0x1u
|
||||
} SercomUartMode;
|
||||
|
||||
typedef enum {
|
||||
SPI_SLAVE_OPERATION = 0x2u,
|
||||
SPI_MASTER_OPERATION = 0x3u
|
||||
} SercomSpiMode;
|
||||
|
||||
typedef enum {
|
||||
I2C_SLAVE_OPERATION = 0x4u,
|
||||
I2C_MASTER_OPERATION = 0x5u
|
||||
} SercomI2CMode;
|
||||
|
||||
typedef enum {
|
||||
SERCOM_EVEN_PARITY = 0,
|
||||
SERCOM_ODD_PARITY,
|
||||
SERCOM_NO_PARITY
|
||||
} SercomParityMode;
|
||||
|
||||
typedef enum {
|
||||
SERCOM_STOP_BIT_1 = 0,
|
||||
SERCOM_STOP_BITS_2
|
||||
} SercomNumberStopBit;
|
||||
|
||||
typedef enum {
|
||||
MSB_FIRST = 0,
|
||||
LSB_FIRST
|
||||
} SercomDataOrder;
|
||||
|
||||
typedef enum {
|
||||
UART_CHAR_SIZE_8_BITS = 0,
|
||||
UART_CHAR_SIZE_9_BITS,
|
||||
UART_CHAR_SIZE_5_BITS = 0x5u,
|
||||
UART_CHAR_SIZE_6_BITS,
|
||||
UART_CHAR_SIZE_7_BITS
|
||||
} SercomUartCharSize;
|
||||
|
||||
typedef enum {
|
||||
SERCOM_RX_PAD_0 = 0,
|
||||
SERCOM_RX_PAD_1,
|
||||
SERCOM_RX_PAD_2,
|
||||
SERCOM_RX_PAD_3
|
||||
} SercomRXPad;
|
||||
|
||||
typedef enum {
|
||||
UART_TX_PAD_0 = 0x0ul, // Only for UART
|
||||
UART_TX_PAD_2 = 0x1ul, // Only for UART
|
||||
// Only for UART with TX on PAD0, RTS on PAD2 and CTS on PAD3
|
||||
UART_TX_RTS_CTS_PAD_0_2_3 = 0x2ul,
|
||||
} SercomUartTXPad;
|
||||
|
||||
typedef enum {
|
||||
SAMPLE_RATE_x16 = 0x1, //Fractional
|
||||
SAMPLE_RATE_x8 = 0x3, //Fractional
|
||||
} SercomUartSampleRate;
|
||||
|
||||
typedef enum {
|
||||
SERCOM_SPI_MODE_0 = 0, // CPOL : 0 | CPHA : 0
|
||||
SERCOM_SPI_MODE_1, // CPOL : 0 | CPHA : 1
|
||||
SERCOM_SPI_MODE_2, // CPOL : 1 | CPHA : 0
|
||||
SERCOM_SPI_MODE_3 // CPOL : 1 | CPHA : 1
|
||||
} SercomSpiClockMode;
|
||||
|
||||
typedef enum {
|
||||
SPI_PAD_0_SCK_1 = 0,
|
||||
SPI_PAD_2_SCK_3,
|
||||
SPI_PAD_3_SCK_1,
|
||||
SPI_PAD_0_SCK_3
|
||||
} SercomSpiTXPad;
|
||||
|
||||
typedef enum {
|
||||
SPI_CHAR_SIZE_8_BITS = 0x0ul,
|
||||
SPI_CHAR_SIZE_9_BITS
|
||||
} SercomSpiCharSize;
|
||||
|
||||
typedef enum {
|
||||
WIRE_UNKNOWN_STATE = 0x0ul,
|
||||
WIRE_IDLE_STATE,
|
||||
WIRE_OWNER_STATE,
|
||||
WIRE_BUSY_STATE
|
||||
} SercomWireBusState;
|
||||
|
||||
typedef enum {
|
||||
WIRE_WRITE_FLAG = 0x0ul,
|
||||
WIRE_READ_FLAG
|
||||
} SercomWireReadWriteFlag;
|
||||
|
||||
typedef enum {
|
||||
WIRE_MASTER_ACT_NO_ACTION = 0,
|
||||
WIRE_MASTER_ACT_REPEAT_START,
|
||||
WIRE_MASTER_ACT_READ,
|
||||
WIRE_MASTER_ACT_STOP
|
||||
} SercomMasterCommandWire;
|
||||
|
||||
typedef enum {
|
||||
WIRE_MASTER_ACK_ACTION = 0,
|
||||
WIRE_MASTER_NACK_ACTION
|
||||
} SercomMasterAckActionWire;
|
||||
|
||||
class SERCOM {
|
||||
public:
|
||||
SERCOM(Sercom *s) ;
|
||||
|
||||
/* ========== UART ========== */
|
||||
void initUART(SercomUartMode mode, SercomUartSampleRate sampleRate,
|
||||
uint32_t baudrate = 0);
|
||||
void initFrame(SercomUartCharSize charSize,
|
||||
SercomDataOrder dataOrder, SercomParityMode parityMode,
|
||||
SercomNumberStopBit nbStopBits);
|
||||
void initPads(SercomUartTXPad txPad, SercomRXPad rxPad);
|
||||
|
||||
void resetUART(void);
|
||||
void enableUART(void);
|
||||
void flushUART(void);
|
||||
void clearStatusUART(void);
|
||||
bool availableDataUART(void);
|
||||
bool isBufferOverflowErrorUART(void);
|
||||
bool isFrameErrorUART(void);
|
||||
void clearFrameErrorUART(void);
|
||||
bool isParityErrorUART(void);
|
||||
bool isDataRegisterEmptyUART(void);
|
||||
uint8_t readDataUART(void);
|
||||
int writeDataUART(uint8_t data);
|
||||
bool isUARTError();
|
||||
void acknowledgeUARTError();
|
||||
void enableDataRegisterEmptyInterruptUART();
|
||||
void disableDataRegisterEmptyInterruptUART();
|
||||
|
||||
/* ========== SPI ========== */
|
||||
void initSPI(SercomSpiTXPad mosi, SercomRXPad miso,
|
||||
SercomSpiCharSize charSize, SercomDataOrder dataOrder);
|
||||
void initSPIClock(SercomSpiClockMode clockMode, uint32_t baudrate);
|
||||
|
||||
void resetSPI(void);
|
||||
void enableSPI(void);
|
||||
void disableSPI(void);
|
||||
void setDataOrderSPI(SercomDataOrder dataOrder);
|
||||
SercomDataOrder getDataOrderSPI(void);
|
||||
void setBaudrateSPI(uint8_t divider);
|
||||
void setClockModeSPI(SercomSpiClockMode clockMode);
|
||||
uint8_t transferDataSPI(uint8_t data);
|
||||
bool isBufferOverflowErrorSPI(void);
|
||||
bool isDataRegisterEmptySPI(void);
|
||||
bool isTransmitCompleteSPI(void);
|
||||
bool isReceiveCompleteSPI(void);
|
||||
|
||||
/* ========== WIRE ========== */
|
||||
void initSlaveWIRE(uint8_t address, bool enableGeneralCall = false);
|
||||
void initMasterWIRE(uint32_t baudrate);
|
||||
|
||||
void resetWIRE(void);
|
||||
void enableWIRE(void);
|
||||
void disableWIRE(void);
|
||||
void prepareNackBitWIRE(void);
|
||||
void prepareAckBitWIRE(void);
|
||||
void prepareCommandBitsWire(uint8_t cmd);
|
||||
bool startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag);
|
||||
bool sendDataMasterWIRE(uint8_t data);
|
||||
bool sendDataSlaveWIRE(uint8_t data);
|
||||
bool isMasterWIRE(void);
|
||||
bool isSlaveWIRE(void);
|
||||
bool isBusIdleWIRE(void);
|
||||
bool isBusOwnerWIRE(void);
|
||||
bool isDataReadyWIRE(void);
|
||||
bool isStopDetectedWIRE(void);
|
||||
bool isRestartDetectedWIRE(void);
|
||||
bool isAddressMatch(void);
|
||||
bool isMasterReadOperationWIRE(void);
|
||||
bool isRXNackReceivedWIRE(void);
|
||||
int availableWIRE(void);
|
||||
uint8_t readDataWIRE(void);
|
||||
|
||||
private:
|
||||
Sercom *sercom;
|
||||
uint8_t calculateBaudrateSynchronous(uint32_t baudrate);
|
||||
uint32_t division(uint32_t dividend, uint32_t divisor);
|
||||
void initClockNVIC(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
80
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Tone.cpp
vendored
Normal file
80
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Tone.cpp
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include "Arduino.h"
|
||||
#include "DigitalInOutHBridge.h"
|
||||
#include "SysConnectors.h"
|
||||
#include "SysManager.h"
|
||||
#include "WVariant.h"
|
||||
#include "variant.h"
|
||||
#include <Common.h>
|
||||
#include <sam.h>
|
||||
|
||||
namespace ClearCore {
|
||||
extern SysManager SysMgr;
|
||||
}
|
||||
|
||||
// Board resource controller
|
||||
extern const uint32_t SystemCoreClock;
|
||||
uint32_t toneMaxFrequency = SystemCoreClock / 2;
|
||||
|
||||
void noTone(uint8_t outputPin) {
|
||||
ClearCore::Connector *myConnector =
|
||||
ClearCore::SysMgr.ConnectorByIndex(static_cast<ClearCorePins>(outputPin));
|
||||
// Only playing tones on the H-Bridge connectors
|
||||
if (myConnector->Type() != ClearCore::Connector::H_BRIDGE_TYPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (static_cast<ClearCore::DigitalInOutHBridge *>(myConnector)->ToneActiveState()
|
||||
!= ClearCore::DigitalInOutHBridge::ToneState::TONE_TIMED) {
|
||||
// Stop the tone on the specified pin
|
||||
static_cast<ClearCore::DigitalInOutHBridge *>(myConnector)->ToneStop();
|
||||
}
|
||||
}
|
||||
|
||||
void tone(
|
||||
unsigned char outputPin, unsigned int frequency, unsigned long duration) {
|
||||
|
||||
ClearCore::Connector *myConnector =
|
||||
ClearCore::SysMgr.ConnectorByIndex(static_cast<ClearCorePins>(outputPin));
|
||||
// Only playing tones on the H-Bridge connectors
|
||||
if (myConnector->Type() != ClearCore::Connector::H_BRIDGE_TYPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Put the pin in tone mode
|
||||
static_cast<ClearCore::DigitalInOutHBridge *>(myConnector)
|
||||
->Mode(ClearCore::DigitalInOutHBridge::OUTPUT_TONE);
|
||||
|
||||
static_cast<ClearCore::DigitalInOutHBridge *>(myConnector)
|
||||
->ToneTimed(frequency, duration);
|
||||
}
|
||||
|
||||
void toneVolume(unsigned char outputPin, float volume) {
|
||||
|
||||
ClearCore::Connector *myConnector =
|
||||
ClearCore::SysMgr.ConnectorByIndex(static_cast<ClearCorePins>(outputPin));
|
||||
// Only playing tones on the H-Bridge connectors
|
||||
if (myConnector->Type() != ClearCore::Connector::H_BRIDGE_TYPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the tone amplitude for this pin
|
||||
static_cast<ClearCore::DigitalInOutHBridge *>(myConnector)
|
||||
->ToneAmplitude(static_cast<int16_t>(volume * INT16_MAX));
|
||||
}
|
||||
192
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Uart.cpp
vendored
Normal file
192
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Uart.cpp
vendored
Normal file
@ -0,0 +1,192 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "Uart.h"
|
||||
#include "Arduino.h"
|
||||
#include "SerialDriver.h"
|
||||
#include "SysConnectors.h"
|
||||
#include "SysManager.h"
|
||||
#include "Common.h"
|
||||
|
||||
// Board resource controller
|
||||
namespace ClearCore {
|
||||
extern SysManager SysMgr;
|
||||
}
|
||||
|
||||
Uart::Uart(ClearCorePins connectorPin, bool isUsbCon) {
|
||||
m_serial = nullptr;
|
||||
m_serialConnector = nullptr;
|
||||
|
||||
ClearCore::Connector *con =
|
||||
ClearCore::SysMgr.ConnectorByIndex(connectorPin);
|
||||
if (isUsbCon) {
|
||||
ClearCore::SerialUsb *serialUsb =
|
||||
static_cast<ClearCore::SerialUsb *>(con);
|
||||
m_serial = static_cast<ClearCore::ISerial *>(serialUsb);
|
||||
}
|
||||
else {
|
||||
m_serialConnector = static_cast<ClearCore::SerialDriver *>(con);
|
||||
m_serial = static_cast<ClearCore::ISerial *>(m_serialConnector);
|
||||
}
|
||||
}
|
||||
|
||||
void Uart::begin(unsigned long baudrate) {
|
||||
if (m_serial) {
|
||||
m_serial->PortClose();
|
||||
m_serial->Speed(baudrate);
|
||||
m_serial->PortOpen();
|
||||
}
|
||||
}
|
||||
|
||||
void Uart::begin(unsigned long baudrate, uint16_t config) {
|
||||
if (m_serial) {
|
||||
m_serial->PortClose();
|
||||
m_serial->Speed(baudrate);
|
||||
m_serial->CharSize(extractCharSize(config));
|
||||
m_serial->Parity(extractParity(config));
|
||||
m_serial->PortOpen();
|
||||
m_serial->StopBits(extractNbStopBit(config));
|
||||
}
|
||||
}
|
||||
|
||||
void Uart::end() {
|
||||
m_serial->PortClose();
|
||||
}
|
||||
|
||||
void Uart::flush() {
|
||||
m_serial->WaitForTransmitIdle();
|
||||
m_serial->Flush();
|
||||
}
|
||||
|
||||
void Uart::flushInput() {
|
||||
m_serial->FlushInput();
|
||||
}
|
||||
|
||||
int Uart::available() {
|
||||
return m_serial ? m_serial->AvailableForRead() : 0;
|
||||
}
|
||||
|
||||
int Uart::availableForWrite() {
|
||||
return m_serial ? m_serial->AvailableForWrite() : 0;
|
||||
}
|
||||
|
||||
int Uart::peek() {
|
||||
return m_serial ? m_serial->CharPeek() : -1;
|
||||
}
|
||||
|
||||
int Uart::read() {
|
||||
return m_serial ? m_serial->CharGet() : -1;
|
||||
}
|
||||
|
||||
size_t Uart::write(const uint8_t data) {
|
||||
if (m_serial) {
|
||||
m_serial->SendChar(data);
|
||||
// The serial connector returns nothing, but return that one byte
|
||||
// was written to conform to the arduino standard for write()
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t Uart::extractNbStopBit(uint16_t config) {
|
||||
switch (config & SERIAL_STOP_BIT_MASK) {
|
||||
case SERIAL_STOP_BIT_1:
|
||||
default:
|
||||
return 1;
|
||||
|
||||
case SERIAL_STOP_BIT_2:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t Uart::extractCharSize(uint16_t config) {
|
||||
switch (config & SERIAL_DATA_MASK) {
|
||||
case SERIAL_DATA_5:
|
||||
return 5;
|
||||
|
||||
case SERIAL_DATA_6:
|
||||
return 6;
|
||||
|
||||
case SERIAL_DATA_7:
|
||||
return 7;
|
||||
|
||||
case SERIAL_DATA_8:
|
||||
default:
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
|
||||
ClearCore::ISerial::Parities Uart::extractParity(uint16_t config) {
|
||||
switch (config & SERIAL_PARITY_MASK) {
|
||||
case SERIAL_PARITY_NONE:
|
||||
default:
|
||||
return ClearCore::ISerial::Parities::PARITY_N;
|
||||
|
||||
case SERIAL_PARITY_EVEN:
|
||||
return ClearCore::ISerial::Parities::PARITY_E;
|
||||
|
||||
case SERIAL_PARITY_ODD:
|
||||
return ClearCore::ISerial::Parities::PARITY_O;
|
||||
}
|
||||
}
|
||||
|
||||
// Get or set TTL on the Serial port
|
||||
void Uart::ttl(bool newState) {
|
||||
if (m_serialConnector) {
|
||||
if (newState) {
|
||||
m_serialConnector->Mode(ClearCore::SerialDriver::TTL);
|
||||
}
|
||||
else {
|
||||
m_serialConnector->Mode(ClearCore::SerialDriver::RS232);
|
||||
}
|
||||
}
|
||||
}
|
||||
bool Uart::ttl() {
|
||||
if (m_serialConnector) {
|
||||
return (m_serialConnector->Mode() == ClearCore::SerialDriver::TTL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Uart::operator bool() {
|
||||
if (m_serial) {
|
||||
return (bool) *m_serial;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Serial Constants for Arduino users
|
||||
Uart Serial(CLEARCORE_PIN_USB, true);
|
||||
Uart Serial0(CLEARCORE_PIN_COM0);
|
||||
Uart Serial1(CLEARCORE_PIN_COM1);
|
||||
|
||||
// Weak definitions for the serial event runner and handlers
|
||||
// These can be overridden by the user's functions if needed
|
||||
void serialEventRun(void) {
|
||||
if (serialEvent && Serial.available()) {
|
||||
serialEvent();
|
||||
}
|
||||
if (serialEvent0 && Serial0.available()) {
|
||||
serialEvent0();
|
||||
}
|
||||
if (serialEvent1 && Serial1.available()) {
|
||||
serialEvent1();
|
||||
}
|
||||
}
|
||||
60
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Uart.h
vendored
Normal file
60
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Uart.h
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SerialDriver.h"
|
||||
#include "SerialUsb.h"
|
||||
#include "SysConnectors.h"
|
||||
#include "SysManager.h"
|
||||
#include "HardwareSerial.h"
|
||||
#include "SERCOM.h"
|
||||
|
||||
class Uart : public HardwareSerial {
|
||||
public:
|
||||
Uart(ClearCorePins connectorPin, bool isUsbCon = false);
|
||||
void begin(unsigned long baudRate);
|
||||
void begin(unsigned long baudrate, uint16_t config);
|
||||
void end();
|
||||
int available();
|
||||
int availableForWrite();
|
||||
int peek();
|
||||
int read();
|
||||
void flush();
|
||||
void flushInput();
|
||||
size_t write(const uint8_t data);
|
||||
void ttl(bool newState);
|
||||
bool ttl();
|
||||
using Print::write; // pull in write(str) and write(buf, size) from Print
|
||||
|
||||
operator bool();
|
||||
|
||||
private:
|
||||
|
||||
ClearCore::ISerial *m_serial;
|
||||
ClearCore::SerialDriver *m_serialConnector;
|
||||
|
||||
uint8_t extractNbStopBit(uint16_t config);
|
||||
uint8_t extractCharSize(uint16_t config);
|
||||
ClearCore::ISerial::Parities extractParity(uint16_t config);
|
||||
};
|
||||
|
||||
|
||||
extern Uart Serial;
|
||||
extern Uart Serial0;
|
||||
extern Uart Serial1;
|
||||
105
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Udp.h
vendored
Normal file
105
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/Udp.h
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Udp.cpp: Library to send/receive UDP packets.
|
||||
*
|
||||
* NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray
|
||||
* for mentioning these)
|
||||
* 1) UDP does not guarantee the order in which assembled UDP packets are
|
||||
* received. This might not happen often in practice, but in larger network
|
||||
* topologies, a UDP packet can be received out of sequence.
|
||||
* 2) UDP does not guard against lost packets - so packets *can* disappear
|
||||
* without the sender being aware of it. Again, this may not be a concern in
|
||||
* practice on small local networks.
|
||||
* For more information, see http://www.cafeaulait.org/course/week12/35.html
|
||||
*
|
||||
* MIT License:
|
||||
* Copyright (c) 2008 Bjoern Hartmann
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* bjoern@cs.stanford.edu 12/30/2008
|
||||
*/
|
||||
|
||||
#ifndef udp_h
|
||||
#define udp_h
|
||||
|
||||
#include <Stream.h>
|
||||
#include <IPAddress.h>
|
||||
|
||||
class UDP : public Stream {
|
||||
|
||||
public:
|
||||
// initialize, start listening on specified port. Returns 1 if successful, 0
|
||||
// if there are no sockets available to use
|
||||
virtual uint8_t begin(uint16_t) = 0;
|
||||
virtual uint8_t beginMulticast(IPAddress, uint16_t) {
|
||||
// initialize, start listening on specified multicast IP address and
|
||||
// port. Returns 1 if successful, 0 on failure
|
||||
return 0;
|
||||
}
|
||||
virtual void stop() = 0; // Finish with the UDP socket
|
||||
|
||||
// Sending UDP packets
|
||||
|
||||
// Start building up a packet to send to the remote host specific in ip and
|
||||
// port
|
||||
// Returns 1 if successful, 0 if there was a problem with the supplied IP
|
||||
// address or port
|
||||
virtual int beginPacket(IPAddress ip, uint16_t port) = 0;
|
||||
// Start building up a packet to send to the remote host specific in host
|
||||
// and port
|
||||
// Returns 1 if successful, 0 if there was a problem resolving the hostname
|
||||
// or port
|
||||
virtual int beginPacket(const char *host, uint16_t port) = 0;
|
||||
// Finish off this packet and send it
|
||||
// Returns 1 if the packet was sent successfully, 0 if there was an error
|
||||
virtual int endPacket() = 0;
|
||||
// Write a single byte into the packet
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
// Write size bytes from buffer into the packet
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
|
||||
|
||||
// Start processing the next available incoming packet
|
||||
// Returns the size of the packet in bytes, or 0 if no packets are available
|
||||
virtual int parsePacket() = 0;
|
||||
// Number of bytes remaining in the current packet
|
||||
virtual int available() = 0;
|
||||
// Read a single byte from the current packet
|
||||
virtual int read() = 0;
|
||||
// Read up to len bytes from the current packet and place them into buffer
|
||||
// Returns the number of bytes read, or 0 if none are available
|
||||
virtual int read(unsigned char *buffer, size_t len) = 0;
|
||||
// Read up to len characters from the current packet and place them into
|
||||
// buffer
|
||||
// Returns the number of characters read, or 0 if none are available
|
||||
virtual int read(char *buffer, size_t len) = 0;
|
||||
// Return the next byte from the current packet without moving on to the
|
||||
// next byte
|
||||
virtual int peek() = 0;
|
||||
virtual void flush() = 0; // Finish reading the current packet
|
||||
|
||||
// Return the IP address of the host who sent the current incoming packet
|
||||
virtual IPAddress remoteIP() = 0;
|
||||
// Return the port of the host who sent the current incoming packet
|
||||
virtual uint16_t remotePort() = 0;
|
||||
protected:
|
||||
uint8_t *rawIPAddress(IPAddress &addr) {
|
||||
return addr.raw_address();
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
46
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/WMath.cpp
vendored
Normal file
46
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/WMath.cpp
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
#include "stdlib.h"
|
||||
#include "stdint.h"
|
||||
}
|
||||
|
||||
void randomSeed(uint32_t dwSeed) {
|
||||
if (dwSeed != 0) {
|
||||
srand(dwSeed);
|
||||
}
|
||||
}
|
||||
|
||||
long random(long howbig) {
|
||||
if (howbig == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return rand() % howbig;
|
||||
}
|
||||
|
||||
long random(long howsmall, long howbig) {
|
||||
if (howsmall >= howbig) {
|
||||
return howsmall;
|
||||
}
|
||||
|
||||
long diff = howbig - howsmall;
|
||||
|
||||
return random(diff) + howsmall;
|
||||
}
|
||||
54
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/WVariant.h
vendored
Normal file
54
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/WVariant.h
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "sam.h"
|
||||
#include "Common.h"
|
||||
#include "pins_arduino.h"
|
||||
#include "SysConnectors.h"
|
||||
#include "SysManager.h"
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LED_BUILTIN CLEARCORE_PIN_LED
|
||||
|
||||
/**
|
||||
PIN Modes
|
||||
**/
|
||||
typedef enum {
|
||||
CLEARCORE_MODE_INPUT = INPUT, // Match standard name
|
||||
CLEARCORE_MODE_OUTPUT = OUTPUT,
|
||||
CLEARCORE_MODE_ANALOG
|
||||
} ClearCorePinModes;
|
||||
|
||||
// Parallel version of pinMode to setup ClearCore "connectors" using the
|
||||
// connector index.
|
||||
void pinModeClearCore(ClearCorePins thePin, PinMode ulMode);
|
||||
|
||||
// Mapping of ClearCore pins to interrupts
|
||||
pin_size_t digitalPinToInterrupt(pin_size_t pin);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
41
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/abi.cpp
vendored
Normal file
41
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/abi.cpp
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
extern "C" void __cxa_pure_virtual(void) __attribute__((__noreturn__));
|
||||
extern "C" void __cxa_deleted_virtual(void) __attribute__((__noreturn__));
|
||||
|
||||
extern "C" {
|
||||
void __cxa_pure_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
while (1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
void __cxa_deleted_virtual(void) {
|
||||
// We might want to write some diagnostics to uart in this case
|
||||
//std::terminate();
|
||||
while (1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
54
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/ArduinoAPI.h
vendored
Normal file
54
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/ArduinoAPI.h
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
Arduino API main include
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef ARDUINO_API_H
|
||||
#define ARDUINO_API_H
|
||||
|
||||
// version 1.0.0
|
||||
#define ARDUINO_API_VERSION 10000
|
||||
|
||||
#include "Binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "Client.h"
|
||||
#include "HardwareI2C.h"
|
||||
#include "HardwareSerial.h"
|
||||
#include "Interrupts.h"
|
||||
#include "IPAddress.h"
|
||||
#include "Print.h"
|
||||
#include "Printable.h"
|
||||
#include "Server.h"
|
||||
#include "ArduinoString.h"
|
||||
#include "Stream.h"
|
||||
#include "Uart.h"
|
||||
#include "Udp.h"
|
||||
#include "WCharacter.h"
|
||||
#endif
|
||||
|
||||
/* Standard C library includes */
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
// Misc Arduino core functions
|
||||
#include "Common.h"
|
||||
|
||||
#endif
|
||||
342
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/ArduinoString.h
vendored
Normal file
342
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/ArduinoString.h
vendored
Normal file
@ -0,0 +1,342 @@
|
||||
/*
|
||||
String library for Wiring & Arduino
|
||||
...mostly rewritten by Paul Stoffregen...
|
||||
Copyright (c) 2009-10 Hernando Barragan. All right reserved.
|
||||
Copyright 2011, Paul Stoffregen, paul@pjrc.com
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#if defined(__AVR__)
|
||||
#include "avr/pgmspace.h"
|
||||
#else
|
||||
#include "deprecated-avr-comp/avr/pgmspace.h"
|
||||
#endif
|
||||
|
||||
// When compiling programs with this class, the following gcc parameters
|
||||
// dramatically increase performance and memory (RAM) efficiency, typically
|
||||
// with little or no increase in code size.
|
||||
// -felide-constructors
|
||||
// -std=c++0x
|
||||
|
||||
class __FlashStringHelper;
|
||||
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
|
||||
|
||||
// An inherited class for holding the result of a concatenation. These
|
||||
// result objects are assumed to be writable by subsequent concatenations.
|
||||
class StringSumHelper;
|
||||
|
||||
// The string class
|
||||
class String {
|
||||
// use a function pointer to allow for "if (s)" without the
|
||||
// complications of an operator bool(). for more information, see:
|
||||
// http://www.artima.com/cppsource/safebool.html
|
||||
typedef void (String::*StringIfHelperType)() const;
|
||||
void StringIfHelper() const {}
|
||||
|
||||
public:
|
||||
// constructors
|
||||
// creates a copy of the initial value.
|
||||
// if the initial value is null or invalid, or if memory allocation
|
||||
// fails, the string will be marked as invalid (i.e. "if (s)" will
|
||||
// be false).
|
||||
String(const char *cstr = "");
|
||||
String(const String &str);
|
||||
String(const __FlashStringHelper *str);
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
String(String &&rval);
|
||||
String(StringSumHelper &&rval);
|
||||
#endif
|
||||
explicit String(char c);
|
||||
explicit String(unsigned char, unsigned char base = 10);
|
||||
explicit String(int, unsigned char base = 10);
|
||||
explicit String(unsigned int, unsigned char base = 10);
|
||||
explicit String(long, unsigned char base = 10);
|
||||
explicit String(unsigned long, unsigned char base = 10);
|
||||
explicit String(float, unsigned char decimalPlaces = 2);
|
||||
explicit String(double, unsigned char decimalPlaces = 2);
|
||||
~String(void);
|
||||
|
||||
// memory management
|
||||
// return true on success, false on failure (in which case, the string
|
||||
// is left unchanged). reserve(0), if successful, will validate an
|
||||
// invalid string (i.e., "if (s)" will be true afterwards)
|
||||
unsigned char reserve(unsigned int size);
|
||||
inline unsigned int length(void) const {
|
||||
return len;
|
||||
}
|
||||
|
||||
// creates a copy of the assigned value. if the value is null or
|
||||
// invalid, or if the memory allocation fails, the string will be
|
||||
// marked as invalid ("if (s)" will be false).
|
||||
String &operator = (const String &rhs);
|
||||
String &operator = (const char *cstr);
|
||||
String &operator = (const __FlashStringHelper *str);
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
String &operator = (String &&rval);
|
||||
String &operator = (StringSumHelper &&rval);
|
||||
#endif
|
||||
|
||||
// concatenate (works w/ built-in types)
|
||||
|
||||
// returns true on success, false on failure (in which case, the string
|
||||
// is left unchanged). if the argument is null or invalid, the
|
||||
// concatenation is considered unsucessful.
|
||||
unsigned char concat(const String &str);
|
||||
unsigned char concat(const char *cstr);
|
||||
unsigned char concat(char c);
|
||||
unsigned char concat(unsigned char c);
|
||||
unsigned char concat(int num);
|
||||
unsigned char concat(unsigned int num);
|
||||
unsigned char concat(long num);
|
||||
unsigned char concat(unsigned long num);
|
||||
unsigned char concat(float num);
|
||||
unsigned char concat(double num);
|
||||
unsigned char concat(const __FlashStringHelper *str);
|
||||
|
||||
// if there's not enough memory for the concatenated value, the string
|
||||
// will be left unchanged (but this isn't signalled in any way)
|
||||
String &operator += (const String &rhs) {
|
||||
concat(rhs);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (const char *cstr) {
|
||||
concat(cstr);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (char c) {
|
||||
concat(c);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (unsigned char num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (int num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (unsigned int num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (long num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (unsigned long num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (float num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (double num) {
|
||||
concat(num);
|
||||
return (*this);
|
||||
}
|
||||
String &operator += (const __FlashStringHelper *str) {
|
||||
concat(str);
|
||||
return (*this);
|
||||
}
|
||||
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, const String &rhs);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, const char *cstr);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, char c);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, unsigned char num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, int num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, unsigned int num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, long num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, unsigned long num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, float num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, double num);
|
||||
friend StringSumHelper &operator +
|
||||
(const StringSumHelper &lhs, const __FlashStringHelper *rhs);
|
||||
|
||||
// comparison (only works w/ Strings and "strings")
|
||||
operator StringIfHelperType() const {
|
||||
return buffer ? &String::StringIfHelper : 0;
|
||||
}
|
||||
int compareTo(const String &s) const;
|
||||
int compareTo(const char *cstr) const;
|
||||
unsigned char equals(const String &s) const;
|
||||
unsigned char equals(const char *cstr) const;
|
||||
|
||||
friend unsigned char operator == (const String &a, const String &b) {
|
||||
return a.equals(b);
|
||||
}
|
||||
friend unsigned char operator == (const String &a, const char *b) {
|
||||
return a.equals(b);
|
||||
}
|
||||
friend unsigned char operator == (const char *a, const String &b) {
|
||||
return b == a;
|
||||
}
|
||||
friend unsigned char operator < (const String &a, const String &b) {
|
||||
return a.compareTo(b) < 0;
|
||||
}
|
||||
friend unsigned char operator < (const String &a, const char *b) {
|
||||
return a.compareTo(b) < 0;
|
||||
}
|
||||
friend unsigned char operator < (const char *a, const String &b) {
|
||||
return b.compareTo(a) > 0;
|
||||
}
|
||||
|
||||
friend unsigned char operator != (const String &a, const String &b) {
|
||||
return !(a == b);
|
||||
}
|
||||
friend unsigned char operator != (const String &a, const char *b) {
|
||||
return !(a == b);
|
||||
}
|
||||
friend unsigned char operator != (const char *a, const String &b) {
|
||||
return !(a == b);
|
||||
}
|
||||
friend unsigned char operator > (const String &a, const String &b) {
|
||||
return b < a;
|
||||
}
|
||||
friend unsigned char operator > (const String &a, const char *b) {
|
||||
return b < a;
|
||||
}
|
||||
friend unsigned char operator > (const char *a, const String &b) {
|
||||
return b < a;
|
||||
}
|
||||
friend unsigned char operator <= (const String &a, const String &b) {
|
||||
return !(b < a);
|
||||
}
|
||||
friend unsigned char operator <= (const String &a, const char *b) {
|
||||
return !(b < a);
|
||||
}
|
||||
friend unsigned char operator <= (const char *a, const String &b) {
|
||||
return !(b < a);
|
||||
}
|
||||
friend unsigned char operator >= (const String &a, const String &b) {
|
||||
return !(a < b);
|
||||
}
|
||||
friend unsigned char operator >= (const String &a, const char *b) {
|
||||
return !(a < b);
|
||||
}
|
||||
friend unsigned char operator >= (const char *a, const String &b) {
|
||||
return !(a < b);
|
||||
}
|
||||
|
||||
unsigned char equalsIgnoreCase(const String &s) const;
|
||||
unsigned char startsWith(const String &prefix) const;
|
||||
unsigned char startsWith(const String &prefix, unsigned int offset) const;
|
||||
unsigned char endsWith(const String &suffix) const;
|
||||
|
||||
// character acccess
|
||||
char charAt(unsigned int index) const;
|
||||
void setCharAt(unsigned int index, char c);
|
||||
char operator [](unsigned int index) const;
|
||||
char &operator [](unsigned int index);
|
||||
void getBytes(unsigned char *buf, unsigned int bufsize,
|
||||
unsigned int index = 0) const;
|
||||
void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0)const {
|
||||
getBytes((unsigned char *)buf, bufsize, index);
|
||||
}
|
||||
const char *c_str() const {
|
||||
return buffer;
|
||||
}
|
||||
char *begin() {
|
||||
return buffer;
|
||||
}
|
||||
char *end() {
|
||||
return buffer + length();
|
||||
}
|
||||
const char *begin() const {
|
||||
return c_str();
|
||||
}
|
||||
const char *end() const {
|
||||
return c_str() + length();
|
||||
}
|
||||
|
||||
// search
|
||||
int indexOf(char ch) const;
|
||||
int indexOf(char ch, unsigned int fromIndex) const;
|
||||
int indexOf(const String &str) const;
|
||||
int indexOf(const String &str, unsigned int fromIndex) const;
|
||||
int lastIndexOf(char ch) const;
|
||||
int lastIndexOf(char ch, unsigned int fromIndex) const;
|
||||
int lastIndexOf(const String &str) const;
|
||||
int lastIndexOf(const String &str, unsigned int fromIndex) const;
|
||||
String substring(unsigned int beginIndex) const {
|
||||
return substring(beginIndex, len);
|
||||
};
|
||||
String substring(unsigned int beginIndex, unsigned int endIndex) const;
|
||||
|
||||
// modification
|
||||
void replace(char find, char replace);
|
||||
void replace(const String &find, const String &replace);
|
||||
void remove(unsigned int index);
|
||||
void remove(unsigned int index, unsigned int count);
|
||||
void toLowerCase(void);
|
||||
void toUpperCase(void);
|
||||
void trim(void);
|
||||
|
||||
// parsing/conversion
|
||||
long toInt(void) const;
|
||||
float toFloat(void) const;
|
||||
double toDouble(void) const;
|
||||
|
||||
protected:
|
||||
char *buffer; // the actual char array
|
||||
unsigned int capacity; // the array length minus one (for the '\0')
|
||||
unsigned int len; // the String length (not counting the '\0')
|
||||
|
||||
void init(void);
|
||||
void invalidate(void);
|
||||
unsigned char changeBuffer(unsigned int maxStrLen);
|
||||
unsigned char concat(const char *cstr, unsigned int length);
|
||||
|
||||
// copy and move
|
||||
String ©(const char *cstr, unsigned int length);
|
||||
String ©(const __FlashStringHelper *pstr, unsigned int length);
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
void move(String &rhs);
|
||||
#endif
|
||||
};
|
||||
|
||||
class StringSumHelper : public String {
|
||||
public:
|
||||
StringSumHelper(const String &s) : String(s) {}
|
||||
StringSumHelper(const char *p) : String(p) {}
|
||||
StringSumHelper(char c) : String(c) {}
|
||||
StringSumHelper(unsigned char num) : String(num) {}
|
||||
StringSumHelper(int num) : String(num) {}
|
||||
StringSumHelper(unsigned int num) : String(num) {}
|
||||
StringSumHelper(long num) : String(num) {}
|
||||
StringSumHelper(unsigned long num) : String(num) {}
|
||||
StringSumHelper(float num) : String(num) {}
|
||||
StringSumHelper(double num) : String(num) {}
|
||||
};
|
||||
|
||||
#endif // __cplusplus
|
||||
552
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Binary.h
vendored
Normal file
552
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Binary.h
vendored
Normal file
@ -0,0 +1,552 @@
|
||||
/*
|
||||
binary.h - Definitions for binary constants
|
||||
Deprecated -- use 0b binary literals instead
|
||||
Copyright (c) 2006 David A. Mellis. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef Binary_h
|
||||
#define Binary_h
|
||||
|
||||
/* If supported, 0b binary literals are preferable to these constants.
|
||||
* In that case, warn the user about these being deprecated (if possible). */
|
||||
#if __cplusplus >= 201402L
|
||||
/* C++14 introduces binary literals; C++11 introduces [[deprecated()]] */
|
||||
#define DEPRECATED(x) [[deprecated("use " #x " instead")]]
|
||||
#elif __GNUC__ >= 6
|
||||
/*GCC 4.3 supports binary literals; GCC 6 supports __deprecated__ on enums*/
|
||||
#define DEPRECATED(x) __attribute__ ((__deprecated__ ("use " #x " instead")))
|
||||
#else
|
||||
/* binary literals not supported, or "deprecated" warning not displayable */
|
||||
#define DEPRECATED(x)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
B0 DEPRECATED(0b0 ) = 0,
|
||||
B00 DEPRECATED(0b00 ) = 0,
|
||||
B000 DEPRECATED(0b000 ) = 0,
|
||||
B0000 DEPRECATED(0b0000 ) = 0,
|
||||
B00000 DEPRECATED(0b00000 ) = 0,
|
||||
B000000 DEPRECATED(0b000000 ) = 0,
|
||||
B0000000 DEPRECATED(0b0000000 ) = 0,
|
||||
B00000000 DEPRECATED(0b00000000) = 0,
|
||||
B1 DEPRECATED(0b1 ) = 1,
|
||||
B01 DEPRECATED(0b01 ) = 1,
|
||||
B001 DEPRECATED(0b001 ) = 1,
|
||||
B0001 DEPRECATED(0b0001 ) = 1,
|
||||
B00001 DEPRECATED(0b00001 ) = 1,
|
||||
B000001 DEPRECATED(0b000001 ) = 1,
|
||||
B0000001 DEPRECATED(0b0000001 ) = 1,
|
||||
B00000001 DEPRECATED(0b00000001) = 1,
|
||||
B10 DEPRECATED(0b10 ) = 2,
|
||||
B010 DEPRECATED(0b010 ) = 2,
|
||||
B0010 DEPRECATED(0b0010 ) = 2,
|
||||
B00010 DEPRECATED(0b00010 ) = 2,
|
||||
B000010 DEPRECATED(0b000010 ) = 2,
|
||||
B0000010 DEPRECATED(0b0000010 ) = 2,
|
||||
B00000010 DEPRECATED(0b00000010) = 2,
|
||||
B11 DEPRECATED(0b11 ) = 3,
|
||||
B011 DEPRECATED(0b011 ) = 3,
|
||||
B0011 DEPRECATED(0b0011 ) = 3,
|
||||
B00011 DEPRECATED(0b00011 ) = 3,
|
||||
B000011 DEPRECATED(0b000011 ) = 3,
|
||||
B0000011 DEPRECATED(0b0000011 ) = 3,
|
||||
B00000011 DEPRECATED(0b00000011) = 3,
|
||||
B100 DEPRECATED(0b100 ) = 4,
|
||||
B0100 DEPRECATED(0b0100 ) = 4,
|
||||
B00100 DEPRECATED(0b00100 ) = 4,
|
||||
B000100 DEPRECATED(0b000100 ) = 4,
|
||||
B0000100 DEPRECATED(0b0000100 ) = 4,
|
||||
B00000100 DEPRECATED(0b00000100) = 4,
|
||||
B101 DEPRECATED(0b101 ) = 5,
|
||||
B0101 DEPRECATED(0b0101 ) = 5,
|
||||
B00101 DEPRECATED(0b00101 ) = 5,
|
||||
B000101 DEPRECATED(0b000101 ) = 5,
|
||||
B0000101 DEPRECATED(0b0000101 ) = 5,
|
||||
B00000101 DEPRECATED(0b00000101) = 5,
|
||||
B110 DEPRECATED(0b110 ) = 6,
|
||||
B0110 DEPRECATED(0b0110 ) = 6,
|
||||
B00110 DEPRECATED(0b00110 ) = 6,
|
||||
B000110 DEPRECATED(0b000110 ) = 6,
|
||||
B0000110 DEPRECATED(0b0000110 ) = 6,
|
||||
B00000110 DEPRECATED(0b00000110) = 6,
|
||||
B111 DEPRECATED(0b111 ) = 7,
|
||||
B0111 DEPRECATED(0b0111 ) = 7,
|
||||
B00111 DEPRECATED(0b00111 ) = 7,
|
||||
B000111 DEPRECATED(0b000111 ) = 7,
|
||||
B0000111 DEPRECATED(0b0000111 ) = 7,
|
||||
B00000111 DEPRECATED(0b00000111) = 7,
|
||||
B1000 DEPRECATED(0b1000 ) = 8,
|
||||
B01000 DEPRECATED(0b01000 ) = 8,
|
||||
B001000 DEPRECATED(0b001000 ) = 8,
|
||||
B0001000 DEPRECATED(0b0001000 ) = 8,
|
||||
B00001000 DEPRECATED(0b00001000) = 8,
|
||||
B1001 DEPRECATED(0b1001 ) = 9,
|
||||
B01001 DEPRECATED(0b01001 ) = 9,
|
||||
B001001 DEPRECATED(0b001001 ) = 9,
|
||||
B0001001 DEPRECATED(0b0001001 ) = 9,
|
||||
B00001001 DEPRECATED(0b00001001) = 9,
|
||||
B1010 DEPRECATED(0b1010 ) = 10,
|
||||
B01010 DEPRECATED(0b01010 ) = 10,
|
||||
B001010 DEPRECATED(0b001010 ) = 10,
|
||||
B0001010 DEPRECATED(0b0001010 ) = 10,
|
||||
B00001010 DEPRECATED(0b00001010) = 10,
|
||||
B1011 DEPRECATED(0b1011 ) = 11,
|
||||
B01011 DEPRECATED(0b01011 ) = 11,
|
||||
B001011 DEPRECATED(0b001011 ) = 11,
|
||||
B0001011 DEPRECATED(0b0001011 ) = 11,
|
||||
B00001011 DEPRECATED(0b00001011) = 11,
|
||||
B1100 DEPRECATED(0b1100 ) = 12,
|
||||
B01100 DEPRECATED(0b01100 ) = 12,
|
||||
B001100 DEPRECATED(0b001100 ) = 12,
|
||||
B0001100 DEPRECATED(0b0001100 ) = 12,
|
||||
B00001100 DEPRECATED(0b00001100) = 12,
|
||||
B1101 DEPRECATED(0b1101 ) = 13,
|
||||
B01101 DEPRECATED(0b01101 ) = 13,
|
||||
B001101 DEPRECATED(0b001101 ) = 13,
|
||||
B0001101 DEPRECATED(0b0001101 ) = 13,
|
||||
B00001101 DEPRECATED(0b00001101) = 13,
|
||||
B1110 DEPRECATED(0b1110 ) = 14,
|
||||
B01110 DEPRECATED(0b01110 ) = 14,
|
||||
B001110 DEPRECATED(0b001110 ) = 14,
|
||||
B0001110 DEPRECATED(0b0001110 ) = 14,
|
||||
B00001110 DEPRECATED(0b00001110) = 14,
|
||||
B1111 DEPRECATED(0b1111 ) = 15,
|
||||
B01111 DEPRECATED(0b01111 ) = 15,
|
||||
B001111 DEPRECATED(0b001111 ) = 15,
|
||||
B0001111 DEPRECATED(0b0001111 ) = 15,
|
||||
B00001111 DEPRECATED(0b00001111) = 15,
|
||||
B10000 DEPRECATED(0b10000 ) = 16,
|
||||
B010000 DEPRECATED(0b010000 ) = 16,
|
||||
B0010000 DEPRECATED(0b0010000 ) = 16,
|
||||
B00010000 DEPRECATED(0b00010000) = 16,
|
||||
B10001 DEPRECATED(0b10001 ) = 17,
|
||||
B010001 DEPRECATED(0b010001 ) = 17,
|
||||
B0010001 DEPRECATED(0b0010001 ) = 17,
|
||||
B00010001 DEPRECATED(0b00010001) = 17,
|
||||
B10010 DEPRECATED(0b10010 ) = 18,
|
||||
B010010 DEPRECATED(0b010010 ) = 18,
|
||||
B0010010 DEPRECATED(0b0010010 ) = 18,
|
||||
B00010010 DEPRECATED(0b00010010) = 18,
|
||||
B10011 DEPRECATED(0b10011 ) = 19,
|
||||
B010011 DEPRECATED(0b010011 ) = 19,
|
||||
B0010011 DEPRECATED(0b0010011 ) = 19,
|
||||
B00010011 DEPRECATED(0b00010011) = 19,
|
||||
B10100 DEPRECATED(0b10100 ) = 20,
|
||||
B010100 DEPRECATED(0b010100 ) = 20,
|
||||
B0010100 DEPRECATED(0b0010100 ) = 20,
|
||||
B00010100 DEPRECATED(0b00010100) = 20,
|
||||
B10101 DEPRECATED(0b10101 ) = 21,
|
||||
B010101 DEPRECATED(0b010101 ) = 21,
|
||||
B0010101 DEPRECATED(0b0010101 ) = 21,
|
||||
B00010101 DEPRECATED(0b00010101) = 21,
|
||||
B10110 DEPRECATED(0b10110 ) = 22,
|
||||
B010110 DEPRECATED(0b010110 ) = 22,
|
||||
B0010110 DEPRECATED(0b0010110 ) = 22,
|
||||
B00010110 DEPRECATED(0b00010110) = 22,
|
||||
B10111 DEPRECATED(0b10111 ) = 23,
|
||||
B010111 DEPRECATED(0b010111 ) = 23,
|
||||
B0010111 DEPRECATED(0b0010111 ) = 23,
|
||||
B00010111 DEPRECATED(0b00010111) = 23,
|
||||
B11000 DEPRECATED(0b11000 ) = 24,
|
||||
B011000 DEPRECATED(0b011000 ) = 24,
|
||||
B0011000 DEPRECATED(0b0011000 ) = 24,
|
||||
B00011000 DEPRECATED(0b00011000) = 24,
|
||||
B11001 DEPRECATED(0b11001 ) = 25,
|
||||
B011001 DEPRECATED(0b011001 ) = 25,
|
||||
B0011001 DEPRECATED(0b0011001 ) = 25,
|
||||
B00011001 DEPRECATED(0b00011001) = 25,
|
||||
B11010 DEPRECATED(0b11010 ) = 26,
|
||||
B011010 DEPRECATED(0b011010 ) = 26,
|
||||
B0011010 DEPRECATED(0b0011010 ) = 26,
|
||||
B00011010 DEPRECATED(0b00011010) = 26,
|
||||
B11011 DEPRECATED(0b11011 ) = 27,
|
||||
B011011 DEPRECATED(0b011011 ) = 27,
|
||||
B0011011 DEPRECATED(0b0011011 ) = 27,
|
||||
B00011011 DEPRECATED(0b00011011) = 27,
|
||||
B11100 DEPRECATED(0b11100 ) = 28,
|
||||
B011100 DEPRECATED(0b011100 ) = 28,
|
||||
B0011100 DEPRECATED(0b0011100 ) = 28,
|
||||
B00011100 DEPRECATED(0b00011100) = 28,
|
||||
B11101 DEPRECATED(0b11101 ) = 29,
|
||||
B011101 DEPRECATED(0b011101 ) = 29,
|
||||
B0011101 DEPRECATED(0b0011101 ) = 29,
|
||||
B00011101 DEPRECATED(0b00011101) = 29,
|
||||
B11110 DEPRECATED(0b11110 ) = 30,
|
||||
B011110 DEPRECATED(0b011110 ) = 30,
|
||||
B0011110 DEPRECATED(0b0011110 ) = 30,
|
||||
B00011110 DEPRECATED(0b00011110) = 30,
|
||||
B11111 DEPRECATED(0b11111 ) = 31,
|
||||
B011111 DEPRECATED(0b011111 ) = 31,
|
||||
B0011111 DEPRECATED(0b0011111 ) = 31,
|
||||
B00011111 DEPRECATED(0b00011111) = 31,
|
||||
B100000 DEPRECATED(0b100000 ) = 32,
|
||||
B0100000 DEPRECATED(0b0100000 ) = 32,
|
||||
B00100000 DEPRECATED(0b00100000) = 32,
|
||||
B100001 DEPRECATED(0b100001 ) = 33,
|
||||
B0100001 DEPRECATED(0b0100001 ) = 33,
|
||||
B00100001 DEPRECATED(0b00100001) = 33,
|
||||
B100010 DEPRECATED(0b100010 ) = 34,
|
||||
B0100010 DEPRECATED(0b0100010 ) = 34,
|
||||
B00100010 DEPRECATED(0b00100010) = 34,
|
||||
B100011 DEPRECATED(0b100011 ) = 35,
|
||||
B0100011 DEPRECATED(0b0100011 ) = 35,
|
||||
B00100011 DEPRECATED(0b00100011) = 35,
|
||||
B100100 DEPRECATED(0b100100 ) = 36,
|
||||
B0100100 DEPRECATED(0b0100100 ) = 36,
|
||||
B00100100 DEPRECATED(0b00100100) = 36,
|
||||
B100101 DEPRECATED(0b100101 ) = 37,
|
||||
B0100101 DEPRECATED(0b0100101 ) = 37,
|
||||
B00100101 DEPRECATED(0b00100101) = 37,
|
||||
B100110 DEPRECATED(0b100110 ) = 38,
|
||||
B0100110 DEPRECATED(0b0100110 ) = 38,
|
||||
B00100110 DEPRECATED(0b00100110) = 38,
|
||||
B100111 DEPRECATED(0b100111 ) = 39,
|
||||
B0100111 DEPRECATED(0b0100111 ) = 39,
|
||||
B00100111 DEPRECATED(0b00100111) = 39,
|
||||
B101000 DEPRECATED(0b101000 ) = 40,
|
||||
B0101000 DEPRECATED(0b0101000 ) = 40,
|
||||
B00101000 DEPRECATED(0b00101000) = 40,
|
||||
B101001 DEPRECATED(0b101001 ) = 41,
|
||||
B0101001 DEPRECATED(0b0101001 ) = 41,
|
||||
B00101001 DEPRECATED(0b00101001) = 41,
|
||||
B101010 DEPRECATED(0b101010 ) = 42,
|
||||
B0101010 DEPRECATED(0b0101010 ) = 42,
|
||||
B00101010 DEPRECATED(0b00101010) = 42,
|
||||
B101011 DEPRECATED(0b101011 ) = 43,
|
||||
B0101011 DEPRECATED(0b0101011 ) = 43,
|
||||
B00101011 DEPRECATED(0b00101011) = 43,
|
||||
B101100 DEPRECATED(0b101100 ) = 44,
|
||||
B0101100 DEPRECATED(0b0101100 ) = 44,
|
||||
B00101100 DEPRECATED(0b00101100) = 44,
|
||||
B101101 DEPRECATED(0b101101 ) = 45,
|
||||
B0101101 DEPRECATED(0b0101101 ) = 45,
|
||||
B00101101 DEPRECATED(0b00101101) = 45,
|
||||
B101110 DEPRECATED(0b101110 ) = 46,
|
||||
B0101110 DEPRECATED(0b0101110 ) = 46,
|
||||
B00101110 DEPRECATED(0b00101110) = 46,
|
||||
B101111 DEPRECATED(0b101111 ) = 47,
|
||||
B0101111 DEPRECATED(0b0101111 ) = 47,
|
||||
B00101111 DEPRECATED(0b00101111) = 47,
|
||||
B110000 DEPRECATED(0b110000 ) = 48,
|
||||
B0110000 DEPRECATED(0b0110000 ) = 48,
|
||||
B00110000 DEPRECATED(0b00110000) = 48,
|
||||
B110001 DEPRECATED(0b110001 ) = 49,
|
||||
B0110001 DEPRECATED(0b0110001 ) = 49,
|
||||
B00110001 DEPRECATED(0b00110001) = 49,
|
||||
B110010 DEPRECATED(0b110010 ) = 50,
|
||||
B0110010 DEPRECATED(0b0110010 ) = 50,
|
||||
B00110010 DEPRECATED(0b00110010) = 50,
|
||||
B110011 DEPRECATED(0b110011 ) = 51,
|
||||
B0110011 DEPRECATED(0b0110011 ) = 51,
|
||||
B00110011 DEPRECATED(0b00110011) = 51,
|
||||
B110100 DEPRECATED(0b110100 ) = 52,
|
||||
B0110100 DEPRECATED(0b0110100 ) = 52,
|
||||
B00110100 DEPRECATED(0b00110100) = 52,
|
||||
B110101 DEPRECATED(0b110101 ) = 53,
|
||||
B0110101 DEPRECATED(0b0110101 ) = 53,
|
||||
B00110101 DEPRECATED(0b00110101) = 53,
|
||||
B110110 DEPRECATED(0b110110 ) = 54,
|
||||
B0110110 DEPRECATED(0b0110110 ) = 54,
|
||||
B00110110 DEPRECATED(0b00110110) = 54,
|
||||
B110111 DEPRECATED(0b110111 ) = 55,
|
||||
B0110111 DEPRECATED(0b0110111 ) = 55,
|
||||
B00110111 DEPRECATED(0b00110111) = 55,
|
||||
B111000 DEPRECATED(0b111000 ) = 56,
|
||||
B0111000 DEPRECATED(0b0111000 ) = 56,
|
||||
B00111000 DEPRECATED(0b00111000) = 56,
|
||||
B111001 DEPRECATED(0b111001 ) = 57,
|
||||
B0111001 DEPRECATED(0b0111001 ) = 57,
|
||||
B00111001 DEPRECATED(0b00111001) = 57,
|
||||
B111010 DEPRECATED(0b111010 ) = 58,
|
||||
B0111010 DEPRECATED(0b0111010 ) = 58,
|
||||
B00111010 DEPRECATED(0b00111010) = 58,
|
||||
B111011 DEPRECATED(0b111011 ) = 59,
|
||||
B0111011 DEPRECATED(0b0111011 ) = 59,
|
||||
B00111011 DEPRECATED(0b00111011) = 59,
|
||||
B111100 DEPRECATED(0b111100 ) = 60,
|
||||
B0111100 DEPRECATED(0b0111100 ) = 60,
|
||||
B00111100 DEPRECATED(0b00111100) = 60,
|
||||
B111101 DEPRECATED(0b111101 ) = 61,
|
||||
B0111101 DEPRECATED(0b0111101 ) = 61,
|
||||
B00111101 DEPRECATED(0b00111101) = 61,
|
||||
B111110 DEPRECATED(0b111110 ) = 62,
|
||||
B0111110 DEPRECATED(0b0111110 ) = 62,
|
||||
B00111110 DEPRECATED(0b00111110) = 62,
|
||||
B111111 DEPRECATED(0b111111 ) = 63,
|
||||
B0111111 DEPRECATED(0b0111111 ) = 63,
|
||||
B00111111 DEPRECATED(0b00111111) = 63,
|
||||
B1000000 DEPRECATED(0b1000000 ) = 64,
|
||||
B01000000 DEPRECATED(0b01000000) = 64,
|
||||
B1000001 DEPRECATED(0b1000001 ) = 65,
|
||||
B01000001 DEPRECATED(0b01000001) = 65,
|
||||
B1000010 DEPRECATED(0b1000010 ) = 66,
|
||||
B01000010 DEPRECATED(0b01000010) = 66,
|
||||
B1000011 DEPRECATED(0b1000011 ) = 67,
|
||||
B01000011 DEPRECATED(0b01000011) = 67,
|
||||
B1000100 DEPRECATED(0b1000100 ) = 68,
|
||||
B01000100 DEPRECATED(0b01000100) = 68,
|
||||
B1000101 DEPRECATED(0b1000101 ) = 69,
|
||||
B01000101 DEPRECATED(0b01000101) = 69,
|
||||
B1000110 DEPRECATED(0b1000110 ) = 70,
|
||||
B01000110 DEPRECATED(0b01000110) = 70,
|
||||
B1000111 DEPRECATED(0b1000111 ) = 71,
|
||||
B01000111 DEPRECATED(0b01000111) = 71,
|
||||
B1001000 DEPRECATED(0b1001000 ) = 72,
|
||||
B01001000 DEPRECATED(0b01001000) = 72,
|
||||
B1001001 DEPRECATED(0b1001001 ) = 73,
|
||||
B01001001 DEPRECATED(0b01001001) = 73,
|
||||
B1001010 DEPRECATED(0b1001010 ) = 74,
|
||||
B01001010 DEPRECATED(0b01001010) = 74,
|
||||
B1001011 DEPRECATED(0b1001011 ) = 75,
|
||||
B01001011 DEPRECATED(0b01001011) = 75,
|
||||
B1001100 DEPRECATED(0b1001100 ) = 76,
|
||||
B01001100 DEPRECATED(0b01001100) = 76,
|
||||
B1001101 DEPRECATED(0b1001101 ) = 77,
|
||||
B01001101 DEPRECATED(0b01001101) = 77,
|
||||
B1001110 DEPRECATED(0b1001110 ) = 78,
|
||||
B01001110 DEPRECATED(0b01001110) = 78,
|
||||
B1001111 DEPRECATED(0b1001111 ) = 79,
|
||||
B01001111 DEPRECATED(0b01001111) = 79,
|
||||
B1010000 DEPRECATED(0b1010000 ) = 80,
|
||||
B01010000 DEPRECATED(0b01010000) = 80,
|
||||
B1010001 DEPRECATED(0b1010001 ) = 81,
|
||||
B01010001 DEPRECATED(0b01010001) = 81,
|
||||
B1010010 DEPRECATED(0b1010010 ) = 82,
|
||||
B01010010 DEPRECATED(0b01010010) = 82,
|
||||
B1010011 DEPRECATED(0b1010011 ) = 83,
|
||||
B01010011 DEPRECATED(0b01010011) = 83,
|
||||
B1010100 DEPRECATED(0b1010100 ) = 84,
|
||||
B01010100 DEPRECATED(0b01010100) = 84,
|
||||
B1010101 DEPRECATED(0b1010101 ) = 85,
|
||||
B01010101 DEPRECATED(0b01010101) = 85,
|
||||
B1010110 DEPRECATED(0b1010110 ) = 86,
|
||||
B01010110 DEPRECATED(0b01010110) = 86,
|
||||
B1010111 DEPRECATED(0b1010111 ) = 87,
|
||||
B01010111 DEPRECATED(0b01010111) = 87,
|
||||
B1011000 DEPRECATED(0b1011000 ) = 88,
|
||||
B01011000 DEPRECATED(0b01011000) = 88,
|
||||
B1011001 DEPRECATED(0b1011001 ) = 89,
|
||||
B01011001 DEPRECATED(0b01011001) = 89,
|
||||
B1011010 DEPRECATED(0b1011010 ) = 90,
|
||||
B01011010 DEPRECATED(0b01011010) = 90,
|
||||
B1011011 DEPRECATED(0b1011011 ) = 91,
|
||||
B01011011 DEPRECATED(0b01011011) = 91,
|
||||
B1011100 DEPRECATED(0b1011100 ) = 92,
|
||||
B01011100 DEPRECATED(0b01011100) = 92,
|
||||
B1011101 DEPRECATED(0b1011101 ) = 93,
|
||||
B01011101 DEPRECATED(0b01011101) = 93,
|
||||
B1011110 DEPRECATED(0b1011110 ) = 94,
|
||||
B01011110 DEPRECATED(0b01011110) = 94,
|
||||
B1011111 DEPRECATED(0b1011111 ) = 95,
|
||||
B01011111 DEPRECATED(0b01011111) = 95,
|
||||
B1100000 DEPRECATED(0b1100000 ) = 96,
|
||||
B01100000 DEPRECATED(0b01100000) = 96,
|
||||
B1100001 DEPRECATED(0b1100001 ) = 97,
|
||||
B01100001 DEPRECATED(0b01100001) = 97,
|
||||
B1100010 DEPRECATED(0b1100010 ) = 98,
|
||||
B01100010 DEPRECATED(0b01100010) = 98,
|
||||
B1100011 DEPRECATED(0b1100011 ) = 99,
|
||||
B01100011 DEPRECATED(0b01100011) = 99,
|
||||
B1100100 DEPRECATED(0b1100100 ) = 100,
|
||||
B01100100 DEPRECATED(0b01100100) = 100,
|
||||
B1100101 DEPRECATED(0b1100101 ) = 101,
|
||||
B01100101 DEPRECATED(0b01100101) = 101,
|
||||
B1100110 DEPRECATED(0b1100110 ) = 102,
|
||||
B01100110 DEPRECATED(0b01100110) = 102,
|
||||
B1100111 DEPRECATED(0b1100111 ) = 103,
|
||||
B01100111 DEPRECATED(0b01100111) = 103,
|
||||
B1101000 DEPRECATED(0b1101000 ) = 104,
|
||||
B01101000 DEPRECATED(0b01101000) = 104,
|
||||
B1101001 DEPRECATED(0b1101001 ) = 105,
|
||||
B01101001 DEPRECATED(0b01101001) = 105,
|
||||
B1101010 DEPRECATED(0b1101010 ) = 106,
|
||||
B01101010 DEPRECATED(0b01101010) = 106,
|
||||
B1101011 DEPRECATED(0b1101011 ) = 107,
|
||||
B01101011 DEPRECATED(0b01101011) = 107,
|
||||
B1101100 DEPRECATED(0b1101100 ) = 108,
|
||||
B01101100 DEPRECATED(0b01101100) = 108,
|
||||
B1101101 DEPRECATED(0b1101101 ) = 109,
|
||||
B01101101 DEPRECATED(0b01101101) = 109,
|
||||
B1101110 DEPRECATED(0b1101110 ) = 110,
|
||||
B01101110 DEPRECATED(0b01101110) = 110,
|
||||
B1101111 DEPRECATED(0b1101111 ) = 111,
|
||||
B01101111 DEPRECATED(0b01101111) = 111,
|
||||
B1110000 DEPRECATED(0b1110000 ) = 112,
|
||||
B01110000 DEPRECATED(0b01110000) = 112,
|
||||
B1110001 DEPRECATED(0b1110001 ) = 113,
|
||||
B01110001 DEPRECATED(0b01110001) = 113,
|
||||
B1110010 DEPRECATED(0b1110010 ) = 114,
|
||||
B01110010 DEPRECATED(0b01110010) = 114,
|
||||
B1110011 DEPRECATED(0b1110011 ) = 115,
|
||||
B01110011 DEPRECATED(0b01110011) = 115,
|
||||
B1110100 DEPRECATED(0b1110100 ) = 116,
|
||||
B01110100 DEPRECATED(0b01110100) = 116,
|
||||
B1110101 DEPRECATED(0b1110101 ) = 117,
|
||||
B01110101 DEPRECATED(0b01110101) = 117,
|
||||
B1110110 DEPRECATED(0b1110110 ) = 118,
|
||||
B01110110 DEPRECATED(0b01110110) = 118,
|
||||
B1110111 DEPRECATED(0b1110111 ) = 119,
|
||||
B01110111 DEPRECATED(0b01110111) = 119,
|
||||
B1111000 DEPRECATED(0b1111000 ) = 120,
|
||||
B01111000 DEPRECATED(0b01111000) = 120,
|
||||
B1111001 DEPRECATED(0b1111001 ) = 121,
|
||||
B01111001 DEPRECATED(0b01111001) = 121,
|
||||
B1111010 DEPRECATED(0b1111010 ) = 122,
|
||||
B01111010 DEPRECATED(0b01111010) = 122,
|
||||
B1111011 DEPRECATED(0b1111011 ) = 123,
|
||||
B01111011 DEPRECATED(0b01111011) = 123,
|
||||
B1111100 DEPRECATED(0b1111100 ) = 124,
|
||||
B01111100 DEPRECATED(0b01111100) = 124,
|
||||
B1111101 DEPRECATED(0b1111101 ) = 125,
|
||||
B01111101 DEPRECATED(0b01111101) = 125,
|
||||
B1111110 DEPRECATED(0b1111110 ) = 126,
|
||||
B01111110 DEPRECATED(0b01111110) = 126,
|
||||
B1111111 DEPRECATED(0b1111111 ) = 127,
|
||||
B01111111 DEPRECATED(0b01111111) = 127,
|
||||
B10000000 DEPRECATED(0b10000000) = 128,
|
||||
B10000001 DEPRECATED(0b10000001) = 129,
|
||||
B10000010 DEPRECATED(0b10000010) = 130,
|
||||
B10000011 DEPRECATED(0b10000011) = 131,
|
||||
B10000100 DEPRECATED(0b10000100) = 132,
|
||||
B10000101 DEPRECATED(0b10000101) = 133,
|
||||
B10000110 DEPRECATED(0b10000110) = 134,
|
||||
B10000111 DEPRECATED(0b10000111) = 135,
|
||||
B10001000 DEPRECATED(0b10001000) = 136,
|
||||
B10001001 DEPRECATED(0b10001001) = 137,
|
||||
B10001010 DEPRECATED(0b10001010) = 138,
|
||||
B10001011 DEPRECATED(0b10001011) = 139,
|
||||
B10001100 DEPRECATED(0b10001100) = 140,
|
||||
B10001101 DEPRECATED(0b10001101) = 141,
|
||||
B10001110 DEPRECATED(0b10001110) = 142,
|
||||
B10001111 DEPRECATED(0b10001111) = 143,
|
||||
B10010000 DEPRECATED(0b10010000) = 144,
|
||||
B10010001 DEPRECATED(0b10010001) = 145,
|
||||
B10010010 DEPRECATED(0b10010010) = 146,
|
||||
B10010011 DEPRECATED(0b10010011) = 147,
|
||||
B10010100 DEPRECATED(0b10010100) = 148,
|
||||
B10010101 DEPRECATED(0b10010101) = 149,
|
||||
B10010110 DEPRECATED(0b10010110) = 150,
|
||||
B10010111 DEPRECATED(0b10010111) = 151,
|
||||
B10011000 DEPRECATED(0b10011000) = 152,
|
||||
B10011001 DEPRECATED(0b10011001) = 153,
|
||||
B10011010 DEPRECATED(0b10011010) = 154,
|
||||
B10011011 DEPRECATED(0b10011011) = 155,
|
||||
B10011100 DEPRECATED(0b10011100) = 156,
|
||||
B10011101 DEPRECATED(0b10011101) = 157,
|
||||
B10011110 DEPRECATED(0b10011110) = 158,
|
||||
B10011111 DEPRECATED(0b10011111) = 159,
|
||||
B10100000 DEPRECATED(0b10100000) = 160,
|
||||
B10100001 DEPRECATED(0b10100001) = 161,
|
||||
B10100010 DEPRECATED(0b10100010) = 162,
|
||||
B10100011 DEPRECATED(0b10100011) = 163,
|
||||
B10100100 DEPRECATED(0b10100100) = 164,
|
||||
B10100101 DEPRECATED(0b10100101) = 165,
|
||||
B10100110 DEPRECATED(0b10100110) = 166,
|
||||
B10100111 DEPRECATED(0b10100111) = 167,
|
||||
B10101000 DEPRECATED(0b10101000) = 168,
|
||||
B10101001 DEPRECATED(0b10101001) = 169,
|
||||
B10101010 DEPRECATED(0b10101010) = 170,
|
||||
B10101011 DEPRECATED(0b10101011) = 171,
|
||||
B10101100 DEPRECATED(0b10101100) = 172,
|
||||
B10101101 DEPRECATED(0b10101101) = 173,
|
||||
B10101110 DEPRECATED(0b10101110) = 174,
|
||||
B10101111 DEPRECATED(0b10101111) = 175,
|
||||
B10110000 DEPRECATED(0b10110000) = 176,
|
||||
B10110001 DEPRECATED(0b10110001) = 177,
|
||||
B10110010 DEPRECATED(0b10110010) = 178,
|
||||
B10110011 DEPRECATED(0b10110011) = 179,
|
||||
B10110100 DEPRECATED(0b10110100) = 180,
|
||||
B10110101 DEPRECATED(0b10110101) = 181,
|
||||
B10110110 DEPRECATED(0b10110110) = 182,
|
||||
B10110111 DEPRECATED(0b10110111) = 183,
|
||||
B10111000 DEPRECATED(0b10111000) = 184,
|
||||
B10111001 DEPRECATED(0b10111001) = 185,
|
||||
B10111010 DEPRECATED(0b10111010) = 186,
|
||||
B10111011 DEPRECATED(0b10111011) = 187,
|
||||
B10111100 DEPRECATED(0b10111100) = 188,
|
||||
B10111101 DEPRECATED(0b10111101) = 189,
|
||||
B10111110 DEPRECATED(0b10111110) = 190,
|
||||
B10111111 DEPRECATED(0b10111111) = 191,
|
||||
B11000000 DEPRECATED(0b11000000) = 192,
|
||||
B11000001 DEPRECATED(0b11000001) = 193,
|
||||
B11000010 DEPRECATED(0b11000010) = 194,
|
||||
B11000011 DEPRECATED(0b11000011) = 195,
|
||||
B11000100 DEPRECATED(0b11000100) = 196,
|
||||
B11000101 DEPRECATED(0b11000101) = 197,
|
||||
B11000110 DEPRECATED(0b11000110) = 198,
|
||||
B11000111 DEPRECATED(0b11000111) = 199,
|
||||
B11001000 DEPRECATED(0b11001000) = 200,
|
||||
B11001001 DEPRECATED(0b11001001) = 201,
|
||||
B11001010 DEPRECATED(0b11001010) = 202,
|
||||
B11001011 DEPRECATED(0b11001011) = 203,
|
||||
B11001100 DEPRECATED(0b11001100) = 204,
|
||||
B11001101 DEPRECATED(0b11001101) = 205,
|
||||
B11001110 DEPRECATED(0b11001110) = 206,
|
||||
B11001111 DEPRECATED(0b11001111) = 207,
|
||||
B11010000 DEPRECATED(0b11010000) = 208,
|
||||
B11010001 DEPRECATED(0b11010001) = 209,
|
||||
B11010010 DEPRECATED(0b11010010) = 210,
|
||||
B11010011 DEPRECATED(0b11010011) = 211,
|
||||
B11010100 DEPRECATED(0b11010100) = 212,
|
||||
B11010101 DEPRECATED(0b11010101) = 213,
|
||||
B11010110 DEPRECATED(0b11010110) = 214,
|
||||
B11010111 DEPRECATED(0b11010111) = 215,
|
||||
B11011000 DEPRECATED(0b11011000) = 216,
|
||||
B11011001 DEPRECATED(0b11011001) = 217,
|
||||
B11011010 DEPRECATED(0b11011010) = 218,
|
||||
B11011011 DEPRECATED(0b11011011) = 219,
|
||||
B11011100 DEPRECATED(0b11011100) = 220,
|
||||
B11011101 DEPRECATED(0b11011101) = 221,
|
||||
B11011110 DEPRECATED(0b11011110) = 222,
|
||||
B11011111 DEPRECATED(0b11011111) = 223,
|
||||
B11100000 DEPRECATED(0b11100000) = 224,
|
||||
B11100001 DEPRECATED(0b11100001) = 225,
|
||||
B11100010 DEPRECATED(0b11100010) = 226,
|
||||
B11100011 DEPRECATED(0b11100011) = 227,
|
||||
B11100100 DEPRECATED(0b11100100) = 228,
|
||||
B11100101 DEPRECATED(0b11100101) = 229,
|
||||
B11100110 DEPRECATED(0b11100110) = 230,
|
||||
B11100111 DEPRECATED(0b11100111) = 231,
|
||||
B11101000 DEPRECATED(0b11101000) = 232,
|
||||
B11101001 DEPRECATED(0b11101001) = 233,
|
||||
B11101010 DEPRECATED(0b11101010) = 234,
|
||||
B11101011 DEPRECATED(0b11101011) = 235,
|
||||
B11101100 DEPRECATED(0b11101100) = 236,
|
||||
B11101101 DEPRECATED(0b11101101) = 237,
|
||||
B11101110 DEPRECATED(0b11101110) = 238,
|
||||
B11101111 DEPRECATED(0b11101111) = 239,
|
||||
B11110000 DEPRECATED(0b11110000) = 240,
|
||||
B11110001 DEPRECATED(0b11110001) = 241,
|
||||
B11110010 DEPRECATED(0b11110010) = 242,
|
||||
B11110011 DEPRECATED(0b11110011) = 243,
|
||||
B11110100 DEPRECATED(0b11110100) = 244,
|
||||
B11110101 DEPRECATED(0b11110101) = 245,
|
||||
B11110110 DEPRECATED(0b11110110) = 246,
|
||||
B11110111 DEPRECATED(0b11110111) = 247,
|
||||
B11111000 DEPRECATED(0b11111000) = 248,
|
||||
B11111001 DEPRECATED(0b11111001) = 249,
|
||||
B11111010 DEPRECATED(0b11111010) = 250,
|
||||
B11111011 DEPRECATED(0b11111011) = 251,
|
||||
B11111100 DEPRECATED(0b11111100) = 252,
|
||||
B11111101 DEPRECATED(0b11111101) = 253,
|
||||
B11111110 DEPRECATED(0b11111110) = 254,
|
||||
B11111111 DEPRECATED(0b11111111) = 255
|
||||
};
|
||||
|
||||
#undef DEPRECATED
|
||||
|
||||
#endif
|
||||
45
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Client.h
vendored
Normal file
45
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Client.h
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
Client.h - Base class that provides Client
|
||||
Copyright (c) 2011 Adrian McEwen. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stream.h"
|
||||
#include "IPAddress.h"
|
||||
|
||||
class Client : public Stream {
|
||||
|
||||
public:
|
||||
virtual int connect(IPAddress ip, uint16_t port) = 0;
|
||||
virtual int connect(const char *host, uint16_t port) = 0;
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
virtual size_t write(const uint8_t *buf, size_t size) = 0;
|
||||
virtual int available() = 0;
|
||||
virtual int read() = 0;
|
||||
virtual int read(uint8_t *buf, size_t size) = 0;
|
||||
virtual int peek() = 0;
|
||||
virtual void flush() = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual uint8_t connected() = 0;
|
||||
virtual operator bool() = 0;
|
||||
protected:
|
||||
uint8_t *rawIPAddress(IPAddress &addr) {
|
||||
return addr.raw_address();
|
||||
};
|
||||
};
|
||||
|
||||
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Common.cpp
vendored
Normal file
31
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Common.cpp
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright (c) 2019 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
/* C++ prototypes */
|
||||
long map(long x, long in_min, long in_max, long out_min, long out_max) {
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
}
|
||||
|
||||
uint16_t makeWord(uint16_t w) {
|
||||
return w;
|
||||
}
|
||||
uint16_t makeWord(uint8_t h, uint8_t l) {
|
||||
return (h << 8) | l;
|
||||
}
|
||||
227
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Common.h
vendored
Normal file
227
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Common.h
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
/*
|
||||
Copyright (c) 2019 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void yield(void);
|
||||
|
||||
typedef enum {
|
||||
LOW = 0,
|
||||
HIGH = 1,
|
||||
CHANGE = 2,
|
||||
FALLING = 3,
|
||||
RISING = 4,
|
||||
} PinStatus;
|
||||
|
||||
typedef enum {
|
||||
INPUT = 0x0,
|
||||
OUTPUT = 0x1,
|
||||
INPUT_PULLUP = 0x2,
|
||||
} PinMode;
|
||||
|
||||
typedef enum {
|
||||
PWM,
|
||||
CURRENT
|
||||
} AnalogOutMode;
|
||||
|
||||
typedef enum {
|
||||
ADC_RAW,
|
||||
MILLIVOLTS
|
||||
} AnalogInputUnits;
|
||||
|
||||
typedef enum {
|
||||
DAC_RAW,
|
||||
MICROAMPS
|
||||
} AnalogOutputUnits;
|
||||
|
||||
typedef enum {
|
||||
LSBFIRST = 0,
|
||||
MSBFIRST = 1,
|
||||
} BitOrder;
|
||||
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#define HALF_PI 1.5707963267948966192313216916398
|
||||
#define TWO_PI 6.283185307179586476925286766559
|
||||
#define DEG_TO_RAD 0.017453292519943295769236907684886
|
||||
#define RAD_TO_DEG 57.295779513082320876798154814105
|
||||
#define EULER 2.718281828459045235360287471352
|
||||
|
||||
#define SERIAL 0x0
|
||||
#define DISPLAY 0x1
|
||||
|
||||
typedef void (*voidFuncPtr)(void);
|
||||
typedef void (*voidFuncPtrParam)(void *);
|
||||
|
||||
// interrupts() / noInterrupts() must be defined by the core
|
||||
|
||||
#define lowByte(w) ((uint8_t)((w)&0xff))
|
||||
#define highByte(w) ((uint8_t)((w) >> 8))
|
||||
|
||||
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
|
||||
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
|
||||
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
|
||||
#define bitWrite(value, bit, bitvalue) \
|
||||
(bitvalue ? bitSet(value, bit) : bitClear(value, bit))
|
||||
|
||||
#ifndef bit
|
||||
#define bit(b) (1UL << (b))
|
||||
#endif
|
||||
|
||||
typedef bool boolean;
|
||||
typedef uint8_t byte;
|
||||
typedef uint16_t word;
|
||||
typedef uint16_t _iq15_s;
|
||||
|
||||
void init(void);
|
||||
void initVariant(void);
|
||||
|
||||
int atexit(void (*func)()) __attribute__((weak));
|
||||
int main() __attribute__((weak));
|
||||
|
||||
#ifdef EXTENDED_PIN_MODE
|
||||
// Platforms who want to declare more than 256 pins need to define
|
||||
// EXTENDED_PIN_MODE globally
|
||||
typedef uint32_t pin_size_t;
|
||||
#else
|
||||
typedef uint8_t pin_size_t;
|
||||
#endif
|
||||
|
||||
// Define sketch exposed functions
|
||||
// New API definitions for these functions break Arduino's included examples.
|
||||
// Created "overloaded" versions to facilitate this
|
||||
|
||||
// Digital I/O
|
||||
PinStatus digitalRead(pin_size_t pinNumber);
|
||||
void digitalWrite(pin_size_t ulPin, uint32_t ulVal);
|
||||
void pinMode(pin_size_t ulPin, uint32_t ulMode);
|
||||
|
||||
PinStatus digitalReadClearCore(pin_size_t pinNumber);
|
||||
void digitalWriteClearCore(pin_size_t pinNumber, PinStatus status);
|
||||
void pinModeAPI(pin_size_t pinNumber, PinMode ulMode);
|
||||
|
||||
// Analog I/O
|
||||
int analogReadAPI(pin_size_t pinNumber, AnalogInputUnits units);
|
||||
void analogWriteAPI(pin_size_t pinNumber, int value, AnalogOutMode mode,
|
||||
AnalogOutputUnits units);
|
||||
|
||||
// Zero, Due & MKR Family
|
||||
void analogReadResolution(int res);
|
||||
|
||||
// Advanced I/O
|
||||
void noTone(uint8_t _pin);
|
||||
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
|
||||
unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
|
||||
pin_size_t shiftIn(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder);
|
||||
void shiftOut(pin_size_t dataPin, pin_size_t clockPin, BitOrder bitOrder,
|
||||
uint8_t val);
|
||||
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration);
|
||||
void toneVolume(unsigned char outputPin, float volume);
|
||||
void OutputPulsesStop(pin_size_t pin);
|
||||
|
||||
// Time
|
||||
void delay(unsigned long);
|
||||
void delayMicroseconds(unsigned int usec);
|
||||
unsigned long micros(void);
|
||||
unsigned long millis(void);
|
||||
|
||||
// Math
|
||||
#ifndef constrain
|
||||
#define constrain(amt, low, high) \
|
||||
((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt)))
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) \
|
||||
({ __typeof__ (a) _a = (a); \
|
||||
__typeof__ (b) _b = (b); \
|
||||
_a < _b ? _a : _b; })
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a, b) \
|
||||
({ __typeof__ (a) _a = (a); \
|
||||
__typeof__ (b) _b = (b); \
|
||||
_a > _b ? _a : _b; })
|
||||
#endif
|
||||
|
||||
#ifndef sq
|
||||
#define sq(x) ((x) * (x))
|
||||
#endif
|
||||
|
||||
// Trigonometry
|
||||
#ifndef radians
|
||||
#define radians(deg) ((deg) * DEG_TO_RAD)
|
||||
#endif
|
||||
|
||||
#ifndef degrees
|
||||
#define degrees(rad) ((rad) * RAD_TO_DEG)
|
||||
#endif
|
||||
|
||||
// External Interrupts
|
||||
void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback,
|
||||
PinStatus mode);
|
||||
void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback,
|
||||
PinStatus mode, void *param);
|
||||
void detachInterrupt(pin_size_t interruptNumber);
|
||||
|
||||
// Interrupts
|
||||
void interrupts();
|
||||
void noInterrupts();
|
||||
|
||||
// Test Sketch
|
||||
void setup(void);
|
||||
void loop(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/* C++ prototypes */
|
||||
int analogRead(pin_size_t pinNumber, AnalogInputUnits units = ADC_RAW);
|
||||
void analogWrite(pin_size_t pinNumber, uint32_t value,
|
||||
AnalogOutMode mode = PWM, AnalogOutputUnits units = DAC_RAW);
|
||||
|
||||
uint16_t makeWord(uint16_t w);
|
||||
uint16_t makeWord(byte h, byte l);
|
||||
|
||||
#define word(...) makeWord(__VA_ARGS__)
|
||||
|
||||
unsigned long pulseIn(uint8_t pin, uint8_t state,
|
||||
unsigned long timeout = 1000000L); // timeout in microsec
|
||||
unsigned long pulseInLong(uint8_t pin, uint8_t state,
|
||||
unsigned long timeout = 1000000L);
|
||||
|
||||
void OutputPulsesStart(pin_size_t pin, uint32_t onTime, uint32_t offTime,
|
||||
uint16_t pulseCnt = 0, bool blockUntilDone = false);
|
||||
void OutputPulsesStop(pin_size_t pin, bool stopImmediately);
|
||||
|
||||
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
|
||||
// WMath prototypes
|
||||
long random(long);
|
||||
long random(long, long);
|
||||
void randomSeed(unsigned long);
|
||||
long map(long, long, long, long, long);
|
||||
|
||||
#endif // __cplusplus
|
||||
42
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/HardwareI2C.h
vendored
Normal file
42
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/HardwareI2C.h
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "Stream.h"
|
||||
|
||||
class HardwareI2C : public Stream {
|
||||
public:
|
||||
virtual void begin() = 0;
|
||||
virtual void begin(uint8_t address) = 0;
|
||||
virtual void end() = 0;
|
||||
|
||||
virtual void setClock(uint32_t freq) = 0;
|
||||
|
||||
virtual void beginTransmission(uint8_t address) = 0;
|
||||
virtual uint8_t endTransmission(bool stopBit) = 0;
|
||||
virtual uint8_t endTransmission(void) = 0;
|
||||
|
||||
virtual uint8_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
|
||||
virtual uint8_t requestFrom(uint8_t address, size_t len) = 0;
|
||||
|
||||
virtual void onReceive(void(*)(int)) = 0;
|
||||
virtual void onRequest(void(*)(void)) = 0;
|
||||
};
|
||||
|
||||
102
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/HardwareSerial.h
vendored
Normal file
102
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/HardwareSerial.h
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stream.h"
|
||||
|
||||
// XXX: Those constants should be defined as const int / enums?
|
||||
// XXX: shall we use namespaces too?
|
||||
#define SERIAL_PARITY_EVEN (0x1ul)
|
||||
#define SERIAL_PARITY_ODD (0x2ul)
|
||||
#define SERIAL_PARITY_NONE (0x3ul)
|
||||
#define SERIAL_PARITY_MARK (0x4ul)
|
||||
#define SERIAL_PARITY_SPACE (0x5ul)
|
||||
#define SERIAL_PARITY_MASK (0xFul)
|
||||
|
||||
#define SERIAL_STOP_BIT_1 (0x10ul)
|
||||
#define SERIAL_STOP_BIT_1_5 (0x20ul)
|
||||
#define SERIAL_STOP_BIT_2 (0x30ul)
|
||||
#define SERIAL_STOP_BIT_MASK (0xF0ul)
|
||||
|
||||
#define SERIAL_DATA_5 (0x100ul)
|
||||
#define SERIAL_DATA_6 (0x200ul)
|
||||
#define SERIAL_DATA_7 (0x300ul)
|
||||
#define SERIAL_DATA_8 (0x400ul)
|
||||
#define SERIAL_DATA_MASK (0xF00ul)
|
||||
|
||||
#define SERIAL_5N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
|
||||
#define SERIAL_6N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
|
||||
#define SERIAL_7N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
|
||||
#define SERIAL_8N1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_NONE | SERIAL_DATA_8)
|
||||
#define SERIAL_5N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_5)
|
||||
#define SERIAL_6N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_6)
|
||||
#define SERIAL_7N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_7)
|
||||
#define SERIAL_8N2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_NONE | SERIAL_DATA_8)
|
||||
#define SERIAL_5E1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_EVEN | SERIAL_DATA_5)
|
||||
#define SERIAL_6E1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_EVEN | SERIAL_DATA_6)
|
||||
#define SERIAL_7E1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_EVEN | SERIAL_DATA_7)
|
||||
#define SERIAL_8E1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_EVEN | SERIAL_DATA_8)
|
||||
#define SERIAL_5E2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_EVEN | SERIAL_DATA_5)
|
||||
#define SERIAL_6E2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_EVEN | SERIAL_DATA_6)
|
||||
#define SERIAL_7E2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_EVEN | SERIAL_DATA_7)
|
||||
#define SERIAL_8E2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_EVEN | SERIAL_DATA_8)
|
||||
#define SERIAL_5O1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_ODD | SERIAL_DATA_5)
|
||||
#define SERIAL_6O1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_ODD | SERIAL_DATA_6)
|
||||
#define SERIAL_7O1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_ODD | SERIAL_DATA_7)
|
||||
#define SERIAL_8O1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_ODD | SERIAL_DATA_8)
|
||||
#define SERIAL_5O2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_ODD | SERIAL_DATA_5)
|
||||
#define SERIAL_6O2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_ODD | SERIAL_DATA_6)
|
||||
#define SERIAL_7O2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_ODD | SERIAL_DATA_7)
|
||||
#define SERIAL_8O2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_ODD | SERIAL_DATA_8)
|
||||
#define SERIAL_5M1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_MARK | SERIAL_DATA_5)
|
||||
#define SERIAL_6M1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_MARK | SERIAL_DATA_6)
|
||||
#define SERIAL_7M1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_MARK | SERIAL_DATA_7)
|
||||
#define SERIAL_8M1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_MARK | SERIAL_DATA_8)
|
||||
#define SERIAL_5M2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_MARK | SERIAL_DATA_5)
|
||||
#define SERIAL_6M2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_MARK | SERIAL_DATA_6)
|
||||
#define SERIAL_7M2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_MARK | SERIAL_DATA_7)
|
||||
#define SERIAL_8M2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_MARK | SERIAL_DATA_8)
|
||||
#define SERIAL_5S1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_SPACE | SERIAL_DATA_5)
|
||||
#define SERIAL_6S1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_SPACE | SERIAL_DATA_6)
|
||||
#define SERIAL_7S1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_SPACE | SERIAL_DATA_7)
|
||||
#define SERIAL_8S1 (SERIAL_STOP_BIT_1 | SERIAL_PARITY_SPACE | SERIAL_DATA_8)
|
||||
#define SERIAL_5S2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_SPACE | SERIAL_DATA_5)
|
||||
#define SERIAL_6S2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_SPACE | SERIAL_DATA_6)
|
||||
#define SERIAL_7S2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_SPACE | SERIAL_DATA_7)
|
||||
#define SERIAL_8S2 (SERIAL_STOP_BIT_2 | SERIAL_PARITY_SPACE | SERIAL_DATA_8)
|
||||
|
||||
class HardwareSerial : public Stream {
|
||||
public:
|
||||
virtual void begin(unsigned long) = 0;
|
||||
virtual void begin(unsigned long baudrate, uint16_t config) = 0;
|
||||
virtual void end() = 0;
|
||||
virtual int available(void) = 0;
|
||||
virtual int peek(void) = 0;
|
||||
virtual int read(void) = 0;
|
||||
virtual void flush(void) = 0;
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
using Print::write; // pull in write(str) and write(buf, size) from Print
|
||||
virtual operator bool() = 0;
|
||||
};
|
||||
|
||||
extern void serialEventRun(void) __attribute__((weak));
|
||||
extern void serialEvent(void) __attribute__((weak));
|
||||
extern void serialEvent0(void) __attribute__((weak));
|
||||
extern void serialEvent1(void) __attribute__((weak));
|
||||
|
||||
103
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/IPAddress.cpp
vendored
Normal file
103
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/IPAddress.cpp
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
/*
|
||||
IPAddress.cpp - Base class that provides IPAddress
|
||||
Copyright (c) 2011 Adrian McEwen. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "IPAddress.h"
|
||||
#include "Print.h"
|
||||
|
||||
IPAddress::IPAddress() {
|
||||
_address.dword = 0;
|
||||
}
|
||||
|
||||
IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet,
|
||||
uint8_t third_octet, uint8_t fourth_octet) {
|
||||
_address.bytes[0] = first_octet;
|
||||
_address.bytes[1] = second_octet;
|
||||
_address.bytes[2] = third_octet;
|
||||
_address.bytes[3] = fourth_octet;
|
||||
}
|
||||
|
||||
IPAddress::IPAddress(uint32_t address) {
|
||||
_address.dword = address;
|
||||
}
|
||||
|
||||
IPAddress::IPAddress(const uint8_t *address) {
|
||||
memcpy(_address.bytes, address, sizeof(_address.bytes));
|
||||
}
|
||||
|
||||
bool IPAddress::fromString(const char *address) {
|
||||
|
||||
uint16_t acc = 0; // Accumulator
|
||||
uint8_t dots = 0;
|
||||
|
||||
while (*address) {
|
||||
char c = *address++;
|
||||
if (c >= '0' && c <= '9') {
|
||||
acc = acc * 10 + (c - '0');
|
||||
if (acc > 255) {
|
||||
// Value out of [0..255] range
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (c == '.') {
|
||||
if (dots == 3) {
|
||||
// Too much dots (there must be 3 dots)
|
||||
return false;
|
||||
}
|
||||
_address.bytes[dots++] = acc;
|
||||
acc = 0;
|
||||
}
|
||||
else {
|
||||
// Invalid char
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (dots != 3) {
|
||||
// Too few dots (there must be 3 dots)
|
||||
return false;
|
||||
}
|
||||
_address.bytes[3] = acc;
|
||||
return true;
|
||||
}
|
||||
|
||||
IPAddress &IPAddress::operator=(const uint8_t *address) {
|
||||
memcpy(_address.bytes, address, sizeof(_address.bytes));
|
||||
return *this;
|
||||
}
|
||||
|
||||
IPAddress &IPAddress::operator=(uint32_t address) {
|
||||
_address.dword = address;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool IPAddress::operator==(const uint8_t *addr) const {
|
||||
return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0;
|
||||
}
|
||||
|
||||
size_t IPAddress::printTo(Print &p) const {
|
||||
size_t n = 0;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
n += p.print(_address.bytes[i], DEC);
|
||||
n += p.print('.');
|
||||
}
|
||||
n += p.print(_address.bytes[3], DEC);
|
||||
return n;
|
||||
}
|
||||
|
||||
const IPAddress INADDR_NONE(0, 0, 0, 0);
|
||||
93
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/IPAddress.h
vendored
Normal file
93
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/IPAddress.h
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
IPAddress.h - Base class that provides IPAddress
|
||||
Copyright (c) 2011 Adrian McEwen. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include "Printable.h"
|
||||
#include "ArduinoString.h"
|
||||
|
||||
// A class to make it easier to handle and pass around IP addresses
|
||||
|
||||
class IPAddress : public Printable {
|
||||
private:
|
||||
union {
|
||||
uint8_t bytes[4]; // IPv4 address
|
||||
uint32_t dword;
|
||||
} _address;
|
||||
|
||||
// Access the raw byte array containing the address. Because this returns a
|
||||
// pointer to the internal structure rather than a copy of the address this
|
||||
// function should only be used when you know that the usage of the returned
|
||||
// uint8_t* will be transient and not stored.
|
||||
uint8_t *raw_address() {
|
||||
return _address.bytes;
|
||||
};
|
||||
|
||||
public:
|
||||
// Constructors
|
||||
IPAddress();
|
||||
IPAddress(uint8_t first_octet, uint8_t second_octet,
|
||||
uint8_t third_octet, uint8_t fourth_octet);
|
||||
IPAddress(uint32_t address);
|
||||
IPAddress(const uint8_t *address);
|
||||
|
||||
bool fromString(const char *address);
|
||||
bool fromString(const String &address) {
|
||||
return fromString(address.c_str());
|
||||
}
|
||||
|
||||
// Overloaded cast operator to allow IPAddress objects to be used where a
|
||||
// pointer to a four-byte uint8_t array is expected
|
||||
operator uint32_t() const {
|
||||
return _address.dword;
|
||||
};
|
||||
bool operator==(const IPAddress &addr) const {
|
||||
return _address.dword == addr._address.dword;
|
||||
};
|
||||
bool operator!=(const IPAddress &addr) const {
|
||||
return _address.dword != addr._address.dword;
|
||||
};
|
||||
bool operator==(const uint8_t *addr) const;
|
||||
|
||||
// Overloaded index operator to allow getting and setting individual octets
|
||||
// of the address
|
||||
uint8_t operator[](int index) const {
|
||||
return _address.bytes[index];
|
||||
};
|
||||
uint8_t &operator[](int index) {
|
||||
return _address.bytes[index];
|
||||
};
|
||||
|
||||
// Overloaded copy operators to allow initialisation of IPAddress objects
|
||||
// from other types
|
||||
IPAddress &operator=(const uint8_t *address);
|
||||
IPAddress &operator=(uint32_t address);
|
||||
|
||||
virtual size_t printTo(Print &p) const;
|
||||
|
||||
friend class EthernetClass;
|
||||
friend class UDP;
|
||||
friend class Client;
|
||||
friend class Server;
|
||||
friend class DhcpClass;
|
||||
friend class DNSClient;
|
||||
};
|
||||
|
||||
extern const IPAddress INADDR_NONE;
|
||||
59
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Interrupts.h
vendored
Normal file
59
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Interrupts.h
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
Copyright (c) 2019 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef W_INTERRUPTS_CPP
|
||||
#define W_INTERRUPTS_CPP
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "Common.h"
|
||||
|
||||
template <typename T>
|
||||
using voidTemplateFuncPtrParam = void (*)(T param);
|
||||
|
||||
template<typename T> struct __container__ {
|
||||
void *param;
|
||||
voidTemplateFuncPtrParam<T> function;
|
||||
};
|
||||
|
||||
// C++ only overloaded version of attachInterrupt function
|
||||
template<typename T> void attachInterrupt(pin_size_t interruptNum,
|
||||
voidTemplateFuncPtrParam<T> userFunc, PinStatus mode, T ¶m) {
|
||||
|
||||
struct __container__<T> *cont = new __container__<T>();
|
||||
cont->param = ¶m;
|
||||
cont->function = userFunc;
|
||||
|
||||
auto f = [](void *a) -> void {
|
||||
T param = *(T *)((struct __container__<T> *)a)->param;
|
||||
(((struct __container__<T> *)a)->function)(param);
|
||||
};
|
||||
|
||||
attachInterruptParam(interruptNum, f, mode, cont);
|
||||
}
|
||||
|
||||
template<typename T> void attachInterrupt(pin_size_t interruptNum,
|
||||
voidTemplateFuncPtrParam<T *> userFunc, PinStatus mode, T *param) {
|
||||
attachInterruptParam(interruptNum, (voidFuncPtrParam)userFunc, mode,
|
||||
(void *)param);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
375
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Print.cpp
vendored
Normal file
375
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Print.cpp
vendored
Normal file
@ -0,0 +1,375 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
// Public Methods //////////////////////////////////////////////////////////////
|
||||
|
||||
/* default implementation: may be overridden */
|
||||
size_t Print::write(const uint8_t *buffer, size_t size) {
|
||||
size_t n = 0;
|
||||
while (size--) {
|
||||
if (write(*buffer++)) {
|
||||
n++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::print(const __FlashStringHelper *ifsh) {
|
||||
#if defined(__AVR__)
|
||||
PGM_P p = reinterpret_cast<PGM_P>(ifsh);
|
||||
size_t n = 0;
|
||||
while (1) {
|
||||
unsigned char c = pgm_read_byte(p++);
|
||||
if (c == 0) {
|
||||
break;
|
||||
}
|
||||
if (write(c)) {
|
||||
n++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
#else
|
||||
return print(reinterpret_cast<const char *>(ifsh));
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t Print::print(const String &s) {
|
||||
return write(s.c_str(), s.length());
|
||||
}
|
||||
|
||||
size_t Print::print(const char str[]) {
|
||||
return write(str);
|
||||
}
|
||||
|
||||
size_t Print::print(char c) {
|
||||
return write(c);
|
||||
}
|
||||
|
||||
size_t Print::print(unsigned char b, int base) {
|
||||
return print((unsigned long) b, base);
|
||||
}
|
||||
|
||||
size_t Print::print(int n, int base) {
|
||||
return print((long) n, base);
|
||||
}
|
||||
|
||||
size_t Print::print(unsigned int n, int base) {
|
||||
return print((unsigned long) n, base);
|
||||
}
|
||||
|
||||
size_t Print::print(long n, int base) {
|
||||
if (base == 0) {
|
||||
return write(n);
|
||||
}
|
||||
else if (base == 10) {
|
||||
if (n < 0) {
|
||||
int t = print('-');
|
||||
n = -n;
|
||||
return printNumber(n, 10) + t;
|
||||
}
|
||||
return printNumber(n, 10);
|
||||
}
|
||||
else {
|
||||
return printNumber(n, base);
|
||||
}
|
||||
}
|
||||
|
||||
size_t Print::print(unsigned long n, int base) {
|
||||
if (base == 0) {
|
||||
return write(n);
|
||||
}
|
||||
else {
|
||||
return printNumber(n, base);
|
||||
}
|
||||
}
|
||||
|
||||
size_t Print::print(long long n, int base) {
|
||||
if (base == 0) {
|
||||
return write(n);
|
||||
}
|
||||
else if (base == 10) {
|
||||
if (n < 0) {
|
||||
int t = print('-');
|
||||
n = -n;
|
||||
return printULLNumber(n, 10) + t;
|
||||
}
|
||||
return printULLNumber(n, 10);
|
||||
}
|
||||
else {
|
||||
return printULLNumber(n, base);
|
||||
}
|
||||
}
|
||||
|
||||
size_t Print::print(unsigned long long n, int base) {
|
||||
if (base == 0) {
|
||||
return write(n);
|
||||
}
|
||||
else {
|
||||
return printULLNumber(n, base);
|
||||
}
|
||||
}
|
||||
|
||||
size_t Print::print(double n, int digits) {
|
||||
return printFloat(n, digits);
|
||||
}
|
||||
|
||||
size_t Print::println(const __FlashStringHelper *ifsh) {
|
||||
size_t n = print(ifsh);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::print(const Printable &x) {
|
||||
return x.printTo(*this);
|
||||
}
|
||||
|
||||
size_t Print::println(void) {
|
||||
return write("\r\n");
|
||||
}
|
||||
|
||||
size_t Print::println(const String &s) {
|
||||
size_t n = print(s);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(const char c[]) {
|
||||
size_t n = print(c);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(char c) {
|
||||
size_t n = print(c);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(unsigned char b, int base) {
|
||||
size_t n = print(b, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(int num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(unsigned int num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(long num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(unsigned long num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(long long num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(unsigned long long num, int base) {
|
||||
size_t n = print(num, base);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(double num, int digits) {
|
||||
size_t n = print(num, digits);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t Print::println(const Printable &x) {
|
||||
size_t n = print(x);
|
||||
n += println();
|
||||
return n;
|
||||
}
|
||||
|
||||
// Private Methods /////////////////////////////////////////////////////////////
|
||||
|
||||
size_t Print::printNumber(unsigned long n, uint8_t base) {
|
||||
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
|
||||
char *str = &buf[sizeof(buf) - 1];
|
||||
|
||||
*str = '\0';
|
||||
|
||||
// prevent crash if called with base == 1
|
||||
if (base < 2) {
|
||||
base = 10;
|
||||
}
|
||||
|
||||
do {
|
||||
char c = n % base;
|
||||
n /= base;
|
||||
|
||||
*--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||
} while(n);
|
||||
|
||||
return write(str);
|
||||
}
|
||||
|
||||
// REFERENCE IMPLEMENTATION FOR ULL
|
||||
// size_t Print::printULLNumber(unsigned long long n, uint8_t base)
|
||||
// {
|
||||
// // if limited to base 10 and 16 the bufsize can be smaller
|
||||
// char buf[65];
|
||||
// char *str = &buf[64];
|
||||
|
||||
// *str = '\0';
|
||||
|
||||
// // prevent crash if called with base == 1
|
||||
// if (base < 2) base = 10;
|
||||
|
||||
// do {
|
||||
// unsigned long long t = n / base;
|
||||
// char c = n - t * base; // faster than c = n%base;
|
||||
// n = t;
|
||||
// *--str = c < 10 ? c + '0' : c + 'A' - 10;
|
||||
// } while(n);
|
||||
|
||||
// return write(str);
|
||||
// }
|
||||
|
||||
// FAST IMPLEMENTATION FOR ULL
|
||||
size_t Print::printULLNumber(unsigned long long n64, uint8_t base) {
|
||||
// if limited to base 10 and 16 the bufsize can be 20
|
||||
char buf[64];
|
||||
uint8_t i = 0;
|
||||
uint8_t innerLoops = 0;
|
||||
|
||||
// prevent crash if called with base == 1
|
||||
if (base < 2) {
|
||||
base = 10;
|
||||
}
|
||||
|
||||
// process chunks that fit in "16 bit math".
|
||||
uint16_t top = 0xFFFF / base;
|
||||
uint16_t th16 = 1;
|
||||
while (th16 < top) {
|
||||
th16 *= base;
|
||||
innerLoops++;
|
||||
}
|
||||
|
||||
while (n64 > th16) {
|
||||
// 64 bit math part
|
||||
uint64_t q = n64 / th16;
|
||||
uint16_t r = n64 - q * th16;
|
||||
n64 = q;
|
||||
|
||||
// 16 bit math loop to do remainder. (note buffer is filled reverse)
|
||||
for (uint8_t j = 0; j < innerLoops; j++) {
|
||||
uint16_t qq = r / base;
|
||||
buf[i++] = r - qq * base;
|
||||
r = qq;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t n16 = n64;
|
||||
while (n16 > 0) {
|
||||
uint16_t qq = n16 / base;
|
||||
buf[i++] = n16 - qq * base;
|
||||
n16 = qq;
|
||||
}
|
||||
|
||||
size_t bytes = i;
|
||||
for (; i > 0; i--) {
|
||||
write((char)(buf[i - 1] < 10 ?
|
||||
'0' + buf[i - 1] :
|
||||
'A' + buf[i - 1] - 10));
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
size_t Print::printFloat(double number, uint8_t digits) {
|
||||
size_t n = 0;
|
||||
|
||||
if (isnan(number)) {
|
||||
return print("nan");
|
||||
}
|
||||
if (isinf(number)) {
|
||||
return print("inf");
|
||||
}
|
||||
if (number > 4294967040.0) {
|
||||
return print("ovf"); // constant determined empirically
|
||||
}
|
||||
if (number < -4294967040.0) {
|
||||
return print("ovf"); // constant determined empirically
|
||||
}
|
||||
|
||||
// Handle negative numbers
|
||||
if (number < 0.0) {
|
||||
n += print('-');
|
||||
number = -number;
|
||||
}
|
||||
|
||||
// Round correctly so that print(1.999, 2) prints as "2.00"
|
||||
double rounding = 0.5;
|
||||
for (uint8_t i = 0; i < digits; ++i) {
|
||||
rounding /= 10.0;
|
||||
}
|
||||
|
||||
number += rounding;
|
||||
|
||||
// Extract the integer part of the number and print it
|
||||
unsigned long int_part = (unsigned long)number;
|
||||
double remainder = number - (double)int_part;
|
||||
n += print(int_part);
|
||||
|
||||
// Print the decimal point, but only if there are digits beyond
|
||||
if (digits > 0) {
|
||||
n += print(".");
|
||||
}
|
||||
|
||||
// Extract digits from the remainder one at a time
|
||||
while (digits-- > 0) {
|
||||
remainder *= 10.0;
|
||||
unsigned int toPrint = (unsigned int)remainder;
|
||||
n += print(toPrint);
|
||||
remainder -= toPrint;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
93
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Print.h
vendored
Normal file
93
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Print.h
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h> // for size_t
|
||||
|
||||
#include "ArduinoString.h"
|
||||
#include "Printable.h"
|
||||
|
||||
#define DEC 10
|
||||
#define HEX 16
|
||||
#define OCT 8
|
||||
#define BIN 2
|
||||
|
||||
class Print {
|
||||
private:
|
||||
int write_error;
|
||||
size_t printNumber(unsigned long, uint8_t);
|
||||
size_t printULLNumber(unsigned long long, uint8_t);
|
||||
size_t printFloat(double, uint8_t);
|
||||
protected:
|
||||
void setWriteError(int err = 1) {
|
||||
write_error = err;
|
||||
}
|
||||
public:
|
||||
Print() : write_error(0) {}
|
||||
|
||||
int getWriteError() {
|
||||
return write_error;
|
||||
}
|
||||
void clearWriteError() {
|
||||
setWriteError(0);
|
||||
}
|
||||
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
size_t write(const char *str) {
|
||||
if (str == NULL) {
|
||||
return 0;
|
||||
}
|
||||
return write((const uint8_t *)str, strlen(str));
|
||||
}
|
||||
virtual size_t write(const uint8_t *buffer, size_t size);
|
||||
size_t write(const char *buffer, size_t size) {
|
||||
return write((const uint8_t *)buffer, size);
|
||||
}
|
||||
|
||||
size_t print(const __FlashStringHelper *);
|
||||
size_t print(const String &);
|
||||
size_t print(const char[]);
|
||||
size_t print(char);
|
||||
size_t print(unsigned char, int = DEC);
|
||||
size_t print(int, int = DEC);
|
||||
size_t print(unsigned int, int = DEC);
|
||||
size_t print(long, int = DEC);
|
||||
size_t print(unsigned long, int = DEC);
|
||||
size_t print(long long, int = DEC);
|
||||
size_t print(unsigned long long, int = DEC);
|
||||
size_t print(double, int = 2);
|
||||
size_t print(const Printable &);
|
||||
|
||||
size_t println(const __FlashStringHelper *);
|
||||
size_t println(const String &s);
|
||||
size_t println(const char[]);
|
||||
size_t println(char);
|
||||
size_t println(unsigned char, int = DEC);
|
||||
size_t println(int, int = DEC);
|
||||
size_t println(unsigned int, int = DEC);
|
||||
size_t println(long, int = DEC);
|
||||
size_t println(unsigned long, int = DEC);
|
||||
size_t println(long long, int = DEC);
|
||||
size_t println(unsigned long long, int = DEC);
|
||||
size_t println(double, int = 2);
|
||||
size_t println(const Printable &);
|
||||
size_t println(void);
|
||||
};
|
||||
|
||||
35
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Printable.h
vendored
Normal file
35
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Printable.h
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
class Print;
|
||||
|
||||
/** The Printable class provides a way for new classes to allow themselves to be
|
||||
printed. By deriving from Printable and implementing the printTo method, it
|
||||
will then be possible for users to print out instances of this class by
|
||||
passing them into the usual Print::print and Print::println methods.
|
||||
*/
|
||||
|
||||
class Printable {
|
||||
public:
|
||||
virtual size_t printTo(Print &p) const = 0;
|
||||
};
|
||||
|
||||
177
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/SPI.cpp
vendored
Normal file
177
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/SPI.cpp
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
/*
|
||||
* SPI Master library for Teknic ClearCore.
|
||||
* Copyright (c) 2015 Arduino LLC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "SPI.h"
|
||||
#include "ISerial.h"
|
||||
#include "SerialBase.h"
|
||||
#include "SerialDriver.h"
|
||||
#include "SdCardDriver.h"
|
||||
|
||||
using ClearCore::Connector;
|
||||
using ClearCore::SerialBase;
|
||||
using ClearCore::SerialDriver;
|
||||
using ClearCore::ISerial;
|
||||
|
||||
namespace ClearCore {
|
||||
extern SdCardDriver SdCard;
|
||||
extern SerialDriver ConnectorCOM0;
|
||||
extern SerialDriver ConnectorCOM1;
|
||||
}
|
||||
|
||||
SPIClass::SPIClass(SerialBase &thePort, bool isCom)
|
||||
: m_serial(&thePort),
|
||||
m_isCom(isCom),
|
||||
m_settings() {
|
||||
}
|
||||
|
||||
void SPIClass::begin() {
|
||||
if (m_isCom) {
|
||||
ISerial *asISerial = dynamic_cast<ISerial *>(m_serial);
|
||||
SerialDriver *serialDriver = static_cast<SerialDriver *>(asISerial);
|
||||
serialDriver->Mode(Connector::ConnectorModes::SPI);
|
||||
}
|
||||
else {
|
||||
m_serial->PortMode(SerialBase::PortModes::SPI);
|
||||
}
|
||||
m_serial->SpiSsMode(SerialBase::CtrlLineModes::LINE_OFF);
|
||||
config();
|
||||
m_serial->PortOpen();
|
||||
}
|
||||
|
||||
void SPIClass::config() {
|
||||
m_serial->Speed(m_settings.m_clockFreq);
|
||||
switch (m_settings.m_dataMode) {
|
||||
case SPI_MODE0:
|
||||
m_serial->SpiClock(SerialBase::SpiClockPolarities::SCK_LOW,
|
||||
SerialBase::SpiClockPhases::LEAD_SAMPLE);
|
||||
break;
|
||||
case SPI_MODE1:
|
||||
m_serial->SpiClock(SerialBase::SpiClockPolarities::SCK_LOW,
|
||||
SerialBase::SpiClockPhases::LEAD_CHANGE);
|
||||
break;
|
||||
case SPI_MODE2:
|
||||
m_serial->SpiClock(SerialBase::SpiClockPolarities::SCK_HIGH,
|
||||
SerialBase::SpiClockPhases::LEAD_SAMPLE);
|
||||
break;
|
||||
case SPI_MODE3:
|
||||
m_serial->SpiClock(SerialBase::SpiClockPolarities::SCK_HIGH,
|
||||
SerialBase::SpiClockPhases::LEAD_CHANGE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SPIClass::end() {
|
||||
m_serial->PortClose();
|
||||
}
|
||||
|
||||
void SPIClass::usingInterrupt(int interruptNumber) {
|
||||
(void)interruptNumber;
|
||||
}
|
||||
|
||||
void SPIClass::notUsingInterrupt(int interruptNumber) {
|
||||
(void)interruptNumber;
|
||||
}
|
||||
|
||||
void SPIClass::beginTransaction(SPISettings settings) {
|
||||
m_settings.m_bitOrder = settings.m_bitOrder;
|
||||
m_settings.m_dataMode = settings.m_dataMode;
|
||||
m_settings.m_clockFreq = settings.m_clockFreq;
|
||||
config();
|
||||
m_serial->SpiSsMode(SerialBase::CtrlLineModes::LINE_ON);
|
||||
}
|
||||
|
||||
void SPIClass::endTransaction(void) {
|
||||
m_serial->SpiSsMode(SerialBase::CtrlLineModes::LINE_OFF);
|
||||
}
|
||||
|
||||
void SPIClass::setBitOrder(BitOrder order) {
|
||||
m_settings.m_bitOrder = order;
|
||||
config();
|
||||
}
|
||||
|
||||
void SPIClass::setDataMode(uint8_t mode) {
|
||||
m_settings.m_dataMode = mode;
|
||||
config();
|
||||
}
|
||||
|
||||
void SPIClass::setClockDivider(uint8_t div) {
|
||||
m_settings.m_clockFreq = MAX_SPI / div;
|
||||
config();
|
||||
}
|
||||
|
||||
byte SPIClass::transfer(uint8_t data) {
|
||||
return m_serial->SpiTransferData(data);
|
||||
}
|
||||
|
||||
uint16_t SPIClass::transfer16(uint16_t data) {
|
||||
union {
|
||||
uint16_t val;
|
||||
struct {
|
||||
uint8_t lsb;
|
||||
uint8_t msb;
|
||||
};
|
||||
} t;
|
||||
|
||||
t.val = data;
|
||||
|
||||
if (m_settings.m_bitOrder == LSBFIRST) {
|
||||
t.lsb = transfer(t.lsb);
|
||||
t.msb = transfer(t.msb);
|
||||
}
|
||||
else {
|
||||
t.msb = transfer(t.msb);
|
||||
t.lsb = transfer(t.lsb);
|
||||
}
|
||||
|
||||
return t.val;
|
||||
}
|
||||
|
||||
void SPIClass::transfer(void *buf, size_t count) {
|
||||
m_serial->SpiTransferData((uint8_t *)buf, (uint8_t *)buf, count);
|
||||
}
|
||||
|
||||
void SPIClass::transfer(const void *txbuf, void *rxbuf, size_t count,
|
||||
bool block) {
|
||||
if (!block &&
|
||||
m_serial->SpiTransferDataAsync((uint8_t *)txbuf, (uint8_t *)rxbuf, count)) {
|
||||
return;
|
||||
}
|
||||
m_serial->SpiTransferData((uint8_t *)txbuf, (uint8_t *)rxbuf, count);
|
||||
}
|
||||
|
||||
// Waits for a prior in-background DMA transfer to complete.
|
||||
void SPIClass::waitForTransfer(void) {
|
||||
m_serial->SpiAsyncWaitComplete();
|
||||
}
|
||||
|
||||
void SPIClass::attachInterrupt() {
|
||||
// Should be enableInterrupt()
|
||||
}
|
||||
|
||||
void SPIClass::detachInterrupt() {
|
||||
// Should be disableInterrupt()
|
||||
}
|
||||
|
||||
|
||||
SPIClass SPI(ClearCore::ConnectorCOM0, true);
|
||||
SPIClass SPI1(ClearCore::ConnectorCOM1, true);
|
||||
SPIClass SPI2(ClearCore::SdCard, false);
|
||||
|
||||
119
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/SPI.h
vendored
Normal file
119
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/SPI.h
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* SPI Master library for Teknic ClearCore.
|
||||
* Copyright (c) 2015 Arduino LLC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _SPI_H_INCLUDED
|
||||
#define _SPI_H_INCLUDED
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "SerialBase.h"
|
||||
|
||||
// SPI_HAS_TRANSACTION means SPI has
|
||||
// - beginTransaction()
|
||||
// - endTransaction()
|
||||
// - usingInterrupt()
|
||||
// - SPISetting(clock, bitOrder, dataMode)
|
||||
#define SPI_HAS_TRANSACTION 1
|
||||
|
||||
// SPI_HAS_NOTUSINGINTERRUPT means that SPI has notUsingInterrupt() method
|
||||
#define SPI_HAS_NOTUSINGINTERRUPT 1
|
||||
|
||||
#define SPI_MODE0 0x00
|
||||
#define SPI_MODE1 0x01
|
||||
#define SPI_MODE2 0x02
|
||||
#define SPI_MODE3 0x03
|
||||
|
||||
#define MAX_SPI 10000000
|
||||
#define SPI_MIN_CLOCK_DIVIDER 1
|
||||
|
||||
class SPISettings {
|
||||
public:
|
||||
SPISettings(uint32_t clock, BitOrder bitOrder, uint8_t dataMode)
|
||||
: m_clockFreq(clock),
|
||||
m_bitOrder(bitOrder),
|
||||
m_dataMode(dataMode) {
|
||||
}
|
||||
|
||||
// Default speed set to 4MHz, SPI mode set to MODE 0 and Bit order set to
|
||||
// MSB first.
|
||||
SPISettings()
|
||||
: m_clockFreq(10000000),
|
||||
m_bitOrder(BitOrder::MSBFIRST),
|
||||
m_dataMode(SPI_MODE0) {
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t m_clockFreq;
|
||||
BitOrder m_bitOrder;
|
||||
uint8_t m_dataMode;
|
||||
|
||||
friend class SPIClass;
|
||||
};
|
||||
|
||||
class SPIClass {
|
||||
public:
|
||||
SPIClass(ClearCore::SerialBase &thePort, bool isCom);
|
||||
|
||||
byte transfer(uint8_t data);
|
||||
uint16_t transfer16(uint16_t data);
|
||||
void transfer(void *buf, size_t count);
|
||||
void transfer(const void *txbuf, void *rxbuf, size_t count,
|
||||
bool block = true);
|
||||
void waitForTransfer(void);
|
||||
|
||||
// Transaction Functions
|
||||
void usingInterrupt(int interruptNumber);
|
||||
void notUsingInterrupt(int interruptNumber);
|
||||
void beginTransaction(SPISettings settings);
|
||||
void endTransaction(void);
|
||||
|
||||
// SPI Configuration methods
|
||||
void attachInterrupt();
|
||||
void detachInterrupt();
|
||||
|
||||
void begin();
|
||||
void end();
|
||||
|
||||
void setBitOrder(BitOrder order);
|
||||
void setDataMode(uint8_t uc_mode);
|
||||
void setClockDivider(uint8_t uc_div);
|
||||
|
||||
private:
|
||||
void config();
|
||||
|
||||
ClearCore::SerialBase *m_serial;
|
||||
bool m_isCom;
|
||||
SPISettings m_settings;
|
||||
|
||||
};
|
||||
|
||||
extern SPIClass SPI;
|
||||
extern SPIClass SPI1;
|
||||
extern SPIClass SPI2;
|
||||
|
||||
// For compatibility with sketches designed for AVR @ 16 MHz
|
||||
// New programs should use SPI.beginTransaction to set the SPI clock
|
||||
#define SPI_CLOCK_DIV2 (MAX_SPI * 2 / 8000000)
|
||||
#define SPI_CLOCK_DIV4 (MAX_SPI * 2 / 4000000)
|
||||
#define SPI_CLOCK_DIV8 (MAX_SPI * 2 / 2000000)
|
||||
#define SPI_CLOCK_DIV16 (MAX_SPI * 2 / 1000000)
|
||||
#define SPI_CLOCK_DIV32 (MAX_SPI * 2 / 500000)
|
||||
#define SPI_CLOCK_DIV64 (MAX_SPI * 2 / 250000)
|
||||
#define SPI_CLOCK_DIV128 (MAX_SPI * 2 / 125000)
|
||||
|
||||
#endif
|
||||
28
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Server.h
vendored
Normal file
28
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Server.h
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
Server.h - Base class that provides Server
|
||||
Copyright (c) 2011 Adrian McEwen. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
class Server : public Print {
|
||||
public:
|
||||
virtual void begin() = 0;
|
||||
};
|
||||
|
||||
344
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Stream.cpp
vendored
Normal file
344
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Stream.cpp
vendored
Normal file
@ -0,0 +1,344 @@
|
||||
/*
|
||||
Stream.cpp - adds parsing methods to Stream class
|
||||
Copyright (c) 2008 David A. Mellis. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Created July 2011
|
||||
parsing functions based on TextFinder library by Michael Margolis
|
||||
|
||||
findMulti/findUntil routines written by Jim Leonard/Xuth
|
||||
*/
|
||||
|
||||
#include "Common.h"
|
||||
#include "Stream.h"
|
||||
|
||||
#define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait
|
||||
|
||||
// private method to read stream with timeout
|
||||
int Stream::timedRead() {
|
||||
int c;
|
||||
_startMillis = millis();
|
||||
do {
|
||||
c = read();
|
||||
if (c >= 0) {
|
||||
return c;
|
||||
}
|
||||
} while (millis() - _startMillis < _timeout);
|
||||
return -1; // -1 indicates timeout
|
||||
}
|
||||
|
||||
// private method to peek stream with timeout
|
||||
int Stream::timedPeek() {
|
||||
int c;
|
||||
_startMillis = millis();
|
||||
do {
|
||||
c = peek();
|
||||
if (c >= 0) {
|
||||
return c;
|
||||
}
|
||||
} while (millis() - _startMillis < _timeout);
|
||||
return -1; // -1 indicates timeout
|
||||
}
|
||||
|
||||
// returns peek of the next digit in the stream or -1 if timeout
|
||||
// discards non-numeric characters
|
||||
int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal) {
|
||||
int c;
|
||||
while (1) {
|
||||
c = timedPeek();
|
||||
|
||||
if (c < 0 || c == '-' || (c >= '0' && c <= '9') ||
|
||||
(detectDecimal && c == '.')) {
|
||||
return c;
|
||||
}
|
||||
|
||||
switch (lookahead) {
|
||||
case SKIP_NONE:
|
||||
return -1; // Fail code.
|
||||
case SKIP_WHITESPACE:
|
||||
switch (c) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\r':
|
||||
case '\n':
|
||||
break;
|
||||
default:
|
||||
return -1; // Fail code.
|
||||
}
|
||||
case SKIP_ALL:
|
||||
break;
|
||||
}
|
||||
read(); // discard non-numeric
|
||||
}
|
||||
}
|
||||
|
||||
// Public Methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// sets the maximum number of milliseconds to wait
|
||||
void Stream::setTimeout(unsigned long timeout) {
|
||||
_timeout = timeout;
|
||||
}
|
||||
|
||||
// find returns true if the target string is found
|
||||
bool Stream::find(const char *target) {
|
||||
return findUntil(target, strlen(target), NULL, 0);
|
||||
}
|
||||
|
||||
// reads data from the stream until the target string of given length is found
|
||||
// returns true if target string is found, false if timed out
|
||||
bool Stream::find(const char *target, size_t length) {
|
||||
return findUntil(target, length, NULL, 0);
|
||||
}
|
||||
|
||||
// as find but search ends if the terminator string is found
|
||||
bool Stream::findUntil(const char *target, const char *terminator) {
|
||||
return findUntil(target, strlen(target), terminator, strlen(terminator));
|
||||
}
|
||||
|
||||
// reads data from the stream until the target string of the given length is
|
||||
// found
|
||||
// search terminated if the terminator string is found
|
||||
// returns true if target string is found, false if terminated or timed out
|
||||
bool Stream::findUntil(const char *target, size_t targetLen,
|
||||
const char *terminator, size_t termLen) {
|
||||
if (terminator == NULL) {
|
||||
MultiTarget t[1] = {{target, targetLen, 0}};
|
||||
return findMulti(t, 1) == 0;
|
||||
}
|
||||
else {
|
||||
MultiTarget t[2] = {{target, targetLen, 0}, {terminator, termLen, 0}};
|
||||
return findMulti(t, 2) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
// returns the first valid (long) integer value from the current position.
|
||||
// lookahead determines how parseInt looks ahead in the stream.
|
||||
// See LookaheadMode enumeration at the top of the file.
|
||||
// Lookahead is terminated by the first character that is not a valid part of an
|
||||
// integer. Once parsing commences, 'ignore' will be skipped in the stream.
|
||||
long Stream::parseInt(LookaheadMode lookahead, char ignore) {
|
||||
bool isNegative = false;
|
||||
long value = 0;
|
||||
int c;
|
||||
|
||||
c = peekNextDigit(lookahead, false);
|
||||
// ignore non numeric leading characters
|
||||
if (c < 0) {
|
||||
return 0; // zero returned if timeout
|
||||
}
|
||||
|
||||
do {
|
||||
if ((char)c == ignore) {
|
||||
; // ignore this character
|
||||
}
|
||||
else if (c == '-') {
|
||||
isNegative = true;
|
||||
}
|
||||
else if (c >= '0' && c <= '9') { // is c a digit?
|
||||
value = value * 10 + c - '0';
|
||||
}
|
||||
read(); // consume the character we got with peek
|
||||
c = timedPeek();
|
||||
} while ((c >= '0' && c <= '9') || (char)c == ignore);
|
||||
|
||||
if (isNegative) {
|
||||
value = -value;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// as parseInt but returns a floating point value
|
||||
float Stream::parseFloat(LookaheadMode lookahead, char ignore) {
|
||||
bool isNegative = false;
|
||||
bool isFraction = false;
|
||||
long value = 0;
|
||||
int c;
|
||||
float fraction = 1.0;
|
||||
|
||||
c = peekNextDigit(lookahead, true);
|
||||
// ignore non numeric leading characters
|
||||
if (c < 0) {
|
||||
return 0; // zero returned if timeout
|
||||
}
|
||||
|
||||
|
||||
|
||||
do {
|
||||
if ((char)c == ignore) {
|
||||
; // ignore
|
||||
}
|
||||
else if (c == '-') {
|
||||
isNegative = true;
|
||||
}
|
||||
else if (c == '.') {
|
||||
isFraction = true;
|
||||
}
|
||||
else if (c >= '0' && c <= '9') { // is c a digit?
|
||||
value = value * 10 + c - '0';
|
||||
if (isFraction) {
|
||||
fraction *= 0.1;
|
||||
}
|
||||
}
|
||||
read(); // consume the character we got with peek
|
||||
c = timedPeek();
|
||||
}
|
||||
while ((c >= '0' && c <= '9') || (c == '.' && !isFraction) ||
|
||||
(char)c == ignore);
|
||||
|
||||
if (isNegative) {
|
||||
value = -value;
|
||||
}
|
||||
if (isFraction) {
|
||||
return value * fraction;
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
// read characters from stream into buffer
|
||||
// terminates if length characters have been read, or timeout (see setTimeout)
|
||||
// returns the number of characters placed in the buffer
|
||||
// the buffer is NOT null terminated.
|
||||
//
|
||||
size_t Stream::readBytes(char *buffer, size_t length) {
|
||||
size_t count = 0;
|
||||
while (count < length) {
|
||||
int c = timedRead();
|
||||
if (c < 0) {
|
||||
break;
|
||||
}
|
||||
*buffer++ = (char)c;
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
// as readBytes with terminator character
|
||||
// terminates if length characters have been read, timeout, or if the terminator
|
||||
// character detected returns the number of characters placed in the buffer
|
||||
// (0 means no valid data found)
|
||||
|
||||
size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) {
|
||||
if (length < 1) {
|
||||
return 0;
|
||||
}
|
||||
size_t index = 0;
|
||||
while (index < length) {
|
||||
int c = timedRead();
|
||||
if (c < 0 || (char)c == terminator) {
|
||||
break;
|
||||
}
|
||||
*buffer++ = (char)c;
|
||||
index++;
|
||||
}
|
||||
return index; // return number of characters, not including null terminator
|
||||
}
|
||||
|
||||
String Stream::readString() {
|
||||
String ret;
|
||||
int c = timedRead();
|
||||
while (c >= 0) {
|
||||
ret += (char)c;
|
||||
c = timedRead();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
String Stream::readStringUntil(char terminator) {
|
||||
String ret;
|
||||
int c = timedRead();
|
||||
while (c >= 0 && (char)c != terminator) {
|
||||
ret += (char)c;
|
||||
c = timedRead();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int Stream::findMulti(struct Stream::MultiTarget *targets, int tCount) {
|
||||
// any zero length target string automatically matches and would make
|
||||
// a mess of the rest of the algorithm.
|
||||
for (struct MultiTarget *t = targets; t < targets + tCount; ++t) {
|
||||
if (t->len <= 0) {
|
||||
return t - targets;
|
||||
}
|
||||
}
|
||||
|
||||
while (1) {
|
||||
int c = timedRead();
|
||||
if (c < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (struct MultiTarget *t = targets; t < targets + tCount; ++t) {
|
||||
// the simple case is if we match, deal with that first.
|
||||
if ((char)c == t->str[t->index]) {
|
||||
if (++t->index == t->len) {
|
||||
return t - targets;
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// if not we need to walk back and see if we could have matched
|
||||
// further down the stream (ie '1112' doesn't match the first
|
||||
// position in '11112' but it will match the second position so we
|
||||
// can't just reset the current index to 0 when we find a mismatch.
|
||||
if (t->index == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int origIndex = t->index;
|
||||
do {
|
||||
--t->index;
|
||||
// first check if current char works against the new current
|
||||
// index
|
||||
if ((char)c != t->str[t->index]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if it's the only char then we're good, nothing more to check
|
||||
if (t->index == 0) {
|
||||
t->index++;
|
||||
break;
|
||||
}
|
||||
|
||||
// otherwise we need to check the rest of the found string
|
||||
int diff = origIndex - t->index;
|
||||
size_t i;
|
||||
for (i = 0; i < t->index; ++i) {
|
||||
if (t->str[i] != t->str[i + diff]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if we successfully got through the previous loop then our
|
||||
// current index is good.
|
||||
if (i == t->index) {
|
||||
t->index++;
|
||||
break;
|
||||
}
|
||||
|
||||
// otherwise we just try the next index
|
||||
} while (t->index);
|
||||
}
|
||||
}
|
||||
// unreachable
|
||||
return -1;
|
||||
}
|
||||
172
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Stream.h
vendored
Normal file
172
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Stream.h
vendored
Normal file
@ -0,0 +1,172 @@
|
||||
/*
|
||||
Stream.h - base class for character-based streams.
|
||||
Copyright (c) 2010 David A. Mellis. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
parsing functions based on TextFinder library by Michael Margolis
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Print.h"
|
||||
|
||||
// compatability macros for testing
|
||||
/*
|
||||
#define getInt() parseInt()
|
||||
#define getInt(ignore) parseInt(ignore)
|
||||
#define getFloat() parseFloat()
|
||||
#define getFloat(ignore) parseFloat(ignore)
|
||||
#define getString( pre_string, post_string, buffer, length)
|
||||
readBytesBetween( pre_string, terminator, buffer, length)
|
||||
*/
|
||||
|
||||
// This enumeration provides the lookahead options for parseInt(), parseFloat()
|
||||
// The rules set out here are used until either the first valid character is
|
||||
// found or a time out occurs due to lack of input.
|
||||
enum LookaheadMode {
|
||||
SKIP_ALL, // All invalid characters are ignored.
|
||||
SKIP_NONE, // Nothing is skipped, and the stream is not touched unless
|
||||
// the first waiting character is valid.
|
||||
SKIP_WHITESPACE // Only tabs, spaces, line feeds & carriage returns are
|
||||
// skipped.
|
||||
};
|
||||
|
||||
// a char not found in a valid ASCII numeric field
|
||||
#define NO_IGNORE_CHAR '\x01'
|
||||
|
||||
class Stream : public Print {
|
||||
protected:
|
||||
// number of milliseconds to wait for the next char before aborting timed
|
||||
// read
|
||||
unsigned long _timeout;
|
||||
unsigned long _startMillis; // used for timeout measurement
|
||||
int timedRead(); // private method to read stream with timeout
|
||||
int timedPeek(); // private method to peek stream with timeout
|
||||
// returns the next numeric digit in the stream or -1 if timeout
|
||||
int peekNextDigit(LookaheadMode lookahead, bool detectDecimal);
|
||||
|
||||
public:
|
||||
virtual int available() = 0;
|
||||
virtual int read() = 0;
|
||||
virtual int peek() = 0;
|
||||
virtual void flush() = 0;
|
||||
|
||||
Stream() {
|
||||
_timeout = 1000;
|
||||
}
|
||||
|
||||
// parsing methods
|
||||
|
||||
// sets maximum milliseconds to wait for stream data, default is 1 second
|
||||
void setTimeout(unsigned long timeout);
|
||||
unsigned long getTimeout(void) {
|
||||
return _timeout;
|
||||
}
|
||||
|
||||
// reads data from the stream until the target string is found
|
||||
bool find(const char *target);
|
||||
bool find(const uint8_t *target) {
|
||||
return find((const char *)target);
|
||||
}
|
||||
// returns true if target string is found, false if timed out
|
||||
// (see setTimeout)
|
||||
|
||||
// reads data from the stream until the target string of given length is
|
||||
// found
|
||||
bool find(const char *target, size_t length);
|
||||
bool find(const uint8_t *target, size_t length) {
|
||||
return find((const char *)target, length);
|
||||
}
|
||||
// returns true if target string is found, false if timed out
|
||||
|
||||
bool find(char target) {
|
||||
return find(&target, 1);
|
||||
}
|
||||
|
||||
// as find but search ends if the terminator string is found
|
||||
bool findUntil(const char *target, const char *terminator);
|
||||
bool findUntil(const uint8_t *target, const char *terminator) {
|
||||
return findUntil((const char *)target, terminator);
|
||||
}
|
||||
|
||||
// as above but search ends if the terminate string is found
|
||||
bool findUntil(const char *target, size_t targetLen,
|
||||
const char *terminate, size_t termLen);
|
||||
bool findUntil(const uint8_t *target, size_t targetLen,
|
||||
const char *terminate, size_t termLen) {
|
||||
return findUntil((const char *)target, targetLen, terminate, termLen);
|
||||
}
|
||||
|
||||
long parseInt(LookaheadMode lookahead = SKIP_ALL,
|
||||
char ignore = NO_IGNORE_CHAR);
|
||||
// returns the first valid (long) integer value from the current position.
|
||||
// lookahead determines how parseInt looks ahead in the stream.
|
||||
// See LookaheadMode enumeration at the top of the file.
|
||||
// Lookahead is terminated by the first character that is not a valid part
|
||||
// of an integer. Once parsing commences, 'ignore' will be skipped in the
|
||||
// stream.
|
||||
|
||||
float parseFloat(LookaheadMode lookahead = SKIP_ALL,
|
||||
char ignore = NO_IGNORE_CHAR);
|
||||
// float version of parseInt
|
||||
|
||||
// read chars from stream into buffer
|
||||
size_t readBytes(char *buffer, size_t length);
|
||||
size_t readBytes(uint8_t *buffer, size_t length) {
|
||||
return readBytes((char *)buffer, length);
|
||||
}
|
||||
// terminates if length characters have been read or timeout (see
|
||||
// setTimeout)
|
||||
// returns the number of characters placed in the buffer (0 means no valid
|
||||
// data found)
|
||||
|
||||
// as readBytes with terminator character
|
||||
size_t readBytesUntil(char terminator, char *buffer, size_t length);
|
||||
size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length) {
|
||||
return readBytesUntil(terminator, (char *)buffer, length);
|
||||
}
|
||||
// terminates if length characters have been read, timeout, or if the
|
||||
// terminator character detected
|
||||
// returns the number of characters placed in the buffer (0 means no valid
|
||||
// data found)
|
||||
|
||||
// Arduino String functions to be added here
|
||||
String readString();
|
||||
String readStringUntil(char terminator);
|
||||
|
||||
protected:
|
||||
long parseInt(char ignore) {
|
||||
return parseInt(SKIP_ALL, ignore);
|
||||
}
|
||||
float parseFloat(char ignore) {
|
||||
return parseFloat(SKIP_ALL, ignore);
|
||||
}
|
||||
// These overload exists for compatibility with any class that has derived
|
||||
// Stream and used parseFloat/Int with a custom ignore character. To keep
|
||||
// the public API simple, these overload remains protected.
|
||||
|
||||
struct MultiTarget {
|
||||
const char *str; // string you're searching for
|
||||
size_t len; // length of string you're searching for
|
||||
size_t index; // index used by the search routine.
|
||||
};
|
||||
|
||||
// This allows you to search for an arbitrary number of strings.
|
||||
// Returns index of the target that is found first or -1 if timeout occurs.
|
||||
int findMulti(struct MultiTarget *targets, int tCount);
|
||||
};
|
||||
|
||||
#undef NO_IGNORE_CHAR
|
||||
820
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/String.cpp
vendored
Normal file
820
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/String.cpp
vendored
Normal file
@ -0,0 +1,820 @@
|
||||
/*
|
||||
String library for Wiring & Arduino
|
||||
...mostly rewritten by Paul Stoffregen...
|
||||
Copyright (c) 2009-10 Hernando Barragan. All rights reserved.
|
||||
Copyright 2011, Paul Stoffregen, paul@pjrc.com
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "ArduinoString.h"
|
||||
#include "itoa.h"
|
||||
#include "deprecated-avr-comp/avr/dtostrf.h"
|
||||
|
||||
/*********************************************/
|
||||
/* Constructors */
|
||||
/*********************************************/
|
||||
|
||||
String::String(const char *cstr) {
|
||||
init();
|
||||
if (cstr) {
|
||||
copy(cstr, strlen(cstr));
|
||||
}
|
||||
}
|
||||
|
||||
String::String(const String &value) {
|
||||
init();
|
||||
*this = value;
|
||||
}
|
||||
|
||||
String::String(const __FlashStringHelper *pstr) {
|
||||
init();
|
||||
*this = pstr;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
String::String(String &&rval) {
|
||||
init();
|
||||
move(rval);
|
||||
}
|
||||
String::String(StringSumHelper &&rval) {
|
||||
init();
|
||||
move(rval);
|
||||
}
|
||||
#endif
|
||||
|
||||
String::String(char c) {
|
||||
init();
|
||||
char buf[2];
|
||||
buf[0] = c;
|
||||
buf[1] = 0;
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(unsigned char value, unsigned char base) {
|
||||
init();
|
||||
char buf[1 + 8 * sizeof(unsigned char)];
|
||||
utoa(value, buf, base);
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(int value, unsigned char base) {
|
||||
init();
|
||||
char buf[2 + 8 * sizeof(int)];
|
||||
itoa(value, buf, base);
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(unsigned int value, unsigned char base) {
|
||||
init();
|
||||
char buf[1 + 8 * sizeof(unsigned int)];
|
||||
utoa(value, buf, base);
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(long value, unsigned char base) {
|
||||
init();
|
||||
char buf[2 + 8 * sizeof(long)];
|
||||
ltoa(value, buf, base);
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(unsigned long value, unsigned char base) {
|
||||
init();
|
||||
char buf[1 + 8 * sizeof(unsigned long)];
|
||||
ultoa(value, buf, base);
|
||||
*this = buf;
|
||||
}
|
||||
|
||||
String::String(float value, unsigned char decimalPlaces) {
|
||||
init();
|
||||
char buf[33];
|
||||
*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
|
||||
}
|
||||
|
||||
String::String(double value, unsigned char decimalPlaces) {
|
||||
init();
|
||||
char buf[33];
|
||||
*this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf);
|
||||
}
|
||||
|
||||
String::~String() {
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Memory Management */
|
||||
/*********************************************/
|
||||
|
||||
inline void String::init(void) {
|
||||
buffer = NULL;
|
||||
capacity = 0;
|
||||
len = 0;
|
||||
}
|
||||
|
||||
void String::invalidate(void) {
|
||||
if (buffer) {
|
||||
free(buffer);
|
||||
}
|
||||
buffer = NULL;
|
||||
capacity = len = 0;
|
||||
}
|
||||
|
||||
unsigned char String::reserve(unsigned int size) {
|
||||
if (buffer && capacity >= size) {
|
||||
return 1;
|
||||
}
|
||||
if (changeBuffer(size)) {
|
||||
if (len == 0) {
|
||||
buffer[0] = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char String::changeBuffer(unsigned int maxStrLen) {
|
||||
char *newbuffer = (char *)realloc(buffer, maxStrLen + 1);
|
||||
if (newbuffer) {
|
||||
buffer = newbuffer;
|
||||
capacity = maxStrLen;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Copy and Move */
|
||||
/*********************************************/
|
||||
|
||||
String &String::copy(const char *cstr, unsigned int length) {
|
||||
if (!reserve(length)) {
|
||||
invalidate();
|
||||
return *this;
|
||||
}
|
||||
len = length;
|
||||
strcpy(buffer, cstr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
String &String::copy(const __FlashStringHelper *pstr, unsigned int length) {
|
||||
if (!reserve(length)) {
|
||||
invalidate();
|
||||
return *this;
|
||||
}
|
||||
len = length;
|
||||
strcpy_P(buffer, (PGM_P)pstr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
void String::move(String &rhs) {
|
||||
if (buffer) {
|
||||
if (rhs && capacity >= rhs.len) {
|
||||
strcpy(buffer, rhs.buffer);
|
||||
len = rhs.len;
|
||||
rhs.len = 0;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
buffer = rhs.buffer;
|
||||
capacity = rhs.capacity;
|
||||
len = rhs.len;
|
||||
rhs.buffer = NULL;
|
||||
rhs.capacity = 0;
|
||||
rhs.len = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
String &String::operator = (const String &rhs) {
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
if (rhs.buffer) {
|
||||
copy(rhs.buffer, rhs.len);
|
||||
}
|
||||
else {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
String &String::operator = (String &&rval) {
|
||||
if (this != &rval) {
|
||||
move(rval);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
String &String::operator = (StringSumHelper &&rval) {
|
||||
if (this != &rval) {
|
||||
move(rval);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
String &String::operator = (const char *cstr) {
|
||||
if (cstr) {
|
||||
copy(cstr, strlen(cstr));
|
||||
}
|
||||
else {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
String &String::operator = (const __FlashStringHelper *pstr) {
|
||||
if (pstr) {
|
||||
copy(pstr, strlen_P((PGM_P)pstr));
|
||||
}
|
||||
else {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* concat */
|
||||
/*********************************************/
|
||||
|
||||
unsigned char String::concat(const String &s) {
|
||||
return concat(s.buffer, s.len);
|
||||
}
|
||||
|
||||
unsigned char String::concat(const char *cstr, unsigned int length) {
|
||||
unsigned int newlen = len + length;
|
||||
if (!cstr) {
|
||||
return 0;
|
||||
}
|
||||
if (length == 0) {
|
||||
return 1;
|
||||
}
|
||||
if (!reserve(newlen)) {
|
||||
return 0;
|
||||
}
|
||||
strcpy(buffer + len, cstr);
|
||||
len = newlen;
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char String::concat(const char *cstr) {
|
||||
if (!cstr) {
|
||||
return 0;
|
||||
}
|
||||
return concat(cstr, strlen(cstr));
|
||||
}
|
||||
|
||||
unsigned char String::concat(char c) {
|
||||
char buf[2];
|
||||
buf[0] = c;
|
||||
buf[1] = 0;
|
||||
return concat(buf, 1);
|
||||
}
|
||||
|
||||
unsigned char String::concat(unsigned char num) {
|
||||
char buf[1 + 3 * sizeof(unsigned char)];
|
||||
itoa(num, buf, 10);
|
||||
return concat(buf, strlen(buf));
|
||||
}
|
||||
|
||||
unsigned char String::concat(int num) {
|
||||
char buf[2 + 3 * sizeof(int)];
|
||||
itoa(num, buf, 10);
|
||||
return concat(buf, strlen(buf));
|
||||
}
|
||||
|
||||
unsigned char String::concat(unsigned int num) {
|
||||
char buf[1 + 3 * sizeof(unsigned int)];
|
||||
utoa(num, buf, 10);
|
||||
return concat(buf, strlen(buf));
|
||||
}
|
||||
|
||||
unsigned char String::concat(long num) {
|
||||
char buf[2 + 3 * sizeof(long)];
|
||||
ltoa(num, buf, 10);
|
||||
return concat(buf, strlen(buf));
|
||||
}
|
||||
|
||||
unsigned char String::concat(unsigned long num) {
|
||||
char buf[1 + 3 * sizeof(unsigned long)];
|
||||
ultoa(num, buf, 10);
|
||||
return concat(buf, strlen(buf));
|
||||
}
|
||||
|
||||
unsigned char String::concat(float num) {
|
||||
char buf[20];
|
||||
char *string = dtostrf(num, 4, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
unsigned char String::concat(double num) {
|
||||
char buf[20];
|
||||
char *string = dtostrf(num, 4, 2, buf);
|
||||
return concat(string, strlen(string));
|
||||
}
|
||||
|
||||
unsigned char String::concat(const __FlashStringHelper *str) {
|
||||
if (!str) {
|
||||
return 0;
|
||||
}
|
||||
int length = strlen_P((const char *) str);
|
||||
if (length == 0) {
|
||||
return 1;
|
||||
}
|
||||
unsigned int newlen = len + length;
|
||||
if (!reserve(newlen)) {
|
||||
return 0;
|
||||
}
|
||||
strcpy_P(buffer + len, (const char *) str);
|
||||
len = newlen;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Concatenate */
|
||||
/*********************************************/
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, const String &rhs) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(rhs.buffer, rhs.len)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, const char *cstr) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!cstr || !a.concat(cstr, strlen(cstr))) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, char c) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(c)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, unsigned char num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, int num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, unsigned int num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, long num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, unsigned long num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, float num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs, double num) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(num)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
StringSumHelper &operator + (const StringSumHelper &lhs,
|
||||
const __FlashStringHelper *rhs) {
|
||||
StringSumHelper &a = const_cast<StringSumHelper &>(lhs);
|
||||
if (!a.concat(rhs)) {
|
||||
a.invalidate();
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Comparison */
|
||||
/*********************************************/
|
||||
|
||||
int String::compareTo(const String &s) const {
|
||||
if (!buffer || !s.buffer) {
|
||||
if (s.buffer && s.len > 0) {
|
||||
return 0 - *(unsigned char *)s.buffer;
|
||||
}
|
||||
if (buffer && len > 0) {
|
||||
return *(unsigned char *)buffer;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return strcmp(buffer, s.buffer);
|
||||
}
|
||||
|
||||
int String::compareTo(const char *cstr) const {
|
||||
if (!buffer || !cstr) {
|
||||
if (cstr && !*cstr) {
|
||||
return 0 - *(unsigned char *)cstr;
|
||||
}
|
||||
if (buffer && len > 0) {
|
||||
return *(unsigned char *)buffer;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return strcmp(buffer, cstr);
|
||||
}
|
||||
|
||||
unsigned char String::equals(const String &s2) const {
|
||||
return (len == s2.len && compareTo(s2) == 0);
|
||||
}
|
||||
|
||||
unsigned char String::equals(const char *cstr) const {
|
||||
if (len == 0) {
|
||||
return (cstr == NULL || *cstr == 0);
|
||||
}
|
||||
if (cstr == NULL) {
|
||||
return buffer[0] == 0;
|
||||
}
|
||||
return strcmp(buffer, cstr) == 0;
|
||||
}
|
||||
|
||||
unsigned char String::equalsIgnoreCase(const String &s2) const {
|
||||
if (this == &s2) {
|
||||
return 1;
|
||||
}
|
||||
if (len != s2.len) {
|
||||
return 0;
|
||||
}
|
||||
if (len == 0) {
|
||||
return 1;
|
||||
}
|
||||
const char *p1 = buffer;
|
||||
const char *p2 = s2.buffer;
|
||||
while (*p1) {
|
||||
if (tolower(*p1++) != tolower(*p2++)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char String::startsWith(const String &s2) const {
|
||||
if (len < s2.len) {
|
||||
return 0;
|
||||
}
|
||||
return startsWith(s2, 0);
|
||||
}
|
||||
|
||||
unsigned char String::startsWith(const String &s2, unsigned int offset) const {
|
||||
if (offset > len - s2.len || !buffer || !s2.buffer) {
|
||||
return 0;
|
||||
}
|
||||
return strncmp(&buffer[offset], s2.buffer, s2.len) == 0;
|
||||
}
|
||||
|
||||
unsigned char String::endsWith(const String &s2) const {
|
||||
if (len < s2.len || !buffer || !s2.buffer) {
|
||||
return 0;
|
||||
}
|
||||
return strcmp(&buffer[len - s2.len], s2.buffer) == 0;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Character Access */
|
||||
/*********************************************/
|
||||
|
||||
char String::charAt(unsigned int loc) const {
|
||||
return operator[](loc);
|
||||
}
|
||||
|
||||
void String::setCharAt(unsigned int loc, char c) {
|
||||
if (loc < len) {
|
||||
buffer[loc] = c;
|
||||
}
|
||||
}
|
||||
|
||||
char &String::operator[](unsigned int index) {
|
||||
static char dummy_writable_char;
|
||||
if (index >= len || !buffer) {
|
||||
dummy_writable_char = 0;
|
||||
return dummy_writable_char;
|
||||
}
|
||||
return buffer[index];
|
||||
}
|
||||
|
||||
char String::operator[](unsigned int index) const {
|
||||
if (index >= len || !buffer) {
|
||||
return 0;
|
||||
}
|
||||
return buffer[index];
|
||||
}
|
||||
|
||||
void String::getBytes(unsigned char *buf, unsigned int bufsize,
|
||||
unsigned int index) const {
|
||||
if (!bufsize || !buf) {
|
||||
return;
|
||||
}
|
||||
if (index >= len) {
|
||||
buf[0] = 0;
|
||||
return;
|
||||
}
|
||||
unsigned int n = bufsize - 1;
|
||||
if (n > len - index) {
|
||||
n = len - index;
|
||||
}
|
||||
strncpy((char *)buf, buffer + index, n);
|
||||
buf[n] = 0;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Search */
|
||||
/*********************************************/
|
||||
|
||||
int String::indexOf(char c) const {
|
||||
return indexOf(c, 0);
|
||||
}
|
||||
|
||||
int String::indexOf(char ch, unsigned int fromIndex) const {
|
||||
if (fromIndex >= len) {
|
||||
return -1;
|
||||
}
|
||||
const char *temp = strchr(buffer + fromIndex, ch);
|
||||
if (temp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return temp - buffer;
|
||||
}
|
||||
|
||||
int String::indexOf(const String &s2) const {
|
||||
return indexOf(s2, 0);
|
||||
}
|
||||
|
||||
int String::indexOf(const String &s2, unsigned int fromIndex) const {
|
||||
if (fromIndex >= len) {
|
||||
return -1;
|
||||
}
|
||||
const char *found = strstr(buffer + fromIndex, s2.buffer);
|
||||
if (found == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return found - buffer;
|
||||
}
|
||||
|
||||
int String::lastIndexOf(char theChar) const {
|
||||
return lastIndexOf(theChar, len - 1);
|
||||
}
|
||||
|
||||
int String::lastIndexOf(char ch, unsigned int fromIndex) const {
|
||||
if (fromIndex >= len) {
|
||||
return -1;
|
||||
}
|
||||
char tempchar = buffer[fromIndex + 1];
|
||||
buffer[fromIndex + 1] = '\0';
|
||||
char *temp = strrchr(buffer, ch);
|
||||
buffer[fromIndex + 1] = tempchar;
|
||||
if (temp == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return temp - buffer;
|
||||
}
|
||||
|
||||
int String::lastIndexOf(const String &s2) const {
|
||||
return lastIndexOf(s2, len - s2.len);
|
||||
}
|
||||
|
||||
int String::lastIndexOf(const String &s2, unsigned int fromIndex) const {
|
||||
if (s2.len == 0 || len == 0 || s2.len > len) {
|
||||
return -1;
|
||||
}
|
||||
if (fromIndex >= len) {
|
||||
fromIndex = len - 1;
|
||||
}
|
||||
int found = -1;
|
||||
for (char *p = buffer; p <= buffer + fromIndex; p++) {
|
||||
p = strstr(p, s2.buffer);
|
||||
if (!p) {
|
||||
break;
|
||||
}
|
||||
if ((unsigned int)(p - buffer) <= fromIndex) {
|
||||
found = p - buffer;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
String String::substring(unsigned int left, unsigned int right) const {
|
||||
if (left > right) {
|
||||
unsigned int temp = right;
|
||||
right = left;
|
||||
left = temp;
|
||||
}
|
||||
String out;
|
||||
if (left >= len) {
|
||||
return out;
|
||||
}
|
||||
if (right > len) {
|
||||
right = len;
|
||||
}
|
||||
char temp = buffer[right]; // save the replaced character
|
||||
buffer[right] = '\0';
|
||||
out = buffer + left; // pointer arithmetic
|
||||
buffer[right] = temp; //restore character
|
||||
return out;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Modification */
|
||||
/*********************************************/
|
||||
|
||||
void String::replace(char find, char replace) {
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
for (char *p = buffer; *p; p++) {
|
||||
if (*p == find) {
|
||||
*p = replace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void String::replace(const String &find, const String &replace) {
|
||||
if (len == 0 || find.len == 0) {
|
||||
return;
|
||||
}
|
||||
int diff = replace.len - find.len;
|
||||
char *readFrom = buffer;
|
||||
char *foundAt;
|
||||
if (diff == 0) {
|
||||
while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
|
||||
memcpy(foundAt, replace.buffer, replace.len);
|
||||
readFrom = foundAt + replace.len;
|
||||
}
|
||||
}
|
||||
else if (diff < 0) {
|
||||
char *writeTo = buffer;
|
||||
while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
|
||||
unsigned int n = foundAt - readFrom;
|
||||
memcpy(writeTo, readFrom, n);
|
||||
writeTo += n;
|
||||
memcpy(writeTo, replace.buffer, replace.len);
|
||||
writeTo += replace.len;
|
||||
readFrom = foundAt + find.len;
|
||||
len += diff;
|
||||
}
|
||||
strcpy(writeTo, readFrom);
|
||||
}
|
||||
else {
|
||||
unsigned int size = len; // compute size needed for result
|
||||
while ((foundAt = strstr(readFrom, find.buffer)) != NULL) {
|
||||
readFrom = foundAt + find.len;
|
||||
size += diff;
|
||||
}
|
||||
if (size == len) {
|
||||
return;
|
||||
}
|
||||
if (size > capacity && !changeBuffer(size)) {
|
||||
return; // XXX: tell user!
|
||||
}
|
||||
int index = len - 1;
|
||||
while (index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
|
||||
readFrom = buffer + index + find.len;
|
||||
memmove(readFrom + diff, readFrom, len - (readFrom - buffer));
|
||||
len += diff;
|
||||
buffer[len] = 0;
|
||||
memcpy(buffer + index, replace.buffer, replace.len);
|
||||
index--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void String::remove(unsigned int index) {
|
||||
// Pass the biggest integer as the count. The remove method
|
||||
// below will take care of truncating it at the end of the
|
||||
// string.
|
||||
remove(index, (unsigned int) -1);
|
||||
}
|
||||
|
||||
void String::remove(unsigned int index, unsigned int count) {
|
||||
if (index >= len) {
|
||||
return;
|
||||
}
|
||||
if (count == 0) {
|
||||
return;
|
||||
}
|
||||
if (count > len - index) {
|
||||
count = len - index;
|
||||
}
|
||||
char *writeTo = buffer + index;
|
||||
len = len - count;
|
||||
memmove(writeTo, buffer + index + count, len - index);
|
||||
buffer[len] = 0;
|
||||
}
|
||||
|
||||
void String::toLowerCase(void) {
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
for (char *p = buffer; *p; p++) {
|
||||
*p = tolower(*p);
|
||||
}
|
||||
}
|
||||
|
||||
void String::toUpperCase(void) {
|
||||
if (!buffer) {
|
||||
return;
|
||||
}
|
||||
for (char *p = buffer; *p; p++) {
|
||||
*p = toupper(*p);
|
||||
}
|
||||
}
|
||||
|
||||
void String::trim(void) {
|
||||
if (!buffer || len == 0) {
|
||||
return;
|
||||
}
|
||||
char *begin = buffer;
|
||||
while (isspace(*begin)) {
|
||||
begin++;
|
||||
}
|
||||
char *end = buffer + len - 1;
|
||||
while (isspace(*end) && end >= begin) {
|
||||
end--;
|
||||
}
|
||||
len = end + 1 - begin;
|
||||
if (begin > buffer) {
|
||||
memmove(buffer, begin, len);
|
||||
}
|
||||
buffer[len] = 0;
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
/* Parsing / Conversion */
|
||||
/*********************************************/
|
||||
|
||||
long String::toInt(void) const {
|
||||
if (buffer) {
|
||||
return atol(buffer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
float String::toFloat(void) const {
|
||||
return float(toDouble());
|
||||
}
|
||||
|
||||
double String::toDouble(void) const {
|
||||
if (buffer) {
|
||||
return atof(buffer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
98
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Udp.h
vendored
Normal file
98
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/Udp.h
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Udp.cpp: Library to send/receive UDP packets.
|
||||
*
|
||||
* NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray
|
||||
* for mentioning these)
|
||||
* 1) UDP does not guarantee the order in which assembled UDP packets are
|
||||
* received. This might not happen often in practice, but in larger network
|
||||
* topologies, a UDP packet can be received out of sequence.
|
||||
* 2) UDP does not guard against lost packets - so packets *can* disappear
|
||||
* without the sender being aware of it. Again, this may not be a concern in
|
||||
* practice on small local networks.
|
||||
* For more information, see http://www.cafeaulait.org/course/week12/35.html
|
||||
*
|
||||
* MIT License:
|
||||
* Copyright (c) 2008 Bjoern Hartmann
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* bjoern@cs.stanford.edu 12/30/2008
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stream.h"
|
||||
#include "IPAddress.h"
|
||||
|
||||
class UDP : public Stream {
|
||||
|
||||
public:
|
||||
// initialize, start listening on specified port. Returns 1 if successful,
|
||||
// 0 if there are no sockets available to use
|
||||
virtual uint8_t begin(uint16_t) = 0;
|
||||
virtual void stop() = 0; // Finish with the UDP socket
|
||||
|
||||
// Sending UDP packets
|
||||
|
||||
// Start building up a packet to send to the remote host specific in ip and
|
||||
// port
|
||||
// Returns 1 if successful, 0 if there was a problem with the supplied IP
|
||||
// address or port
|
||||
virtual int beginPacket(IPAddress ip, uint16_t port) = 0;
|
||||
// Start building up a packet to send to the remote host specific in host
|
||||
// and port
|
||||
// Returns 1 if successful, 0 if there was a problem resolving the hostname
|
||||
// or port
|
||||
virtual int beginPacket(const char *host, uint16_t port) = 0;
|
||||
// Finish off this packet and send it
|
||||
// Returns 1 if the packet was sent successfully, 0 if there was an error
|
||||
virtual int endPacket() = 0;
|
||||
// Write a single byte into the packet
|
||||
virtual size_t write(uint8_t) = 0;
|
||||
// Write size bytes from buffer into the packet
|
||||
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
|
||||
|
||||
// Start processing the next available incoming packet
|
||||
// Returns the size of the packet in bytes, or 0 if no packets are available
|
||||
virtual int parsePacket() = 0;
|
||||
// Number of bytes remaining in the current packet
|
||||
virtual int available() = 0;
|
||||
// Read a single byte from the current packet
|
||||
virtual int read() = 0;
|
||||
// Read up to len bytes from the current packet and place them into buffer
|
||||
// Returns the number of bytes read, or 0 if none are available
|
||||
virtual int read(unsigned char *buffer, size_t len) = 0;
|
||||
// Read up to len characters from the current packet and place them into
|
||||
// buffer
|
||||
// Returns the number of characters read, or 0 if none are available
|
||||
virtual int read(char *buffer, size_t len) = 0;
|
||||
// Return the next byte from the current packet without moving on to the
|
||||
// next byte
|
||||
virtual int peek() = 0;
|
||||
virtual void flush() = 0; // Finish reading the current packet
|
||||
|
||||
// Return the IP address of the host who sent the current incoming packet
|
||||
virtual IPAddress remoteIP() = 0;
|
||||
// Return the port of the host who sent the current incoming packet
|
||||
virtual uint16_t remotePort() = 0;
|
||||
protected:
|
||||
uint8_t *rawIPAddress(IPAddress &addr) {
|
||||
return addr.raw_address();
|
||||
};
|
||||
};
|
||||
|
||||
137
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/WCharacter.h
vendored
Normal file
137
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/WCharacter.h
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
WCharacter.h - Character utility functions for Wiring & Arduino
|
||||
Copyright (c) 2010 Hernando Barragan. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef Character_h
|
||||
#define Character_h
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
// WCharacter.h prototypes
|
||||
inline bool isAlphaNumeric(int c) __attribute__((always_inline));
|
||||
inline bool isAlpha(int c) __attribute__((always_inline));
|
||||
inline bool isAscii(int c) __attribute__((always_inline));
|
||||
inline bool isWhitespace(int c) __attribute__((always_inline));
|
||||
inline bool isControl(int c) __attribute__((always_inline));
|
||||
inline bool isDigit(int c) __attribute__((always_inline));
|
||||
inline bool isGraph(int c) __attribute__((always_inline));
|
||||
inline bool isLowerCase(int c) __attribute__((always_inline));
|
||||
inline bool isPrintable(int c) __attribute__((always_inline));
|
||||
inline bool isPunct(int c) __attribute__((always_inline));
|
||||
inline bool isSpace(int c) __attribute__((always_inline));
|
||||
inline bool isUpperCase(int c) __attribute__((always_inline));
|
||||
inline bool isHexadecimalDigit(int c) __attribute__((always_inline));
|
||||
inline int toAscii(int c) __attribute__((always_inline));
|
||||
inline int toLowerCase(int c) __attribute__((always_inline));
|
||||
inline int toUpperCase(int c)__attribute__((always_inline));
|
||||
|
||||
|
||||
// Checks for an alphanumeric character.
|
||||
// It is equivalent to (isalpha(c) || isdigit(c)).
|
||||
inline bool isAlphaNumeric(int c) {
|
||||
return (isalnum(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for an alphabetic character.
|
||||
// It is equivalent to (isupper(c) || islower(c)).
|
||||
inline bool isAlpha(int c) {
|
||||
return (isalpha(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks whether c is a 7-bit unsigned char value
|
||||
// that fits into the ASCII character set.
|
||||
inline bool isAscii(int c) {
|
||||
return (isascii(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for a blank character, that is, a space or a tab.
|
||||
inline bool isWhitespace(int c) {
|
||||
return (isblank(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for a control character.
|
||||
inline bool isControl(int c) {
|
||||
return (iscntrl(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for a digit (0 through 9).
|
||||
inline bool isDigit(int c) {
|
||||
return (isdigit(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for any printable character except space.
|
||||
inline bool isGraph(int c) {
|
||||
return (isgraph(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for a lower-case character.
|
||||
inline bool isLowerCase(int c) {
|
||||
return (islower(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for any printable character including space.
|
||||
inline bool isPrintable(int c) {
|
||||
return (isprint(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for any printable character which is not a space
|
||||
// or an alphanumeric character.
|
||||
inline bool isPunct(int c) {
|
||||
return (ispunct(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for white-space characters. For the avr-libc library,
|
||||
// these are: space, formfeed ('\f'), newline ('\n'), carriage
|
||||
// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v').
|
||||
inline bool isSpace(int c) {
|
||||
return (isspace(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for an uppercase letter.
|
||||
inline bool isUpperCase(int c) {
|
||||
return (isupper(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7
|
||||
// 8 9 a b c d e f A B C D E F.
|
||||
inline bool isHexadecimalDigit(int c) {
|
||||
return (isxdigit(c) == 0 ? false : true);
|
||||
}
|
||||
|
||||
// Converts c to a 7-bit unsigned char value that fits into the
|
||||
// ASCII character set, by clearing the high-order bits.
|
||||
inline int toAscii(int c) {
|
||||
return toascii(c);
|
||||
}
|
||||
|
||||
// Warning:
|
||||
// Many people will be unhappy if you use this function.
|
||||
// This function will convert accented letters into random
|
||||
// characters.
|
||||
|
||||
// Converts the letter c to lower case, if possible.
|
||||
inline int toLowerCase(int c) {
|
||||
return tolower(c);
|
||||
}
|
||||
|
||||
// Converts the letter c to upper case, if possible.
|
||||
inline int toUpperCase(int c) {
|
||||
return toupper(c);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,34 @@
|
||||
/*
|
||||
dtostrf - Emulation for dtostrf function from avr-libc
|
||||
Copyright (c) 2015 Arduino LLC. All rights reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(ARDUINO_ARCH_AVR)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *dtostrf(double val, signed char width, unsigned char prec, char *sout);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,23 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LCC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*
|
||||
Empty file.
|
||||
This file is here to allow compatibility with sketches (made for AVR)
|
||||
that includes <AVR/interrupt.h>
|
||||
*/
|
||||
@ -0,0 +1,122 @@
|
||||
/*
|
||||
pgmspace.h - Definitions for compatibility with AVR pgmspace macros
|
||||
|
||||
Copyright (c) 2015 Arduino LLC
|
||||
|
||||
Based on work of Paul Stoffregen on Teensy 3 (http://pjrc.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE
|
||||
*/
|
||||
|
||||
#ifndef __PGMSPACE_H_
|
||||
#define __PGMSPACE_H_ 1
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#define PROGMEM
|
||||
#define PGM_P const char *
|
||||
#define PSTR(str) (str)
|
||||
|
||||
#define _SFR_BYTE(n) (n)
|
||||
|
||||
typedef void prog_void;
|
||||
typedef char prog_char;
|
||||
typedef unsigned char prog_uchar;
|
||||
typedef int8_t prog_int8_t;
|
||||
typedef uint8_t prog_uint8_t;
|
||||
typedef int16_t prog_int16_t;
|
||||
typedef uint16_t prog_uint16_t;
|
||||
typedef int32_t prog_int32_t;
|
||||
typedef uint32_t prog_uint32_t;
|
||||
typedef int64_t prog_int64_t;
|
||||
typedef uint64_t prog_uint64_t;
|
||||
|
||||
typedef const void *int_farptr_t;
|
||||
typedef const void *uint_farptr_t;
|
||||
|
||||
#define memchr_P(s, c, n) memchr((s), (c), (n))
|
||||
#define memcmp_P(s1, s2, n) memcmp((s1), (s2), (n))
|
||||
#define memccpy_P(dest, src, c, n) memccpy((dest), (src), (c), (n))
|
||||
#define memcpy_P(dest, src, n) memcpy((dest), (src), (n))
|
||||
#define memmem_P(haystack, haystacklen, needle, needlelen) memmem((haystack), (haystacklen), (needle), (needlelen))
|
||||
#define memrchr_P(s, c, n) memrchr((s), (c), (n))
|
||||
#define strcat_P(dest, src) strcat((dest), (src))
|
||||
#define strchr_P(s, c) strchr((s), (c))
|
||||
#define strchrnul_P(s, c) strchrnul((s), (c))
|
||||
#define strcmp_P(a, b) strcmp((a), (b))
|
||||
#define strcpy_P(dest, src) strcpy((dest), (src))
|
||||
#define strcasecmp_P(s1, s2) strcasecmp((s1), (s2))
|
||||
#define strcasestr_P(haystack, needle) strcasestr((haystack), (needle))
|
||||
#define strcspn_P(s, accept) strcspn((s), (accept))
|
||||
#define strlcat_P(s1, s2, n) strlcat((s1), (s2), (n))
|
||||
#define strlcpy_P(s1, s2, n) strlcpy((s1), (s2), (n))
|
||||
#define strlen_P(a) strlen((a))
|
||||
#define strnlen_P(s, n) strnlen((s), (n))
|
||||
#define strncmp_P(s1, s2, n) strncmp((s1), (s2), (n))
|
||||
#define strncasecmp_P(s1, s2, n) strncasecmp((s1), (s2), (n))
|
||||
#define strncat_P(s1, s2, n) strncat((s1), (s2), (n))
|
||||
#define strncpy_P(s1, s2, n) strncpy((s1), (s2), (n))
|
||||
#define strpbrk_P(s, accept) strpbrk((s), (accept))
|
||||
#define strrchr_P(s, c) strrchr((s), (c))
|
||||
#define strsep_P(sp, delim) strsep((sp), (delim))
|
||||
#define strspn_P(s, accept) strspn((s), (accept))
|
||||
#define strstr_P(a, b) strstr((a), (b))
|
||||
#define strtok_P(s, delim) strtok((s), (delim))
|
||||
#define strtok_rP(s, delim, last) strtok((s), (delim), (last))
|
||||
|
||||
#define strlen_PF(a) strlen((a))
|
||||
#define strnlen_PF(src, len) strnlen((src), (len))
|
||||
#define memcpy_PF(dest, src, len) memcpy((dest), (src), (len))
|
||||
#define strcpy_PF(dest, src) strcpy((dest), (src))
|
||||
#define strncpy_PF(dest, src, len) strncpy((dest), (src), (len))
|
||||
#define strcat_PF(dest, src) strcat((dest), (src))
|
||||
#define strlcat_PF(dest, src, len) strlcat((dest), (src), (len))
|
||||
#define strncat_PF(dest, src, len) strncat((dest), (src), (len))
|
||||
#define strcmp_PF(s1, s2) strcmp((s1), (s2))
|
||||
#define strncmp_PF(s1, s2, n) strncmp((s1), (s2), (n))
|
||||
#define strcasecmp_PF(s1, s2) strcasecmp((s1), (s2))
|
||||
#define strncasecmp_PF(s1, s2, n) strncasecmp((s1), (s2), (n))
|
||||
#define strstr_PF(s1, s2) strstr((s1), (s2))
|
||||
#define strlcpy_PF(dest, src, n) strlcpy((dest), (src), (n))
|
||||
#define memcmp_PF(s1, s2, n) memcmp((s1), (s2), (n))
|
||||
|
||||
#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__)
|
||||
#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__)
|
||||
|
||||
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
|
||||
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
|
||||
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
|
||||
#define pgm_read_float(addr) (*(const float *)(addr))
|
||||
#define pgm_read_ptr(addr) (*(const void *)(addr))
|
||||
|
||||
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
|
||||
#define pgm_read_word_near(addr) pgm_read_word(addr)
|
||||
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
|
||||
#define pgm_read_float_near(addr) pgm_read_float(addr)
|
||||
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
|
||||
|
||||
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
|
||||
#define pgm_read_word_far(addr) pgm_read_word(addr)
|
||||
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
|
||||
#define pgm_read_float_far(addr) pgm_read_float(addr)
|
||||
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
|
||||
|
||||
#define pgm_get_far_address(addr) (&(addr))
|
||||
|
||||
#endif
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Client.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Client.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Client.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Client.h"
|
||||
|
||||
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/HardwareSerial.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/HardwareSerial.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including HardwareSerial.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../HardwareSerial.h"
|
||||
|
||||
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/IPAddress.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/IPAddress.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including IPAddress.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../IPAddress.h"
|
||||
|
||||
|
||||
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Print.h
vendored
Normal file
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Print.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Print.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Print.h"
|
||||
|
||||
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Printable.h
vendored
Normal file
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Printable.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Printable.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Printable.h"
|
||||
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Server.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Server.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Server.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Server.h"
|
||||
|
||||
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Stream.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Stream.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Stream.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Stream.h"
|
||||
|
||||
|
||||
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Udp.h
vendored
Normal file
25
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/Udp.h
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including Udp.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../Udp.h"
|
||||
|
||||
|
||||
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/WString.h
vendored
Normal file
24
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/deprecated/WString.h
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2016, Arduino LLC. All Right Reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// including WString.h is deprecated, for all future projects use Arduino.h instead
|
||||
|
||||
// This include is added for compatibility, it will be remove on the next
|
||||
// major release of the API
|
||||
#include "../String.h"
|
||||
|
||||
37
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/dtostrf.c
vendored
Normal file
37
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/dtostrf.c
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
dtostrf - Emulation for dtostrf function from avr-libc
|
||||
Copyright (c) 2016 Arduino LLC. All rights reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// This is a default implementation for dtostrf function.
|
||||
// This file should be used if the standard lib doesn't provide an
|
||||
// implementation of dtostrf.
|
||||
|
||||
// Create a file called "dtostrf.c" with the following include:
|
||||
// #include "api/deprecated-avr-comp/avr/dtostrf.c.impl"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
char *dtostrf (double val, signed char width, unsigned char prec, char *sout) {
|
||||
asm(".global _printf_float");
|
||||
|
||||
char fmt[20];
|
||||
sprintf(fmt, "%%%d.%df", width, prec);
|
||||
sprintf(sout, fmt, val);
|
||||
return sout;
|
||||
}
|
||||
|
||||
133
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/itoa.c
vendored
Normal file
133
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/itoa.c
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
Copyright (c) 2014 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "itoa.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef IMPL_ITOA
|
||||
// DCB: We need to keep the implementations of the functions in this file!
|
||||
// ltoa, itoa, etc. are not in the ANSI-C or C++ standards, so not
|
||||
// all compilers support them. You may be able to replace these with
|
||||
// standard versions in some cases, but they won't always work for everyone.
|
||||
|
||||
char* ltoa( long value, char *string, int radix )
|
||||
{
|
||||
char tmp[33];
|
||||
char *tp = tmp;
|
||||
long i;
|
||||
unsigned long v;
|
||||
int sign;
|
||||
char *sp;
|
||||
|
||||
if ( string == NULL )
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
if (radix > 36 || radix <= 1)
|
||||
{
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
sign = (radix == 10 && value < 0);
|
||||
if (sign)
|
||||
{
|
||||
v = -value;
|
||||
}
|
||||
else
|
||||
{
|
||||
v = (unsigned long)value;
|
||||
}
|
||||
|
||||
while (v || tp == tmp)
|
||||
{
|
||||
i = v % radix;
|
||||
v = v / radix;
|
||||
if (i < 10)
|
||||
*tp++ = i+'0';
|
||||
else
|
||||
*tp++ = i + 'a' - 10;
|
||||
}
|
||||
|
||||
sp = string;
|
||||
|
||||
if (sign)
|
||||
*sp++ = '-';
|
||||
while (tp > tmp)
|
||||
*sp++ = *--tp;
|
||||
*sp = 0;
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char* ultoa( unsigned long value, char *string, int radix )
|
||||
{
|
||||
char tmp[33];
|
||||
char *tp = tmp;
|
||||
long i;
|
||||
unsigned long v = value;
|
||||
char *sp;
|
||||
|
||||
if ( string == NULL )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (radix > 36 || radix <= 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (v || tp == tmp)
|
||||
{
|
||||
i = v % radix;
|
||||
v = v / radix;
|
||||
if (i < 10)
|
||||
*tp++ = i+'0';
|
||||
else
|
||||
*tp++ = i + 'a' - 10;
|
||||
}
|
||||
|
||||
sp = string;
|
||||
|
||||
|
||||
while (tp > tmp)
|
||||
*sp++ = *--tp;
|
||||
*sp = 0;
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
char* itoa( int value, char *string, int radix )
|
||||
{
|
||||
return ltoa( value, string, radix ) ;
|
||||
}
|
||||
|
||||
char* utoa( unsigned int value, char *string, int radix )
|
||||
{
|
||||
return ultoa( value, string, radix ) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
50
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/itoa.h
vendored
Normal file
50
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/api/itoa.h
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright (c) 2016 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Standard C functions required in Arduino API
|
||||
// If these functions are not provided by the standard library, the
|
||||
// core should supply an implementation of them.
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef IMPL_ITOA
|
||||
extern char *itoa(int value, char *string, int radix);
|
||||
extern char *ltoa(long value, char *string, int radix);
|
||||
extern char *utoa(unsigned value, char *string, int radix);
|
||||
extern char *ultoa(unsigned long value, char *string, int radix);
|
||||
|
||||
#else
|
||||
|
||||
#include "stdlib.h"
|
||||
extern char *ltoa(long value, char *string, int radix) {
|
||||
return itoa((int)value, string, radix);
|
||||
}
|
||||
|
||||
extern char *ultoa(unsigned long value, char *string, int radix) {
|
||||
return utoa((unsigned)value, string, radix);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
56
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/delay.cpp
vendored
Normal file
56
vendor/teknic/clear-core/ClearCore-Arduino-wrapper/cores/arduino/delay.cpp
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
Copyright (c) 2015 Arduino LLC. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <sam.h>
|
||||
#include "Reset.h" // for tickReset()
|
||||
#include "SysTiming.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Tick Counter united by ms */
|
||||
static volatile uint32_t _ulTickCount = 0;
|
||||
|
||||
unsigned long millis(void) {
|
||||
return Milliseconds();
|
||||
}
|
||||
|
||||
unsigned long micros(void) {
|
||||
return Microseconds();
|
||||
}
|
||||
|
||||
void delay(unsigned long ms) {
|
||||
Delay_ms(ms);
|
||||
}
|
||||
|
||||
void delayMicroseconds(unsigned int usec) {
|
||||
Delay_us(usec);
|
||||
}
|
||||
|
||||
void SysTick_DefaultHandler(void) {
|
||||
// Increment tick count each ms
|
||||
_ulTickCount++;
|
||||
// See if USB Serial or others have caused a reset to bootloader cycle
|
||||
tickReset();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user