19 Commits

Author SHA1 Message Date
0146c32da4 batt display, low batt shutdown, timeout shutdown 2021-03-27 14:00:37 +01:00
79edcef8ce update firmware
add 3d cad design
updated PCB layout and chematics
2021-03-25 18:33:02 +01:00
7d9fbc228e added mechanical drawing, updated PCB dwg layer 2021-03-22 07:39:44 +01:00
e853f96505 updated footprints 2021-03-19 15:53:53 +01:00
e86caa99d7 update schematic to match proto pins 2021-03-19 13:57:24 +01:00
6094e47b15 modified code for different hardware version 2021-03-19 13:49:53 +01:00
9bdd68a8ae gitignore update 2021-03-19 13:47:25 +01:00
d0df1d9353 led-board v1.0 2021-03-18 21:15:12 +01:00
65c9807cac Merge branch 'master' of http://192.168.2.3/Bonobo.Git.Server/Leo-led-truck 2021-03-18 08:44:14 +01:00
0fc4b2669c upload invoices 2021-03-18 08:43:58 +01:00
0f1614382f v1.1 2021-03-18 08:08:47 +01:00
72494a4847 update 2021-03-02 13:03:26 +01:00
c001f0a3b9 silk update prep for order V1.0, added billing info 2021-03-02 13:01:25 +01:00
c03e9303a1 update pcb 2021-03-01 16:21:54 +01:00
fc3914eeb4 datasheets added 2021-02-22 17:25:14 +01:00
3eeba1e4c2 Merge branch 'master' of http://192.168.2.3/Bonobo.Git.Server/Leo-led-truck 2021-02-22 15:09:19 +01:00
647e2d36a3 gitignore added 2021-02-22 15:09:08 +01:00
29a09051a1 Merge commit '98f4790c70684bb30948741ef635366a231f1a53' 2021-02-22 15:07:38 +01:00
5b3a3cec8d Merge commit 'f96d466f25cadce2ab48258edd08b90da7a41be7' 2021-02-22 15:06:05 +01:00
89 changed files with 509267 additions and 21701 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.DS_Store
manufacturing.zip

17
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "PlatformIO",
"task": "Build",
"problemMatcher": [
"$platformio"
],
"group": {
"kind": "build",
"isDefault": true
},
"label": "PlatformIO: Build"
}
]
}

6
README.txt Normal file
View File

@@ -0,0 +1,6 @@
flashing
macos:
brewl install stlink
st-flash --reset --freq=4M write firmware.bin 0x8000000

45
boards/stm32l031k6.json Normal file
View File

@@ -0,0 +1,45 @@
{
"build": {
"cpu": "cortex-m0plus",
"extra_flags": "-DSTM32L031xx",
"f_cpu": "32000000L",
"mcu": "stm32l031k6t6",
"product_line": "STM32L031xx",
"variant": "STM32L031K6",
"variants_dir": "variants"
},
"debug": {
"default_tools": [
"stlink"
],
"jlink_device": "STM32L031K6",
"onboard_tools": [
"stlink"
],
"openocd_target": "stm32l0",
"svd_path": "STM32L0x1.svd"
},
"frameworks": [
"arduino",
"cmsis",
"mbed",
"stm32cube",
"libopencm3"
],
"name": "STM32L031K6",
"upload": {
"maximum_ram_size": 8192,
"maximum_size": 32768,
"protocol": "stlink",
"protocols": [
"jlink",
"cmsis-dap",
"stlink",
"blackmagic",
"mbed"
]
},
"url": "https://developer.mbed.org/platforms/ST-Nucleo-L031K6/",
"vendor": "ST"
}

View File

@@ -0,0 +1,74 @@
/*
Battery.cpp - Battery library
Copyright (c) 2014 Roberto Lo Giacco.
This program 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 3 of the
License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Battery.h"
#include <Arduino.h>
Battery::Battery(uint16_t minVoltage, uint16_t maxVoltage, uint8_t sensePin) {
this->sensePin = sensePin;
this->activationPin = 0xFF;
this->minVoltage = minVoltage;
this->maxVoltage = maxVoltage;
}
void Battery::begin(uint16_t refVoltage, float dividerRatio, mapFn_t mapFunction) {
this->refVoltage = refVoltage;
this->dividerRatio = dividerRatio;
pinMode(this->sensePin, INPUT);
if (this->activationPin < 0xFF) {
pinMode(this->activationPin, OUTPUT);
}
this->mapFunction = mapFunction ? mapFunction : &linear;
}
void Battery::onDemand(uint8_t activationPin, uint8_t activationMode) {
if (activationPin < 0xFF) {
this->activationPin = activationPin;
this->activationMode = activationMode;
pinMode(this->activationPin, OUTPUT);
digitalWrite(activationPin, !activationMode);
}
}
uint8_t Battery::level() {
return this->level(this->voltage());
}
uint8_t Battery::level(uint16_t voltage) {
if (voltage <= minVoltage) {
return 0;
} else if (voltage >= maxVoltage) {
return 100;
} else {
return (*mapFunction)(voltage, minVoltage, maxVoltage);
}
}
uint16_t Battery::voltage() {
if (activationPin != 0xFF) {
digitalWrite(activationPin, activationMode);
delayMicroseconds(10); // copes with slow switching activation circuits
}
analogRead(sensePin);
delay(2); // allow the ADC to stabilize
uint16_t reading = analogRead(sensePin) * dividerRatio * refVoltage / 1024;
if (activationPin != 0xFF) {
digitalWrite(activationPin, !activationMode);
}
return reading;
}

View File

@@ -0,0 +1,129 @@
/*
Battery.h - Battery library
Copyright (c) 2014 Roberto Lo Giacco.
This program 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 3 of the
License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BATTERY_H_
#define BATTERY_H_
#include <Arduino.h>
typedef uint8_t(*mapFn_t)(uint16_t, uint16_t, uint16_t);
class Battery {
public:
/**
* Creates an instance to monitor battery voltage and level.
* Initialization parameters depend on battery type and configuration.
*
* @param minVoltage is the voltage, expressed in millivolts, corresponding to an empty battery
* @param maxVoltage is the voltage, expressed in millivolts, corresponding to a full battery
* @param sensePin is the analog pin used for sensing the battery voltage
*/
Battery(uint16_t minVoltage, uint16_t maxVoltage, uint8_t sensePin);
/**
* Initializes the library by optionally setting additional parameters.
* To obtain the best results use a calibrated reference using the VoltageReference library or equivalent.
*
* @param refVoltage is the board reference voltage, expressed in millivolts
* @param dividerRatio is the multiplier used to obtain the real battery voltage
* @param mapFunction is a pointer to the function used to map the battery voltage to the remaining capacity percentage (defaults to linear mapping)
*/
void begin(uint16_t refVoltage, float dividerRatio, mapFn_t = 0);
/**
* Enables on-demand activation of the sensing circuit to limit battery consumption.
*
* @param activationPin is the pin which will be turned HIGH or LOW before starting the battery sensing
* @param activationMode is the optional value to set on the activationPin to enable battery sensing, defaults to LOW
* useful when using a resistor divider to save on battery consumption, but it can be changed to HIGH in case
* you are using a P-CH MOSFET or a PNP BJT
*/
void onDemand(uint8_t activationPin, uint8_t activationMode = LOW);
/**
* Activation pin value disabling the on-demand feature.
*/
static const uint8_t ON_DEMAND_DISABLE = 0xFF;
/**
* Returns the current battery level as a number between 0 and 100, with 0 indicating an empty battery and 100 a
* full battery.
*/
uint8_t level();
uint8_t level(uint16_t voltage);
/**
* Returns the current battery voltage in millivolts.
*/
uint16_t voltage();
private:
uint16_t refVoltage;
uint16_t minVoltage;
uint16_t maxVoltage;
float dividerRatio;
uint8_t sensePin;
uint8_t activationPin;
uint8_t activationMode;
mapFn_t mapFunction;
};
//
// Plots of the functions below available at
// https://www.desmos.com/calculator/x0esk5bsrk
//
/**
* Symmetric sigmoidal approximation
* https://www.desmos.com/calculator/7m9lu26vpy
*
* c - c / (1 + k*x/v)^3
*/
static inline uint8_t sigmoidal(uint16_t voltage, uint16_t minVoltage, uint16_t maxVoltage) {
// slow
// uint8_t result = 110 - (110 / (1 + pow(1.468 * (voltage - minVoltage)/(maxVoltage - minVoltage), 6)));
// steep
// uint8_t result = 102 - (102 / (1 + pow(1.621 * (voltage - minVoltage)/(maxVoltage - minVoltage), 8.1)));
// normal
uint8_t result = 105 - (105 / (1 + pow(1.724 * (voltage - minVoltage)/(maxVoltage - minVoltage), 5.5)));
return result >= 100 ? 100 : result;
}
/**
* Asymmetric sigmoidal approximation
* https://www.desmos.com/calculator/oyhpsu8jnw
*
* c - c / [1 + (k*x/v)^4.5]^3
*/
static inline uint8_t asigmoidal(uint16_t voltage, uint16_t minVoltage, uint16_t maxVoltage) {
uint8_t result = 101 - (101 / pow(1 + pow(1.33 * (voltage - minVoltage)/(maxVoltage - minVoltage) ,4.5), 3));
return result >= 100 ? 100 : result;
}
/**
* Linear mapping
* https://www.desmos.com/calculator/sowyhttjta
*
* x * 100 / v
*/
static inline uint8_t linear(uint16_t voltage, uint16_t minVoltage, uint16_t maxVoltage) {
return (unsigned long)(voltage - minVoltage) * 100 / (maxVoltage - minVoltage);
}
#endif // BATTERY_H_

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

136199
manufacturing/CAD/ledTruck.step Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,15 +0,0 @@
(module 3,5mm_straight_circular (layer F.Cu) (tedit 6027E55C)
(fp_text reference REF** (at 0 -4) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value 3,5mm_straight_circular (at 0 3) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_circle (center 0 0) (end 8 0) (layer F.SilkS) (width 0.15))
(pad 1 thru_hole oval (at 0 -2.5) (size 3.2 1.4) (drill oval 2.6 0.8) (layers *.Cu *.Mask)
(die_length 1))
(pad 2 thru_hole oval (at -2.5 0 90) (size 3.2 1.4) (drill oval 2.6 0.8) (layers *.Cu *.Mask)
(die_length 1))
(pad 3 thru_hole oval (at 2.5 0 90) (size 3.2 1.4) (drill oval 2.6 0.8) (layers *.Cu *.Mask)
(die_length 1))
)

View File

@@ -1,14 +0,0 @@
(module 428-202569-MG01 (layer F.Cu) (tedit 602ED7AC)
(fp_text reference REF** (at -0.5 2.5) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value 428-202569-MG01 (at 0 4.5) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 2 -1) (end 2 1) (layer F.SilkS) (width 0.12))
(fp_line (start 2 1) (end -2 1) (layer F.SilkS) (width 0.12))
(fp_line (start -2 1) (end -2 -1) (layer F.SilkS) (width 0.12))
(fp_line (start -2 -1) (end 2 -1) (layer F.SilkS) (width 0.12))
(pad 1 smd rect (at -1.25 0) (size 1 1.8) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at 1.25 0) (size 1 1.8) (layers F.Cu F.Paste F.Mask))
)

