Skip to content

File ns_rpc_generic_data.c

FileList > neuralSPOT > neuralspot > ns-rpc > src > ns_rpc_generic_data.c

Go to the source code of this file

  • #include "ns_rpc_generic_data.h"
  • #include "erpc_client_setup.h"
  • #include "erpc_server_setup.h"
  • #include "ns_usb.h"
  • #include "GenericDataOperations_EvbToPc.h"
  • #include "GenericDataOperations_PcToEvb.h"
  • #include "GenericDataOperations_PcToEvb_server.h"
  • #include "ns_ambiqsuite_harness.h"
  • #include "ns_core.h"
  • #include "ns_malloc.h"

Public Attributes

Type Name
ns_rpc_config_t g_RpcGenericDataConfig = = {
.api = &ns_rpc_gdo_current_version,
.mode = NS_RPC_GENERICDATA_CLIENT,
.rx_buf = NULL,
.rx_bufLength = 0,
.tx_buf = NULL,
.tx_bufLength = 0,
.usbHandle = NULL,
.sendBlockToEVB_cb = NULL,
.fetchBlockFromEVB_cb = NULL,
.computeOnEVB_cb = NULL}
ns_usb_config_t g_RpcGenericUSBHandle = = {
.api = &ns_usb_V1_0_0,
.deviceType = NS_USB_CDC_DEVICE,
.rx_buffer = NULL,
.rx_bufferLength = 0,
.tx_buffer = NULL,
.tx_bufferLength = 0,
.rx_cb = NULL,
.tx_cb = NULL,
.service_cb = NULL}
const ns_core_api_t ns_rpc_gdo_V0_0_1
const ns_core_api_t ns_rpc_gdo_V1_0_0
const ns_core_api_t ns_rpc_gdo_current_version
const ns_core_api_t ns_rpc_gdo_oldest_supported_version

Public Functions

Type Name
void ns_rpc_data_clientDoneWithBlockFromPC (const dataBlock * block)
Helper function to be called after processing the block from ns_rpc_data_fetchBlockFromPC or result block from ns_rpc_data_computeOnPC. This will free() the description and buffer.data block struct members, so only do it after you're done with those!
status ns_rpc_data_computeOnEVB (const dataBlock * in_block, dataBlock * result_block)
status ns_rpc_data_fetchBlockFromEVB (dataBlock * block)
status ns_rpc_data_sendBlockToEVB (const dataBlock * block)
uint16_t ns_rpc_genericDataOperationsClient_reset (ns_rpc_config_t * cfg)
uint16_t ns_rpc_genericDataOperations_init (ns_rpc_config_t * cfg)
Initialize the GenericDataOperations RPC system.
void ns_rpc_genericDataOperations_pollServer (ns_rpc_config_t * cfg)
Polls the server for incoming RPC calls. Must be called to handle incoming RPC calls (for example, when a USB or timer event occurs)
void ns_rpc_genericDataOperations_printDatablock (const dataBlock * block)
Helper function for printing a block's contents.

Macros

Type Name
define NS_RPC_GENERIC_DATA

Public Attributes Documentation

variable g_RpcGenericDataConfig

ns_rpc_config_t g_RpcGenericDataConfig;

variable g_RpcGenericUSBHandle

ns_usb_config_t g_RpcGenericUSBHandle;

variable ns_rpc_gdo_V0_0_1

const ns_core_api_t ns_rpc_gdo_V0_0_1;

variable ns_rpc_gdo_V1_0_0

const ns_core_api_t ns_rpc_gdo_V1_0_0;

variable ns_rpc_gdo_current_version

const ns_core_api_t ns_rpc_gdo_current_version;

variable ns_rpc_gdo_oldest_supported_version

const ns_core_api_t ns_rpc_gdo_oldest_supported_version;

Public Functions Documentation

function ns_rpc_data_clientDoneWithBlockFromPC

Helper function to be called after processing the block from ns_rpc_data_fetchBlockFromPC or result block from ns_rpc_data_computeOnPC. This will free() the description and buffer.data block struct members, so only do it after you're done with those!

void ns_rpc_data_clientDoneWithBlockFromPC (
    const dataBlock * block
) 

Parameters:

  • block Block to be freed

function ns_rpc_data_computeOnEVB

status ns_rpc_data_computeOnEVB (
    const dataBlock * in_block,
    dataBlock * result_block
) 

function ns_rpc_data_fetchBlockFromEVB

status ns_rpc_data_fetchBlockFromEVB (
    dataBlock * block
) 

function ns_rpc_data_sendBlockToEVB

status ns_rpc_data_sendBlockToEVB (
    const dataBlock * block
) 

function ns_rpc_genericDataOperationsClient_reset

uint16_t ns_rpc_genericDataOperationsClient_reset (
    ns_rpc_config_t * cfg
) 

function ns_rpc_genericDataOperations_init

Initialize the GenericDataOperations RPC system.

uint16_t ns_rpc_genericDataOperations_init (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

Returns:

uint16_t Status

function ns_rpc_genericDataOperations_pollServer

Polls the server for incoming RPC calls. Must be called to handle incoming RPC calls (for example, when a USB or timer event occurs)

void ns_rpc_genericDataOperations_pollServer (
    ns_rpc_config_t * cfg
) 

Parameters:

  • cfg

function ns_rpc_genericDataOperations_printDatablock

Helper function for printing a block's contents.

void ns_rpc_genericDataOperations_printDatablock (
    const dataBlock * block
) 

Parameters:

  • block to be printed

Macro Definition Documentation

define NS_RPC_GENERIC_DATA

#define NS_RPC_GENERIC_DATA 

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-rpc/src/ns_rpc_generic_data.c