npmx backend API.
More...
|
typedef npmx_error_t(* | npmx_backend_function_t) (void *p_context, uint32_t register_address, uint8_t *p_data, size_t num_of_bytes) |
| Definition of pointer to type of function used to write and read data.
|
|
npmx backend API.
◆ npmx_backend_function_t
typedef npmx_error_t(* npmx_backend_function_t) (void *p_context, uint32_t register_address, uint8_t *p_data, size_t num_of_bytes) |
Definition of pointer to type of function used to write and read data.
- Parameters
-
[in] | p_context | Pointer to user-defined context data. |
[in] | register_address | Register address in npmx device to be modified. |
[in] | p_data | Pointer to data. |
[in] | num_of_bytes | Number of bytes of data. |
- Return values
-
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
◆ npmx_backend_register_read()
npmx_error_t npmx_backend_register_read |
( |
npmx_backend_t const * | p_config, |
|
|
uint32_t | register_address, |
|
|
uint8_t * | p_data, |
|
|
size_t | num_of_bytes ) |
Function for reading a message over the chosen transport backend.
This function is used by services to read npmx registers.
- Parameters
-
[in] | p_config | Pointer to the backend configuration structure. |
[in] | register_address | Register address in npmx device to be read. |
[in] | p_data | Pointer to buffer for read data. |
[in] | num_of_bytes | Number of bytes to read. |
- Return values
-
NPMX_SUCCESS | All data read successfully. |
NPMX_ERROR_IO | Backend returned IO error during data reading. |
◆ npmx_backend_register_write()
npmx_error_t npmx_backend_register_write |
( |
npmx_backend_t const * | p_config, |
|
|
uint32_t | register_address, |
|
|
uint8_t * | p_data, |
|
|
size_t | num_of_bytes ) |
Function for sending a message over the chosen transport backend.
This function is used by services to write to npmx registers.
- Parameters
-
[in] | p_config | Pointer to the backend configuration structure. |
[in] | register_address | Register address in npmx device to be modified. |
[in] | p_data | Pointer to data to write. |
[in] | num_of_bytes | Number of bytes of data to write. |
- Return values
-
NPMX_SUCCESS | All data written successfully. |
NPMX_ERROR_IO | Backend returned IO error during data writing. |