View File

@@ -1,9 +0,0 @@
(module TestPoint_SMD_R (layer F.Cu) (tedit 602EC615)
(fp_text reference REF** (at -3.5 -2.5) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value TestPoint_SMD_R (at 0 -0.5) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 1 smd circle (at 0 -2.5) (size 1 1) (layers F.Cu F.Paste F.Mask))
)

View File

@@ -1,43 +0,0 @@
(module USB_Micro_B_Female (layer F.Cu) (tedit 602ED58C)
(descr https://cdn.amphenol-icc.com/media/wysiwyg/files/drawing/10103594.pdf)
(attr smd)
(fp_text reference J2 (at 0 -5.13 180) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value USB_B_Micro (at 0 2.79 180) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start 4.68 1.75) (end 4.68 -4.22) (layer F.CrtYd) (width 0.05))
(fp_line (start -4.68 -4.22) (end 4.68 -4.22) (layer F.CrtYd) (width 0.05))
(fp_line (start -4.68 1.75) (end 4.68 1.75) (layer F.CrtYd) (width 0.05))
(fp_line (start -4.68 1.75) (end -4.68 -4.22) (layer F.CrtYd) (width 0.05))
(fp_line (start -1.6 -3.6) (end -1.6 -2) (layer F.SilkS) (width 0.1))
(fp_line (start 0 -4.1) (end 0.3 -4.1) (layer F.SilkS) (width 0.1))
(fp_line (start 0 -4.1) (end -0.3 -4.1) (layer F.SilkS) (width 0.1))
(fp_line (start 3.9 1.4) (end 3.9 1.1) (layer F.SilkS) (width 0.1))
(fp_line (start 3.9 1.4) (end 3.6 1.4) (layer F.SilkS) (width 0.1))
(fp_line (start -3.9 1.4) (end -3.9 1.1) (layer F.SilkS) (width 0.1))
(fp_line (start -3.9 1.4) (end -3.6 1.4) (layer F.SilkS) (width 0.1))
(fp_line (start -3.9 -4.1) (end -3.6 -4.1) (layer F.SilkS) (width 0.1))
(fp_line (start -3.9 -4.1) (end -3.9 -3.8) (layer F.SilkS) (width 0.1))
(fp_line (start 3.9 -4.1) (end 3.6 -4.1) (layer F.SilkS) (width 0.1))
(fp_line (start 3.9 -4.1) (end 3.9 -3.8) (layer F.SilkS) (width 0.1))
(fp_line (start -3.75 1.29) (end 3.75 1.29) (layer F.Fab) (width 0.1))
(fp_line (start 3.75 -3.97) (end 3.75 1.29) (layer F.Fab) (width 0.1))
(fp_line (start -3.75 -3.97) (end 3.75 -3.97) (layer F.Fab) (width 0.1))
(fp_line (start -3.75 -3.97) (end -3.75 1.29) (layer F.Fab) (width 0.1))
(fp_line (start 3.75 2.15) (end -3.75 2.15) (layer F.SilkS) (width 0.12))
(pad SH smd rect (at -1.5 1.15) (size 1 1) (layers F.Cu F.Paste F.Mask))
(pad 1 smd rect (at -1.3 -3.16) (size 0.4 2.15) (layers F.Cu F.Paste F.Mask))
(pad SH thru_hole rect (at -3.6 -3.16) (size 2 1.8) (drill oval 0.7 1.3 (offset -0.2 0)) (layers *.Cu *.Mask))
(pad SH thru_hole oval (at -3.6 0) (size 1.3 2.15) (drill oval 0.7 1.3) (layers *.Cu *.Mask))
(pad SH thru_hole rect (at 3.6 -3.16 180) (size 2 1.8) (drill oval 0.7 1.3 (offset -0.2 0)) (layers *.Cu *.Mask))
(pad SH thru_hole oval (at 3.6 0) (size 1.3 2.15) (drill oval 0.7 1.3) (layers *.Cu *.Mask))
(pad "" np_thru_hole circle (at -2 -2.15) (size 0.6 0.6) (drill 0.6) (layers *.Cu *.Mask))
(pad "" np_thru_hole circle (at 2 -2.15) (size 0.6 0.6) (drill 0.6) (layers *.Cu *.Mask))
(pad SH smd rect (at 1.5 1.15) (size 1 1) (layers F.Cu F.Paste F.Mask))
(pad 2 smd rect (at -0.65 -3.16) (size 0.4 2.15) (layers F.Cu F.Paste F.Mask))
(pad 3 smd rect (at 0 -3.16) (size 0.4 2.15) (layers F.Cu F.Paste F.Mask))
(pad 4 smd rect (at 0.65 -3.16) (size 0.4 2.15) (layers F.Cu F.Paste F.Mask))
(pad 5 smd rect (at 1.3 -3.16) (size 0.4 2.15) (layers F.Cu F.Paste F.Mask))
)

View File

@@ -1,20 +0,0 @@
(module slids_switch_spdt (layer F.Cu) (tedit 6027F33B)
(fp_text reference REF** (at 0.5 -3.5) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value slids_switch_spdt (at 0.5 3.5) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -6.5 -2.85) (end -6.5 2.85) (layer F.SilkS) (width 0.12))
(fp_line (start -6.5 2.85) (end 6.5 2.85) (layer F.SilkS) (width 0.12))
(fp_line (start 6.5 -2.85) (end 6.5 2.85) (layer F.SilkS) (width 0.12))
(fp_line (start 6.5 -2.85) (end -6.5 -2.85) (layer F.SilkS) (width 0.12))
(fp_line (start -3 2.85) (end -3 6.85) (layer F.SilkS) (width 0.12))
(fp_line (start -3 6.85) (end 0 6.85) (layer F.SilkS) (width 0.12))
(fp_line (start 0 2.85) (end 0 6.85) (layer F.SilkS) (width 0.12))
(pad 1 thru_hole circle (at -3 0) (size 1.4 1.4) (drill 0.85) (layers *.Cu *.Mask))
(pad 2 thru_hole circle (at 0 0) (size 1.4 1.4) (drill 0.85) (layers *.Cu *.Mask))
(pad 3 thru_hole circle (at 3 0) (size 1.4 1.4) (drill 0.85) (layers *.Cu *.Mask))
(pad 4 thru_hole oval (at -6.3 0) (size 0.8 1.8) (drill oval 0.4 1.4) (layers *.Cu *.Mask))
(pad 5 thru_hole oval (at 6.3 0) (size 0.8 1.8) (drill oval 0.4 1.4) (layers *.Cu *.Mask))
)

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,137 +1,117 @@
%TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*%
%TF.CreationDate,2021-02-18T22:12:25+01:00*%
%TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Bot*%
%TF.FilePolarity,Negative*%
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*
G04 #@! TF.CreationDate,2021-03-02T11:33:06+01:00*
G04 #@! TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Soldermask,Bot*
G04 #@! TF.FilePolarity,Negative*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-02-18 22:12:25*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-03-02 11:33:06*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.600000*%
%ADD11O,2.150000X1.300000*%
%ADD12R,1.800000X2.000000*%
%ADD13C,2.850000*%
%ADD14R,2.850000X2.850000*%
%ADD15C,2.020000*%
%ADD16O,1.700000X2.000000*%
%ADD17O,3.200000X1.400000*%
%ADD18O,1.400000X3.200000*%
%ADD19C,0.400000*%
%ADD20C,1.400000*%
%ADD21O,1.800000X0.800000*%
%ADD10R,2.500000X2.000000*%
%ADD11O,2.500000X2.000000*%
%ADD12C,0.400000*%
%ADD13O,2.000000X3.200000*%
%ADD14O,3.200000X2.000000*%
%ADD15O,1.700000X2.000000*%
%ADD16C,2.020000*%
%ADD17C,0.600000*%
%ADD18O,2.150000X1.300000*%
%ADD19R,1.800000X2.000000*%
%ADD20C,3.200000*%
%ADD21R,3.200000X2.300000*%
G04 APERTURE END LIST*
D10*
%TO.C,J2*%
X111116000Y-98012000D03*
X111116000Y-94012000D03*
X109474000Y-88812000D03*
X109474000Y-76212000D03*
D11*
X108966000Y-99612000D03*
X109474000Y-85512000D03*
X109474000Y-82512000D03*
D10*
X109474000Y-79512000D03*
D12*
X112126000Y-99812000D03*
D11*
X108966000Y-92412000D03*
D12*
X112126000Y-92212000D03*
%TD*%
X155190000Y-83962000D03*
X155190000Y-84962000D03*
X155190000Y-85962000D03*
X154190000Y-83962000D03*
X154190000Y-84962000D03*
X154190000Y-85962000D03*
X153190000Y-83962000D03*
X153190000Y-84962000D03*
X153190000Y-85962000D03*
D13*
%TO.C,SW3*%
X170034000Y-76612000D03*
X170034000Y-81312000D03*
D14*
X170034000Y-86012000D03*
%TD*%
D13*
%TO.C,SW2*%
X145034000Y-76612000D03*
X145034000Y-81312000D03*
D14*
X145034000Y-86012000D03*
%TD*%
D13*
%TO.C,SW1*%
X120034000Y-76612000D03*
X120034000Y-81312000D03*
D14*
X120034000Y-86012000D03*
%TD*%
D15*
%TO.C,J3*%
X180594000Y-91186000D03*
X180594000Y-93726000D03*
X180594000Y-96266000D03*
X180594000Y-98806000D03*
%TD*%
D16*
%TO.C,J1*%
X180034000Y-78012000D03*
G36*
G01*
X176684000Y-78762000D02*
X176684000Y-77262000D01*
G75*
G02*
X176934000Y-77012000I250000J0D01*
G01*
X178134000Y-77012000D01*
G75*
G02*
X178384000Y-77262000I0J-250000D01*
G01*
X178384000Y-78762000D01*
G75*
G02*
X178134000Y-79012000I-250000J0D01*
G01*
X176934000Y-79012000D01*
G75*
G02*
X176684000Y-78762000I0J250000D01*
G01*
G37*
%TD*%
D17*
%TO.C,CON1*%
X120034000Y-107012000D03*
D18*
X117534000Y-109512000D03*
X122534000Y-109512000D03*
%TD*%
D17*
%TO.C,CON2*%
X145034000Y-107012000D03*
D18*
X142534000Y-109512000D03*
X147534000Y-109512000D03*
%TD*%
%TO.C,CON3*%
X172534000Y-109512000D03*
X167534000Y-109512000D03*
D17*
D14*
X170034000Y-107012000D03*
%TD*%
D13*
X147534000Y-109512000D03*
X142534000Y-109512000D03*
D14*
X145034000Y-107012000D03*
D13*
X122534000Y-109512000D03*
X117534000Y-109512000D03*
D14*
X120034000Y-107012000D03*
D15*
X182078000Y-78012000D03*
G36*
G01*
X178728000Y-78762000D02*
X178728000Y-77262000D01*
G75*
G02*
X178978000Y-77012000I250000J0D01*
G01*
X180178000Y-77012000D01*
G75*
G02*
X180428000Y-77262000I0J-250000D01*
G01*
X180428000Y-78762000D01*
G75*
G02*
X180178000Y-79012000I-250000J0D01*
G01*
X178978000Y-79012000D01*
G75*
G02*
X178728000Y-78762000I0J250000D01*
G01*
G37*
D16*
X181620160Y-91183460D03*
X181620160Y-93723460D03*
X181620160Y-96263460D03*
X181620160Y-98803460D03*
D17*
X109071300Y-98004380D03*
X109071300Y-94004380D03*
D18*
X106921300Y-99604380D03*
D19*
%TO.C,U1*%
X153190000Y-85962000D03*
X153190000Y-84962000D03*
X153190000Y-83962000D03*
X154190000Y-85962000D03*
X154190000Y-84962000D03*
X154190000Y-83962000D03*
X155190000Y-85962000D03*
X155190000Y-84962000D03*
X155190000Y-83962000D03*
%TD*%
X110081300Y-99804380D03*
D18*
X106921300Y-92404380D03*
D19*
X110081300Y-92204380D03*
D20*
%TO.C,S1*%
X111034000Y-79512000D03*
X111034000Y-82512000D03*
X111034000Y-85512000D03*
X120034000Y-76612000D03*
X120034000Y-81312000D03*
D21*
X111034000Y-76212000D03*
X111034000Y-88812000D03*
%TD*%
X120034000Y-86012000D03*
D20*
X145034000Y-76612000D03*
X145034000Y-81312000D03*
D21*
X145034000Y-86012000D03*
D20*
X170034000Y-76612000D03*
X170034000Y-81312000D03*
D21*
X170034000Y-86012000D03*
M02*

View File

@@ -1,15 +0,0 @@
%TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*%
%TF.CreationDate,2021-02-18T22:12:25+01:00*%
%TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-02-18 22:12:25*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -1,12 +1,12 @@
%TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*%
%TF.CreationDate,2021-02-18T22:12:25+01:00*%
%TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Legend,Bot*%
%TF.FilePolarity,Positive*%
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*
G04 #@! TF.CreationDate,2021-03-02T11:33:06+01:00*
G04 #@! TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Legend,Bot*
G04 #@! TF.FilePolarity,Positive*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-02-18 22:12:25*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-03-02 11:33:06*
%MOMM*%
%LPD*%
G01*

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +1,26 @@
%TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*%
%TF.CreationDate,2021-02-18T22:12:25+01:00*%
%TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Profile,NP*%
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*
G04 #@! TF.CreationDate,2021-03-02T11:33:06+01:00*
G04 #@! TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Profile,NP*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-02-18 22:12:25*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-03-02 11:33:06*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%TA.AperFunction,Profile*%
G04 #@! TA.AperFunction,Profile*
%ADD10C,0.050000*%
%TD*%
G04 #@! TD*
G04 APERTURE END LIST*
D10*
X107034000Y-118012000D02*
X107034000Y-74012000D01*
X107034000Y-118012000D02*
X183034000Y-118012000D01*
X183034000Y-74012000D02*
X183034000Y-118012000D01*
X107034000Y-74012000D02*
X183034000Y-74012000D01*
X105034000Y-119512000D02*
X105034000Y-72512000D01*
X105034000Y-119512000D02*
X185034000Y-119512000D01*
X185034000Y-72512000D02*
X185034000Y-119512000D01*
X105034000Y-72512000D02*
X185034000Y-72512000D01*
M02*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,221 +0,0 @@
%TF.GenerationSoftware,KiCad,Pcbnew,(5.1.9-0-10_14)*%
%TF.CreationDate,2021-02-18T22:12:25+01:00*%
%TF.ProjectId,ledTruck,6c656454-7275-4636-9b2e-6b696361645f,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.9-0-10_14)) date 2021-02-18 22:12:25*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10R,1.800000X1.000000*%
%ADD11R,2.150000X0.400000*%
%ADD12R,1.000000X1.000000*%
%ADD13C,1.000000*%
%ADD14R,1.200000X1.200000*%
%ADD15R,0.600000X1.050000*%
%ADD16R,0.600000X0.800000*%
%ADD17R,0.800000X0.600000*%
%ADD18R,0.280000X0.850000*%
%ADD19R,0.850000X0.280000*%
%ADD20R,3.450000X3.450000*%
G04 APERTURE END LIST*
D10*
%TO.C,Y1*%
X161544000Y-83078000D03*
X161544000Y-85578000D03*
%TD*%
D11*
%TO.C,J2*%
X112126000Y-97312000D03*
X112126000Y-96662000D03*
X112126000Y-96012000D03*
X112126000Y-95362000D03*
D12*
X107816000Y-97512000D03*
D11*
X112126000Y-94712000D03*
D12*
X107816000Y-94512000D03*
%TD*%
D13*
%TO.C,BOOT0*%
X156718000Y-89194000D03*
%TD*%
%TO.C,RST1*%
X155956000Y-77470000D03*
%TD*%
D14*
%TO.C,C9*%
X126204000Y-87122000D03*
X128304000Y-87122000D03*
%TD*%
%TO.C,C7*%
X134586000Y-83566000D03*
X136686000Y-83566000D03*
%TD*%
%TO.C,C4*%
X126204000Y-83566000D03*
X128304000Y-83566000D03*
%TD*%
%TO.C,C1*%
X134586000Y-87122000D03*
X136686000Y-87122000D03*
%TD*%
D15*
%TO.C,U2*%
X135316000Y-75358000D03*
X134366000Y-75358000D03*
X133416000Y-75358000D03*
X133416000Y-78058000D03*
X135316000Y-78058000D03*
%TD*%
D16*
%TO.C,R13*%
X160844000Y-78486000D03*
X162244000Y-78486000D03*
%TD*%
%TO.C,R12*%
X160844000Y-76962000D03*
X162244000Y-76962000D03*
%TD*%
%TO.C,R11*%
X108834000Y-114012000D03*
X110234000Y-114012000D03*
%TD*%
%TO.C,R10*%
X108834000Y-115512000D03*
X110234000Y-115512000D03*
%TD*%
%TO.C,R9*%
X151446000Y-80010000D03*
X152846000Y-80010000D03*
%TD*%
D17*
%TO.C,R8*%
X163830000Y-84774000D03*
X163830000Y-83374000D03*
%TD*%
D16*
%TO.C,R7*%
X137222000Y-78232000D03*
X138622000Y-78232000D03*
%TD*%
%TO.C,R6*%
X157672000Y-109728000D03*
X156272000Y-109728000D03*
%TD*%
%TO.C,R5*%
X156272000Y-106426000D03*
X157672000Y-106426000D03*
%TD*%
%TO.C,R4*%
X132142000Y-113284000D03*
X133542000Y-113284000D03*
%TD*%
%TO.C,R3*%
X157672000Y-108204000D03*
X156272000Y-108204000D03*
%TD*%
%TO.C,R2*%
X157672000Y-104902000D03*
X156272000Y-104902000D03*
%TD*%
%TO.C,R1*%
X132128000Y-111760000D03*
X133528000Y-111760000D03*
%TD*%
D14*
%TO.C,L1*%
X128338000Y-80264000D03*
X126238000Y-80264000D03*
%TD*%
%TO.C,D2*%
X109034000Y-107462000D03*
X109034000Y-109562000D03*
%TD*%
%TO.C,D1*%
X109034000Y-102912000D03*
X109034000Y-105012000D03*
%TD*%
D16*
%TO.C,C8*%
X152846000Y-78486000D03*
X151446000Y-78486000D03*
%TD*%
%TO.C,C6*%
X152846000Y-76962000D03*
X151446000Y-76962000D03*
%TD*%
%TO.C,C5*%
X152846000Y-75464000D03*
X151446000Y-75464000D03*
%TD*%
%TO.C,C3*%
X160844000Y-80010000D03*
X162244000Y-80010000D03*
%TD*%
%TO.C,C2*%
X160844000Y-88138000D03*
X162244000Y-88138000D03*
%TD*%
D18*
%TO.C,U1*%
X152440000Y-87437000D03*
D19*
X151715000Y-83212000D03*
D18*
X155940000Y-82487000D03*
D20*
X154190000Y-84962000D03*
D19*
X156665000Y-86712000D03*
X156665000Y-86212000D03*
X156665000Y-85712000D03*
X156665000Y-85212000D03*
X156665000Y-84712000D03*
X156665000Y-84212000D03*
X156665000Y-83712000D03*
X156665000Y-83212000D03*
D18*
X155440000Y-82487000D03*
X154940000Y-82487000D03*
X154440000Y-82487000D03*
X153940000Y-82487000D03*
X153440000Y-82487000D03*
X152940000Y-82487000D03*
X152440000Y-82487000D03*
D19*
X151715000Y-83712000D03*
X151715000Y-84212000D03*
X151715000Y-84712000D03*
X151715000Y-85212000D03*
X151715000Y-85712000D03*
X151715000Y-86212000D03*
X151715000Y-86712000D03*
D18*
X152940000Y-87437000D03*
X153440000Y-87437000D03*
X153940000Y-87437000D03*
X154440000Y-87437000D03*
X154940000Y-87437000D03*
X155440000Y-87437000D03*
X155940000Y-87437000D03*
%TD*%
D17*
%TO.C,R14*%
X115062000Y-80964000D03*
X115062000Y-79564000D03*
%TD*%
D15*
%TO.C,U3*%
X128204000Y-78058000D03*
X126304000Y-78058000D03*
X126304000Y-75358000D03*
X127254000Y-75358000D03*
X128204000Y-75358000D03*
%TD*%
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
M48
; DRILL file {KiCad (5.1.9-0-10_14)} date Thursday, February 18, 2021 at 10:12:30 PM
; DRILL file {KiCad (5.1.9-0-10_14)} date Tuesday, March 02, 2021 at 11:51:50 AM
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-02-18T22:12:30+01:00
; #@! TF.CreationDate,2021-03-02T11:51:50+01:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.1.9-0-10_14)
; #@! TF.FileFunction,NonPlated,1,2,NPTH
FMAT,2
@@ -11,7 +11,7 @@ T1C0.0236
G90
G05
T1
X4.3746Y-3.7013
X4.3746Y-3.8587
X4.2941Y-3.701
X4.2941Y-3.8584
T0
M30

View File

