Backend

group npmx_backend

npmx backend API.

Typedefs

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.

Param p_context:

[in] Pointer to user-defined context data.

Param register_address:

[in] Register address in npmx device to be modified.

Param p_data:

[in] Pointer to data.

Param num_of_bytes:

[in] Number of bytes of data.

Retval NPMX_SUCCESS:

Operation performed successfully.

Retval NPMX_ERROR_IO:

Error using IO bus line.

Functions

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:
  • p_config[in] Pointer to the backend configuration structure.

  • register_address[in] Register address in npmx device to be modified.

  • p_data[in] Pointer to data to write.

  • num_of_bytes[in] 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.

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:
  • p_config[in] Pointer to the backend configuration structure.

  • register_address[in] Register address in npmx device to be read.

  • p_data[in] Pointer to buffer for read data.

  • num_of_bytes[in] Number of bytes to read.

Return values:
  • NPMX_SUCCESS – All data read successfully.

  • NPMX_ERROR_IO – Backend returned IO error during data reading.

struct npmx_backend_t
#include <npmx_backend.h>

Data structure of backend configuration.

Public Members

npmx_backend_function_t p_write

Pointer to write function.

npmx_backend_function_t p_read

Pointer to read function.

void *p_context

User-defined context data passed as an argument for write and read functions.