picoAPI  1.0.0
SerialCom

Typedefs

typedef enum picoUART_e picoUART_e
 

Enumerations

enum  picoUART_e { UART1 =1, UART2, UART3 }
 

Functions

void debugInit (void)
 
uint32_t debugSend (void *data, size_t len)
 
uint32_t debugRecv (void *data, size_t len)
 
void printString (char *string)
 
void printInteger (int32_t number)
 
void printHex (uint32_t number)
 
void picoUARTInit (picoUART_e u, picoPin_e txpin, picoPin_e rxpin, uint32_t baudrate)
 
uint32_t picoUARTSend (picoUART_e u, void *data, size_t len)
 
uint32_t picoUARTRecv (picoUART_e u, void *data, size_t len)
 

Detailed Description

UART communication

Typedef Documentation

typedef enum picoUART_e picoUART_e

Available UARTs

Enumeration Type Documentation

enum picoUART_e

Available UARTs

Enumerator
UART1 

UART1

UART2 

UART2

UART3 

UART3

Function Documentation

void debugInit ( void  )

initialize USART0 using ring buffers

uint32_t debugRecv ( void *  data,
size_t  len 
)

receive data from debug interface (USART0)

Parameters
databuffer to store data
lenbuffer size
Returns
number of bytes readed from rx buffer
uint32_t debugSend ( void *  data,
size_t  len 
)

send data through debug interface (USART0)

Parameters
datapointer to data
lendata length in bytes
Returns
number of bytes placed in tx buffer
void picoUARTInit ( picoUART_e  u,
picoPin_e  txpin,
picoPin_e  rxpin,
uint32_t  baudrate 
)

initialize UART

Parameters
upicoUART_e UART number (UART1, UART2 or UART3)
txpinTXD pin to use, see picoPin_e
rxpinRXD pin to use, see picoPin_e
baudrateinteger baudrate (i.e. 9600, 19200, 115200, etc.)

Here is the call graph for this function:

uint32_t picoUARTRecv ( picoUART_e  u,
void *  data,
size_t  len 
)

receive data from UART

Parameters
upicoUART_e UART number (UART1, UART2 or UART3)
databuffer to store data
lenbuffer size
Returns
number of bytes readed from rx buffer
uint32_t picoUARTSend ( picoUART_e  u,
void *  data,
size_t  len 
)

send data through UART

Parameters
upicoUART_e UART number (UART1, UART2 or UART3)
datapointer to data
lendata length in bytes
Returns
number of bytes placed in tx buffer
void printHex ( uint32_t  number)

convert integer to hexadecimal string and send through debug interface

Parameters
numberinteger to convert and send

Here is the call graph for this function:

void printInteger ( int32_t  number)

convert integer to decimal string and send through debug interface

Parameters
numberinteger to convert and send

Here is the call graph for this function:

void printString ( char *  string)

send a string through debug interface

Parameters
stringnull-terminated string to send

Here is the call graph for this function: