csi_common.c File Reference

Implementation of common serial port functions. More...

#include "csi_hwserial.h"
#include "csi_plfabstr.h"
#include <string.h>
+ Include dependency graph for csi_common.c:

Functions

long CsiSerOpenChannel (struct CsiSerChannel *pChan, const char *DeviceName, uint32_t BaudRate)
 This is a hardware independent function to open a serial channel. More...
 
void CsiSleep (uint32_t Milliseconds)
 Function to sleep for a certain amount of milliseconds.
 

Detailed Description

Implementation of common serial port functions.

Author
Uwe Kindler
Date
31.07.2014

Function Documentation

long CsiSerOpenChannel ( struct CsiSerChannel pChan,
const char *  DeviceName,
uint32_t  BaudRate 
)

This is a hardware independent function to open a serial channel.

This function calls CsiHwSerOpenChannel to open the serial channel with the given parameters

Parameters
[in]pChanSerial channel to initialize
[in]DeviceNameName of the serial device to open (i.e. COM1)
[in]BaudRateThe baud rate to use for communication
Returns
Error code - CSI_ERR_NOERR indicates success
21 {
22  pChan->pPriv = 0;
23  pChan->BaudRate = BaudRate;
24  strncpy(pChan->DeviceName, DeviceName, sizeof(pChan->DeviceName));
25  return CsiHwSerOpenChannel(pChan);
26 }
CSI_API long CsiHwSerOpenChannel(struct CsiSerChannel *pChan)
Initializes serial channel configuration data and opens serial connection.
char DeviceName[64]
stores the device name
Definition: csi_types.h:59
uint32_t BaudRate
baudrate of serial channel
Definition: csi_types.h:57
void * pPriv
pointer to private data
Definition: csi_types.h:58

+ Here is the call graph for this function: