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

SCI Layer 3: Command (Message) Module. More...

#include "sci_cmd.h"
#include "sci.h"
#include "sci_datalink.h"
#include "board/board.h"
#include "utility/time.h"
Include dependency graph for sci_cmd.c:

Functions

status_t GetSystemStatus (sci_device_t deviceID)
 Returns the current system status.
 
status_t SCI_CMD_Init (void)
 Initialize the serial commands module.
 
static status_t RxCmd_Ping (sci_device_t deviceID, sci_frame_t *frame)
 Receiving Ping Command.
 
static status_t RxCmd_TestMessage (sci_device_t deviceID, sci_frame_t *frame)
 Receiving Test Message Command.
 
static status_t TxCmd_TestMessage (sci_device_t deviceID, sci_frame_t *frame, sci_param_t param, sci_frame_t *msg)
 Sending Test Message Command.
 
static status_t RxCmd_StatusReport (sci_device_t deviceID, sci_frame_t *frame)
 Receiving Status Report Request Command.
 
static status_t TxCmd_StatusReport (sci_device_t deviceID, sci_frame_t *frame, sci_param_t param, status_t const *status)
 Receiving Test Message Command.
 
static status_t RxCmd_SystemReset (sci_device_t deviceID, sci_frame_t *frame)
 Receiving MCU Reset Command.
 
status_t SCI_SendStatusReport (sci_device_t deviceID, status_t status)
 Sends an status report.
 
static status_t PrxCmd_SystemReset (sci_device_t deviceID, sci_frame_t *frame)
 

Detailed Description

SCI Layer 3: Command (Message) Module.

This file provides command definitions 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.

Function Documentation

◆ GetSystemStatus()

status_t GetSystemStatus ( sci_device_t  deviceID)
extern

Returns the current system status.


Overwrites the weak definition on "sci_cmd.c".

Parameters
deviceIDThe device ID to query for status.
Returns
Returns the current system status.

◆ PrxCmd_SystemReset()

static status_t PrxCmd_SystemReset ( sci_device_t  deviceID,
sci_frame_t frame 
)
static

◆ RxCmd_Ping()

static status_t RxCmd_Ping ( sci_device_t  deviceID,
sci_frame_t frame 
)
static

Receiving Ping Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
Returns
Returns the status (STATUS_OK on success).

◆ RxCmd_StatusReport()

static status_t RxCmd_StatusReport ( sci_device_t  deviceID,
sci_frame_t frame 
)
static

Receiving Status Report Request Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
Returns
Returns the status (STATUS_OK on success).

◆ RxCmd_SystemReset()

static status_t RxCmd_SystemReset ( sci_device_t  deviceID,
sci_frame_t frame 
)
static

Receiving MCU Reset Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
Returns
Returns the status (STATUS_OK on success).

◆ RxCmd_TestMessage()

static status_t RxCmd_TestMessage ( sci_device_t  deviceID,
sci_frame_t frame 
)
static

Receiving Test Message Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
Returns
Returns the status (STATUS_OK on success).

◆ SCI_CMD_Init()

status_t SCI_CMD_Init ( void  )

Initialize the serial commands module.


Returns
Returns the status (STATUS_OK on success).

◆ TxCmd_StatusReport()

static status_t TxCmd_StatusReport ( sci_device_t  deviceID,
sci_frame_t frame,
sci_param_t  param,
status_t const *  status 
)
static

Receiving Test Message Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
paramNo used!
statusPointer to status to be sent.
Returns
Returns the status (STATUS_OK on success).

◆ TxCmd_TestMessage()

static status_t TxCmd_TestMessage ( sci_device_t  deviceID,
sci_frame_t frame,
sci_param_t  param,
sci_frame_t msg 
)
static

Sending Test Message Command.


Parameters
deviceIDThe slave ID of the sensor handler to process the command.
framePointer to data frame.
paramNo used!
msgPointer to the message to be sent.
Returns
Returns the status (STATUS_OK on success).