The latest development version of this page may be more current than this released 1.14.1 version.

Entropy

Overview

API Reference

group entropy_interface

Entropy Interface.

Defines

ENTROPY_BUSYWAIT

Typedefs

typedef entropy_get_entropy_t

Callback API to get entropy.

See entropy_get_entropy() for argument description

typedef entropy_get_entropy_isr_t

Callback API to get entropy from an ISR.

See entropy_get_entropy_isr() for argument description

Functions

int entropy_get_entropy(struct device *dev, u8_t *buffer, u16_t length)

Fills a buffer with entropy. Blocks if required in order to generate the necessary random data.

Parameters
  • dev: Pointer to the entropy device.
  • buffer: Buffer to fill with entropy.
  • length: Buffer length.
Return Value
  • 0: on success.
  • -ERRNO: errno code on error.

static int z_impl_entropy_get_entropy(struct device *dev, u8_t *buffer, u16_t length)
static int entropy_get_entropy_isr(struct device *dev, u8_t *buffer, u16_t length, u32_t flags)

Fills a buffer with entropy in a non-blocking or busy-wait manner. Callable from ISRs.

Parameters
  • dev: Pointer to the device structure.
  • buffer: Buffer to fill with entropy.
  • length: Buffer length.
  • flags: Flags to modify the behavior of the call.
Return Value
  • number: of bytes filled with entropy or -error.