/* Read multiple random data from TRNG. 
As soon as the TRNG is enabled, the module provides a new 32-bits random data for every 84 CLK_TRNG_APB clock cycles. */
enum status_code trng_read_buffer_job(struct trng_module *const module_inst, uint32_t *buffer, uint32_t number)
/* Read multiple random data from TRNG. 
As soon as the TRNG is enabled, the module provides a new 32-bits random data for every 84 CLK_TRNG_APB clock cycles. */
enum status_code trng_read_buffer_job(struct trng_module *const module_inst, uint32_t *buffer, uint32_t number)
{
	Assert(module_inst);
	Assert(number);
	Assert(buffer);
	if (module_inst->remaining_number != 0 ||
			module_inst->job_status == STATUS_BUSY) {
		return STATUS_BUSY;
	}
	module_inst->job_status = STATUS_BUSY;
	module_inst->remaining_number = number;
	module_inst->job_buffer = buffer;
	module_inst->hw->INTENSET.reg = TRNG_INTENSET_DATARDY;
	return STATUS_OK;
}