Defines | Functions | Variables

sercom.c File Reference

#include <sys/signal.h>
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include "sercom.h"
Include dependency graph for sercom.c:

Defines

#define DEBUG_SERCOM

Functions

void sercom_sighandler (int status)
long sercom_get_baudrate (unsigned int baudrate)
 Get constant representing the baud rate.
long sercom_get_databits (int databits)
 Get constant representing number of data bits.
long sercom_get_stopbits (int stopbits)
 Get constant representing number of stop bits.
long sercom_get_parity (int parity)
 Get constant representing number of parity bits.
int sercom_open (struct sercom_data *sercom)
 Open serial communication.
ssize_t sercom_read (struct sercom_data *sercom, char *buf, ssize_t buflen)
 Read received bytes to a buffer.
void sercom_close (struct sercom_data *sercom)
 Close serial communication.

Variables

unsigned char sercom_wait_flag = 1

Define Documentation

#define DEBUG_SERCOM

Function Documentation

void sercom_close ( struct sercom_data sercom  ) 

Close serial communication.

Parameters:
sercom serial communication settings

Here is the caller graph for this function:

long sercom_get_baudrate ( unsigned int  baudrate  ) 

Get constant representing the baud rate.

FUNCTION PROTOTYPES.

Parameters:
baudrate in bauds
Returns:
br constant

Here is the caller graph for this function:

long sercom_get_databits ( int  databits  ) 

Get constant representing number of data bits.

Parameters:
databits number of data bits
Returns:
db constant
long sercom_get_parity ( int  parity  ) 

Get constant representing number of parity bits.

Parameters:
parity number of parity bits
Returns:
par constant
long sercom_get_stopbits ( int  stopbits  ) 

Get constant representing number of stop bits.

Parameters:
stopbits number of stop bits
Returns:
sb constant
int sercom_open ( struct sercom_data sercom  ) 

Open serial communication.

Parameters:
sercom serial communication settings

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t sercom_read ( struct sercom_data sercom,
char *  buf,
ssize_t  buflen 
)

Read received bytes to a buffer.

Parameters:
sercom serial communication settings
buf receive buffer
buflen buffer length
Returns:
number of received bytes

Here is the caller graph for this function:

void sercom_sighandler ( int  status  ) 

Variable Documentation

unsigned char sercom_wait_flag = 1