Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
a89e43ae
Commit
a89e43ae
authored
6 years ago
by
Federico Pellegrin
Browse files
Options
Downloads
Patches
Plain Diff
sys/arduino: add possibility to customize Arduino serial port at compile time
parent
94adf875
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/arduino/doc.txt
+6
-0
6 additions, 0 deletions
sys/arduino/doc.txt
sys/arduino/include/arduino.hpp
+9
-2
9 additions, 2 deletions
sys/arduino/include/arduino.hpp
with
15 additions
and
2 deletions
sys/arduino/doc.txt
+
6
−
0
View file @
a89e43ae
...
@@ -112,6 +112,12 @@
...
@@ -112,6 +112,12 @@
* @endcode
* @endcode
* This links to the third entry in the `arduino_pinmap` array.
* This links to the third entry in the `arduino_pinmap` array.
*
*
* - a define `ARDUINO_UART_DEV` that defines the UART to use as the Arduino
* primary serial port (default UART_DEV(0)):
* @code{c}
* #define ARDUINO_UART_DEV (UART_DEV(3))
* @endcode
*
* In addition, you have to add the 'arduino' feature to the board. For this,
* In addition, you have to add the 'arduino' feature to the board. For this,
* just add `FEATURES_PROVIDED += arduino` to the 'other features' section in
* just add `FEATURES_PROVIDED += arduino` to the 'other features' section in
* your board's `Makefile.features'.
* your board's `Makefile.features'.
...
...
This diff is collapsed.
Click to expand it.
sys/arduino/include/arduino.hpp
+
9
−
2
View file @
a89e43ae
...
@@ -45,10 +45,17 @@ enum {
...
@@ -45,10 +45,17 @@ enum {
HIGH
=
1
/**< pin is set */
HIGH
=
1
/**< pin is set */
};
};
#ifndef ARDUINO_UART_DEV
/**
/**
* @brief
Primary serial port (mapped to UART_DEV(0))
* @brief
UART device to use for Arduino serial
*/
*/
static
SerialPort
Serial
(
UART_DEV
(
0
));
#define ARDUINO_UART_DEV UART_DEV(0)
#endif
/**
* @brief Primary serial port (mapped to ARDUINO_UART_DEV)
*/
static
SerialPort
Serial
(
ARDUINO_UART_DEV
);
/**
/**
* @brief Configure a pin as either input or output
* @brief Configure a pin as either input or output
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment