Skip to content

Commit

Permalink
Fixed unavailable GPIOs issue
Browse files Browse the repository at this point in the history
- GPIO0 and GPIO1 on the DWM1001 are attached to the DW1000 not the
nRF52
- Removed 2 digital pins
- Shifted all the numbering
  • Loading branch information
Beetix committed Nov 7, 2018
1 parent 3edc8ae commit 283bf08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
4 changes: 1 addition & 3 deletions variants/DWM1001-DEV/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include "variant.h"

const uint32_t g_ADigitalPinMap[] = {
// D0 - D10
1,
0,
// D0 - D8
12,
27,
23,
Expand Down
44 changes: 22 additions & 22 deletions variants/DWM1001-DEV/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ extern "C"
#endif // __cplusplus

// Number of pins defined in PinDescription array
#define PINS_COUNT (29u)
#define NUM_DIGITAL_PINS (13u)
#define PINS_COUNT (27u)
#define NUM_DIGITAL_PINS (11u)
#define NUM_ANALOG_INPUTS (2u)
#define NUM_ANALOG_OUTPUTS (0u)

// LEDs
#define PIN_LEDRT (24)
#define PIN_LEDRB (25)
#define PIN_LEDG (26)
#define PIN_LEDB (27)
#define PIN_LEDRT (22)
#define PIN_LEDRB (23)
#define PIN_LEDG (24)
#define PIN_LEDB (25)
#define LED_BUILTIN PIN_LEDRT
static const uint8_t LED_RED_TOP = PIN_LEDRT ;
static const uint8_t LED_RED_BOT = PIN_LEDRB ;
static const uint8_t LED_GREEN = PIN_LEDG ;
static const uint8_t LED_BLUE = PIN_LEDB ;

// Button
#define PIN_BUTTON (28)
#define PIN_BUTTON (26)

static const uint8_t BTN = PIN_BUTTON ;

/*
* Analog pins
*/
#define PIN_A0 (11)
#define PIN_A1 (15)
#define PIN_A0 (9)
#define PIN_A1 (10)

static const uint8_t A0 = PIN_A0 ; // AIN2
static const uint8_t A1 = PIN_A1 ; // AIN1
Expand All @@ -67,27 +67,27 @@ static const uint8_t A1 = PIN_A1 ; // AIN1
* Serial interfaces
*/
// Serial
#define PIN_SERIAL_RX (15)
#define PIN_SERIAL_TX (16)
#define PIN_SERIAL_RX (13)
#define PIN_SERIAL_TX (14)

/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 2

#define PIN_SPI_MISO (10)
#define PIN_SPI_MOSI (9)
#define PIN_SPI_MISO (8)
#define PIN_SPI_MOSI (7)
#define PIN_SPI_SCK (PIN_A0)

static const uint8_t SS = PIN_A1 ;
static const uint8_t MOSI = PIN_SPI_MOSI ;
static const uint8_t MISO = PIN_SPI_MISO ;
static const uint8_t SCK = PIN_SPI_SCK ;

#define PIN_SPI1_SS (17)
#define PIN_SPI1_MISO (18)
#define PIN_SPI1_MOSI (19)
#define PIN_SPI1_SCK (20)
#define PIN_SPI1_SS (15)
#define PIN_SPI1_MISO (16)
#define PIN_SPI1_MOSI (17)
#define PIN_SPI1_SCK (18)

static const uint8_t SS1 = PIN_SPI1_SS ;
static const uint8_t MOSI1 = PIN_SPI1_MOSI ;
Expand All @@ -99,8 +99,8 @@ static const uint8_t SCK1 = PIN_SPI1_SCK ;
*/
#define WIRE_INTERFACES_COUNT 1

#define PIN_WIRE_SDA (13)
#define PIN_WIRE_SCL (14)
#define PIN_WIRE_SDA (11)
#define PIN_WIRE_SCL (12)

static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
Expand All @@ -113,13 +113,13 @@ static const uint8_t SCL = PIN_WIRE_SCL;
/*
* Other DWM1001 internal IOs
*/
#define PIN_DW_RST (21)
#define PIN_DW_IRQ (22)
#define PIN_DW_RST (19)
#define PIN_DW_IRQ (20)

static const uint8_t DW_RST = PIN_DW_RST;
static const uint8_t DW_IRQ = PIN_DW_IRQ;

#define PIN_ACC_IRQ (23)
#define PIN_ACC_IRQ (21)

static const uint8_t ACC_IRQ = PIN_ACC_IRQ;

Expand Down

0 comments on commit 283bf08

Please sign in to comment.