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

This file is part of the AFBR-S50 Explorer Application. More...

#include "sci.h"
#include "sci_datalink.h"
#include "sci_cmd.h"
#include "sci_handshaking.h"
#include "debug.h"
#include <assert.h>
Include dependency graph for sci.c:

Macros

#define SCI_MAX_COMMANDS   128u
 

Functions

status_t SCI_CMD_Init (void)
 Initialize the serial commands module.
 
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_SetRxCommand (sci_cmd_t cmd, sci_rx_cmd_fct_t rxfct)
 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.
 
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.
 

Variables

sci_rx_cmd_cb_t SCI_RxCallback
 
sci_error_cb_t SCI_ErrorCallback
 
static sci_cmd_ctrl_block_t myCCB [SCI_MAX_COMMANDS] = {{0}}
 

Detailed Description

This file is part of the AFBR-S50 Explorer Application.

This file implements the API of 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.

Macro Definition Documentation

◆ SCI_MAX_COMMANDS

#define SCI_MAX_COMMANDS   128u

Max. number of commands.

Function Documentation

◆ SCI_CMD_Init()

status_t SCI_CMD_Init ( void  )
extern

Initialize the serial commands module.


Returns
Returns the status (STATUS_OK on success).

Variable Documentation

◆ myCCB

sci_cmd_ctrl_block_t myCCB[SCI_MAX_COMMANDS] = {{0}}
static

The command control block buffer.

◆ SCI_ErrorCallback

sci_error_cb_t SCI_ErrorCallback
extern

Callback function pointer for error event.

◆ SCI_RxCallback

sci_rx_cmd_cb_t SCI_RxCallback
extern

Callback function pointer for received frame event.