AudioScience HPI Version_4.18.
Functions

Nonvolatile memory

Some adapters contain non-volatile memory containing a number of bytes The number of data words is adapter dependant and can be obtained from the *pwSizeInBytes parameter returned from the Open function. More...

Functions

hpi_err_t HPI_NvMemoryOpen (const hpi_hsubsys_t *phSubSys, uint16_t wAdapterIndex, hpi_handle_t *phNvMemory, uint16_t *pwSizeInBytes)
 Opens the non-volatile memory on a particular adapter for reading and writing.
hpi_err_t HPI_NvMemoryReadByte (const hpi_hsubsys_t *phSubSys, hpi_handle_t hNvMemory, uint16_t wIndex, uint16_t *pwData)
 Reads a byte from an adapters non-volatile memory.
hpi_err_t HPI_NvMemoryWriteByte (const hpi_hsubsys_t *phSubSys, hpi_handle_t hNvMemory, uint16_t wIndex, uint16_t wData)
 Writes a byte to an adapters non-volatile memory.

Detailed Description

Some adapters contain non-volatile memory containing a number of bytes The number of data words is adapter dependant and can be obtained from the *pwSizeInBytes parameter returned from the Open function.

There can be at most one nvmemory object per adapter.


Function Documentation

hpi_err_t HPI_NvMemoryOpen ( const hpi_hsubsys_t *  phSubSys,
uint16_t  wAdapterIndex,
hpi_handle_t phNvMemory,
uint16_t *  pwSizeInBytes 
)

Opens the non-volatile memory on a particular adapter for reading and writing.

It takes as input the handle to the subsytem (phSubSys) and the adapter index (wAdapterIndex) and returns a handle to the non-volatile memory (hNvMemory) and the size of the memory in bytes (wSizeInBytes). If the adapter does not have any non-volatile memory, the function will return an error.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
wAdapterIndexGet nvmemory handle on this adapter
phNvMemoryHandle to an HPI_NVMEMORY object
pwSizeInBytessize of the nv memory in bytes

References HPI_IndexesToHandle().

hpi_err_t HPI_NvMemoryReadByte ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hNvMemory,
uint16_t  wIndex,
uint16_t *  pwData 
)

Reads a byte from an adapters non-volatile memory.

The input is a handle to the non-volatile memory (hNvMemory - returned from HPI_NvMemoryOpen()) and an index which addresses one of the bytes in the memory (wIndex). The index may range from 0 to SizeInBytes-1 (returned by HPI_NvMemoryOpen()). The byte is returned in *pwData.). An error return of HPI_ERROR_NVMEM_BUSY indicates that an attempt to access the NvMem was made before the previous operation has completed. The call should be re-tried.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hNvMemoryHandle to an HPI_NVMEMORY object
wIndexAn Index that may range from 0 to SizeInBytes-1 (returned by HPI_NvMemoryOpen())
pwDataReturned data byte
hpi_err_t HPI_NvMemoryWriteByte ( const hpi_hsubsys_t *  phSubSys,
hpi_handle_t  hNvMemory,
uint16_t  wIndex,
uint16_t  wData 
)

Writes a byte to an adapters non-volatile memory.

The input is a handle to the non-volatile memory (hNvMemory - returned from HPI_NvMemoryOpen()), an index which addresses one of the bytes in the memory (wIndex) and the data to write (wData). The index may range from 0 to SizeInBytes-1 (returned by HPI_NvMemoryOpen()). An error return of HPI_ERROR_NVMEM_BUSY indicates that an attempt to access the NvMem was made before the previous operation has completed. The call should be re-tried.

Returns:
0 on success, or one of the HPI_ERROR_CODES.
Parameters:
phSubSysVestigial subsys handle (unused), may be set to NULL
hNvMemoryHandle to an HPI_NVMEMORY object
wIndexAn Index that may range from 0 to SizeInBytes-1 (returned by HPI_NvMemoryOpen())
wData> Byte of data to write