USER MANUAL RC188x-GPR
2019 Radiocrafts AS
RIIM User Manual (rev.1.2)
Page
21
of
23
8.13. UART
The UART module controls the UART port. The uart can be configured with respect to baudrate, parity, number of
databits and number of stopbits.
Example TBD:
Example : ICI code
static
void
TxCallback
(
uint8_t
len
)
{
Util
.
printf
(
"Sent %i bytes\n"
,
len
);
return
;
}
static
void
DemoFunc
()
{
const
uint8_t
buffer
=
"Test"
;
UART
.
init
(
115200
,
UART_PARITY_NONE
,
UART_DATA_8_BITS
,
UART_STOP_1_BIT
);
UART
.
startTransmit
(
buffer
,
sizeof
(
buffer
),
TXCallback
);
return
;
}
Example 13 - UART example code
Function
Description
Init
(Baudrate, Parity,
DataBits,StopBits)
Initialize the UART module. Baudrate, Parity, Databits and Stopbits
must be specified
startReceive
(UARTReceiveCallback)
Start reception and call a function when
cancelReceive
()
Stop reception
startTransmit
(Buffer, Length,
UARTTransmitCallback)
Start transmission of a buffer of bytes
cancelTransmit
()
Stop transmission, even if it not finished
Table 13 - UART functions
8.14. UTIL
The UTIL module contains useful helper functions. The module provides common C library functions for the user
application to use: printf, sprintf, snprinf. It also provides a random generator.
The following example shows how to print something on the console (UART)
Example : ICI code
static
void
DemoFunc
()
{
Util
.
printf
(
"Reading sensors....\n"
);
return
;
}
Example 14 - UTIL example code
Function
Description
printf
(const char *format,...)
Standard C-library printf