Skip to content

Commit 33aa7a4

Browse files
committed
first commit
0 parents  commit 33aa7a4

File tree

130 files changed

+44918
-0
lines changed

Some content is hidden

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

130 files changed

+44918
-0
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Specific
2+
astyle.out
3+
boards.local.txt
4+
platform.local.txt
5+
path_config.json
6+
update_config.json
7+
variant_config.json
8+
9+
# Backup
10+
*.bak
11+
*.gho
12+
*.ori
13+
*.swp
14+
*.tmp
15+
16+
# macOS
17+
# General
18+
.DS_Store
19+
.AppleDouble
20+
.LSOverride
21+
22+
# Patch
23+
*.orig
24+
*.rej
25+
26+
# Python
27+
# Byte-compiled / optimized / DLL files
28+
__pycache__/
29+
*.py[cod]
30+
*$py.class
31+
32+
# VisualStudioCode
33+
.vscode/*
34+
*.code-workspace
35+
36+
Unsupport/*

ArduinoCore-AT32F403A/boards.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#
2+
menu.upload_method=Upload method
3+
menu.pll_clock_source=pll_clock_source
4+
menu.pll_mult=pll_mult
5+
menu.pll_output_range=pll_output_range
6+
7+
WeActStudioAT32F4.name=AT32F403ACGU7 BlackPill Boards
8+
WeActStudioAT32F4.build.mcu=cortex-m4
9+
WeActStudioAT32F4.build.f_cpu=80000000L
10+
WeActStudioAT32F4.build.board=AT32F403ACGxx
11+
WeActStudioAT32F4.build.vect_flags=-DUSER_ADDR_ROM=0x08000000
12+
WeActStudioAT32F4.build.core=arduino
13+
WeActStudioAT32F4.build.extra_flags=-DAT32F403ACGU7 -USE_STDPERIPH_DRIVER
14+
WeActStudioAT32F4.build.variant=AT32F403ACGU7
15+
WeActStudioAT32F4.build.variant_system_lib=FrameLib.a
16+
WeActStudioAT32F4.build.ldscript=linker_scripts\AT32F403AxG_FLASH.ld
17+
18+
WeActStudioAT32F4.menu.pll_clock_source.hext_div2=high speed external crystal div 2
19+
WeActStudioAT32F4.menu.pll_clock_source.hext_div2.build.f_pll_clock_source=2
20+
WeActStudioAT32F4.menu.pll_clock_source.hext_div2.build.f_hext_div=CRM_HEXT_DIV_2
21+
WeActStudioAT32F4.menu.pll_clock_source.hext_div2.build.f_hsi_div=CRM_HICK48_DIV6
22+
WeActStudioAT32F4.menu.pll_clock_source.hext_div3=high speed external crystal div 3
23+
WeActStudioAT32F4.menu.pll_clock_source.hext_div3.build.f_pll_clock_source=2
24+
WeActStudioAT32F4.menu.pll_clock_source.hext_div3.build.f_hext_div=CRM_HEXT_DIV_3
25+
WeActStudioAT32F4.menu.pll_clock_source.hext_div3.build.f_hsi_div=CRM_HICK48_DIV6
26+
WeActStudioAT32F4.menu.pll_clock_source.hext_div4=high speed external crystal div 4
27+
WeActStudioAT32F4.menu.pll_clock_source.hext_div4.build.f_pll_clock_source=2
28+
WeActStudioAT32F4.menu.pll_clock_source.hext_div4.build.f_hext_div=CRM_HEXT_DIV_4
29+
WeActStudioAT32F4.menu.pll_clock_source.hext_div4.build.f_hsi_div=CRM_HICK48_DIV6
30+
WeActStudioAT32F4.menu.pll_clock_source.hext_div5=high speed external crystal div 5
31+
WeActStudioAT32F4.menu.pll_clock_source.hext_div5.build.f_pll_clock_source=2
32+
WeActStudioAT32F4.menu.pll_clock_source.hext_div5.build.f_hext_div=CRM_HEXT_DIV_5
33+
WeActStudioAT32F4.menu.pll_clock_source.hext_div5.build.f_hsi_div=CRM_HICK48_DIV6
34+
WeActStudioAT32F4.menu.pll_clock_source.hext_div1=high speed external crystal div 1
35+
WeActStudioAT32F4.menu.pll_clock_source.hext_div1.build.f_pll_clock_source=1
36+
WeActStudioAT32F4.menu.pll_clock_source.hext_div1.build.f_hext_div=CRM_HEXT_DIV_2
37+
WeActStudioAT32F4.menu.pll_clock_source.hext_div1.build.f_hsi_div=CRM_HICK48_DIV6
38+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div6=high speed internal clock(48mhz) div 6
39+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div6.build.f_pll_clock_source=0
40+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div6.build.f_hsi_div=CRM_HICK48_DIV6
41+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div6.build.f_hext_div=CRM_HEXT_DIV_2
42+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div1=high speed internal clock(48mhz)
43+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div1.build.f_pll_clock_source=0
44+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div1.build.f_hsi_div=CRM_HICK48_NODIV
45+
WeActStudioAT32F4.menu.pll_clock_source.hsi_div1.build.f_hext_div=CRM_HEXT_DIV_2
46+
47+
WeActStudioAT32F4.menu.pll_mult.pll_mult_60=pll multiplication factor 60
48+
WeActStudioAT32F4.menu.pll_mult.pll_mult_60.build.f_pll_mult=CRM_PLL_MULT_60
49+
WeActStudioAT32F4.menu.pll_mult.pll_mult_59=pll multiplication factor 59
50+
WeActStudioAT32F4.menu.pll_mult.pll_mult_59.build.f_pll_mult=CRM_PLL_MULT_59
51+
WeActStudioAT32F4.menu.pll_mult.pll_mult_58=pll multiplication factor 58
52+
WeActStudioAT32F4.menu.pll_mult.pll_mult_58.build.f_pll_mult=CRM_PLL_MULT_58
53+
WeActStudioAT32F4.menu.pll_mult.pll_mult_57=pll multiplication factor 57
54+
WeActStudioAT32F4.menu.pll_mult.pll_mult_57.build.f_pll_mult=CRM_PLL_MULT_57
55+
WeActStudioAT32F4.menu.pll_mult.pll_mult_56=pll multiplication factor 56
56+
WeActStudioAT32F4.menu.pll_mult.pll_mult_56.build.f_pll_mult=CRM_PLL_MULT_56
57+
WeActStudioAT32F4.menu.pll_mult.pll_mult_55=pll multiplication factor 55
58+
WeActStudioAT32F4.menu.pll_mult.pll_mult_55.build.f_pll_mult=CRM_PLL_MULT_55
59+
WeActStudioAT32F4.menu.pll_mult.pll_mult_54=pll multiplication factor 54
60+
WeActStudioAT32F4.menu.pll_mult.pll_mult_54.build.f_pll_mult=CRM_PLL_MULT_54
61+
WeActStudioAT32F4.menu.pll_mult.pll_mult_53=pll multiplication factor 53
62+
WeActStudioAT32F4.menu.pll_mult.pll_mult_53.build.f_pll_mult=CRM_PLL_MULT_53
63+
WeActStudioAT32F4.menu.pll_mult.pll_mult_52=pll multiplication factor 52
64+
WeActStudioAT32F4.menu.pll_mult.pll_mult_52.build.f_pll_mult=CRM_PLL_MULT_52
65+
WeActStudioAT32F4.menu.pll_mult.pll_mult_51=pll multiplication factor 51
66+
WeActStudioAT32F4.menu.pll_mult.pll_mult_51.build.f_pll_mult=CRM_PLL_MULT_51
67+
WeActStudioAT32F4.menu.pll_mult.pll_mult_50=pll multiplication factor 50
68+
WeActStudioAT32F4.menu.pll_mult.pll_mult_50.build.f_pll_mult=CRM_PLL_MULT_50
69+
WeActStudioAT32F4.menu.pll_mult.pll_mult_40=pll multiplication factor 40
70+
WeActStudioAT32F4.menu.pll_mult.pll_mult_40.build.f_pll_mult=CRM_PLL_MULT_40
71+
WeActStudioAT32F4.menu.pll_mult.pll_mult_30=pll multiplication factor 30
72+
WeActStudioAT32F4.menu.pll_mult.pll_mult_30.build.f_pll_mult=CRM_PLL_MULT_30
73+
WeActStudioAT32F4.menu.pll_mult.pll_mult_20=pll multiplication factor 20
74+
WeActStudioAT32F4.menu.pll_mult.pll_mult_20.build.f_pll_mult=CRM_PLL_MULT_20
75+
WeActStudioAT32F4.menu.pll_mult.pll_mult_10=pll multiplication factor 10
76+
WeActStudioAT32F4.menu.pll_mult.pll_mult_10.build.f_pll_mult=CRM_PLL_MULT_10
77+
WeActStudioAT32F4.menu.pll_mult.pll_mult_2=pll multiplication factor 2
78+
WeActStudioAT32F4.menu.pll_mult.pll_mult_2.build.f_pll_mult=CRM_PLL_MULT_2
79+
80+
WeActStudioAT32F4.menu.pll_output_range.pll_output_range_gt72mhz=pll clock output range greater than 72mhz
81+
WeActStudioAT32F4.menu.pll_output_range.pll_output_range_gt72mhz.build.f_pll_output_range=CRM_PLL_OUTPUT_RANGE_GT72MHZ
82+
WeActStudioAT32F4.menu.pll_output_range.pll_output_range_le72mhz=pll clock output range less than or equal to 72mhz
83+
WeActStudioAT32F4.menu.pll_output_range.pll_output_range_le72mhz.build.f_pll_output_range=CRM_PLL_OUTPUT_RANGE_LE72MHZ
84+
85+
WeActStudioAT32F4.menu.upload_method.USBDFUMethod=Artery DFU ISP
86+
WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.protocol=Artery_ISP
87+
WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.tool=Artery_ISP_Console
88+
WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.maximum_size=1048576
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* MIT License
3+
* Copyright (c) 2017 - 2022 _VIFEXTech
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.
22+
*/
23+
#ifndef __ARDUINO_H
24+
#define __ARDUINO_H
25+
26+
#include <stdlib.h>
27+
#include <stdbool.h>
28+
#include "libcore/mcu_core.h"
29+
#include "binary.h"
30+
#include "avr/pgmspace.h"
31+
32+
#ifdef __cplusplus
33+
extern "C" {
34+
#endif
35+
36+
#define KEILDUINO_VERSION 100
37+
38+
#define PI 3.1415926535897932384626433832795f
39+
#define HALF_PI 1.5707963267948966192313216916398f
40+
#define TWO_PI 6.283185307179586476925286766559f
41+
#define DEG_TO_RAD 0.017453292519943295769236907684886f
42+
#define RAD_TO_DEG 57.295779513082320876798154814105f
43+
#define EULER 2.718281828459045235360287471352f
44+
45+
#define SERIAL 0x0
46+
#define DISPLAY 0x1
47+
48+
#define LSBFIRST 0x0
49+
#define MSBFIRST 0x1
50+
51+
#define LOW 0x0
52+
#define HIGH 0x1
53+
54+
#define min(a,b) ((a)<(b)?(a):(b))
55+
#define max(a,b) ((a)>(b)?(a):(b))
56+
#define ABS(x) (((x)>0)?(x):-(x)) //abs(x) is define in stdlib.h
57+
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
58+
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
59+
#define radians(deg) ((deg)*DEG_TO_RAD)
60+
#define degrees(rad) ((rad)*RAD_TO_DEG)
61+
#define sq(x) ((x)*(x))
62+
63+
#define lowByte(w) ((uint8_t) ((w) & 0xff))
64+
#define highByte(w) ((uint8_t) ((w) >> 8))
65+
66+
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
67+
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
68+
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
69+
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
70+
71+
#ifndef _BV
72+
# define _BV(bit) (1 << (bit))
73+
#endif
74+
75+
#define clockCyclesPerMicrosecond() (F_CPU / 1000000L)
76+
#define clockCyclesToMicroseconds(a) (((a) * 1000L) / (F_CPU / 1000L))
77+
#define microsecondsToClockCycles(a) ((a) * (F_CPU / 1000000L))
78+
79+
#define delay(ms) delay_ms(ms)
80+
#define delayMicroseconds(us) delay_us(us)
81+
82+
#define interrupts() sei()
83+
#define noInterrupts() cli()
84+
85+
#define NOT_A_PIN 0xFF
86+
#define NOT_A_PORT 0xFF
87+
#define NOT_AN_INTERRUPT -1
88+
89+
#define boolean bool
90+
typedef unsigned char byte;
91+
92+
void pinMode(uint8_t pin, PinMode_TypeDef mode);
93+
void digitalWrite(uint8_t pin, uint8_t value);
94+
uint8_t digitalRead(uint8_t pin);
95+
void analogWrite(uint8_t pin, uint16_t value);
96+
uint16_t analogRead(uint8_t pin);
97+
uint16_t analogRead_DMA(uint8_t pin);
98+
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t value);
99+
uint32_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint32_t bitOrder);
100+
uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout);
101+
102+
long map(long x, long in_min, long in_max, long out_min, long out_max);
103+
float fmap(float x, float in_min, float in_max, float out_min, float out_max);
104+
void yield(void);
105+
106+
#ifdef __cplusplus
107+
}// extern "C"
108+
#endif
109+
110+
#ifdef __cplusplus
111+
# include "WCharacter.h"
112+
# include "WString.h"
113+
# include "WMath.h"
114+
# include <libcore/Tone.h>
115+
# include <libcore/HardwareSerial.h>
116+
#endif
117+
118+
#endif

0 commit comments

Comments
 (0)