drivers: entropy: Small documentation tweaks

Document driver API and moved around a flag.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2023-09-28 14:28:59 -07:00 committed by Carles Cufí
parent 52c55177ba
commit 09950b6d0b
1 changed files with 9 additions and 3 deletions

View File

@ -29,6 +29,9 @@
extern "C" {
#endif
/** @brief Driver is allowed to busy-wait for random data to be ready */
#define ENTROPY_BUSYWAIT BIT(0)
/**
* @typedef entropy_get_entropy_t
* @brief Callback API to get entropy.
@ -51,6 +54,12 @@ typedef int (*entropy_get_entropy_isr_t)(const struct device *dev,
uint8_t *buffer,
uint16_t length,
uint32_t flags);
/**
* @brief Entropy driver API structure.
*
* This is the mandatory API any Entropy driver needs to expose.
*/
__subsystem struct entropy_driver_api {
entropy_get_entropy_t get_entropy;
entropy_get_entropy_isr_t get_entropy_isr;
@ -82,9 +91,6 @@ static inline int z_impl_entropy_get_entropy(const struct device *dev,
return api->get_entropy(dev, buffer, length);
}
/* Busy-wait for random data to be ready */
#define ENTROPY_BUSYWAIT BIT(0)
/**
* @brief Fills a buffer with entropy in a non-blocking or busy-wait manner.
* Callable from ISRs.