Add getclksfreq(), wfe(), wfi(), rnd.setup() and rnd.read() functions.

wfe() and wfi() just call the underlying ARM functions.

getclksfreq() returns a table containing these clock frequencies: SYSCLK,
HCLK, PCLK1 and PCLK2.

rnd.setup() initialises the random number generator. rnd.read() will call
this anyway if the RNG hasn't been initialised before you read from it. If
rng.read() ever returns nil to signify a problem, you can call rnd.setup()
to re-initialise the RNG.

rnd.read() returns a 32 bit random number or nil if the generator signals
an error.
Change stm32f4.cpu.rng.read() to return a number rather than an integer.

This ensures the result is always positive when numbers are not 32 integers.
Merge branch 'master' into mb-stm32f4-cpu-additions
Add functions to read STM32F4 MCU id and unique device id.

stm32f4.cpu.read_mcu_device_id() returns a number containing the 32 bit id.

stm32f4.cpu.read_unique_device_id() returns an array of 3 numbers. The first
number contains bits 0-31, the second number contains bits 32-63 and the
last number contains bits 64-95 of the unique device id.
Ported to STM32F401 Nucleo board.

The Nucleo boards are like the Discovery boards in that they come with an
attached STLINK-V2 programmer. The MCU's UART2 is routed through the
programmer's USB connection and it appears as a VCP device on the host.

So far, this has only been tested to the extent that the elua shell and
lua prompt appear to be functioning as expected.
Merge pull request #44 from smartavionics/stm32f4-nucleo

Ported to STM32F401 Nucleo board.
DOC - CAN - fix typo
eLua - comments - include return from functions in can, i2c
elua i2c module - fix comment
platform.h - note unused constants
PLATFORM_SPI_TOTAL, PLATFORM_UART_TOTAL, PLATFORM_PWM_TOTAL

TODO: Figure out purpose, or remove them
LM3S - startup_gcc.c - human readable error messages for default ISRs
also, use ROM versions of UARTCharPut, if available
LM3S - startup_gcc - use console UART, rather than assuming UART0
LM3S - platform_int - use platform_pio_get_num_pins rather than assuming 8 pins per port
LM3S - platform.c - MAP_ - Use ROM versions of library if available
LM3S - platform.c - remove duplicate include
Reduce the flash latency to 2WS as that is sufficient for the 84MHz clock.
Can't use HSE clock on the Nucleo board as it's not populated.

The board as supplied does not provide any external clock to the F4.
It could supply an 8MHz clock from the STLINK part but, by default, it
isn't configured to do that.

So just use the HSI instead of the HSE - it won't be good for USB or fast
CAN bit rates but should be fine for bit banging, etc.
Now determines the required flash latency from the system clock frequency.

This assumes that the MCU supply voltage is at least 2.7V.
Rework configuration of STM32F4 HSI clock.

Now, to use the HSI clock, specify an internal clock frequency in the
"clocks" config section, like this...

clocks = { internal = 16000000, cpu = 84000000 }

Don't specify an external frequency as well as the internal frequency.
Merge pull request #41 from smartavionics/mb-stm32f4-cpu-additions

Add getclksfreq(), wfe(), wfi(), rnd.setup() and rnd.read() functions.