Skip to content

Commit 90790ab

Browse files
committed
add: 添加库文件
1 parent 845e357 commit 90790ab

File tree

408 files changed

+42160
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+42160
-31
lines changed

.gitignore

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
1-
# Ignore editor backup files and macOS system metadata
2-
.DS_Store
3-
.*.swp
4-
.*.swo
5-
*~
1+
# Prerequisites
2+
*.d
63

7-
# Ignore build folder
8-
/build
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
99

10-
# Ignore files built by Visual Studio/Visual Micro
11-
[Dd]ebug/
12-
[Rr]elease/
13-
.vs/
14-
__vm/
15-
*.vcxproj*
16-
.vscode/
17-
platform.sloeber.txt
18-
boards.sloeber.txt
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
1913

20-
# Ignore docs build (Sphinx)
21-
docs/build
22-
docs/source/_build
23-
__pycache__/
24-
_build/
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
2518

26-
# Test log files
27-
*.log
28-
debug.cfg
29-
debug.svd
30-
debug_custom.json
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# vscode
35+
.vscode/*.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Air-duino
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

boards.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ GenF030.build.board=GenF030
4242
GenF030.build.mcu=cortex-m0plus
4343
GenF030.build.series=PY32F0xx
4444
GenF030.build.cmsis_lib_gcc=arm_cortexM0l_math
45-
# GenF030.build.product_line=AIR001
46-
# GenF030.build.variant=AIR001/AIR001_DEV
4745
GenF030.build.air_extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial}
48-
GenF030.build.drivers_include="-I{build.system.path}/Arduino-Air001-Drivers/{build.series}_HAL_Driver/Inc" "-I{build.system.path}/Arduino-Air001-Drivers/{build.series}_HAL_Driver/Src" "-I{build.system.path}/{build.series}" "-I{build.system.path}/Arduino-Air001-Drivers/CMSIS/Device/{build.series}/Include/" "-I{build.system.path}/Arduino-Air001-Drivers/CMSIS/Device/{build.series}/Source/gcc/"
46+
GenF030.build.drivers_include="-I{build.system.path}/Arduino-PY32F0xx-Drivers/{build.series}_HAL_Driver/Inc" "-I{build.system.path}/Arduino-PY32F0xx-Drivers/{build.series}_HAL_Driver/Src" "-I{build.system.path}/{build.series}" "-I{build.system.path}/Arduino-PY32F0xx-Drivers/CMSIS/Device/{build.series}/Include/" "-I{build.system.path}/Arduino-PY32F0xx-Drivers/CMSIS/Device/{build.series}/Source/gcc/"
4947

5048
GenF030.menu.UploadSpeed.115200=115200
5149
GenF030.menu.UploadSpeed.115200.upload.speed=115200
@@ -182,4 +180,3 @@ GenF030.menu.pnum.PY32F030K26T.upload.maximum_data_size=4096
182180
GenF030.menu.pnum.PY32F030K26T.build.board=PY32F030K26T
183181
GenF030.menu.pnum.PY32F030K26T.build.product_line=PY32F030x26
184182
GenF030.menu.pnum.PY32F030K26T.build.variant=PY32F030xx/PY32F030K26T
185-
GenF030.menu.pnum.PY32F030K26T.build.variant_h=variant_{build.board}.h

cores/arduino/Arduino.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
Arduino.h - Main include file for the Arduino SDK
3+
Copyright (c) 2005-2013 Arduino Team. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef Arduino_h
21+
#define Arduino_h
22+
23+
#ifndef GCC_VERSION
24+
#define GCC_VERSION (__GNUC__ * 10000 \
25+
+ __GNUC_MINOR__ * 100 \
26+
+ __GNUC_PATCHLEVEL__)
27+
#endif
28+
#if GCC_VERSION < 60300
29+
#error "GCC version 6.3 or higher is required"
30+
#endif
31+
32+
#ifdef __IN_ECLIPSE__
33+
#include "SrcWrapper.h"
34+
#endif
35+
36+
#include "wiring.h"
37+
38+
/* sketch */
39+
40+
#ifdef __cplusplus
41+
extern "C" {
42+
#endif // __cplusplus
43+
// Weak empty variant initialization function.
44+
// May be redefined by variant files.
45+
extern void initVariant() __attribute__((weak));
46+
47+
extern void setup(void) ;
48+
extern void loop(void) ;
49+
50+
void yield(void);
51+
#ifdef __cplusplus
52+
} // extern "C"
53+
#endif // __cplusplus
54+
55+
// Include pins variant
56+
#include "pins_arduino.h"
57+
58+
#endif // Arduino_h

cores/arduino/CMakeLists.txt

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
5+
add_library(core INTERFACE)
6+
add_library(core_usage INTERFACE)
7+
8+
target_include_directories(core_usage INTERFACE
9+
.
10+
)
11+
12+
13+
target_link_libraries(core_usage INTERFACE
14+
base_config
15+
)
16+
17+
target_link_libraries(core INTERFACE core_usage)
18+
19+
20+
21+
add_library(core_bin STATIC EXCLUDE_FROM_ALL
22+
abi.cpp
23+
avr/dtostrf.c
24+
board.c
25+
core_debug.c
26+
HardwareSerial.cpp
27+
hooks.c
28+
IPAddress.cpp
29+
itoa.c
30+
main.cpp
31+
pins_arduino.c
32+
Print.cpp
33+
RingBuffer.cpp
34+
air/startup_airyyxx.S
35+
Stream.cpp
36+
Tone.cpp
37+
USBSerial.cpp
38+
VirtIOSerial.cpp
39+
WInterrupts.cpp
40+
wiring_analog.c
41+
wiring_digital.c
42+
wiring_pulse.cpp
43+
wiring_shift.c
44+
wiring_time.c
45+
WMath.cpp
46+
WSerial.cpp
47+
WString.cpp
48+
)
49+
target_link_libraries(core_bin PUBLIC core_usage)
50+
51+
target_link_libraries(core INTERFACE
52+
core_bin
53+
)
54+

cores/arduino/Client.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
Client.h - Base class that provides Client
3+
Copyright (c) 2011 Adrian McEwen. All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#ifndef client_h
21+
#define client_h
22+
#include "Print.h"
23+
#include "Stream.h"
24+
#include "IPAddress.h"
25+
26+
class Client : public Stream {
27+
28+
public:
29+
virtual int connect(IPAddress ip, uint16_t port) = 0;
30+
virtual int connect(const char *host, uint16_t port) = 0;
31+
virtual size_t write(uint8_t) = 0;
32+
virtual size_t write(const uint8_t *buf, size_t size) = 0;
33+
virtual int available() = 0;
34+
virtual int read() = 0;
35+
virtual int read(uint8_t *buf, size_t size) = 0;
36+
virtual int peek() = 0;
37+
virtual void flush() = 0;
38+
virtual void stop() = 0;
39+
virtual uint8_t connected() = 0;
40+
virtual operator bool() = 0;
41+
protected:
42+
uint8_t *rawIPAddress(IPAddress &addr)
43+
{
44+
return addr.raw_address();
45+
};
46+
};
47+
48+
#endif

0 commit comments

Comments
 (0)