Commit 2010d4d5 authored by Tomasz Moń's avatar Tomasz Moń Committed by Carles Cufi
Browse files

nrfx_usbd: Copy nrfx usbd code to Zephyr



Copy nrfx_usbd code from zephyrproject-rtos/hal_nordic git revision
d054a315eb888ba70e09e5f6decd4097b0276d1f. This enables us to refactor
the code towards a native driver in a step by step manner where the
smallest changes that bring biggest performance improvements are done
early on.

The code is not a vanilla copy from zephyrproject-rtos/hal_nordic.
The code was reformated with clang-format to match project style.
Manual modifications were done to change comments formatting, place
constant comparisons on the right and add blank lines to pass Zephyr
compliance check.

Relicense to Apache 2.0.

No functional changes.

Signed-off-by: default avatarTomasz Moń <tomasz.mon@nordicsemi.no>
parent e1a56058
Loading
Loading
Loading
Loading
+2118 −0

File added.

Preview size limit exceeded, changes collapsed.

+828 −0

File added.

Preview size limit exceeded, changes collapsed.

+58 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016 - 2023, Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef NRFX_USBD_ERRATA_H__
#define NRFX_USBD_ERRATA_H__

#include <nrfx.h>
#include <nrf_erratas.h>

#ifndef NRFX_USBD_ERRATA_ENABLE
/**
 * @brief The constant that informs if errata should be enabled at all.
 *
 * If this constant is set to 0, all the Errata bug fixes will be automatically disabled.
 */
#define NRFX_USBD_ERRATA_ENABLE 1
#endif

/* Errata: ISO double buffering not functional. **/
static inline bool nrfx_usbd_errata_166(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_166();
}

/* Errata: USBD might not reach its active state. **/
static inline bool nrfx_usbd_errata_171(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_171();
}

/* Errata: USB cannot be enabled. **/
static inline bool nrfx_usbd_errata_187(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_187();
}

/* Errata: USBD cannot receive tasks during DMA. **/
static inline bool nrfx_usbd_errata_199(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_199();
}

/* Errata: Device remains in SUSPEND too long. */
static inline bool nrfx_usbd_errata_211(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_211();
}

/* Errata: Unexpected behavior after reset. **/
static inline bool nrfx_usbd_errata_223(void)
{
	return NRFX_USBD_ERRATA_ENABLE && nrf52_errata_223();
}

#endif /* NRFX_USBD_ERRATA_H__ */