Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit b63301b

Browse files
Merge pull request #13 from alfran/development
Development
2 parents 876491c + 64ab58d commit b63301b

File tree

4 files changed

+97
-58
lines changed

4 files changed

+97
-58
lines changed

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Arduino Core for STM32F4 CPU
2+
3+
This repository contains the source code and configuration files of the Arduino Core
4+
for ST Microelectronics STM32F4 processor (used on the Arduino STAR OTTO).
5+
6+
## Installation on Arduino IDE
7+
8+
This core is available as a package in the Arduino IDE cores manager.
9+
Just open the "Boards Manager" and install the package called:
10+
11+
"Arduino STM32F4 Boards (32-bit ARM Cortex-M4)"
12+
13+
## Support
14+
15+
There is a dedicated section of the Arduino Forum for general discussion and project assistance:
16+
17+
http://forum.arduino.org/index.php?board=98.0
18+
19+
## Bugs or Issues
20+
21+
If you find a bug you can submit an issue here on github:
22+
23+
https://github.com/arduino/Arduino-core-stm32f4/issues
24+
25+
Before posting a new issue, please check if the same problem has been already reported by someone else
26+
to avoid duplicates.
27+
28+
## Contributions
29+
30+
Contributions are always welcome. The preferred way to receive code cotribution is by submitting a
31+
Pull Request on github.
32+
33+
## Hourly builds
34+
35+
This repository is under a Continuous Integration system that every hour checks if there are updates and
36+
builds a release for testing (the so called "Hourly builds").
37+
38+
The hourly builds are available through Boards Manager. If you want to install them:
39+
1. Open the **Preferences** of the Arduino IDE.
40+
2. Add this URL `http://downloads.arduino.cc/Hourly/STM32F4/package_stm32f4-hourly-build_index.json` in the **Additional Boards Manager URLs** field, and click OK.
41+
3. Open the **Boards Manager** (menu Tools->Board->Board Manager...)
42+
4. Install **Arduino STM32F4 core - Hourly build**
43+
5. Select one of the boards under **STM32F4 Hourly build XX** in Tools->Board menu
44+
6. Compile/Upload as usual
45+
46+
If you already installed an hourly build and you want to update it with the latest:
47+
1. Open the **Boards Manager** (menu Tools->Board->Board Manager...)
48+
2. Remove **Arduino SAMD core - Hourly build**
49+
3. Install again **Arduino SAMD core - Hourly build**, the Board Manager will download the latest build replacing the old one.
50+
51+
## License and credits
52+
53+
This core has been developed by Arduino.org in collaboration with STM.
54+
55+
```
56+
Copyright (c) 2017 Arduino.org All right reserved.
57+
58+
This library is free software; you can redistribute it and/or
59+
modify it under the terms of the GNU Lesser General Public
60+
License as published by the Free Software Foundation; either
61+
version 2.1 of the License, or (at your option) any later version.
62+
63+
This library is distributed in the hope that it will be useful,
64+
but WITHOUT ANY WARRANTY; without even the implied warranty of
65+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
66+
See the GNU Lesser General Public License for more details.
67+
68+
You should have received a copy of the GNU Lesser General Public
69+
License along with this library; if not, write to the Free Software
70+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

cores/arduino/io.h

+3-57
Original file line numberDiff line numberDiff line change
@@ -43,70 +43,16 @@
4343
#include "adc.h"
4444

4545
#include "wiring_time.h"
46-
47-
/**
48-
* Specifies a GPIO pin behavior.
49-
* @see pinMode()
50-
*/
51-
typedef enum WiringPinMode {
52-
OUTPUT, /**< Basic digital output: when the pin is HIGH, the
53-
voltage is held at +3.3v (Vcc) and when it is LOW, it
54-
is pulled down to ground. */
55-
56-
OUTPUT_OPENDRAIN, /**< In open drain mode, the pin indicates
57-
"low" by accepting current flow to ground
58-
and "high" by providing increased
59-
impedance. An example use would be to
60-
connect a pin to a bus line (which is pulled
61-
up to a positive voltage by a separate
62-
supply through a large resistor). When the
63-
pin is high, not much current flows through
64-
to ground and the line stays at positive
65-
voltage; when the pin is low, the bus
66-
"drains" to ground with a small amount of
67-
current constantly flowing through the large
68-
resistor from the external supply. In this
69-
mode, no current is ever actually sourced
70-
from the pin. */
71-
72-
INPUT, /**< Basic digital input. The pin voltage is sampled; when
73-
it is closer to 3.3v (Vcc) the pin status is high, and
74-
when it is closer to 0v (ground) it is low. If no
75-
external circuit is pulling the pin voltage to high or
76-
low, it will tend to randomly oscillate and be very
77-
sensitive to noise (e.g., a breath of air across the pin
78-
might cause the state to flip). */
79-
80-
INPUT_PULLUP, /**< The state of the pin in this mode is reported
81-
the same way as with INPUT, but the pin voltage
82-
is gently "pulled up" towards +3.3v. This means
83-
the state will be high unless an external device
84-
is specifically pulling the pin down to ground,
85-
in which case the "gentle" pull-up will not
86-
affect the state of the input. */
87-
88-
INPUT_PULLDOWN, /**< The state of the pin in this mode is reported
89-
the same way as with INPUT, but the pin voltage
90-
is gently "pulled down" towards 0v. This means
91-
the state will be low unless an external device
92-
is specifically pulling the pin up to 3.3v, in
93-
which case the "gentle" pull-down will not
94-
affect the state of the input. */
95-
96-
INPUT_FLOAT, /**< Synonym for INPUT. */
97-
98-
OUTPUT_DAC, /**< This is a special mode for when the pin will be used for
99-
PWM output (a special case of digital output). */
100-
} WiringPinMode;
46+
#include "wiring_constants.h"
10147

10248
/**
10349
* Configure behavior of a GPIO pin.
10450
*
10551
* @param pin Number of pin to configure.
10652
* @param mode Mode corresponding to desired pin behavior.
107-
* @see WiringPinMode
53+
* @see PinMode
10854
*/
109-
void pinMode(uint8 pin, WiringPinMode mode);
55+
void pinMode(uint8 pin, uint8 mode);
11056

11157
/**
11258
* Writes a (digital) value to a pin. The pin must have its

cores/arduino/wiring_constants.h

+23
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@
4141
extern "C"{
4242
#endif
4343

44+
#define INPUT 0x0
45+
#define OUTPUT 0x1
46+
#define INPUT_PULLUP 0x2
47+
#define OUTPUT_OPENDRAIN 0x3
48+
#define INPUT_PULLUP 0x4
49+
#define INPUT_PULLDOWN 0x5
50+
#define INPUT_FLOAT 0x6
51+
#define OUTPUT_DAC 0x7
52+
53+
#define true 0x1
54+
#define false 0x0
55+
56+
#define PI 3.1415926535897932384626433832795
57+
#define HALF_PI 1.5707963267948966192313216916398
58+
#define TWO_PI 6.283185307179586476925286766559
59+
#define DEG_TO_RAD 0.017453292519943295769236907684886
60+
#define RAD_TO_DEG 57.295779513082320876798154814105
61+
#define EULER 2.718281828459045235360287471352
62+
63+
#define SERIAL 0x0
64+
#define DISPLAY 0x1
65+
66+
4467
typedef unsigned short word;
4568

4669
enum BitOrder {

cores/arduino/wiring_digital.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "Arduino.h"
3939
#include "dac.h"
4040

41-
void pinMode(uint8 pin, WiringPinMode mode)
41+
void pinMode(uint8 pin, uint8 mode)
4242
{
4343
gpio_pin_mode outputMode;
4444
boolean pwm = false;

0 commit comments

Comments
 (0)