Skip to content

Commit db23d53

Browse files
committed
Enable SPIM and bring into code.
1 parent 65ed9d4 commit db23d53

File tree

3 files changed

+851
-10
lines changed

3 files changed

+851
-10
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,37 +3218,39 @@
32183218

32193219
// </e>
32203220

3221+
// #define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
3222+
32213223
// <e> NRFX_SPIM_ENABLED - nrfx_spim - SPIM peripheral driver
32223224
//==========================================================
32233225
#ifndef NRFX_SPIM_ENABLED
3224-
#define NRFX_SPIM_ENABLED 0
3226+
#define NRFX_SPIM_ENABLED 1
32253227
#endif
32263228
// <q> NRFX_SPIM0_ENABLED - Enable SPIM0 instance
32273229

32283230

32293231
#ifndef NRFX_SPIM0_ENABLED
3230-
#define NRFX_SPIM0_ENABLED 0
3232+
#define NRFX_SPIM0_ENABLED 1
32313233
#endif
32323234

32333235
// <q> NRFX_SPIM1_ENABLED - Enable SPIM1 instance
32343236

32353237

32363238
#ifndef NRFX_SPIM1_ENABLED
3237-
#define NRFX_SPIM1_ENABLED 0
3239+
#define NRFX_SPIM1_ENABLED 1
32383240
#endif
32393241

32403242
// <q> NRFX_SPIM2_ENABLED - Enable SPIM2 instance
32413243

32423244

32433245
#ifndef NRFX_SPIM2_ENABLED
3244-
#define NRFX_SPIM2_ENABLED 0
3246+
#define NRFX_SPIM2_ENABLED 1
32453247
#endif
32463248

32473249
// <q> NRFX_SPIM3_ENABLED - Enable SPIM3 instance
32483250

32493251

32503252
#ifndef NRFX_SPIM3_ENABLED
3251-
#define NRFX_SPIM3_ENABLED 0
3253+
#define NRFX_SPIM3_ENABLED 1
32523254
#endif
32533255

32543256
// <q> NRFX_SPIM_EXTENDED_ENABLED - Enable extended SPIM features
@@ -3448,27 +3450,27 @@
34483450
//==========================================================
34493451

34503452
#ifndef NRFX_SPI_ENABLED
3451-
#define NRFX_SPI_ENABLED 1
3453+
#define NRFX_SPI_ENABLED 0
34523454
#endif
34533455
// <q> NRFX_SPI0_ENABLED - Enable SPI0 instance
34543456

34553457

34563458
#ifndef NRFX_SPI0_ENABLED
3457-
#define NRFX_SPI0_ENABLED 1
3459+
#define NRFX_SPI0_ENABLED 0
34583460
#endif
34593461

34603462
// <q> NRFX_SPI1_ENABLED - Enable SPI1 instance
34613463

34623464

34633465
#ifndef NRFX_SPI1_ENABLED
3464-
#define NRFX_SPI1_ENABLED 1
3466+
#define NRFX_SPI1_ENABLED 0
34653467
#endif
34663468

34673469
// <q> NRFX_SPI2_ENABLED - Enable SPI2 instance
34683470

34693471

34703472
#ifndef NRFX_SPI2_ENABLED
3471-
#define NRFX_SPI2_ENABLED 1
3473+
#define NRFX_SPI2_ENABLED 0
34723474
#endif
34733475

34743476
// <o> NRFX_SPI_MISO_PULL_CFG - MISO pin pull configuration.

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/objects.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
#include "PortNames.h"
4444
#include "PeripheralNames.h"
4545
#include "PinNames.h"
46-
#include "nrfx_spi.h"
46+
#if NRFX_SPIM_ENABLED
47+
#include "nrfx_spim.h"
48+
#elif NRFX_SPI_ENABLED
49+
#include "nrfx_spim.h"
50+
#endif
4751
#include "nrf_twi.h"
4852

4953
#include "nrf_pwm.h"
@@ -90,7 +94,11 @@ struct serial_s {
9094
struct spi_s {
9195
int instance;
9296
PinName cs;
97+
#if NRFX_SPIM_ENABLED
98+
nrfx_spim_config_t config;
99+
#elif NRFX_SPI_ENABLED
93100
nrfx_spi_config_t config;
101+
#endif
94102
bool update;
95103

96104
#if DEVICE_SPI_ASYNCH

0 commit comments

Comments
 (0)