drivers: Add support for nRF52833 in several drivers
By adding new SoC to Zephyr drivers has to be updated. Commit affects: - USB driver - support for nRF52833 added. - support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added. - SPI - IEEE 802.15.4 - CLOCK CONTROL Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This commit is contained in:
parent
82c6d7c415
commit
6c82c80a3c
7 changed files with 17 additions and 15 deletions
|
@ -215,7 +215,7 @@ static int hfclk_init(struct device *dev)
|
||||||
nrf_clock_int_enable(NRF_CLOCK,
|
nrf_clock_int_enable(NRF_CLOCK,
|
||||||
(NRF_CLOCK_INT_HF_STARTED_MASK |
|
(NRF_CLOCK_INT_HF_STARTED_MASK |
|
||||||
NRF_CLOCK_INT_LF_STARTED_MASK |
|
NRF_CLOCK_INT_LF_STARTED_MASK |
|
||||||
COND_CODE_1(CONFIG_USB_NRF52840,
|
COND_CODE_1(CONFIG_USB_NRFX,
|
||||||
(NRF_POWER_INT_USBDETECTED_MASK |
|
(NRF_POWER_INT_USBDETECTED_MASK |
|
||||||
NRF_POWER_INT_USBREMOVED_MASK |
|
NRF_POWER_INT_USBREMOVED_MASK |
|
||||||
NRF_POWER_INT_USBPWRRDY_MASK),
|
NRF_POWER_INT_USBPWRRDY_MASK),
|
||||||
|
@ -289,7 +289,7 @@ static void clkstarted_handle(struct device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_USB_NRF52840)
|
#if defined(CONFIG_USB_NRFX)
|
||||||
static bool power_event_check_and_clean(nrf_power_event_t evt, u32_t intmask)
|
static bool power_event_check_and_clean(nrf_power_event_t evt, u32_t intmask)
|
||||||
{
|
{
|
||||||
bool ret = nrf_power_event_check(NRF_POWER, evt) &&
|
bool ret = nrf_power_event_check(NRF_POWER, evt) &&
|
||||||
|
@ -305,7 +305,7 @@ static bool power_event_check_and_clean(nrf_power_event_t evt, u32_t intmask)
|
||||||
|
|
||||||
static void usb_power_isr(void)
|
static void usb_power_isr(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_USB_NRF52840)
|
#if defined(CONFIG_USB_NRFX)
|
||||||
extern void usb_dc_nrfx_power_event_callback(nrf_power_event_t event);
|
extern void usb_dc_nrfx_power_event_callback(nrf_power_event_t event);
|
||||||
|
|
||||||
if (power_event_check_and_clean(NRF_POWER_EVENT_USBDETECTED,
|
if (power_event_check_and_clean(NRF_POWER_EVENT_USBDETECTED,
|
||||||
|
@ -360,9 +360,9 @@ void nrf_power_clock_isr(void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_USB_NRFX
|
||||||
void nrf5_power_usb_power_int_enable(bool enable)
|
void nrf5_power_usb_power_int_enable(bool enable)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_USB_NRF52840
|
|
||||||
u32_t mask;
|
u32_t mask;
|
||||||
|
|
||||||
mask = NRF_POWER_INT_USBDETECTED_MASK |
|
mask = NRF_POWER_INT_USBDETECTED_MASK |
|
||||||
|
@ -375,5 +375,5 @@ void nrf5_power_usb_power_int_enable(bool enable)
|
||||||
} else {
|
} else {
|
||||||
nrf_power_int_disable(NRF_POWER, mask);
|
nrf_power_int_disable(NRF_POWER, mask);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -222,7 +222,7 @@ endif # SPI_3_NRF_SPIM || SPI_3_NRF_SPIS
|
||||||
|
|
||||||
config SPI_3_NRF_RX_DELAY
|
config SPI_3_NRF_RX_DELAY
|
||||||
int "SPIM3 MISO sampling delay"
|
int "SPIM3 MISO sampling delay"
|
||||||
depends on SPI_3_NRF_SPIM && SOC_NRF52840
|
depends on SPI_3_NRF_SPIM && (SOC_NRF52833 || SOC_NRF52840)
|
||||||
range 0 7
|
range 0 7
|
||||||
default 2
|
default 2
|
||||||
help
|
help
|
||||||
|
|
|
@ -59,7 +59,7 @@ static inline nrf_spim_frequency_t get_nrf_spim_frequency(u32_t frequency)
|
||||||
return NRF_SPIM_FREQ_2M;
|
return NRF_SPIM_FREQ_2M;
|
||||||
} else if (frequency < 8000000) {
|
} else if (frequency < 8000000) {
|
||||||
return NRF_SPIM_FREQ_4M;
|
return NRF_SPIM_FREQ_4M;
|
||||||
#ifdef CONFIG_SOC_NRF52840
|
#if defined(CONFIG_SOC_NRF52833) || defined(CONFIG_SOC_NRF52840)
|
||||||
} else if (frequency < 16000000) {
|
} else if (frequency < 16000000) {
|
||||||
return NRF_SPIM_FREQ_8M;
|
return NRF_SPIM_FREQ_8M;
|
||||||
} else if (frequency < 32000000) {
|
} else if (frequency < 32000000) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ zephyr_sources_ifdef(CONFIG_USB_DW usb_dc_dw.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_DC_STM32 usb_dc_stm32.c)
|
zephyr_sources_ifdef(CONFIG_USB_DC_STM32 usb_dc_stm32.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_DC_SAM0 usb_dc_sam0.c)
|
zephyr_sources_ifdef(CONFIG_USB_DC_SAM0 usb_dc_sam0.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_DC_SAM usb_dc_sam.c)
|
zephyr_sources_ifdef(CONFIG_USB_DC_SAM usb_dc_sam.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_NRF52840 usb_dc_nrfx.c)
|
zephyr_sources_ifdef(CONFIG_USB_NRFX usb_dc_nrfx.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_KINETIS usb_dc_kinetis.c)
|
zephyr_sources_ifdef(CONFIG_USB_KINETIS usb_dc_kinetis.c)
|
||||||
zephyr_sources_ifdef(CONFIG_USB_NATIVE_POSIX
|
zephyr_sources_ifdef(CONFIG_USB_NATIVE_POSIX
|
||||||
usb_dc_native_posix.c
|
usb_dc_native_posix.c
|
||||||
|
|
|
@ -52,21 +52,21 @@ config USB_DC_SAM
|
||||||
help
|
help
|
||||||
SAM family USB HS device controller Driver.
|
SAM family USB HS device controller Driver.
|
||||||
|
|
||||||
menuconfig USB_NRF52840
|
menuconfig USB_NRFX
|
||||||
bool "Nordic Semiconductor nRF52840 USB Device Controller Driver"
|
bool "Nordic Semiconductor USB Device Controller Driver"
|
||||||
default y
|
default y
|
||||||
depends on SOC_NRF52840
|
depends on HAS_HW_NRF_USBD
|
||||||
select USB_DEVICE_DRIVER
|
select USB_DEVICE_DRIVER
|
||||||
select NRFX_USBD
|
select NRFX_USBD
|
||||||
select USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
|
select USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
|
||||||
help
|
help
|
||||||
nRF52840 USB Device Controller Driver
|
nRF USB Device Controller Driver
|
||||||
|
|
||||||
config USB_NRFX_EVT_QUEUE_SIZE
|
config USB_NRFX_EVT_QUEUE_SIZE
|
||||||
int "USBD event queue size"
|
int "USBD event queue size"
|
||||||
range 4 64
|
range 4 64
|
||||||
default 32
|
default 32
|
||||||
depends on USB_NRF52840
|
depends on USB_NRFX
|
||||||
help
|
help
|
||||||
Size of the driver's internal event queue.
|
Size of the driver's internal event queue.
|
||||||
Required size will depend on number of endpoints (class instances) in use.
|
Required size will depend on number of endpoints (class instances) in use.
|
||||||
|
@ -74,7 +74,7 @@ config USB_NRFX_EVT_QUEUE_SIZE
|
||||||
config USB_NRFX_WORK_QUEUE_STACK_SIZE
|
config USB_NRFX_WORK_QUEUE_STACK_SIZE
|
||||||
int "USBD work queue stack size"
|
int "USBD work queue stack size"
|
||||||
default 1024
|
default 1024
|
||||||
depends on USB_NRF52840
|
depends on USB_NRFX
|
||||||
help
|
help
|
||||||
Size of the stack for the work queue thread that is used in the driver
|
Size of the stack for the work queue thread that is used in the driver
|
||||||
for handling the events from the USBD ISR, i.e. executing endpoint
|
for handling the events from the USBD ISR, i.e. executing endpoint
|
||||||
|
|
|
@ -55,7 +55,9 @@
|
||||||
#define CLOCK_CONTROL_NRF_K32SRC_ACCURACY 7
|
#define CLOCK_CONTROL_NRF_K32SRC_ACCURACY 7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_USB_NRFX)
|
||||||
void nrf5_power_usb_power_int_enable(bool enable);
|
void nrf5_power_usb_power_int_enable(bool enable);
|
||||||
|
#endif
|
||||||
|
|
||||||
/** @brief Force LF clock calibration. */
|
/** @brief Force LF clock calibration. */
|
||||||
void z_nrf_clock_calibration_force_start(void);
|
void z_nrf_clock_calibration_force_start(void);
|
||||||
|
|
|
@ -5,6 +5,6 @@ config USB_DEVICE_PID
|
||||||
default USB_PID_HID_MOUSE_SAMPLE
|
default USB_PID_HID_MOUSE_SAMPLE
|
||||||
|
|
||||||
config USB_DEVICE_REMOTE_WAKEUP
|
config USB_DEVICE_REMOTE_WAKEUP
|
||||||
default SOC_NRF52840
|
default y if (SOC_NRF52833 || SOC_NRF52840)
|
||||||
|
|
||||||
source "Kconfig.zephyr"
|
source "Kconfig.zephyr"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue