RIOTOUS handles 95% of the work needed to get an IoT product working with the ESP8266 module. But since every device is unique, a few RIOTOUS functions have to be defined by the user. The following functions need to be defined by the user which are found in RIOTOUS_IO.c unless you download a specific flavour of RIOTOUS that matches your device (such as RIOTOUS PIC16F1516) in which case, RIOTOUS_IO.c has already been defined and you can dive straight into programming an IoT device!

void interrupt isr(void)

RIOTOUS is as interrupt driven as it can possibly be to ensure that there are no infinite loops and/or stalls. When a byte is received over UART, the interrupt service routine must send RIOTOUS framework the received byte by passing the byte to the function riotous_receiveByte(unsigned char byte). For example, the PIC16 would use riotous_receiveByte(RCREG). The interrupt service routine must also handle overflows and framing errors should they occur (PIC devices have a horrible habit of locking up the UART when one of these errors occur).

void riotous_configUART(void)

This function configures the UART module to do the following:

void riotous_delay(void)

This delay is imperative for proper ESP8266 communication and should delay for 100ms. This must not disable interrupts and must never be allowed to stall (i.e. use a simple while loop with a decrementing counter if possible).

void riotous_sendByteUART(unsigned char data)

This function needs to send a byte to the UART module for transmission, start the transmission, and wait until the byte has been sent.

void riotous_turnInterruptsOff(void)

This function needs to disable any interrupts from firing (i.e. disable global interrupts). This is crucial for RIOTOUS to function properly as C does not do well with atomic instructions. Turning interrupts off for short periods of time guarantees the framework that data buffers and variables are not being altered by external code.

void riotous_turnInterruptsOn(void)

This function needs to enabled interrupts globally. When RIOTOUS access vital variables, interrupts are disabled and once these sensitive operations have been completed, interrupts are re-enabled with this function.