m2mb API docs  30.00.007
m2mb API sets documentation
m2mb_uart.h File Reference

UART library implementation. More...

Go to the source code of this file.

Data Structures

struct  M2MB_UART_CFG_T
 UART ioctl configuration. More...
 

Macros

#define NULL   0
 

Typedefs

typedef void(* m2mb_uart_ind_callback) (INT32 fd, M2MB_UART_IND_E uart_event, UINT16 resp_size, void *resp_struct, void *userdata)
 Transmit and receive operation callback type. More...
 

Enumerations

enum  M2MB_UART_IOCTL_REQUEST {
  M2MB_UART_IOCTL_SET_CFG = 0, M2MB_UART_IOCTL_GET_CFG, M2MB_UART_IOCTL_SET_BR, M2MB_UART_IOCTL_GET_BR,
  M2MB_UART_IOCTL_SET_FCTL, M2MB_UART_IOCTL_GET_FCTL, M2MB_UART_IOCTL_SET_PARITY_MODE, M2MB_UART_IOCTL_GET_PARITY_MODE,
  M2MB_UART_IOCTL_SET_STOP_BITS, M2MB_UART_IOCTL_GET_STOP_BITS, M2MB_UART_IOCTL_SET_BITS_PER_CHAR, M2MB_UART_IOCTL_GET_BITS_PER_CHAR,
  M2MB_UART_IOCTL_SET_TX_TIMEOUT = 14, M2MB_UART_IOCTL_GET_TX_TIMEOUT, M2MB_UART_IOCTL_SET_RX_TIMEOUT, M2MB_UART_IOCTL_GET_RX_TIMEOUT,
  M2MB_UART_IOCTL_SET_CB_FN, M2MB_UART_IOCTL_GET_CB_FN, M2MB_UART_IOCTL_SET_CB_USERDATA, M2MB_UART_IOCTL_GET_CB_USERDATA,
  M2MB_UART_IOCTL_SET_POWER_STATE, M2MB_UART_IOCTL_GET_POWER_STATE, M2MB_UART_IOCTL_GET_OP_MODE, M2MB_UART_IOCTL_GET_RTS_STATE,
  M2MB_UART_IOCTL_GET_DTR_STATE, M2MB_UART_IOCTL_SET_CTS, M2MB_UART_IOCTL_SET_DSR, M2MB_UART_IOCTL_SET_DCD,
  M2MB_UART_IOCTL_SET_RING, M2MB_UART_IOCTL_NOF_REQ
}
 UART configuration requests. More...
 
enum  M2MB_UART_FCTL_E { M2MB_UART_FCTL_OFF = 0, M2MB_UART_CTSRFR_AUTO_FCTL, M2MB_UART_FCTL_MAX }
 UART flow control type. More...
 
enum  M2MB_UART_PARITY_E {
  M2MB_UART_NO_PARITY = 0, M2MB_UART_ODD_PARITY, M2MB_UART_EVEN_PARITY, M2MB_UART_SPACE_PARITY,
  M2MB_UART_PARITY_MAX
}
 UART parity mode. More...
 
enum  M2MB_UART_STOP_BITS_E {
  M2MB_UART_0_5_STOP_BITS = 0, M2MB_UART_1_0_STOP_BITS, M2MB_UART_1_5_STOP_BITS, M2MB_UART_2_0_STOP_BITS,
  M2MB_UART_STOP_BITS_MAX
}
 UART number of stop bits. More...
 
enum  M2MB_UART_BITS_PER_CHAR_E {
  M2MB_UART_5_BITS_PER_CHAR = 0, M2MB_UART_6_BITS_PER_CHAR, M2MB_UART_7_BITS_PER_CHAR, M2MB_UART_8_BITS_PER_CHAR,
  M2MB_UART_BITS_PER_CHAR_MAX
}
 UART number of bits per character. More...
 
enum  M2MB_UART_IND_E { M2MB_UART_TX_EV, M2MB_UART_RX_EV, M2MB_UART_DTR_EV }
 UART event type. More...
 
enum  M2MB_UART_PIN_VALUE_E { M2MB_UART_LOW_VALUE, M2MB_UART_HIGH_VALUE }
 UART pin voltage value. More...
 

Functions

INT32 m2mb_uart_open (const CHAR *path, INT32 flags,...)
 m2mb_uart_open opens a UART device. More...
 
INT32 m2mb_uart_close (INT32 fd)
 m2mb_uart_close closes a UART device. More...
 
INT32 m2mb_uart_ioctl (INT32 fd, INT32 request,...)
 m2mb_uart_ioctl configures an open UART device. More...
 
SSIZE_T m2mb_uart_read (INT32 fd, void *buf, SIZE_T nbyte)
 m2mb_uart_read reads data from an open UART device. More...
 
SSIZE_T m2mb_uart_write (INT32 fd, const void *buf, SIZE_T nbyte)
 m2mb_uart_write writes data to an open UART device. More...
 

Detailed Description

UART library implementation.

m2m/m2m_generic/common/m2mb_inc/m2mb_uart.h

The following functions are implemented:

Note
Dependencies: m2m/m2m_generic/common/m2mb_inc/m2mb_types.h
Author
Morgan Deidda
Date
04/01/2018

Typedef Documentation

◆ m2mb_uart_ind_callback

typedef void( * m2mb_uart_ind_callback) (INT32 fd, M2MB_UART_IND_E uart_event, UINT16 resp_size, void *resp_struct, void *userdata)

Transmit and receive operation callback type.

This type defines the callback functions that the client can set in the UART open configuration or get by m2mb_uart_ioctl API.

Enumeration Type Documentation

◆ M2MB_UART_BITS_PER_CHAR_E

UART number of bits per character.

This type defines the number of bits per character that the client can set in the UART open configuration or get by m2mb_uart_ioctl API.

Enumerator
M2MB_UART_5_BITS_PER_CHAR 

5 bits per character

M2MB_UART_6_BITS_PER_CHAR 

6 bits per character

M2MB_UART_7_BITS_PER_CHAR 

7 bits per character

M2MB_UART_8_BITS_PER_CHAR 

8 bits per character

◆ M2MB_UART_FCTL_E

UART flow control type.

This type defines the flow control type that the client can set in the UART open configuration or set/get by m2mb_uart_ioctl API.

Enumerator
M2MB_UART_FCTL_OFF 

Disable flow control

M2MB_UART_CTSRFR_AUTO_FCTL 

Use CTS/RFR flow control with auto RX RFR signal generation

◆ M2MB_UART_IND_E

UART event type.

This type defines the indications which can be passed to the callback.

Enumerator
M2MB_UART_TX_EV 

Transmitted data Event

M2MB_UART_RX_EV 

Received data Event

M2MB_UART_DTR_EV 

Received RTS Event

◆ M2MB_UART_IOCTL_REQUEST

UART configuration requests.

This enum defines the requests wich can be passed to the function m2mb_uart_ioctl()

Enumerator
M2MB_UART_IOCTL_SET_CFG 

set whole uart device configuration

M2MB_UART_IOCTL_GET_CFG 

get whole uart device configuration

M2MB_UART_IOCTL_SET_BR 

set uart baudrate

M2MB_UART_IOCTL_GET_BR 

get uart baudrate

M2MB_UART_IOCTL_SET_FCTL 

set uart flow control type

M2MB_UART_IOCTL_GET_FCTL 

get uart flow control type

M2MB_UART_IOCTL_SET_PARITY_MODE 

set uart parity mode

M2MB_UART_IOCTL_GET_PARITY_MODE 

get uart parity mode

M2MB_UART_IOCTL_SET_STOP_BITS 

set uart number of stop bits

M2MB_UART_IOCTL_GET_STOP_BITS 

get uart number of stop bits

M2MB_UART_IOCTL_SET_BITS_PER_CHAR 

set uart number of bits per character

M2MB_UART_IOCTL_GET_BITS_PER_CHAR 

get uart number of bits per character

M2MB_UART_IOCTL_SET_TX_TIMEOUT 

set synchronous write timeout in ms (if 0, waits indefinitely until the write is completed)

M2MB_UART_IOCTL_GET_TX_TIMEOUT 

get synchronous write timeout in ms (if 0, waits indefinitely until the write is completed)

M2MB_UART_IOCTL_SET_RX_TIMEOUT 

set synchronous read timeout in ms (if 0, waits indefinitely until the read is completed)

M2MB_UART_IOCTL_GET_RX_TIMEOUT 

get synchronous read timeout in ms (if 0, waits indefinitely until the read is completed)

M2MB_UART_IOCTL_SET_CB_FN 

set callback function pointer (if NULL, action is synchronous)

M2MB_UART_IOCTL_GET_CB_FN 

get callback function pointer (if NULL, action is synchronous)

M2MB_UART_IOCTL_SET_CB_USERDATA 

set callback data pointer

M2MB_UART_IOCTL_GET_CB_USERDATA 

get callback data pointer

M2MB_UART_IOCTL_SET_POWER_STATE 

set current power state

M2MB_UART_IOCTL_GET_POWER_STATE 

get current power state

M2MB_UART_IOCTL_GET_OP_MODE 

get current operational mode of device (see +CFUN)

M2MB_UART_IOCTL_GET_RTS_STATE 

get current RTS state

M2MB_UART_IOCTL_GET_DTR_STATE 

get current DTR state

M2MB_UART_IOCTL_SET_CTS 

set CTS pin

M2MB_UART_IOCTL_SET_DSR 

set DSR pin

M2MB_UART_IOCTL_SET_DCD 

set DCD pin

M2MB_UART_IOCTL_SET_RING 

set RING pin

◆ M2MB_UART_PARITY_E

UART parity mode.

This type defines the parity mode that the client can set in the UART open configuration or get by m2mb_uart_ioctl API.

Enumerator
M2MB_UART_NO_PARITY 

no parity

M2MB_UART_ODD_PARITY 

odd parity

M2MB_UART_EVEN_PARITY 

even parity

M2MB_UART_SPACE_PARITY 

space parity

◆ M2MB_UART_PIN_VALUE_E

UART pin voltage value.

This type defines the pin output voltage that the client can set by m2mb_uart_ioctl API.

Enumerator
M2MB_UART_LOW_VALUE 

Set pin output LOW.

M2MB_UART_HIGH_VALUE 

Set pin output HIGH

◆ M2MB_UART_STOP_BITS_E

UART number of stop bits.

This type defines the number of stop bits that the client can set in the UART open configuration or get by m2mb_uart_ioctl API.

Enumerator
M2MB_UART_0_5_STOP_BITS 

0.5 stop bits

M2MB_UART_1_0_STOP_BITS 

1.0 stop bits

M2MB_UART_1_5_STOP_BITS 

1.5 stop bits

M2MB_UART_2_0_STOP_BITS 

2.0 stop bits

Function Documentation

◆ m2mb_uart_close()

INT32 m2mb_uart_close ( INT32  fd)

m2mb_uart_close closes a UART device.

m2mb_uart_close closes a UART device freeing the data associated to the file descriptor passed as parameter.

Parameters
[in]fdFile Descriptor returned by m2mb_uart_open()
Returns
returns 0 on SUCCESS, -1 on FAILURE.
Note

m2mb_uart_close(fd);

int main()
{
INT32 fd;
INT32 retVal;
fd = m2mb_uart_open("/dev/tty1", 0);
//... use UART device ...
retVal = m2mb_uart_close(fd);
if ( retVal != -1 )
printf( "m2mb_uart_close succeeded");
}

◆ m2mb_uart_ioctl()

INT32 m2mb_uart_ioctl ( INT32  fd,
INT32  request,
  ... 
)

m2mb_uart_ioctl configures an open UART device.

m2mb_uart_ioctl sets/gets the full UART configuration or single settings by means of requests listed in enum M2MB_UART_IOCTL_REQUEST.

Parameters
[in]fdfirst parameter is the File Descriptor returned by m2mb_uart_open()
[in]requestsecond parameter indicates the action to be performed. The allowed values ??are those listed in enum M2MB_UART_IOCTL_REQUEST.
[in,out]cfgthird parameter can be a pointer to a previously defined variable or a value, depending on the action requested by the second parameter (see following note for further details).
Returns
returns 0 on SUCCESS, -1 on FAILURE.
Note
Use cases:
  • Action: M2MB_UART_IOCTL_SET_CFG

    Description: set whole uart device configuration

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pCfgStruct(M2MB_UART_CFG_T *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_CFG, &cfgStruct)

  • Action: M2MB_UART_IOCTL_GET_CFG

    Description: get whole uart device configuration

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pCfgStruct(M2MB_UART_CFG_T *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_CFG, &cfgStruct)

  • Action: M2MB_UART_IOCTL_SET_BR

    Description: set uart baudrate

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), baudRate(UINT32)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_BR, 115200)

  • Action: M2MB_UART_IOCTL_GET_BR

    Description: get uart baudrate

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pBaudRate(UINT32 *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_BR, &baudRate)

  • Action: M2MB_UART_IOCTL_SET_FCTL

    Description: set uart flow control type

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), flowControl(M2MB_UART_FCTL_E)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_FCTL, M2MB_UART_CTSRFR_AUTO_FCTL)

  • Action: M2MB_UART_IOCTL_GET_FCTL

    Description: get uart flow control type

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pFlowControl(M2MB_UART_FCTL_E *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_FCTL, &flowControl)

  • Action: M2MB_UART_IOCTL_SET_PARITY_MODE

    Description: set uart parity mode

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), parityMode(M2MB_UART_PARITY_E)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_PARITY_MODE, M2MB_UART_NO_PARITY)

  • Action: M2MB_UART_IOCTL_GET_PARITY_MODE

    Description: get uart parity mode

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pParityMode(M2MB_UART_PARITY_E *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_PARITY_MODE, &parityMode)

  • Action: M2MB_UART_IOCTL_SET_STOP_BITS

    Description: set uart number of stop bits

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), stopBits(M2MB_UART_STOP_BITS_E)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_STOP_BITS, M2MB_UART_1_0_STOP_BITS)

  • Action: M2MB_UART_IOCTL_GET_STOP_BITS

    Description: get uart number of stop bits

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pStopBits(M2MB_UART_STOP_BITS_E *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_STOP_BITS, &stopBits)

  • Action: M2MB_UART_IOCTL_SET_BITS_PER_CHAR

    Description: set uart number of bits per character

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), bitsPerChar(M2MB_UART_BITS_PER_CHAR_E)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_BITS_PER_CHAR, M2MB_UART_8_BITS_PER_CHAR)

  • Action: M2MB_UART_IOCTL_GET_BITS_PER_CHAR

    Description: get uart number of bits per character

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pBitsPerChar(M2MB_UART_BITS_PER_CHAR_E *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_BITS_PER_CHAR, &bitsPerChar)

  • Action: M2MB_UART_IOCTL_SET_TX_TIMEOUT

    Description: set synchronous write timeout in ms (if 0, waits indefinitely until the write is completed)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), timeout(UINT16)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_TX_TIMEOUT, 100)

  • Action: M2MB_UART_IOCTL_GET_TX_TIMEOUT

    Description: get synchronous write timeout in ms (if 0, waits indefinitely until the write is completed)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pTimeout(UINT16 *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_TX_TIMEOUT, &timeout)

  • Action: M2MB_UART_IOCTL_SET_RX_TIMEOUT

    Description: set synchronous read timeout in ms (if 0, waits indefinitely until the read is completed)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), timeout(UINT16)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_RX_TIMEOUT, 100)

  • Action: M2MB_UART_IOCTL_GET_RX_TIMEOUT

    Description: get synchronous read timeout in ms (if 0, waits indefinitely until the read is completed)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pTimeout(UINT16 *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_RX_TIMEOUT, &timeout)

  • Action: M2MB_UART_IOCTL_SET_CB_FN

    Description: set callback function pointer (if NULL, action is synchronous)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), cb_fn(m2mb_uart_ind_callback)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_CB_FN, cb_fn)

  • Action: M2MB_UART_IOCTL_GET_CB_FN

    Description: get callback function pointer (if NULL, action is synchronous)

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pCb_fn(m2mb_uart_ind_callback *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_CB_FN, &cb_fn)

  • Action: M2MB_UART_IOCTL_SET_CB_USERDATA

    Description: set callback data pointer

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), cbData(void *)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_SET_CB_USERDATA, cbData)

  • Action: M2MB_UART_IOCTL_GET_CB_USERDATA

    Description: get callback data pointer

    Params(in): fd(INT32), request(M2MB_UART_IOCTL_REQUEST), pCbData(void **)

    Example: m2mb_uart_ioctl(fd, M2MB_UART_IOCTL_GET_CB_USERDATA, &cbData)

m2mb_uart_ioctl(fd, request, cfg);

int main()
{
INT32 fd;
INT32 retVal;
fd = m2mb_uart_open("/dev/tty1", 0);
//...
if ( retVal != -1 )
printf( "m2mb_uart_ioctl: get cfg struct succeeded");
// modify some configuration structure fields...
cfg.baud_rate = 9600;
//...
if ( retVal != -1 )
printf( "m2mb_uart_ioctl: set cfg struct succeeded");
}

◆ m2mb_uart_open()

INT32 m2mb_uart_open ( const CHAR *  path,
INT32  flags,
  ... 
)

m2mb_uart_open opens a UART device.

m2mb_uart_open opens a UART device returning the file descriptor that must be passed as first parameter for all the other UART actions. Calling the m2mb_uart_open is mandatory before using the UART device.

Parameters
[in]pathfirst parameter is the path to the UART device, that will be initialized by the function. It is a string like "/dev/ttyX" where X is the UART instance index. Path "/dev/tty" is equivalent to default "/dev/tty0".
[in]flagssecond parameter is the access mode flags. Currently unused
Returns
returns the File Descriptor on SUCCESS, -1 on FAILURE.
Note
A default configuration is applied, with following values:
  • Baud rate: 115200 bps
  • Flow Control: off
  • Parity Mode: none
  • Stop Bits: 1
  • Bits Per Char: 8
  • Loopback Mode: disabled
  • Synchronous Write Timeout: 0 ms
  • Synchronous Read Timeout: 0 ms
  • Callback Function: none
  • Callback Data: none

m2mb_uart_open(path, flags);

int main()
{
INT32 fd;
fd = m2mb_uart_open("/dev/tty1", 0);
if ( fd != -1 )
printf( "m2mb_uart_open succeeded");
}

◆ m2mb_uart_read()

SSIZE_T m2mb_uart_read ( INT32  fd,
void *  buf,
SIZE_T  nbyte 
)

m2mb_uart_read reads data from an open UART device.

m2mb_uart_read reads up to nbyte Bytes from a UART device into a destination buffer.

