Module stm32_hal2::rng

source ·
Expand description

Support for the Random Number Generator (RNG) peripheral. This provides a simple API for accessing hardware-generated 32-bit random numbers, where constructing a Rng peripheral enables its peripheral clock, and provides some methods. Once this struct is constructed, the freestanding functions read(), and reading_ready() may be used to get a random number number, and check if a new one is available.

Structs§

  • Represents a RNG peripheral.

Functions§

  • Gets a random value without needing to pass the Rng struct. Assumes it has been initialized, to enable it and its peripheral clock.
  • Return true if a reading is available.