Files | |
| file | escom.h |
| ESCom board type and function declarations. | |
Functions | |
| int | ESCom_Find (ESComInterface_t *boards, int *count) |
| int | ESCom_Connect (ESComInterface_t *board) |
| int | ESCom_Disconnect (ESComInterface_t *board) |
| int | ESCom_SetPower (ESComInterface_t *board, bool on) |
| int | ESCom_I2CWrite (ESComInterface_t *board, uint8_t slAddr, uint8_t *wData1, int wSize1, uint8_t *wData2, int wSize2) |
| int | ESCom_I2CRead (ESComInterface_t *board, uint8_t slAddr, uint8_t *wData, int wSize, uint8_t *rData, int rSize) |
| int | ESCom_GetSensorVoltage (ESComInterface_t *board, float *voltage) |
| char const * | ESCom_GetErrorString (int error, int scope, char *buf, int bufLen) |
Data Structures | |
| struct | ESComInterface_t |
Enumerations | |
| enum | ESComErrorScope_t { iesLibUSB = 0x11, iesI2C = 0x12, iesCommand = 0x14 } |
| enum | ESComMode_t { emUSB, emEVK } |
| struct ESComInterface_t |
| enum ESComErrorScope_t |
ESCom error scopes
These codes identify the component that generated an error code
| int ESCom_Connect | ( | ESComInterface_t * | board | ) |
Connect ESCom board
This function tries to connect the ESCom board identified by board and allocates the required resources.
| [in] | board | Pointer to an ::EScomInterface_t instance obtained through ESCom_Find() |
| int ESCom_Disconnect | ( | ESComInterface_t * | board | ) |
Disconnect ESCom board and free associated resources
| [in] | board | Pointer to an ::EScomInterface_t instance |
| int ESCom_Find | ( | ESComInterface_t * | boards, |
| int * | count | ||
| ) |
Enumerate ESCom boards connected to PC
Scan available USB interfaces and save those with matching VID/PID in the boards buffer. Value pointed to by count serves as input and output. As input, count specifies the size maximum number of boards to be stored in boards. The buffer must provide sufficient space. Before return, this function stores the number of detected EScom boards in count.
| [in] | boards | Pointer to ESComInterface_t objects |
| [in,out] | count | Maximum number of boards to be stored in board [in], actual number of boards stored in board [out] |
| char const* ESCom_GetErrorString | ( | int | error, |
| int | scope, | ||
| char * | buf, | ||
| int | bufLen | ||
| ) |
Generate a descriptive error message
| [in] | error | Error code |
| [in] | scope | Error scope |
| int ESCom_GetSensorVoltage | ( | ESComInterface_t * | board, |
| float * | voltage | ||
| ) |
Read out the measured sensor voltage
| [in] | board | Pointer to an ::ESComInsteface_t instance |
| [out] | voltage | voltage value measured by ESCom board |
| int ESCom_I2CRead | ( | ESComInterface_t * | board, |
| uint8_t | slAddr, | ||
| uint8_t * | wData, | ||
| int | wSize, | ||
| uint8_t * | rData, | ||
| int | rSize | ||
| ) |
This is the ESCom implementation of HAL_t::i2cRead
| int ESCom_I2CWrite | ( | ESComInterface_t * | board, |
| uint8_t | slAddr, | ||
| uint8_t * | wData1, | ||
| int | wSize1, | ||
| uint8_t * | wData2, | ||
| int | wSize2 | ||
| ) |
This is the ESCom implementation of HAL_t::i2cWrite
| int ESCom_SetPower | ( | ESComInterface_t * | board, |
| bool | on | ||
| ) |
Switch on or off the internal sensor supply voltage
| [in] | board | Pointer to an ::ESComInsteface_t instance obtained |
| [in] | on | Boolean indicating whether the sensor supply voltage shall be switched on |