Parameters
[in]fdfirst parameter is the File Descriptor returned by m2mb_uart_open()
[in]bufsecond parameter is the destination buffer, previously allocated.
[in]nbytethird parameter is the length of the destination buffer in Bytes.
Returns
returns the number of read Bytes on SUCCESS, -1 on FAILURE.
Note
Reading can be synchronous or asynchronous. If the callback has been registered (by means of m2mb_uart_ioctl), the function m2mb_uart_read() has an asynchronous behavior: when new data is available from the UART device, the registered callback is triggered in order to signal that a not blocking reading can be performed. If no callback has been registered, the function m2mb_uart_read() has a synchronous behavior and the reading remains blocked until new data is available from the UART device or for a timeout set by means of m2mb_uart_ioctl.

m2mb_uart_read(fd, buf, nbyte);

#define BUF_LEN 32
int main()
{
INT32 fd;
INT32 rdBytes;
UINT8 dstBuf[BUF_LEN];
fd = m2mb_uart_open("/dev/tty1", 0);
//...
rdBytes = m2mb_uart_read(fd, dstBuf, BUF_LEN);
if ( rdBytes >= 0 )
printf( "m2mb_uart_read succeeded");
}

◆ m2mb_uart_write()

SSIZE_T m2mb_uart_write ( INT32  fd,
const void *  buf,
SIZE_T  nbyte 
)

m2mb_uart_write writes data to an open UART device.

m2mb_uart_write writes nbyte Bytes from a source buffer to a UART device.

Parameters
[in]fdfirst parameter is the File Descriptor returned by m2mb_uart_open()
[in]bufsecond parameter is the source buffer, previously allocated.
[in]nbytethird parameter is the length of the source buffer in Bytes.
Returns
returns the number of written Bytes on SUCCESS, -1 on FAILURE.
Note
Writing can be synchronous or asynchronous. If the callback has been registered (by means of m2mb_uart_ioctl), the function m2mb_uart_write() has an asynchronous behavior: after a not blocking writing has been performed, the registered callback is triggered in order to signal that the whole data has been successfully transmitted to the UART device. If no callback has been registered, the function m2mb_uart_write() has a synchronous behavior and the wtiting remains blocked until the data transmission to the UART device is completed or for a timeout set by means of m2mb_uart_ioctl.

m2mb_uart_read(fd, buf, nbyte);

#define BUF_LEN 32
#define WR_BYTE_VAL 0xAB
int main()
{
INT32 fd;
INT32 wrBytes;
UINT8 srcBuf[BUF_LEN];
fd = m2mb_uart_open("/dev/tty1", 0);
//...
memset(srcBuf, WR_BYTE_VAL, BUF_LEN);
wrBytes = m2mb_uart_write(fd, srcBuf, BUF_LEN);
if ( wrBytes >= 0 )
printf( "m2mb_uart_write succeeded");
}
m2mb_uart_close
INT32 m2mb_uart_close(INT32 fd)
m2mb_uart_close closes a UART device.
M2MB_UART_CFG_T
UART ioctl configuration.
Definition: m2mb_uart.h:178
M2MB_UART_IOCTL_SET_CFG
Definition: m2mb_uart.h:45
m2mb_uart_open
INT32 m2mb_uart_open(const CHAR *path, INT32 flags,...)
m2mb_uart_open opens a UART device.
M2MB_UART_IOCTL_GET_CFG
Definition: m2mb_uart.h:46
m2mb_uart_read
SSIZE_T m2mb_uart_read(INT32 fd, void *buf, SIZE_T nbyte)
m2mb_uart_read reads data from an open UART device.
m2mb_uart_write
SSIZE_T m2mb_uart_write(INT32 fd, const void *buf, SIZE_T nbyte)
m2mb_uart_write writes data to an open UART device.
m2mb_uart_ioctl
INT32 m2mb_uart_ioctl(INT32 fd, INT32 request,...)
m2mb_uart_ioctl configures an open UART device.
M2MB_UART_CFG_T::baud_rate
UINT32 baud_rate
Definition: m2mb_uart.h:180