Skip to content

Commit

Permalink
[WIP] hw/mcu: nrf common spi
Browse files Browse the repository at this point in the history
  • Loading branch information
m-gorecki committed Aug 8, 2024
1 parent f36cfea commit 6cf5648
Show file tree
Hide file tree
Showing 4 changed files with 373 additions and 575 deletions.
12 changes: 12 additions & 0 deletions hw/mcu/nordic/include/nrfx_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ extern "C" {

//------------------------------------------------------------------------------

/**
* @brief Macro for invalidating cache lines associated with the specified buffer.
*
* @note Macro should be empty if data cache is disabled or not present.
*
* @param[in] p_buffer Pointer to the buffer.
* @param[in] size Size of the buffer.
*/
#define NRFY_CACHE_INV(p_buffer, size) (void)p_buffer; (void)size;

//------------------------------------------------------------------------------

/** @brief Bitmask that defines DPPI channels that are reserved for use outside of the nrfx library. */
#define NRFX_DPPI_CHANNELS_USED 0

Expand Down
28 changes: 27 additions & 1 deletion hw/mcu/nordic/nrf5340/include/nrfx_config_nrf5340_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,13 @@
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIM_ENABLED
#if MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_1_MASTER) || \
MYNEWT_VAL(SPI_2_MASTER) || MYNEWT_VAL(SPI_3_MASTER) || MYNEWT_VAL(SPI_4_MASTER)
#define NRFX_SPIM_ENABLED 1
#else
#define NRFX_SPIM_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY
Expand Down Expand Up @@ -1151,7 +1156,7 @@
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIM0_ENABLED
#define NRFX_SPIM0_ENABLED 0
#define NRFX_SPIM0_ENABLED 1
#endif

/**
Expand Down Expand Up @@ -1196,8 +1201,13 @@
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIS_ENABLED
#if MYNEWT_VAL(SPI_0_SLAVE) || MYNEWT_VAL(SPI_1_SLAVE) || \
MYNEWT_VAL(SPI_2_SLAVE) || MYNEWT_VAL(SPI_3_SLAVE)
#define NRFX_SPIS_ENABLED 1
#else
#define NRFX_SPIS_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY
Expand Down Expand Up @@ -1238,35 +1248,51 @@
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIS0_ENABLED
#if MYNEWT_VAL(SPI_0_SLAVE)
#define NRFX_SPIS0_ENABLED 1
#else
#define NRFX_SPIS0_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SPIS1_ENABLED
*
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIS1_ENABLED
#if MYNEWT_VAL(SPI_1_SLAVE)
#define NRFX_SPIS1_ENABLED 1
#else
#define NRFX_SPIS1_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SPIS2_ENABLED
*
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIS2_ENABLED
#if MYNEWT_VAL(SPI_2_SLAVE)
#define NRFX_SPIS2_ENABLED 1
#else
#define NRFX_SPIS2_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SPIS3_ENABLED
*
* Boolean. Accepted values: 0 and 1.
*/
#ifndef NRFX_SPIS3_ENABLED
#if MYNEWT_VAL(SPI_3_SLAVE)
#define NRFX_SPIS3_ENABLED 1
#else
#define NRFX_SPIS3_ENABLED 0
#endif
#endif

/**
* @brief NRFX_SYSTICK_ENABLED
Expand Down
Loading

0 comments on commit 6cf5648

Please sign in to comment.