@@ -1,19 +1,18 @@
M48
; DRILL file {KiCad (5.1.9-0-10_14)} date Thursday, February 18, 2021 at 10:12:30 PM
; DRILL file {KiCad (5.1.9-0-10_14)} date Tuesday, March 02, 2021 at 11:51:50 AM
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2021-02-18T22:12:30+01:00
; #@! TF.CreationDate,2021-03-02T11:51:50+01:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,(5.1.9-0-10_14)
; #@! TF.FileFunction,Plated,1,2,PTH
FMAT,2
INCH
T1C0.0079
T2C0.0157
T3C0.0276
T4C0.0315
T5C0.0335
T3C0.0236
T4C0.0276
T5C0.0315
T6C0.0394
T7C0.0402
T8C0.0728
%
G90
G05
@@ -30,159 +29,145 @@ X6.1098Y-3.3843
T2
X4.46Y-4.14
X4.46Y-4.37
X4.5034Y-3.3666
X4.52Y-2.97
X4.53Y-3.3666
X4.53Y-3.77
X4.59Y-3.19
X4.6Y-3.19
X4.6012Y-3.7288
X4.61Y-3.94
X4.6312Y-3.7288
X4.64Y-3.65
X4.75Y-3.6857
X4.78Y-3.85
X4.83Y-3.9
X4.73Y-3.6857
X4.81Y-3.83
X4.8398Y-2.9702
X4.8398Y-3.2702
X4.89Y-3.16
X4.89Y-3.29
X4.89Y-3.43
X4.89Y-3.89
X4.91Y-4.41
X4.919Y-2.9702
X4.99Y-4.34
X5.02Y-3.55
X5.02Y-3.83
X5.02Y-4.0
X5.08Y-4.26
X5.0945Y-2.9702
X5.1487Y-3.2013
X5.15Y-3.02
X5.15Y-3.29
X5.15Y-3.43
X5.16Y-4.55
X5.2Y-2.96
X5.2Y-3.07
X5.2188Y-3.7288
X5.22Y-3.43
X5.22Y-4.55
X5.22Y-3.13
X5.26Y-4.06
X5.26Y-4.34
X5.28Y-3.21
X5.2795Y-3.2305
X5.28Y-3.77
X5.3Y-4.02
X5.3Y-4.46
X5.33Y-4.58
X5.41Y-2.96
X5.405Y-2.965
X5.41Y-4.49
X5.46Y-3.14
X5.46Y-3.2
X5.46Y-3.29
X5.46Y-3.43
X5.54Y-2.97
X5.54Y-3.54
X5.54Y-4.17
X5.63Y-3.83
X5.71Y-3.6
X5.71Y-3.63
X5.72Y-4.58
X5.8084Y-3.9016
X5.8643Y-3.6857
X5.81Y-3.89
X5.8643Y-3.6885
X5.89Y-3.83
X5.92Y-3.09
X5.97Y-3.24
X5.93Y-3.09
X5.94Y-3.23
X5.94Y-4.06
X5.99Y-3.2
X6.0115Y-4.0661
X6.0615Y-3.1267
X6.07Y-3.01
X6.09Y-3.09
X6.0608Y-3.1267
X6.08Y-3.04
X6.09Y-3.52
X6.09Y-4.26
X6.12Y-4.02
X6.1Y-3.15
X6.13Y-4.02
X6.14Y-3.17
X6.17Y-3.24
X6.17Y-4.58
X6.18Y-3.08
X6.1885Y-3.66
X6.2Y-4.07
X6.21Y-4.01
X6.21Y-2.94
X6.23Y-3.09
X6.24Y-3.47
X6.26Y-3.33
X6.26Y-4.36
X6.2675Y-3.0174
X6.27Y-2.95
X6.2793Y-3.16
X6.28Y-3.09
X6.2934Y-3.2809
X6.33Y-3.42
X6.3438Y-2.96
X6.37Y-3.65
X6.41Y-3.9
X6.44Y-3.09
X6.17Y-3.1403
X6.1708Y-3.66
X6.2Y-4.02
X6.205Y-4.075
X6.22Y-3.09
X6.255Y-3.1115
X6.2653Y-3.48
X6.2838Y-3.0153
X6.2859Y-3.2414
X6.2934Y-3.1664
X6.294Y-4.3548
X6.3224Y-3.65
X6.3584Y-3.89
X6.3586Y-3.5186
X6.54Y-3.06
X6.56Y-3.15
X6.56Y-3.2
X6.56Y-3.47
X6.62Y-4.58
X6.66Y-3.69
X6.66Y-3.84
X6.79Y-3.9
X6.79Y-3.89
X6.84Y-3.55
X6.99Y-3.77
X7.12Y-3.31
X7.12Y-3.44
X7.07Y-3.77
X7.11Y-3.3
X7.11Y-3.49
X7.12Y-4.03
X7.12Y-4.19
X7.12Y-4.37
X7.12Y-4.58
T5
X4.3714Y-3.1304
X4.3714Y-3.2485
X4.3714Y-3.3666
T6
X6.9895Y-3.0713
X7.088Y-3.0713
X4.31Y-3.1304
X4.31Y-3.2485
X4.31Y-3.3666
X7.07Y-3.0713
X7.1684Y-3.0713
T7
X7.11Y-3.59
X7.11Y-3.69
X7.11Y-3.79
X7.11Y-3.89
T8
X4.7257Y-3.0162
X4.7257Y-3.2013
X4.7257Y-3.3863
X5.71Y-3.0162
X5.71Y-3.2013
X5.71Y-3.3863
X6.6943Y-3.0162
X6.6943Y-3.2013
X6.6943Y-3.3863
T2
G00X4.3911Y-3.0005
M15
G01X4.3517Y-3.0005
M16
G05
G00X4.3911Y-3.4965
M15
G01X4.3517Y-3.4965
M16
G05
X7.1504Y-3.5899
X7.1504Y-3.6899
X7.1504Y-3.7899
X7.1504Y-3.8899
T3
G00X4.3018Y-3.6383
G00X4.3277Y-3.0005
M15
G01X4.2782Y-3.6383
G01X4.2923Y-3.0005
M16
G05
G00X4.3018Y-3.9217
G00X4.3277Y-3.4965
M15
G01X4.2782Y-3.9217
M16
G05
G00X4.4262Y-3.6383
M15
G01X4.4026Y-3.6383
M16
G05
G00X4.4026Y-3.9217
M15
G01X4.4262Y-3.9217
G01X4.2923Y-3.4965
M16
G05
T4
G00X4.2213Y-3.638
M15
G01X4.1977Y-3.638
M16
G05
G00X4.2213Y-3.9214
M15
G01X4.1977Y-3.9214
M16
G05
G00X4.3457Y-3.638
M15
G01X4.3221Y-3.638
M16
G05
G00X4.3221Y-3.9214
M15
G01X4.3457Y-3.9214
M16
G05
T5
G00X4.6273Y-4.3469
M15
G01X4.6273Y-4.2761
@@ -228,5 +213,51 @@ M15
G01X6.7927Y-4.2761
M16
G05
T6
G00X4.7041Y-3.0162
M15
G01X4.7474Y-3.0162
M16
G05
G00X4.7041Y-3.2013
M15
G01X4.7474Y-3.2013
M16
G05
G00X4.7041Y-3.3863
M15
G01X4.7474Y-3.3863
M16
G05
G00X5.6883Y-3.0162
M15
G01X5.7317Y-3.0162
M16
G05
G00X5.6883Y-3.2013
M15
G01X5.7317Y-3.2013
M16
G05
G00X5.6883Y-3.3863
M15
G01X5.7317Y-3.3863
M16
G05
G00X6.6726Y-3.0162
M15
G01X6.7159Y-3.0162
M16
G05
G00X6.6726Y-3.2013
M15
G01X6.7159Y-3.2013
M16
G05
G00X6.6726Y-3.3863
M15
G01X6.7159Y-3.3863
M16
G05
T0
M30

View File

@@ -1,128 +0,0 @@
{
"Header":
{
"GenerationSoftware":
{
"Vendor": "KiCad",
"Application": "Pcbnew",
"Version": "(5.1.9-0-10_14)"
},
"CreationDate": "2021-02-18T22:12:25+01:00"
},
"GeneralSpecs":
{
"ProjectId":
{
"Name": "ledTruck",
"GUID": "6c656454-7275-4636-9b2e-6b696361645f",
"Revision": "rev?"
},
"Size":
{
"X": 76.050,
"Y": 44.050
},
"LayerNumber": 2,
"BoardThickness": 1.600
},
"DesignRules":
[
{
"Layers": "Outer",
"PadToPad": 0.200,
"PadToTrack": 0.200,
"TrackToTrack": 0.200,
"MinLineWidth": 0.250,
"TrackToRegion": 0.508,
"RegionToRegion": 0.508
}
],
"FilesAttributes":
[
{
"Path": "ledTruck-F_Cu.gbr",
"FileFunction": "Copper,L1,Top",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-B_Cu.gbr",
"FileFunction": "Copper,L2,Bot",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-F_Paste.gbr",
"FileFunction": "SolderPaste,Top",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-B_Paste.gbr",
"FileFunction": "SolderPaste,Bot",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-F_SilkS.gbr",
"FileFunction": "Legend,Top",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-B_SilkS.gbr",
"FileFunction": "Legend,Bot",
"FilePolarity": "Positive"
},
{
"Path": "ledTruck-F_Mask.gbr",
"FileFunction": "SolderMask,Top",
"FilePolarity": "Negative"
},
{
"Path": "ledTruck-B_Mask.gbr",
"FileFunction": "SolderMask,Bot",
"FilePolarity": "Negative"
},
{
"Path": "ledTruck-Edge_Cuts.gbr",
"FileFunction": "Profile",
"FilePolarity": "Positive"
}
],
"MaterialStackup":
[
{
"Type": "Legend",
"Notes": "Layer F.SilkS"
},
{
"Type": "SolderPaste",
"Notes": "Layer F.Paste"
},
{
"Type": "SolderMask",
"Notes": "Layer F.Mask"
},
{
"Type": "Copper",
"Notes": "Layer F.Cu"
},
{
"Type": "Dielectric",
"Material": "FR4",
"Notes": "Layers L1/L2"
},
{
"Type": "Copper",
"Notes": "Layer B.Cu"
},
{
"Type": "SolderMask",
"Notes": "Layer B.Mask"
},
{
"Type": "SolderPaste",
"Notes": "Layer B.Paste"
},
{
"Type": "Legend",
"Notes": "Layer B.SilkS"
}
]
}

View File

@@ -156,29 +156,6 @@ X 2 2 150 0 50 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_L
#
DEF Device_L L 0 40 N N 1 F N
F0 "L" -50 0 50 V V C CNN
F1 "Device_L" 75 0 50 V V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Choke_*
*Coil*
Inductor_*
L_*
$ENDFPLIST
DRAW
A 0 -75 25 -899 899 0 1 0 N 0 -100 0 -50
A 0 -25 25 -899 899 0 1 0 N 0 -50 0 0
A 0 25 25 -899 899 0 1 0 N 0 0 0 50
A 0 75 25 -899 899 0 1 0 N 0 50 0 100
X 1 1 0 150 50 D 50 50 1 1 P
X 2 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_LED
#
DEF Device_LED D 0 40 N N 1 F N
@@ -219,73 +196,46 @@ X ~ 2 0 -150 50 U 50 50 1 1 P
ENDDRAW
ENDDEF
#
# MCU_ST_STM32L0_STM32L031K6Ux
# Jumper_SolderJumper_2_Open
#
DEF MCU_ST_STM32L0_STM32L031K6Ux U 0 20 Y Y 1 F N
F0 "U" -500 850 50 H V L CNN
F1 "MCU_ST_STM32L0_STM32L031K6Ux" 200 850 50 H V L CNN
F2 "Package_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm" -500 -900 50 H I R CNN
DEF Jumper_SolderJumper_2_Open JP 0 0 Y N 1 F N
F0 "JP" 0 80 50 H V C CNN
F1 "Jumper_SolderJumper_2_Open" 0 -100 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
ALIAS STM32L031K6Ux
$FPLIST
QFN*1EP*5x5mm*P0.5mm*
SolderJumper*Open*
$ENDFPLIST
DRAW
S -500 -900 400 800 0 1 10 f
X VDD 1 -100 900 100 D 50 50 1 1 W
X PA4 10 500 300 100 L 50 50 1 1 B
X PA5 11 500 200 100 L 50 50 1 1 B
X PA6 12 500 100 100 L 50 50 1 1 B
X PA7 13 500 0 100 L 50 50 1 1 B
X PB0 14 -600 0 100 R 50 50 1 1 B
X PB1 15 -600 -100 100 R 50 50 1 1 B
X PB2 16 -600 -200 100 R 50 50 1 1 B
X VDD 17 0 900 100 D 50 50 1 1 W
X PA8 18 500 -100 100 L 50 50 1 1 B
X PA9 19 500 -200 100 L 50 50 1 1 B
X PC14/OSC_IN 2 -600 300 100 R 50 50 1 1 B
X PA10 20 500 -300 100 L 50 50 1 1 B
X PA11 21 500 -400 100 L 50 50 1 1 B
X PA12 22 500 -500 100 L 50 50 1 1 B
X PA13/SWDIO 23 500 -600 100 L 50 50 1 1 B
X PA14/SWCLK 24 500 -700 100 L 50 50 1 1 B
X PA15 25 500 -800 100 L 50 50 1 1 B
X PB3 26 -600 -300 100 R 50 50 1 1 B
X PB4 27 -600 -400 100 R 50 50 1 1 B
X PB5 28 -600 -500 100 R 50 50 1 1 B
X PB6 29 -600 -600 100 R 50 50 1 1 B
X PC15/OSC_OUT 3 -600 200 100 R 50 50 1 1 B
X PB7 30 -600 -700 100 R 50 50 1 1 B
X BOOT0 31 -600 500 100 R 50 50 1 1 I
X PB8 32 -600 -800 100 R 50 50 1 1 B
X VSS 33 0 -1000 100 U 50 50 1 1 W
X NRST 4 -600 700 100 R 50 50 1 1 I
X VDDA 5 100 900 100 D 50 50 1 1 W
X PA0 6 500 700 100 L 50 50 1 1 B
X PA1 7 500 600 100 L 50 50 1 1 B
X PA2 8 500 500 100 L 50 50 1 1 B
X PA3 9 500 400 100 L 50 50 1 1 B
A -10 0 40 901 -901 0 1 0 N -10 40 -10 -40
A -10 0 40 901 -901 0 1 0 F -10 40 -10 -40
A 10 0 40 -899 899 0 1 0 N 10 -40 10 40
A 10 0 40 -899 899 0 1 0 F 10 -40 10 40
P 2 0 1 0 -10 40 -10 -40 N
P 2 0 1 0 10 40 10 -40 N
X A 1 -150 0 100 R 50 50 1 1 P
X B 2 150 0 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Regulator_Switching_LM3670MF
# Regulator_Linear_TPS76333
#
DEF Regulator_Switching_LM3670MF U 0 20 Y Y 1 F N
F0 "U" -200 200 50 H V L CNN
F1 "Regulator_Switching_LM3670MF" 0 200 50 H V L CNN
F2 "Package_TO_SOT_SMD:TSOT-23-5" 50 -250 50 H I L CNN
F3 "" -250 -350 50 H I C CNN
ALIAS ADP2108AUJ-1.1 ADP2108AUJ-1.2 ADP2108AUJ-1.3 ADP2108AUJ-1.5 ADP2108AUJ-1.8 ADP2108AUJ-1.82 ADP2108AUJ-2.3 ADP2108AUJ-2.5 ADP2108AUJ-3.0 ADP2108AUJ-3.3 LM3670MF
DEF Regulator_Linear_TPS76333 U 0 10 Y Y 1 F N
F0 "U" -150 225 50 H V C CNN
F1 "Regulator_Linear_TPS76333" 0 225 50 H V L CNN
F2 "Package_TO_SOT_SMD:SOT-23-5" 0 325 50 H I C CIN
F3 "" 0 0 50 H I C CNN
ALIAS TPS76318 TPS76325 TPS76327 TPS76329 TPS76330 TPS76333 TPS76338 TPS76350
$FPLIST
TSOT?23*
SOT?23*
$ENDFPLIST
DRAW
S -200 150 200 -200 0 1 10 f
X Vin 1 -300 100 100 R 50 50 1 1 W
S -200 175 200 -200 0 1 10 f
X VIN 1 -300 100 100 R 50 50 1 1 W
X GND 2 0 -300 100 U 50 50 1 1 W
X EN 3 -300 0 100 R 50 50 1 1 I
X FB 4 300 -100 100 L 50 50 1 1 I
X SW 5 300 100 100 L 50 50 1 1 I
X NC 4 300 0 100 L 50 50 1 1 N N
X VOUT 5 300 100 100 L 50 50 1 1 w
ENDDRAW
ENDDEF
#
@@ -308,6 +258,38 @@ X 3 3 200 -100 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Transistor_FET_BSS84
#
DEF Transistor_FET_BSS84 Q 0 20 Y N 1 F N
F0 "Q" 200 75 50 H V L CNN
F1 "Transistor_FET_BSS84" 200 0 50 H V L CNN
F2 "Package_TO_SOT_SMD:SOT-23" 200 -75 50 H I L CIN
F3 "" 0 0 50 H I L CNN
ALIAS VP0610T BSS84 NTR2101P BSS83P Si2319CDS IRLML6401 IRLML6402 DMG2301L AO3401A IRLML9301 IRLML5203 Si2371EDS TSM2301ACX FDN340P
$FPLIST
SOT?23*
$ENDFPLIST
DRAW
C 65 0 110 0 1 10 N
C 100 -70 10 0 1 0 F
C 100 70 10 0 1 0 F
P 2 0 1 0 10 0 -100 0 N
P 2 0 1 10 10 75 10 -75 N
P 2 0 1 10 30 -50 30 -90 N
P 2 0 1 10 30 20 30 -20 N
P 2 0 1 10 30 90 30 50 N
P 2 0 1 0 100 100 100 70 N
P 3 0 1 0 100 -100 100 0 30 0 N
P 4 0 1 0 30 70 130 70 130 -70 30 -70 N
P 4 0 1 0 90 0 50 15 50 -15 90 0 F
P 4 0 1 0 110 -20 115 -15 145 -15 150 -10 N
P 4 0 1 0 130 -15 115 10 145 10 130 -15 N
X G 1 -200 0 100 R 50 50 1 1 I
X S 2 100 -200 100 U 50 50 1 1 P
X D 3 100 200 100 D 50 50 1 1 P
ENDDRAW
ENDDEF
#
# dk_Barrel-Audio-Connectors_SJ1-3523N
#
DEF dk_Barrel-Audio-Connectors_SJ1-3523N CON 0 2 Y Y 1 F N
@@ -361,11 +343,11 @@ X PROG 5 -400 -200 100 R 50 50 1 1 I
ENDDRAW
ENDDEF
#
# dk_Slide-Switches_EG1218
# ledTruck-rescue_EG1218-dk_Slide-Switches
#
DEF dk_Slide-Switches_EG1218 S 0 0 Y Y 1 F N
DEF ledTruck-rescue_EG1218-dk_Slide-Switches S 0 0 Y Y 1 F N
F0 "S" -150 90 50 H V C CNN
F1 "dk_Slide-Switches_EG1218" 0 -210 50 H V C CNN
F1 "ledTruck-rescue_EG1218-dk_Slide-Switches" 0 -210 50 H V C CNN
F2 "digikey-footprints:Switch_Slide_11.6x4mm_EG1218" 200 200 50 H I L CNN
F3 "http://spec_sheets.e-switch.com/specs/P040040.pdf" 200 300 60 H I L CNN
F4 "EG1903-ND" 200 400 60 H I L CNN "Digi-Key_PN"
@@ -385,6 +367,55 @@ P 2 0 1 0 -80 0 120 90 N
X ~ 1 200 100 100 L 50 50 1 1 P
X ~ 2 -200 0 100 R 50 50 1 1 P
X ~ 3 200 -100 100 L 50 50 1 1 P
X SH 4 200 -300 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# ledTruck-rescue_STM32L031K6Ux-MCU_ST_STM32L0
#
DEF ledTruck-rescue_STM32L031K6Ux-MCU_ST_STM32L0 U 0 20 Y Y 1 F N
F0 "U" -500 850 50 H V L CNN
F1 "ledTruck-rescue_STM32L031K6Ux-MCU_ST_STM32L0" 200 850 50 H V L CNN
F2 "Package_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm" -500 -900 50 H I R CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
QFN*1EP*5x5mm*P0.5mm*
$ENDFPLIST
DRAW
S -500 -900 400 800 0 1 10 f
X VDD 1 -100 900 100 D 50 50 1 1 W
X PA4 10 500 300 100 L 50 50 1 1 B
X PA5 11 500 200 100 L 50 50 1 1 B
X PA6 12 500 100 100 L 50 50 1 1 B
X PA7 13 500 0 100 L 50 50 1 1 B
X PB0 14 -600 0 100 R 50 50 1 1 B
X PB1 15 -600 -100 100 R 50 50 1 1 B
X PB2 16 -600 -200 100 R 50 50 1 1 B
X VDD 17 0 900 100 D 50 50 1 1 W
X PA8 18 500 -100 100 L 50 50 1 1 B
X PA9 19 500 -200 100 L 50 50 1 1 B
X PC14/OSC_IN 2 -600 300 100 R 50 50 1 1 B
X PA10 20 500 -300 100 L 50 50 1 1 B
X PA11 21 500 -400 100 L 50 50 1 1 B
X PA12 22 500 -500 100 L 50 50 1 1 B
X PA13/SWDIO 23 500 -600 100 L 50 50 1 1 B
X PA14/SWCLK 24 500 -700 100 L 50 50 1 1 B
X PA15 25 500 -800 100 L 50 50 1 1 B
X PB3 26 -600 -300 100 R 50 50 1 1 B
X PB4 27 -600 -400 100 R 50 50 1 1 B
X PB5 28 -600 -500 100 R 50 50 1 1 B
X PB6 29 -600 -600 100 R 50 50 1 1 B
X PC15/OSC_OUT 3 -600 200 100 R 50 50 1 1 B
X PB7 30 -600 -700 100 R 50 50 1 1 B
X BOOT0 31 -600 500 100 R 50 50 1 1 I
X PB8 32 -600 -800 100 R 50 50 1 1 B
X VSS 33 0 -1000 100 U 50 50 1 1 W
X NRST 4 -600 700 100 R 50 50 1 1 I
X VDDA 5 100 900 100 D 50 50 1 1 W
X PA0 6 500 700 100 L 50 50 1 1 B
X PA1 7 500 600 100 L 50 50 1 1 B
X PA2 8 500 500 100 L 50 50 1 1 B
X PA3 9 500 400 100 L 50 50 1 1 B
ENDDRAW
ENDDEF
#
@@ -395,6 +426,21 @@ F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+3.3V" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 2 0 1 0 -30 50 0 100 N
P 2 0 1 0 0 0 0 100 N
P 2 0 1 0 0 100 30 50 N
X +3V3 1 0 0 0 U 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_+3V3
#
DEF power_+3V3 #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -150 50 H I C CNN
F1 "power_+3V3" 0 140 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
ALIAS +3.3V
DRAW
P 2 0 1 0 -30 50 0 100 N

