AFBR-S50 API Reference Manual v1.5.6
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
Loading...
Searching...
No Matches
sci.h File Reference

SCI: The main interface. More...

#include "sci_status.h"
#include "sci_frame.h"
Include dependency graph for sci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEVICEID_DEFAULT   0
 
#define DEVICEID_FIRST_VALID   1
 

Typedefs

typedef uint8_t sci_cmd_t
 
typedef uint32_t sci_param_t
 
typedef void const * sci_data_t
 
typedef uint8_t sci_device_t
 
typedef status_t(* sci_rx_cmd_fct_t) (sci_device_t deviceID, sci_frame_t *frame)
 Received command invocation function definition.
 
typedef status_t(* sci_tx_cmd_fct_t) (sci_device_t deviceID, sci_frame_t *frame, sci_param_t param, sci_data_t data)
 Transmitting command function definition.
 
typedef status_t(* sci_rx_cmd_cb_t) (sci_frame_t *frame)
 Callback function type for received SCI data frames.
 
typedef void(* sci_error_cb_t) (status_t status)
 Callback function type for SCI error.
 

Functions

status_t SCI_Init (void)
 Initialize the SCI module.
 
void SCI_SetRxCommandCallback (sci_rx_cmd_cb_t cb)
 Installs a callback routine for command received event.
 
void SCI_RemoveRxCommandCallback (void)
 Removes the previously installed callback function.
 
void SCI_SetErrorCallback (sci_error_cb_t cb)
 Installs a callback routine for the error event.
 
void SCI_RemoveErrorCallback (void)
 Removes the previously installed callback function.
 
status_t SCI_SendCommand (sci_device_t deviceID, sci_cmd_t cmd, sci_param_t param, sci_data_t data)
 Sends a command via the SCI module.
 
status_t SCI_SetRxCommand (sci_cmd_t cmd, sci_rx_cmd_fct_t fct)
 Sets a Rx command function in the list of available commands.
 
status_t SCI_SetPostRxCommand (sci_cmd_t cmd, sci_rx_cmd_fct_t rxfct, sci_rx_cmd_fct_t pfct)
 Sets Rx and post Rx command functions in the list of available commands.
 
status_t SCI_SetTxCommand (sci_cmd_t cmd, sci_tx_cmd_fct_t txfct)
 Sets a Tx command function in the list of available commands.
 
status_t SCI_SetRxTxCommand (sci_cmd_t cmd, sci_rx_cmd_fct_t rxfct, sci_tx_cmd_fct_t txfct)
 Sets the Rx and Tx command functions in the list of available commands.
 
status_t SCI_SetCommand (sci_cmd_t cmd, sci_rx_cmd_fct_t rxfct, sci_tx_cmd_fct_t txfct, sci_rx_cmd_fct_t pfct)
 Sets the Rx and Tx command functions in the list of available commands.
 
status_t SCI_UnsetCommand (sci_cmd_t cmd)
 Unsets a command from the list of available commands.
 
status_t SCI_InvokeRxCommand (sci_frame_t *frame)
 Invokes the previously received user command.
 

Detailed Description

SCI: The main interface.

This file provides an interface for the systems communication interface.

Copyright (c) 2023, Broadcom Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.