MLC interface driver
Utils for USB to SCI

Functions

void MLC_SCI_init (uint32_t baudrate)
 
void MLC_SCI_send_char (char c)
 
void MLC_SCI_send_str (char *str)
 
char MLC_SCI_recv_char (void)
 
char MLC_SCI_char_avail (void)
 
char MLC_SCI_wait_send (void)
 
void MLC_SCI_send_char_wait (char c)
 

Detailed Description

Function Documentation

char MLC_SCI_char_avail ( void  )

Check if char is available in RX buffer of SCI.

Returns
0 if not, >0 if char is in buffer and can be read. If FIFO is enabled it actually returns number of waiting bytes.

Definition at line 1657 of file MLC_drv.c.

void MLC_SCI_init ( uint32_t  baudrate)

It initializes GPIO and baudrate generator.

Parameters
baudraterequired baudrate, for example 115200
char MLC_SCI_recv_char ( void  )

Waits for one char to be received. Blocks until char is received.

Returns
received data byte/char

Definition at line 1694 of file MLC_drv.c.

void MLC_SCI_send_char ( char  c)

Send one char/byte via SCI -> USB -> PC. This is blocking function, if TX buffer is not empty, then it waits for TX buffer to be empty. If FIFO enabled, then it can feed upto 16 bytes to FIFO before it blocks another write to FIFO and waits until at least one level is empty.

Parameters
cchar to send

Definition at line 1722 of file MLC_drv.c.

Referenced by MLC_SCI_send_char_wait(), and MLC_SCI_send_str().

Here is the caller graph for this function:

void MLC_SCI_send_char_wait ( char  c)

Send one char and waits till it is sent.

Parameters
cchar to send

Definition at line 1747 of file MLC_drv.c.

References MLC_SCI_send_char().

Here is the call graph for this function:

void MLC_SCI_send_str ( char *  str)

Sends string via SCI -> USB- > PC. This function is blocking and returns after data is sent.

Parameters
strpointer to string to send

Definition at line 1764 of file MLC_drv.c.

References MLC_SCI_send_char().

Here is the call graph for this function:

char MLC_SCI_wait_send ( void  )

Waits for char to be send.

Returns
1 if char was sent.

Definition at line 1680 of file MLC_drv.c.