View File

@@ -0,0 +1,3 @@
EESchema-DOCLIB Version 2.0
#
#End Doc Library

View File

@@ -0,0 +1,80 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# EG1218-dk_Slide-Switches
#
DEF EG1218-dk_Slide-Switches S 0 0 Y Y 1 F N
F0 "S" -150 90 50 H V C CNN
F1 "EG1218-dk_Slide-Switches" 0 -210 50 H V C CNN
F2 "digikey-footprints:Switch_Slide_11.6x4mm_EG1218" 200 200 50 H I L CNN
F3 "http://spec_sheets.e-switch.com/specs/P040040.pdf" 200 300 60 H I L CNN
F4 "EG1903-ND" 200 400 60 H I L CNN "Digi-Key_PN"
F5 "EG1218" 200 500 60 H I L CNN "MPN"
F6 "Switches" 200 600 60 H I L CNN "Category"
F7 "Slide Switches" 200 700 60 H I L CNN "Family"
F8 "http://spec_sheets.e-switch.com/specs/P040040.pdf" 200 800 60 H I L CNN "DK_Datasheet_Link"
F9 "/product-detail/en/e-switch/EG1218/EG1903-ND/101726" 200 900 60 H I L CNN "DK_Detail_Page"
F10 "SWITCH SLIDE SPDT 200MA 30V" 200 1000 60 H I L CNN "Description"
F11 "E-Switch" 200 1100 60 H I L CNN "Manufacturer"
F12 "Active" 200 1200 60 H I L CNN "Status"
DRAW
C -90 0 14 0 1 0 F
C 90 -100 14 0 1 0 F
C 100 100 14 0 1 0 F
P 2 0 1 0 -80 0 120 90 N
X ~ 1 200 100 100 L 50 50 1 1 P
X ~ 2 -200 0 100 R 50 50 1 1 P
X ~ 3 200 -100 100 L 50 50 1 1 P
X SH 4 200 -300 100 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# STM32L031K6Ux-MCU_ST_STM32L0
#
DEF STM32L031K6Ux-MCU_ST_STM32L0 U 0 20 Y Y 1 F N
F0 "U" -500 850 50 H V L CNN
F1 "STM32L031K6Ux-MCU_ST_STM32L0" 200 850 50 H V L CNN
F2 "Package_DFN_QFN:QFN-32-1EP_5x5mm_P0.5mm_EP3.45x3.45mm" -500 -900 50 H I R CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
QFN*1EP*5x5mm*P0.5mm*
$ENDFPLIST
DRAW
S -500 -900 400 800 0 1 10 f
X VDD 1 -100 900 100 D 50 50 1 1 W
X PA4 10 500 300 100 L 50 50 1 1 B
X PA5 11 500 200 100 L 50 50 1 1 B
X PA6 12 500 100 100 L 50 50 1 1 B
X PA7 13 500 0 100 L 50 50 1 1 B
X PB0 14 -600 0 100 R 50 50 1 1 B
X PB1 15 -600 -100 100 R 50 50 1 1 B
X PB2 16 -600 -200 100 R 50 50 1 1 B
X VDD 17 0 900 100 D 50 50 1 1 W
X PA8 18 500 -100 100 L 50 50 1 1 B
X PA9 19 500 -200 100 L 50 50 1 1 B
X PC14/OSC_IN 2 -600 300 100 R 50 50 1 1 B
X PA10 20 500 -300 100 L 50 50 1 1 B
X PA11 21 500 -400 100 L 50 50 1 1 B
X PA12 22 500 -500 100 L 50 50 1 1 B
X PA13/SWDIO 23 500 -600 100 L 50 50 1 1 B
X PA14/SWCLK 24 500 -700 100 L 50 50 1 1 B
X PA15 25 500 -800 100 L 50 50 1 1 B
X PB3 26 -600 -300 100 R 50 50 1 1 B
X PB4 27 -600 -400 100 R 50 50 1 1 B
X PB5 28 -600 -500 100 R 50 50 1 1 B
X PB6 29 -600 -600 100 R 50 50 1 1 B
X PC15/OSC_OUT 3 -600 200 100 R 50 50 1 1 B
X PB7 30 -600 -700 100 R 50 50 1 1 B
X BOOT0 31 -600 500 100 R 50 50 1 1 I
X PB8 32 -600 -800 100 R 50 50 1 1 B
X VSS 33 0 -1000 100 U 50 50 1 1 W
X NRST 4 -600 700 100 R 50 50 1 1 I
X VDDA 5 100 900 100 D 50 50 1 1 W
X PA0 6 500 700 100 L 50 50 1 1 B
X PA1 7 500 600 100 L 50 50 1 1 B
X PA2 8 500 500 100 L 50 50 1 1 B
X PA3 9 500 400 100 L 50 50 1 1 B
ENDDRAW
ENDDEF
#
#End Library

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
update=2021 February 14, Sunday 15:43:05
update=2021 March 26, Friday 20:53:07
version=1
last_client=kicad
[general]
@@ -38,30 +38,31 @@ MinViaDrill=0.3
MinMicroViaDiameter=0.2
MinMicroViaDrill=0.09999999999999999
MinHoleToHole=0.25
TrackWidth1=0.25
ViaDiameter1=0.8
ViaDrill1=0.4
dPairWidth1=0.2
dPairGap1=0.25
TrackWidth1=0.254
TrackWidth2=0.3048
ViaDiameter1=0.8128
ViaDrill1=0.4064
dPairWidth1=0.2032
dPairGap1=0.254
dPairViaGap1=0.25
SilkLineWidth=0.12
SilkTextSizeV=1
SilkTextSizeH=1
SilkTextSizeThickness=0.15
SilkLineWidth=0.127
SilkTextSizeV=0.635
SilkTextSizeH=0.635
SilkTextSizeThickness=0.1016
SilkTextItalic=0
SilkTextUpright=1
CopperLineWidth=0.2
CopperTextSizeV=1.5
CopperTextSizeH=1.5
CopperTextThickness=0.3
CopperLineWidth=0.2032
CopperTextSizeV=0.635
CopperTextSizeH=0.635
CopperTextThickness=0.1016
CopperTextItalic=0
CopperTextUpright=1
EdgeCutLineWidth=0.05
CourtyardLineWidth=0.05
OthersLineWidth=0.15
OthersTextSizeV=1
OthersTextSizeH=1
OthersTextSizeThickness=0.15
EdgeCutLineWidth=0.0508
CourtyardLineWidth=0.0508
OthersLineWidth=0.1524
OthersTextSizeV=0.635
OthersTextSizeH=0.635
OthersTextSizeThickness=0.1016
OthersTextItalic=0
OthersTextUpright=1
SolderMaskClearance=0
@@ -237,23 +238,23 @@ Enabled=0
[pcbnew/Netclasses]
[pcbnew/Netclasses/Default]
Name=Default
Clearance=0.2
TrackWidth=0.25
ViaDiameter=0.8
ViaDrill=0.4
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
Clearance=0.2032
TrackWidth=0.254
ViaDiameter=0.8128
ViaDrill=0.4064
uViaDiameter=0.3048
uViaDrill=0.1016
dPairWidth=0.2032
dPairGap=0.254
dPairViaGap=0.25
[pcbnew/Netclasses/1]
Name=POWER
Clearance=0.2
Clearance=0.2032
TrackWidth=0.3048
ViaDiameter=0.8
ViaDrill=0.4
uViaDiameter=0.3
uViaDrill=0.1
dPairWidth=0.2
dPairGap=0.25
ViaDiameter=0.8128
ViaDrill=0.4064
uViaDiameter=0.3048
uViaDrill=0.1016
dPairWidth=0.2032
dPairGap=0.254
dPairViaGap=0.25

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,3 @@
(sym_lib_table
(lib (name ledTruck-rescue)(type Legacy)(uri ${KIPRJMOD}/ledTruck-rescue.lib)(options "")(descr ""))
)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -8,20 +8,15 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nucleo_l031K6]
[env:LedBoardV10]
platform = ststm32
board = nucleo_l031K6
board = STM32L031K6
framework = arduino
upload_port = stlink
debug_tool = stlink
; [env:native]
; platform = native
; build_flags =
; -std=gnu++11
; -D UNIT_TEST
; lib_deps =
; ArduinoFake
#boards_dir = boards
lib_ldf_mode = deep+
build_flags =
-DHARDWAREVERSION=10
#lib_deps =
# rlogiacco/Battery Sense@^1.1.2

View File

@@ -1,31 +1,94 @@
#ifndef BOARDH
#define BOARDH
#ifndef UNIT_TEST
#define LED1 PB0 //D3
#define LED2 PB7 //D4
#define LED3 PB6 //D5
#if HARDWAREVERSION==9 //proto board with nucleo32l031 board
#define DETECT1 PA6 //A5
#define DETECT2 PA5 //A4
#define DETECT3 PA4 //A3
#define LED3 PB0 //D3
#define LED2 PB7 //D4
#define LED2 PB6 //D5
#define SWITCH1 PA7 //A6 TOGGLE1
#define SWITCH12 PA2 //A7 MOMENTARY1
#define SWITCH2 PA1 //A1 TOGGLE1
#define SWITCH22 PA3 //A2 MOMENTARY1
#define SWITCH3 PB5 //D11 TOGGLE1
#define SWITCH32 PB4 //D12 MOMENTARY1
#define DETECT3 PA6 //A5
#define DETECT2 PA5 //A4
#define DETECT1 PA4 //A3
#define LD3LED PB3
#define WAKEUPPIN PA2
#define SWITCH3 PA7 //A6 TOGGLE1
#define SWITCH32 PA2 //A7 MOMENTARY1
#define SWITCH2 PA1 //A1 TOGGLE1
#define SWITCH22 PA3 //A2 MOMENTARY1
#define SWITCH1 PB5 //D11 TOGGLE1
#define SWITCH12 PB4 //D12 MOMENTARY1
#define REDLEDRES
#define YELLOWLEDRES
#define GREENLEDRES
#define LD3LED PB3
#define WAKEUPPIN PA2
#else
#define REDLEDRES
#define YELLOWLEDRES
#define GREENLEDRES
#elif HARDWAREVERSION==10 //v1.0 PCB
#define LED3 PB2
#define LED2 PB8
#define LED1 PB7
#define DETECT3 PA6
#define DETECT2 PA5
#define DETECT1 PA4
#define SWITCH3 PA7 //A6 TOGGLE1
#define SWITCH32 PA2 //A7 MOMENTARY1
#define SWITCH2 PA1 //A1 TOGGLE1
#define SWITCH22 PA3 //A2 MOMENTARY1
#define SWITCH1 PB6 //D11 TOGGLE1
#define SWITCH12 PB5 //D12 MOMENTARY1
#define LD3LED PB3
#define WAKEUPPIN PA2
#define VBATTPIN PA0 //A0 VBATT
#define R12 3.3
#define R13 10
#define REDLEDRES
#define YELLOWLEDRES
#define GREENLEDRES
#elif HARDWAREVERSION==11
#define LED3 PB2
#define LED2 PB8
#define LED1 PB7
#define DETECT3 PA6
#define DETECT2 PA5
#define DETECT1 PA4
#define SWITCH3 PA7 //A6 TOGGLE1
#define SWITCH32 PA2 //A7 MOMENTARY1
#define SWITCH2 PA1 //A1 TOGGLE1
#define SWITCH22 PA3 //A2 MOMENTARY1
#define SWITCH1 PB6 //D11 TOGGLE1
#define SWITCH12 PB5 //D12 MOMENTARY1
#define LD3LED PB3
#define WAKEUPPIN PA2
#define VBATTPIN PA0 //A0 VBATT
#define R12 4.7
#define R13 10
#define MEASTRIGGER PA8
#define REDLEDRES
#define YELLOWLEDRES
#define GREENLEDRES
#else
#error No hardware version defined!!
#endif
#else //UNIT_TEST
#define LED1 0 //D3
#define LED2 1 //D4

