ConOpSys V2970  P004.07
ANVILEX control operating system
Typedefs | Functions
sio.h File Reference
#include "lwip/arch.h"
#include "lwip/opt.h"
Include dependency graph for sio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void * sio_fd_t
 

Functions

sio_fd_t sio_open (u8_t devnum)
 
void sio_send (u8_t c, sio_fd_t fd)
 
u8_t sio_recv (sio_fd_t fd)
 
u32_t sio_read (sio_fd_t fd, u8_t *data, u32_t len)
 
u32_t sio_tryread (sio_fd_t fd, u8_t *data, u32_t len)
 
u32_t sio_write (sio_fd_t fd, u8_t *data, u32_t len)
 
void sio_read_abort (sio_fd_t fd)
 

Typedef Documentation

◆ sio_fd_t

typedef void* sio_fd_t

Function Documentation

◆ sio_open()

sio_fd_t sio_open ( u8_t  devnum)

Opens a serial device for communication.

Parameters
devnumdevice number
Returns
handle to serial device if successful, NULL otherwise

Referenced by slipif_init().

Here is the caller graph for this function:

◆ sio_read()

u32_t sio_read ( sio_fd_t  fd,
u8_t data,
u32_t  len 
)

Reads from the serial device.

Parameters
fdserial device handle
datapointer to data buffer for receiving
lenmaximum length (in bytes) of data to receive
Returns
number of bytes actually received - may be 0 if aborted by sio_read_abort
Note
This function will block until data can be received. The blocking can be cancelled by calling sio_read_abort().
Parameters
fdserial device handle
datapointer to data buffer for receiving
lenmaximum length (in bytes) of data to receive
Returns
number of bytes actually received - may be 0 if aborted by sio_read_abort
Note
This function will block until data can be received. The blocking can be cancelled by calling sio_read_abort().

◆ sio_read_abort()

void sio_read_abort ( sio_fd_t  fd)

Aborts a blocking sio_read() call.

Parameters
fdserial device handle

◆ sio_recv()

u8_t sio_recv ( sio_fd_t  fd)

Receives a single character from the serial device.

Parameters
fdserial device handle
Note
This function will block until a character is received.

◆ sio_send()

void sio_send ( u8_t  c,
sio_fd_t  fd 
)

Sends a single character to the serial device.

Parameters
ccharacter to send
fdserial device handle
Note
This function will block until the character can be sent.
Parameters
ccharacter to send
fdserial device handle
Note
This function will block until the character can be sent.

Referenced by slipif_output().

Here is the caller graph for this function:

◆ sio_tryread()

u32_t sio_tryread ( sio_fd_t  fd,
u8_t data,
u32_t  len 
)

Tries to read from the serial device. Same as sio_read but returns immediately if no data is available and never blocks.

Parameters
fdserial device handle
datapointer to data buffer for receiving
lenmaximum length (in bytes) of data to receive
Returns
number of bytes actually received

Same as sio_read but returns immediately if no data is available and never blocks.

Parameters
fdserial device handle
datapointer to data buffer for receiving
lenmaximum length (in bytes) of data to receive
Returns
number of bytes actually received

Referenced by slipif_poll().

Here is the caller graph for this function:

◆ sio_write()

u32_t sio_write ( sio_fd_t  fd,
u8_t data,
u32_t  len 
)

Writes to the serial device.

Parameters
fdserial device handle
datapointer to data to send
lenlength (in bytes) of data to send
Returns
number of bytes actually sent
Note
This function will block until all data can be sent.