Hardware independent serial driver for CSI control. More...
#include <stdint.h>
#include "csi_plfabstr.h"
Macros | |
#define | CSI_RETURN_ON_ERROR(_result_) if ((_result_) < ERR_NOERR) return (_result_); |
Typedefs | |
typedef void(* | CsiDataTransferCallback )(uint32_t BytesTransfered) |
The transfer callback for the CsiBusWriteLargeData() function. More... | |
Functions | |
CSI_API long | CsiBusClose (struct CsiBus *pBus) |
Close connection. More... | |
CSI_API long | CsiBusOpen (struct CsiBus *pBus) |
This function initializes connection to CSI bus. More... | |
CSI_API long | CsiBusReadData (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord) |
This function reads up to 4 bytes of data from device object dictionary. More... | |
CSI_API long | CsiBusReadDataV2 (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t *pRxDWord) |
This function reads up to 4 bytes of data from device object dictionary using the new serial protocol version V2. More... | |
CSI_API long | CsiBusReadLargeData (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint8_t *pDataBuffer, uint16_t BufferSize) |
Use this function if you need to read more than 4 bytes of data. More... | |
CSI_API long | CsiBusWriteData (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord) |
This function writes up to 4 bytes of data into device object dictionary. More... | |
CSI_API long | CsiBusWriteDataV2 (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint32_t TxDWord) |
This function writes up to 4 bytes of data into device object dictionary using the new serial protocol version V2. More... | |
CSI_API long | CsiBusWriteLargeData (struct CsiBus *pBus, uint8_t NodeId, uint16_t ObjDicIdx, uint8_t ObjDicSub, uint8_t *pDataBuffer, uint32_t DataSize, CsiDataTransferCallback Callback) |
Use this function if you need to write more than 4 bytes of data. More... | |
Detailed Description
Hardware independent serial driver for CSI control.
- Date
- 2009/08/30 The hardware independent serial device driver offers a well defined interface for the CSI - Common Serial Interface layer. The driver does never access the RS232 hardware directly. Instead it calls into a hardware dependent serial driver (
- See also
- csi_hwserial_ctb.c) which need to be implemented by user.
Typedef Documentation
typedef void(* CsiDataTransferCallback)(uint32_t BytesTransfered) |
The transfer callback for the CsiBusWriteLargeData() function.
- Parameters
-
BytesTransfered The bytes transferred so far in a segmented data transfer
Function Documentation
CSI_API long CsiBusClose | ( | struct CsiBus * | pBus | ) |
Close connection.
- Parameters
-
[in] pBus Bus object to finish communication
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiClose().
CSI_API long CsiBusOpen | ( | struct CsiBus * | pBus | ) |
This function initializes connection to CSI bus.
- Parameters
-
[in] pBus Bus object with properly set timeout value and configured serial channel data
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiConnectToDevice(), and CsiOpen().
CSI_API long CsiBusReadData | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint32_t * | pRxDWord | ||
) |
This function reads up to 4 bytes of data from device object dictionary.
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of device to read from [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] pRxDWord Points to DWord buffer for storage of received data
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiDevReadObject().
CSI_API long CsiBusReadDataV2 | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint32_t * | pRxDWord | ||
) |
This function reads up to 4 bytes of data from device object dictionary using the new serial protocol version V2.
Use this function if you work with devices like Nemesys M and S that have a controller with this new protocol
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of device to read from [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] pRxDWord Points to DWord buffer for storage of received data
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiDevReadObject().
CSI_API long CsiBusReadLargeData | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint8_t * | pDataBuffer, | ||
uint16_t | BufferSize | ||
) |
Use this function if you need to read more than 4 bytes of data.
If data size is <=4, this function falls back to CsiBusReadData()
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of device to read from [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] pDataBuffer Points to buffer that stores data [in] BufferSize Size of the buffer given in pDataBuffer
- Return values
-
>= 0 Number of received bytes in pDataBuffer <0 Error code
Referenced by CsiDevReadLargeObject().
CSI_API long CsiBusWriteData | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint32_t | TxDWord | ||
) |
This function writes up to 4 bytes of data into device object dictionary.
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of CSI device to write to [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] TxDWord Points to DWord that contains data to write
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiDevWriteObject().
CSI_API long CsiBusWriteDataV2 | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint32_t | TxDWord | ||
) |
This function writes up to 4 bytes of data into device object dictionary using the new serial protocol version V2.
Use this function if you work with devices like Nemesys M and S that have a controller with this new protocol.
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of CSI device to write to [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] TxDWord Points to DWord that contains data to write
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiDevWriteObject().
CSI_API long CsiBusWriteLargeData | ( | struct CsiBus * | pBus, |
uint8_t | NodeId, | ||
uint16_t | ObjDicIdx, | ||
uint8_t | ObjDicSub, | ||
uint8_t * | pDataBuffer, | ||
uint32_t | DataSize, | ||
CsiDataTransferCallback | Callback | ||
) |
Use this function if you need to write more than 4 bytes of data.
If data size is <=4, this function falls back to CsiBusWriteData()
- Parameters
-
[in] pBus Bus object the device is attached to [in] NodeId NodeId (1 - 30) of CSI device to write to [in] ObjDicIdx Index into device object dictionary [in] ObjDicSub Sub entry of object dictionary entry [in] pDataBuffer Points to buffer that stores data [in] DataSize Size of the buffer given in pDataBuffer [in] Callback Callback function that will be called after each data packet that has been sent (e.g. to show a progress bar)
- Returns
- Error code - ERR_NOERR indicates success
Referenced by CsiDevWriteLargeObject().