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
81429bf2
Commit
81429bf2
authored
Nov 25, 2020
by
Sandeep Mistry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nRF52833 support + generic variant
parent
a9ca22cd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
94 additions
and
5 deletions
+94
-5
.travis.yml
.travis.yml
+1
-0
boards.txt
boards.txt
+33
-0
cores/nRF5/Arduino.h
cores/nRF5/Arduino.h
+9
-0
cores/nRF5/wiring_analog_nRF52.c
cores/nRF5/wiring_analog_nRF52.c
+8
-4
variants/Generic/variant.cpp
variants/Generic/variant.cpp
+35
-1
variants/Generic/variant.h
variants/Generic/variant.h
+8
-0
No files found.
.travis.yml
View file @
81429bf2
...
...
@@ -41,3 +41,4 @@ script:
-
buildExampleSketch sandeepmistry:nRF5:Sinobit 01.Basics BareMinimum
-
buildExampleSketch sandeepmistry:nRF5:DWM1001-DEV 01.Basics Blink
-
buildExampleSketch sandeepmistry:nRF5:SeeedArchLink 01.Basics Blink
-
buildExampleSketch sandeepmistry:nRF5:Generic_nRF52833 01.Basics Blink
boards.txt
View file @
81429bf2
...
...
@@ -21,6 +21,39 @@ menu.version=Version
menu.lfclk=Low Frequency Clock
menu.board_variant=Board Variant
# nRF52833 variants
###################
Generic_nRF52833.name=Generic nRF52833
Generic_nRF52833.upload.tool=sandeepmistry:openocd
Generic_nRF52833.upload.target=nrf52
Generic_nRF52833.upload.maximum_size=524288
Generic_nRF52833.bootloader.tool=sandeepmistry:openocd
Generic_nRF52833.build.mcu=cortex-m4
Generic_nRF52833.build.f_cpu=64000000
Generic_nRF52833.build.board=GENERIC
Generic_nRF52833.build.core=nRF5
Generic_nRF52833.build.variant=Generic
Generic_nRF52833.build.variant_system_lib=
Generic_nRF52833.build.extra_flags=-DNRF52833_XXAA
Generic_nRF52833.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
Generic_nRF52833.build.ldscript=nrf52833_xxaa.ld
Generic_nRF52833.menu.softdevice.none=None
Generic_nRF52833.menu.softdevice.none.softdevice=none
Generic_nRF52833.menu.softdevice.none.softdeviceversion=
Generic_nRF52833.menu.lfclk.lfxo=Crystal Oscillator
Generic_nRF52833.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
Generic_nRF52833.menu.lfclk.lfrc=RC Oscillator
Generic_nRF52833.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
Generic_nRF52833.menu.lfclk.lfsynt=Synthesized
Generic_nRF52833.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
# nRF52832 variants
###################
...
...
cores/nRF5/Arduino.h
View file @
81429bf2
...
...
@@ -95,10 +95,19 @@ void loop( void ) ;
#define bit(b) (1UL << (b))
#if (GPIO_COUNT == 1)
#define gpioBaseForPin(P) ( NRF_GPIO )
#define digitalPinToPort(P) ( (NRF_GPIO_Type *) gpioBaseForPin(P) )
#define digitalPinToPin(P) ( g_ADigitalPinMap[P] )
#define digitalPinToBitMask(P) ( 1 << digitalPinToPin(P) )
#elif (GPIO_COUNT == 2)
#define gpioBaseForPin(P) ( (g_ADigitalPinMap[P] & 0x20) ? NRF_P1 : NRF_P0 )
#define digitalPinToPort(P) ( (NRF_GPIO_Type *) gpioBaseForPin(P) )
#define digitalPinToPin(P) ( g_ADigitalPinMap[P] & 0x1f )
#define digitalPinToBitMask(P) ( 1 << digitalPinToPin(P) )
#else
#error "Unsupported GPIO_COUNT"
#endif
#define portOutputRegister(port) ( &(port->OUTSET) )
#define portInputRegister(port) ( &(port->IN) )
...
...
cores/nRF5/wiring_analog_nRF52.c
View file @
81429bf2
...
...
@@ -29,18 +29,22 @@ extern "C" {
static
uint32_t
saadcReference
=
SAADC_CH_CONFIG_REFSEL_Internal
;
static
uint32_t
saadcGain
=
SAADC_CH_CONFIG_GAIN_Gain1_5
;
#define PWM_COUNT 3
static
NRF_PWM_Type
*
pwms
[
PWM_COUNT
]
=
{
NRF_PWM0
,
NRF_PWM1
,
NRF_PWM2
NRF_PWM2
,
#if PWM_COUNT > 3
NRF_PWM3
#endif
};
static
uint32_t
pwmChannelPins
[
PWM_COUNT
]
=
{
0xFFFFFFFF
,
0xFFFFFFFF
,
0xFFFFFFFF
0xFFFFFFFF
,
#if PWM_COUNT > 3
0xFFFFFFFF
,
#endif
};
static
uint16_t
pwmChannelSequence
[
PWM_COUNT
];
...
...
variants/Generic/variant.cpp
View file @
81429bf2
...
...
@@ -51,5 +51,39 @@ const uint32_t g_ADigitalPinMap[] = {
28
,
29
,
30
,
31
31
,
#if GPIO_COUNT > 1
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
#endif
};
variants/Generic/variant.h
View file @
81429bf2
...
...
@@ -18,6 +18,7 @@
#define _VARIANT_GENERIC_
#include "nrf.h"
#include "nrf_peripherals.h"
/** Master clock frequency */
#if defined(NRF52_SERIES)
...
...
@@ -38,8 +39,15 @@ extern "C"
#endif // __cplusplus
// Number of pins defined in PinDescription array
#if GPIO_COUNT == 1
#define PINS_COUNT (32u)
#define NUM_DIGITAL_PINS (32u)
#elif GPIO_COUNT == 2
#define PINS_COUNT (64u)
#define NUM_DIGITAL_PINS (64u)
#else
#error "Unsupported GPIO_COUNT"
#endif
#define NUM_ANALOG_INPUTS (6u)
#define NUM_ANALOG_OUTPUTS (0u)
...
...
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