Skip to content

Add nrf52805 support #1461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MyConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@
* - NRF5_BLE_1MBPS for 1Mbps BLE modulation
*/
#ifndef MY_NRF5_ESB_MODE
#ifdef NRF5_250KBPS
#define MY_NRF5_ESB_MODE (NRF5_250KBPS)
#else
#define MY_NRF5_ESB_MODE (NRF5_1MBPS)
#endif
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion hal/architecture/NRF5/MyHwNRF5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool hwInit(void)
NRF_POWER->TASKS_CONSTLAT = 1;

// Enable cache on >= NRF52
#ifndef NRF51
#if !defined(NRF51) && !defined(NRF52805_XXAA)
NRF_NVMC->ICACHECNF = NVMC_ICACHECNF_CACHEEN_Msk;
#endif

Expand Down
2 changes: 2 additions & 0 deletions hal/transport/NRF5_ESB/driver/Radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ typedef enum {
typedef enum {
NRF5_1MBPS = RADIO_MODE_MODE_Nrf_1Mbit,
NRF5_2MBPS = RADIO_MODE_MODE_Nrf_2Mbit,
#ifdef RADIO_MODE_MODE_Nrf_250Kbit
NRF5_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, // Deprecated!!!
#endif
NRF5_BLE_1MBPS = RADIO_MODE_MODE_Ble_1Mbit,
} nrf5_mode_e;

Expand Down
5 changes: 4 additions & 1 deletion hal/transport/NRF5_ESB/driver/Radio_ESB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,12 @@ static inline uint8_t NRF5_ESB_byte_time()
return (3);
} else if (MY_NRF5_ESB_MODE == NRF5_2MBPS) {
return (2);
} else if (MY_NRF5_ESB_MODE == NRF5_250KBPS) {
}
#ifdef NRF5_250KBPS
else if (MY_NRF5_ESB_MODE == NRF5_250KBPS) {
return (5);
}
#endif
}

extern "C" {
Expand Down
12 changes: 8 additions & 4 deletions hal/transport/NRF5_ESB/driver/Radio_ESB.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,19 @@
RADIO_SHORTS_READY_START_Msk | RADIO_SHORTS_ADDRESS_BCSTART_Msk | \
RADIO_SHORTS_ADDRESS_RSSISTART_Msk | RADIO_SHORTS_DISABLED_RSSISTOP_Msk)

// PPI Channels for TX
/** PPI Channels for TX
* Not all NRF5 modules have the same number of PPI channels
* For regular PPI, select the highest possible channels
*/
#define NRF5_ESB_PPI_LAST_CHANNEL (PPI_CH_NUM - 1)
#if (NRF5_RADIO_TIMER_IRQN != TIMER0_IRQn)
// Use two regular PPI channels
#define NRF5_ESB_PPI_TIMER_START 14
#define NRF5_ESB_PPI_TIMER_RADIO_DISABLE 15
#define NRF5_ESB_PPI_TIMER_START (NRF5_ESB_PPI_LAST_CHANNEL - 1)
#define NRF5_ESB_PPI_TIMER_RADIO_DISABLE (NRF5_ESB_PPI_LAST_CHANNEL)
#else
// Use one regular PPI channel and one predefined PPI channel
#define NRF5_ESB_USE_PREDEFINED_PPI
#define NRF5_ESB_PPI_TIMER_START 15
#define NRF5_ESB_PPI_TIMER_START (NRF5_ESB_PPI_LAST_CHANNEL)
#define NRF5_ESB_PPI_TIMER_RADIO_DISABLE 22
#endif
#define NRF5_ESB_PPI_BITS \
Expand Down