Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-nRF5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-nRF5
Commits
a629080f
Commit
a629080f
authored
Apr 03, 2016
by
Sandeep Mistry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Serial definition from variant to core in Uart
parent
6c89cab3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
90 deletions
+50
-90
cores/nRF5/Arduino.h
cores/nRF5/Arduino.h
+4
-0
cores/nRF5/Uart.cpp
cores/nRF5/Uart.cpp
+22
-0
cores/nRF5/Uart.h
cores/nRF5/Uart.h
+24
-0
variants/BluzDK/variant.cpp
variants/BluzDK/variant.cpp
+0
-10
variants/BluzDK/variant.h
variants/BluzDK/variant.h
+0
-37
variants/nRF52DK/variant.cpp
variants/nRF52DK/variant.cpp
+0
-10
variants/nRF52DK/variant.h
variants/nRF52DK/variant.h
+0
-33
No files found.
cores/nRF5/Arduino.h
View file @
a629080f
...
...
@@ -112,4 +112,8 @@ void loop( void ) ;
// Interrupts
#define digitalPinToInterrupt(P) ( P )
#ifdef __cplusplus
#include "Uart.h"
#endif // __cplusplus
#endif // Arduino_h
cores/nRF5/Uart.cpp
View file @
a629080f
...
...
@@ -146,3 +146,25 @@ size_t Uart::write(const uint8_t data)
return
1
;
}
#if defined(NRF52)
Uart
Serial
(
NRF_UART0
,
UARTE0_UART0_IRQn
,
PIN_SERIAL_RX
,
PIN_SERIAL_TX
);
extern
"C"
{
void
UARTE0_UART0_IRQHandler
()
{
Serial
.
IrqHandler
();
}
}
#elif defined(NRF51)
Uart
Serial
(
NRF_UART0
,
UART0_IRQn
,
PIN_SERIAL_RX
,
PIN_SERIAL_TX
);
extern
"C"
{
void
UART0_IRQHandler
()
{
Serial
.
IrqHandler
();
}
}
#endif
cores/nRF5/Uart.h
View file @
a629080f
...
...
@@ -51,3 +51,27 @@ class Uart : public HardwareSerial
uint8_t
uc_pinRX
;
uint8_t
uc_pinTX
;
};
#ifdef __cplusplus
extern
Uart
Serial
;
#endif
// 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
variants/BluzDK/variant.cpp
View file @
a629080f
...
...
@@ -60,13 +60,3 @@ const uint32_t g_ADigitalPinMap[] = {
18
,
17
};
Uart
Serial
(
NRF_UART0
,
UART0_IRQn
,
PIN_SERIAL_RX
,
PIN_SERIAL_TX
);
extern
"C"
{
void
UART0_IRQHandler
()
{
Serial
.
IrqHandler
();
}
}
variants/BluzDK/variant.h
View file @
a629080f
...
...
@@ -25,10 +25,6 @@
#include "WVariant.h"
#ifdef __cplusplus
#include "Uart.h"
#endif // __cplusplus
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -114,37 +110,4 @@ static const uint8_t SCK1 = PIN_SPI1_SCK ;
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
/* =========================
* ===== SERCOM DEFINITION
* =========================
*/
extern
Uart
Serial
;
#endif
// 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
variants/nRF52DK/variant.cpp
View file @
a629080f
...
...
@@ -56,13 +56,3 @@ const uint32_t g_ADigitalPinMap[] = {
// AREF
2
};
Uart
Serial
(
NRF_UART0
,
UARTE0_UART0_IRQn
,
PIN_SERIAL_RX
,
PIN_SERIAL_TX
);
extern
"C"
{
void
UARTE0_UART0_IRQHandler
()
{
Serial
.
IrqHandler
();
}
}
variants/nRF52DK/variant.h
View file @
a629080f
...
...
@@ -25,10 +25,6 @@
#include "WVariant.h"
#ifdef __cplusplus
#include "Uart.h"
#endif // __cplusplus
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -112,33 +108,4 @@ static const uint8_t SCK = PIN_SPI_SCK ;
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#ifdef __cplusplus
/* =========================
* ===== SERCOM DEFINITION
* =========================
*/
extern
Uart
Serial
;
#endif
// 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment