Skip to content

Commit

Permalink
Merge pull request #434 from adafruit/develop
Browse files Browse the repository at this point in the history
clean up for release 0.18.0
  • Loading branch information
hathach authored Feb 3, 2020
2 parents 94f659d + ef2451c commit fd02ea2
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 95 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Adafruit nRF52 Arduino Core Changelog

## 0.18.0 - 2020.02.03

- Add EXTERNAL_FLASH_USE_QSPI to all variants that has on-board flash

## 0.17.0 - 2020.02.01

### Core
Expand Down
2 changes: 1 addition & 1 deletion libraries/Bluefruit52Lib/library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit Bluefruit nRF52 Libraries
version=0.17.0
version=0.18.0
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules
Expand Down
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

name=Adafruit nRF52 Boards
version=0.17.0
version=0.18.0

# Compile variables
# -----------------
Expand Down
3 changes: 0 additions & 3 deletions variants/circuitplayground_nrf52840/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

/*
* PDM Interfaces
*/
Expand Down
3 changes: 0 additions & 3 deletions variants/clue_nrf52840/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ static const uint8_t SCK1 = PIN_SPI1_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions variants/feather_nrf52840_express/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions variants/feather_nrf52840_sense/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions variants/itsybitsy_nrf52840_express/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 0 additions & 4 deletions variants/metro_nrf52840_express/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)


#ifdef __cplusplus
}
#endif
Expand Down
63 changes: 4 additions & 59 deletions variants/particle_xenon/variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ const uint32_t g_ADigitalPinMap[] =
18, // P0.18 (RESET)
};

void initVariant()
{
switch_antenna(false);
}

void switch_antenna(bool useExternal) {
static void switch_antenna(bool useExternal) {
if (useExternal) {
digitalWrite(ANTENNA_SWITCH_1, LOW);
digitalWrite(ANTENNA_SWITCH_2, HIGH);
Expand All @@ -69,57 +64,7 @@ void switch_antenna(bool useExternal) {
}
}

void led_pwm_init(uint32_t led_index, uint32_t led_pin) {
NRF_PWM_Type* pwm = NRF_PWM0;

pwm->ENABLE = 0;

nrf_gpio_cfg_output(led_pin);
nrf_gpio_pin_write(led_pin, 1 - LED_STATE_ON);

pwm->PSEL.OUT[led_index] = led_pin;

pwm->MODE = PWM_MODE_UPDOWN_Up;
pwm->COUNTERTOP = 0xff;
pwm->PRESCALER = PWM_PRESCALER_PRESCALER_DIV_16;
pwm->DECODER = PWM_DECODER_LOAD_Individual;
pwm->LOOP = 0;

pwm->SEQ[0].PTR = (uint32_t) (led_duty_cycles);
pwm->SEQ[0].CNT = 4; // default mode is Individual --> count must be 4
pwm->SEQ[0].REFRESH = 0;
pwm->SEQ[0].ENDDELAY = 0;

pwm->ENABLE = 1;

pwm->EVENTS_SEQEND[0] = 0;
// pwm->TASKS_SEQSTART[0] = 1;
}

void led_pwm_teardown(void) {
pwm_teardown(NRF_PWM0);
}

void led_pwm_duty_cycle(uint32_t led_index, uint16_t duty_cycle) {
led_duty_cycles[led_index] = duty_cycle;
nrf_pwm_event_clear(NRF_PWM0, NRF_PWM_EVENT_SEQEND0);
nrf_pwm_task_trigger(NRF_PWM0, NRF_PWM_TASK_SEQSTART0);
void initVariant()
{
switch_antenna(false);
}

void pwm_teardown(NRF_PWM_Type* pwm) {
pwm->TASKS_SEQSTART[0] = 0;
pwm->ENABLE = 0;

pwm->PSEL.OUT[0] = 0xFFFFFFFF;
pwm->PSEL.OUT[1] = 0xFFFFFFFF;
pwm->PSEL.OUT[2] = 0xFFFFFFFF;
pwm->PSEL.OUT[3] = 0xFFFFFFFF;

pwm->MODE = 0;
pwm->COUNTERTOP = 0x3FF;
pwm->PRESCALER = 0;
pwm->DECODER = 0;
pwm->LOOP = 0;
pwm->SEQ[0].PTR = 0;
pwm->SEQ[0].CNT = 0;
}
12 changes: 0 additions & 12 deletions variants/particle_xenon/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,6 @@ static const uint8_t SCK1 = PIN_SPI1_SCK;
#define EXTERNAL_FLASH_DEVICES GD25Q16C
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((2*1024*1024) / USB_MSC_BLOCK_SIZE)

void switch_antenna(bool useExternal);

// led pwm
void led_pwm_init(uint32_t led_index, uint32_t led_pin);
void led_pwm_teardown(void);
void led_pwm_duty_cycle(uint32_t led_index, uint16_t duty_cycle);
void pwm_teardown(NRF_PWM_Type* pwm);
static uint16_t led_duty_cycles[PWM0_CH_NUM] = { 0 };

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions variants/pca10056/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
#define EXTERNAL_FLASH_DEVICES MX25R6435F
#define EXTERNAL_FLASH_USE_QSPI

#define USB_MSC_BLOCK_SIZE 512
#define USB_MSC_BLOCK_COUNT ((8*1024*1024) / USB_MSC_BLOCK_SIZE)

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit fd02ea2

Please sign in to comment.