// Low quality random number generator

#include <stdlib.h>
#include "CM_LIB.h"
#include "CM_I2C.h"
#include "CM_I2C_L.h"
#include "hal_interface_api.h"

void cm_RandGen(uint8_t * pucRanddat)
{
	uint32_t random;
	random = stm32_generate_random32bit();
	pucRanddat[0] = (uint8_t) random;
	pucRanddat[1] = (uint8_t) random>>8;
	pucRanddat[2] = (uint8_t) random>>16;
	pucRanddat[3] = (uint8_t) random>>24;
	random = stm32_generate_random32bit();
	pucRanddat[4] = (uint8_t) random;
	pucRanddat[5] = (uint8_t) random>>8;
	pucRanddat[6] = (uint8_t) random>>16;
	pucRanddat[7] = (uint8_t) random>>24;
}