View File

@@ -1,5 +1,3 @@
#include "led.h"
c_leds ledlist;
@@ -18,9 +16,9 @@ c_leds *getledlist(void)
void initLeds(void)
{
ledlist.init();
ledlist.AddLed(LED1, DETECT1, 1, 844, YELLOW, false);
ledlist.AddLed(LED2, DETECT2, 2, 512, RED, false);
ledlist.AddLed(LED3, DETECT3, 3, 92, GREEN, false);
ledlist.AddLed(LED1, DETECT1, 1, 844, YELLOW, true);
ledlist.AddLed(LED2, DETECT2, 2, 512, RED, true);
ledlist.AddLed(LED3, DETECT3, 3, 92, GREEN, true);
ledlist.begin();
}

View File

@@ -8,8 +8,10 @@
#include "simpleled.h"
#include "buttons.h"
#include "led.h"
#include "power.h"
#define TIMEOUT 15000 // 15sec * 1000ms
#define TIMEOUT 900000 // 15min* 60 sec * 1000ms
#define GAMESELECTTIMEOUT 10000 // 7sec * 1000ms
typedef enum
@@ -29,6 +31,7 @@ game nextGame = none;
uint8_t gameState = 0;
uint64_t lasttimeOut = 0;
uint64_t GameSelectTimer = 0;
bool buttonChanged = false;
void HandleIdle(void)
{
@@ -53,7 +56,7 @@ void HandleIdle(void)
if (buttonIsPressed(YELLOW) && buttonIsPressed(RED) && !buttonIsPressed(GREEN) & (nextGame == none))
{
//prepare for next game
nextGame = detectLED;
nextGame = SimpleLed;
turnOffLed(GREEN);
}
@@ -68,8 +71,8 @@ void HandleIdle(void)
void HandleGameSelectTimeout(void)
{
uint64_t currentmillis = millis();
// yellow && red && green all on
if (buttonIsPressed(YELLOW) && buttonIsPressed(RED) && buttonIsPressed(GREEN))
//if (yellow && red && green)
{
//all buttons pressed, wait for next game
if (!GameSelectTimer)
@@ -93,28 +96,33 @@ void HandleGameSelectTimeout(void)
}
}
// void HandleTimeOut(void)
// {
// uint64_t currentmillis = millis();
// if (!lasttimeOut)
// {
// lasttimeOut = currentmillis;
// }
void HandleTimeOut(void)
{
uint64_t currentmillis = millis();
if (!lasttimeOut)
{
lasttimeOut = currentmillis;
buttonChanged = anybutton();
}
//check if lastTime is initialized or timeout expired
if ((currentmillis - lasttimeOut > TIMEOUT))
{
currentGame = sleep;
turnOffAllLed();
shutdown();
}
else
{
if (buttonChanged != anybutton())
{
buttonChanged = anybutton();
//game in progress, update timer
lasttimeOut = currentmillis;
}
}
}
// //check if lastTime is initialized or timeout expired
// if ((currentmillis - lasttimeOut > TIMEOUT))
// {
// //handle timeout
// }
// else
// {
// if (anybutton())
// {
// //game in progress, update timer
// lasttimeOut = currentmillis;
// }
// }
// }
void setup()
{
@@ -122,12 +130,14 @@ void setup()
initButtons();
initDetectLed();
initSimpleLed();
initLowPower();
initBattery();
}
void loop()
{
handleButtons();
//HandleTimeOut();
HandleTimeOut();
HandleGameSelectTimeout();
switch (currentGame)
@@ -166,10 +176,13 @@ void loop()
case none:
{
currentGame = SimpleLed;
if (buttonIsPressed(YELLOW))
batteryCheck();
batterydisplay();
delay(1000);
if (buttonIsPressed(GREEN))
{
currentGame = ChainGame;
turnOnLed(YELLOW);
turnOnLed(GREEN);
}
if (buttonIsPressed(RED))
{
@@ -177,14 +190,15 @@ void loop()
turnOnLed(RED);
}
if (buttonIsPressed(GREEN))
if (buttonIsPressed(YELLOW))
{
currentGame = detectLED;
turnOnLed(GREEN);
currentGame = SimpleLed;
turnOnLed(YELLOW);
}
//wait for all buttons idle
while (anybutton())
;
{}
turnOffAllLed();
}

75
src/power.cpp Normal file
View File

@@ -0,0 +1,75 @@
#include "power.h"
#include "board.h"
#include "rtc.h"
#include "low_Power.h"
#include "led.h"
#ifdef VBATTPIN
#include "Battery.h"
Battery battery(2500, 4160, VBATTPIN);
#endif
void initBattery(void)
{
#ifdef VBATTPIN
battery.begin(3300, (R12+R13)/R13); //R1 = 220K, R2 = 100K, factor = (R1+R2)/R2
#endif
}
uint16_t batteryGetVoltage( void )
{
return battery.voltage();
}
void batterydisplay(void)
{
#ifdef VBATTPIN
uint16_t currentlevel = battery.level();
uint16_t currentvoltage = batteryGetVoltage();
if(currentvoltage)
{
if (currentlevel > 90)
{
turnOnLed(3);
}
if (currentlevel > 50)
{
turnOnLed(2);
}
if (currentlevel > 20)
{
turnOnLed(1);
}
}
#endif
}
void batteryCheck(void)
{
#ifdef VBATTPIN
if (battery.level() < 10)
{
for( int i = 0; i < 10;i++)
{
turnOnLed(1);
delay(300);
turnOffLed(1);
delay(300);
}
delay(5000);
shutdown();
}
#endif
}
//low power
void initLowPower(void)
{
LowPower_init();
}
void shutdown(void)
{
LowPower_shutdown();
}

10
src/power.h Normal file
View File

@@ -0,0 +1,10 @@
#pragma once
//battery
void initBattery( void );
void batterydisplay( void );
void batteryCheck(void);
//low power
void initLowPower( void );
void shutdown( void );

View File

@@ -1,11 +0,0 @@
This directory is intended for PlatformIO Unit Testing and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PlatformIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html

View File

@@ -1,30 +0,0 @@
#include <Arduino.h>
#include <cstdlib>
#include <unity.h>
#include "test_simpleled.h"
#ifdef UNIT_TEST
#define RUN_TEST_GROUP(TEST) \
if (!std::getenv("TEST_GROUP") || (strcmp(#TEST, std::getenv("TEST_GROUP")) == 0)) { \
TEST::run_tests(); \
}
void setUp(void)
{
ArduinoFakeReset();
}
int main(int argc, char **argv) {
UNITY_BEGIN();
RUN_TEST_GROUP(simpleLedTest);
UNITY_END();
}
#endif //UNIT_TEST

View File

@@ -1,12 +0,0 @@
#ifdef UNIT_TEST
namespace simpleLedTest
{
void test_initfunction( void )
{
}
}
#endif

View File

@@ -0,0 +1,196 @@
/*
*******************************************************************************
* Copyright (c) 2019, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
* Automatically generated from STM32L031K(4-6)Tx.xml
*/
#include "Arduino.h"
#include "PeripheralPins.h"
/* =====
* Note: Commented lines are alternative possibilities which are not used per default.
* If you change them, you will have to know what you do
* =====
*/
//*** ADC ***
#ifdef HAL_ADC_MODULE_ENABLED
WEAK const PinMap PinMap_ADC[] = {
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
// {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 - Connected to STDIO_UART_TX
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
{NC, NP, 0}
};
#endif
//*** No DAC ***
//*** I2C ***
#ifdef HAL_I2C_MODULE_ENABLED
WEAK const PinMap PinMap_I2C_SDA[] = {
{PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_I2C_MODULE_ENABLED
WEAK const PinMap PinMap_I2C_SCL[] = {
{PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
#endif
//*** PWM ***
#ifdef HAL_TIM_MODULE_ENABLED
WEAK const PinMap PinMap_PWM[] = {
{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3
// {PA_2, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1
{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4
// {PA_3, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2
{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PA_6, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1
{PA_7, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2
{PA_8, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PA_9, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1
{PA_10, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2
// {PA_11, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 2, 0)}, // TIM21_CH2
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PB_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 3, 0)}, // TIM2_CH3
{PB_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 4, 0)}, // TIM2_CH4
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
{PB_4, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1
{PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2
// {PB_6, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 1, 0)}, // TIM21_CH1
{NC, NP, 0}
};
#endif
//*** SERIAL ***
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_TX[] = {
// {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, // STLink TX
{PA_9, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PB_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_RX[] = {
// {PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_10, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, // STLink RX
{PB_7, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_RTS[] = {
{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_12, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PB_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_CTS[] = {
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
{PA_7, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_11, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{NC, NP, 0}
};
#endif
//*** SPI ***
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MOSI[] = {
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_1, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MISO[] = {
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_0, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SCLK[] = {
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SSEL[] = {
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
// {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
//*** No CAN ***
//*** No ETHERNET ***
//*** No QUADSPI ***
//*** No USB ***

View File

@@ -0,0 +1,25 @@
/* SYS_WKUP */
#ifdef PWR_WAKEUP_PIN1
SYS_WKUP1 = PA_0,
#endif
#ifdef PWR_WAKEUP_PIN2
SYS_WKUP2 = NC,
#endif
#ifdef PWR_WAKEUP_PIN3
SYS_WKUP3 = PA_2,
#endif
#ifdef PWR_WAKEUP_PIN4
SYS_WKUP4 = NC,
#endif
#ifdef PWR_WAKEUP_PIN5
SYS_WKUP5 = NC,
#endif
#ifdef PWR_WAKEUP_PIN6
SYS_WKUP6 = NC,
#endif
#ifdef PWR_WAKEUP_PIN7
SYS_WKUP7 = NC,
#endif
#ifdef PWR_WAKEUP_PIN8
SYS_WKUP8 = NC,
#endif

View File

@@ -0,0 +1,188 @@
/*
*****************************************************************************
**
** File : LinkerScript.ld
**
** Abstract : Linker script for STM32L031K6Tx Device with
** 32KByte FLASH, 8KByte RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
**
** Distribution: The file is distributed as is, without any warranty
** of any kind.
**
*****************************************************************************
** @attention
**
** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
** 1. Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** 3. Neither the name of Ac6 nor the names of its contributors
** may be used to endorse or promote products derived from this software
** without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20002000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}

View File

@@ -0,0 +1,123 @@
/*
*******************************************************************************
* Copyright (c) 2017, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_10, //D0
PA_9, //D1
PA_12, //D2
PB_0, //D3
PB_7, //D4
PB_6, //D5
PB_1, //D6
PC_14, //D7
PC_15, //D8
PA_8, //D9
PA_11, //D10
PB_5, //D11
PB_4, //D12
PB_3, //D13 - LED
PA_0, //D14/A0
PA_1, //D15/A1
PA_3, //D16/A2
PA_4, //D17/A3
PA_5, //D18/A4
PA_6, //D19/A5
PA_7, //D20/A6
PA_2, //D21/A7 - STLink Tx
PA_15, //D22 - STLink Rx
PB_2, //D23
PB_8 //D24
};
#ifdef __cplusplus
}
#endif
// ----------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief System Clock Configuration
* @param None
* @retval None
*/
WEAK void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;
/* Configure the main internal regulator output voltage */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/* Initializes the CPU, AHB and APB buses clocks */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_4;
RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_2;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
/* Initializes the CPU, AHB and APB busses clocks */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2;
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,120 @@
/*
*******************************************************************************
* Copyright (c) 2017, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef _VARIANT_ARDUINO_STM32_
#define _VARIANT_ARDUINO_STM32_
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/*----------------------------------------------------------------------------
* Pins
*----------------------------------------------------------------------------*/
#define PA10 0
#define PA9 1
#define PA12 2
#define PB0 3
#define PB7 4
#define PB6 5
#define PB1 6
#define PC14 7
#define PC15 8
#define PA8 9
#define PA11 10
#define PB5 11
#define PB4 12
#define PB3 13 // LED
#define PA0 14 // A0
#define PA1 15 // A1
#define PA3 16 // A2
#define PA4 17 // A3
#define PA5 18 // A4
#define PA6 19 // A5
#define PA7 20 // A6
#define PA2 21 // A7 - STLink Tx
#define PA15 22 // STLink Rx
#define PB2 23
#define PB8 24
// This must be a literal
#define NUM_DIGITAL_PINS 25
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 7
#define NUM_ANALOG_FIRST 14
// On-board LED pin number
//#define LED_BUILTIN 13
//#define LED_GREEN LED_BUILTIN
// I2C Definitions
#define PIN_WIRE_SDA 4
#define PIN_WIRE_SCL 5
//Timer Definitions
#define TIMER_TONE TIM2
#define TIMER_SERVO TIM21
// UART Definitions
#define SERIAL_UART_INSTANCE 2 //ex: 2 for Serial2 (USART2)
// Default pin used for 'Serial' instance (ex: ST-Link)
// Mandatory for Firmata
#define PIN_SERIAL_RX PA15
#define PIN_SERIAL_TX PA2
#ifdef __cplusplus
} // extern "C"
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
// These serial port names are intended to allow libraries and architecture-neutral
// sketches to automatically default to the correct port name for a particular type
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
//
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
//
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
//
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
//
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
//
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
// pins are NOT connected to anything by default.
#define SERIAL_PORT_MONITOR Serial
#define SERIAL_PORT_HARDWARE Serial
#endif
#endif /* _VARIANT_ARDUINO_STM32_ */

View File

@@ -0,0 +1,196 @@
/*
*******************************************************************************
* Copyright (c) 2019, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
* Automatically generated from STM32L031K(4-6)Tx.xml
*/
#include "Arduino.h"
#include "PeripheralPins.h"
/* =====
* Note: Commented lines are alternative possibilities which are not used per default.
* If you change them, you will have to know what you do
* =====
*/
//*** ADC ***
#ifdef HAL_ADC_MODULE_ENABLED
WEAK const PinMap PinMap_ADC[] = {
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
// {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 - Connected to STDIO_UART_TX
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
{NC, NP, 0}
};
#endif
//*** No DAC ***
//*** I2C ***
#ifdef HAL_I2C_MODULE_ENABLED
WEAK const PinMap PinMap_I2C_SDA[] = {
{PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_I2C_MODULE_ENABLED
WEAK const PinMap PinMap_I2C_SCL[] = {
{PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
{NC, NP, 0}
};
#endif
//*** PWM ***
#ifdef HAL_TIM_MODULE_ENABLED
WEAK const PinMap PinMap_PWM[] = {
{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3
// {PA_2, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1
{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4
// {PA_3, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2
{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PA_6, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1
{PA_7, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2
{PA_8, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PA_9, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1
{PA_10, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2
// {PA_11, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 2, 0)}, // TIM21_CH2
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
{PB_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 3, 0)}, // TIM2_CH3
{PB_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 4, 0)}, // TIM2_CH4
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
{PB_4, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1
{PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2
// {PB_6, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 1, 0)}, // TIM21_CH1
{NC, NP, 0}
};
#endif
//*** SERIAL ***
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_TX[] = {
// {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, // STLink TX
{PA_9, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PB_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_RX[] = {
// {PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_10, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, // STLink RX
{PB_7, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_RTS[] = {
{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_12, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PB_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_UART_MODULE_ENABLED
WEAK const PinMap PinMap_UART_CTS[] = {
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
// {PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
{PA_7, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{PA_11, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
{NC, NP, 0}
};
#endif
//*** SPI ***
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MOSI[] = {
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_1, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_MISO[] = {
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_0, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SCLK[] = {
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
#ifdef HAL_SPI_MODULE_ENABLED
WEAK const PinMap PinMap_SPI_SSEL[] = {
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
// {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
{NC, NP, 0}
};
#endif
//*** No CAN ***
//*** No ETHERNET ***
//*** No QUADSPI ***
//*** No USB ***

View File

@@ -0,0 +1,25 @@
/* SYS_WKUP */
#ifdef PWR_WAKEUP_PIN1
SYS_WKUP1 = PA_0,
#endif
#ifdef PWR_WAKEUP_PIN2
SYS_WKUP2 = NC,
#endif
#ifdef PWR_WAKEUP_PIN3
SYS_WKUP3 = PA_2,
#endif
#ifdef PWR_WAKEUP_PIN4
SYS_WKUP4 = NC,
#endif
#ifdef PWR_WAKEUP_PIN5
SYS_WKUP5 = NC,
#endif
#ifdef PWR_WAKEUP_PIN6
SYS_WKUP6 = NC,
#endif
#ifdef PWR_WAKEUP_PIN7
SYS_WKUP7 = NC,
#endif
#ifdef PWR_WAKEUP_PIN8
SYS_WKUP8 = NC,
#endif

View File

@@ -0,0 +1,188 @@
/*
*****************************************************************************
**
** File : LinkerScript.ld
**
** Abstract : Linker script for STM32L031K6Tx Device with
** 32KByte FLASH, 8KByte RAM
**
** Set heap size, stack size and stack location according
** to application requirements.
**
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
**
** Distribution: The file is distributed as is, without any warranty
** of any kind.
**
*****************************************************************************
** @attention
**
** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
**
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
** 1. Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer in the documentation
** and/or other materials provided with the distribution.
** 3. Neither the name of Ac6 nor the names of its contributors
** may be used to endorse or promote products derived from this software
** without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20002000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K
}
/* Define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.glue_7) /* glue arm to thumb code */
*(.glue_7t) /* glue thumb to arm code */
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
_etext = .; /* define a global symbols at end of code */
} >FLASH
/* Constant data goes into FLASH */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >FLASH
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >FLASH
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >FLASH
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >RAM AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
{
/* This is used by the startup in order to initialize the .bss secion */
_sbss = .; /* define a global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
{
. = ALIGN(8);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >RAM
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}

View File

@@ -0,0 +1,123 @@
/*
*******************************************************************************
* Copyright (c) 2017, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_10, //D0
PA_9, //D1
PA_12, //D2
PB_0, //D3
PB_7, //D4
PB_6, //D5
PB_1, //D6
PC_14, //D7
PC_15, //D8
PA_8, //D9
PA_11, //D10
PB_5, //D11
PB_4, //D12
PB_3, //D13 - LED
PA_0, //D14/A0
PA_1, //D15/A1
PA_3, //D16/A2
PA_4, //D17/A3
PA_5, //D18/A4
PA_6, //D19/A5
PA_7, //D20/A6
PA_2, //D21/A7 - STLink Tx
PA_15, //D22 - STLink Rx
PB_2, //D23
PB_8 //D24
};
#ifdef __cplusplus
}
#endif
// ----------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief System Clock Configuration
* @param None
* @retval None
*/
WEAK void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;
/* Configure the main internal regulator output voltage */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/* Initializes the CPU, AHB and APB buses clocks */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLLMUL_4;
RCC_OscInitStruct.PLL.PLLDIV = RCC_PLLDIV_2;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
/* Initializes the CPU, AHB and APB busses clocks */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART2;
PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
}
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,120 @@
/*
*******************************************************************************
* Copyright (c) 2017, STMicroelectronics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
*/
#ifndef _VARIANT_ARDUINO_STM32_
#define _VARIANT_ARDUINO_STM32_
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/*----------------------------------------------------------------------------
* Pins
*----------------------------------------------------------------------------*/
#define PA10 0
#define PA9 1
#define PA12 2
#define PB0 3
#define PB7 4
#define PB6 5
#define PB1 6
#define PC14 7
#define PC15 8
#define PA8 9
#define PA11 10
#define PB5 11
#define PB4 12
#define PB3 13 // LED
#define PA0 14 // A0
#define PA1 15 // A1
#define PA3 16 // A2
#define PA4 17 // A3
#define PA5 18 // A4
#define PA6 19 // A5
#define PA7 20 // A6
#define PA2 21 // A7 - STLink Tx
#define PA15 22 // STLink Rx
#define PB2 23
#define PB8 24
// This must be a literal
#define NUM_DIGITAL_PINS 25
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
#define NUM_ANALOG_INPUTS 7
#define NUM_ANALOG_FIRST 14
// On-board LED pin number
//#define LED_BUILTIN 13
//#define LED_GREEN LED_BUILTIN
// I2C Definitions
#define PIN_WIRE_SDA 4
#define PIN_WIRE_SCL 5
//Timer Definitions
#define TIMER_TONE TIM2
#define TIMER_SERVO TIM21
// UART Definitions
#define SERIAL_UART_INSTANCE 2 //ex: 2 for Serial2 (USART2)
// Default pin used for 'Serial' instance (ex: ST-Link)
// Mandatory for Firmata
#define PIN_SERIAL_RX PA15
#define PIN_SERIAL_TX PA2
#ifdef __cplusplus
} // extern "C"
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
// These serial port names are intended to allow libraries and architecture-neutral
// sketches to automatically default to the correct port name for a particular type
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
//
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
//
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
//
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
//
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
//
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
// pins are NOT connected to anything by default.
#define SERIAL_PORT_MONITOR Serial
#define SERIAL_PORT_HARDWARE Serial
#endif
#endif /* _VARIANT_ARDUINO_STM32_ */