Sensorian  1.0
C API Reference Guide Library
Serial port

Functions

int SerialOpen (int baud)
 Open and initialise the serial port with a specific baud rate. More...
 
void SerialFlush (int fd)
 Flush the serial buffers (both tx & rx) More...
 
void SerialClose (int fd)
 Closes the serial port characterized by device number fd. More...
 
void SerialPutchar (int fd, unsigned char c)
 Send a single character to the serial port. More...
 
void SerialPuts (int fd, char *s)
 Send a string to the serial port. More...
 
void SerialPrintf (int fd, char const *message,...)
 Printf over Serial Port. More...
 
int SerialDataAvail (int fd)
 Return the number of bytes of data avalable to be read from the serial port. More...
 
int SerialGetchar (int fd)
 Get a single character from the serial device. Note: Zero is a valid character and this function will time-out after 10 seconds. More...
 

Detailed Description

These functions let you communicate with the CAP1203 capacitive touch controller

Function Documentation

void SerialClose ( int  fd)

Closes the serial port characterized by device number fd.

Parameters
fddevice file number
Returns
none

Definition at line 135 of file Serial.c.

int SerialDataAvail ( int  fd)

Return the number of bytes of data avalable to be read from the serial port.

Parameters
fdDevice file number
Returns
result Number of bytes available from the serial port.

Definition at line 185 of file Serial.c.

void SerialFlush ( int  fd)

Flush the serial buffers (both tx & rx)

Parameters
fdDevice file number
Returns
none

Definition at line 125 of file Serial.c.

int SerialGetchar ( int  fd)

Get a single character from the serial device. Note: Zero is a valid character and this function will time-out after 10 seconds.

Parameters
fddevice file number
Returns
ch Serial Char received

Definition at line 201 of file Serial.c.

int SerialOpen ( int  baud)

Open and initialise the serial port with a specific baud rate.

Parameters
baudBaud rate for port ttyAMA0
Returns
fd device file number

Definition at line 51 of file Serial.c.

void SerialPrintf ( int  fd,
char const *  message,
  ... 
)

Printf over Serial Port.

Parameters
fddevice file number
*messageString array
Returns
none

Definition at line 168 of file Serial.c.

void SerialPutchar ( int  fd,
unsigned char  c 
)

Send a single character to the serial port.

Parameters
fddevice file number
cSingle chracter to be sent over the serial port.
Returns
none

Definition at line 146 of file Serial.c.

void SerialPuts ( int  fd,
char *  s 
)

Send a string to the serial port.

Parameters
fdDevice file number.
sArray of characters to be sent over the serial port.
Returns
none

Definition at line 157 of file Serial.c.