Ilmsens HAL API  1.1.1
A cross-platform C-library for interfacing m:explore UWB-sensors
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Low-level access to sensor registers & memory

Typedefs

typedef uint32_t ilmsens_hal_MemoryType
 Represents data type for register and memory access.

Functions

int ilmsens_hal_readReg (unsigned int *pDevNums, unsigned int pNum, unsigned int pReg, ilmsens_hal_MemoryType *pVal, size_t pBufSizeBytes)
 Reads value from register at pReg address from all specified devices to buffer.
int ilmsens_hal_writeReg (unsigned int *pDevNums, unsigned int pNum, unsigned int pReg, ilmsens_hal_MemoryType pVal)
 Writes pVal value to register at pReg address to all specified devices.
int ilmsens_hal_readBlk (unsigned int *pDevNums, unsigned int pNum, unsigned int pAdr, unsigned int pNumEl, ilmsens_hal_MemoryType *pVal, size_t pBufSizeBytes)
 Reads pNumEl elements (32-bit words) starting at address pAdr from the internal memory of specified devices into a buffer pVal.
int ilmsens_hal_writeBlk (unsigned int *pDevNums, unsigned int pNum, unsigned int pAdr, unsigned int pNumEl, ilmsens_hal_MemoryType *pVal, size_t pBufSizeBytes)
 Writes pNumEl elements (32-bit words) from buffer pVal to internal memory starting at address pAdr of specified devices.

Detailed Description

Function Documentation

int ilmsens_hal_readReg ( unsigned int *  pDevNums,
unsigned int  pNum,
unsigned int  pReg,
ilmsens_hal_MemoryType pVal,
size_t  pBufSizeBytes 
)

Reads value from register at pReg address from all specified devices to buffer.

The buffer pVal must be large enough to hold one word for each device, i.e. it must be at least pNum words in size.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pRegregister address
pValpointer to buffer for register value(s)
pBufSizeBytesSize of buffer pointed to by pVal in bytes
Returns
number of words (elements) copied to the buffer
negative error-code
int ilmsens_hal_writeReg ( unsigned int *  pDevNums,
unsigned int  pNum,
unsigned int  pReg,
ilmsens_hal_MemoryType  pVal 
)

Writes pVal value to register at pReg address to all specified devices.

The same value is written to each device.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pRegregister address
pValnew register value
Returns
ILMSENS_SUCCESS on success
negative error-code
int ilmsens_hal_readBlk ( unsigned int *  pDevNums,
unsigned int  pNum,
unsigned int  pAdr,
unsigned int  pNumEl,
ilmsens_hal_MemoryType pVal,
size_t  pBufSizeBytes 
)

Reads pNumEl elements (32-bit words) starting at address pAdr from the internal memory of specified devices into a buffer pVal.

The buffer must be large enough to hold pNumEl words for all specified devices, i.e. it provide space for at least pNumEl x pNum words.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pAdrword-aligned start memory address
pNumElnumber of words (elements) to read
pValpointer to buffer for the transferred memory content
pBufSizeBytesSize of buffer pointed to by pVal in bytes
Returns
number of words (elements) copied to the buffer
negative error-code
int ilmsens_hal_writeBlk ( unsigned int *  pDevNums,
unsigned int  pNum,
unsigned int  pAdr,
unsigned int  pNumEl,
ilmsens_hal_MemoryType pVal,
size_t  pBufSizeBytes 
)

Writes pNumEl elements (32-bit words) from buffer pVal to internal memory starting at address pAdr of specified devices.

The same content is written to each device, i.e. the buffer pVal must hold pNumEl words regardless of pNum.

Parameters
pDevNumspointer to a first element or an array of device-indexes
pNumnumber of array-elements
pAdrword-aligned start memory address
pNumElnumber of words (elements) to write
pValpointer to buffer with data to write
pBufSizeBytesSize of buffer pointed to by pVal in bytes
Returns
ILMSENS_SUCCESS on success
negative error-code