Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit afde642

Browse files
auroraslbwopu-ot
authored andcommitted
Add nrf_rng_shorts_disable
Signed-off-by: Sletnes Bjørlo, Aurora <[email protected]>
1 parent e8973f3 commit afde642

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/nrfx/hal/nrf_rng.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ NRF_STATIC_INLINE void nrf_rng_event_clear(NRF_RNG_Type * p_reg, nrf_rng_event_t
137137
*/
138138
NRF_STATIC_INLINE bool nrf_rng_event_check(NRF_RNG_Type const * p_reg, nrf_rng_event_t rng_event);
139139

140+
/**
141+
* @brief Function for clearing shortcuts.
142+
*
143+
* @param[in] p_reg Pointer to the structure of registers of the peripheral.
144+
* @param[in] mask Mask of shortcuts.
145+
*/
146+
NRF_STATIC_INLINE void nrf_rng_shorts_disable(NRF_RNG_Type * p_reg, uint32_t mask);
147+
140148
/**
141149
* @brief Function for getting the previously generated random value.
142150
*
@@ -179,6 +187,11 @@ NRF_STATIC_INLINE bool nrf_rng_event_check(NRF_RNG_Type const * p_reg, nrf_rng_e
179187
return (bool) * ((volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)rng_event));
180188
}
181189

190+
NRF_STATIC_INLINE void nrf_rng_shorts_disable(NRF_RNG_Type * p_reg, uint32_t mask)
191+
{
192+
p_reg->SHORTS &= ~mask;
193+
}
194+
182195
NRF_STATIC_INLINE uint8_t nrf_rng_random_value_get(NRF_RNG_Type const * p_reg)
183196
{
184197
return (uint8_t)(p_reg->VALUE & RNG_VALUE_VALUE_Msk);

0 commit comments

Comments
 (0)