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

This file is part of the AFBR-S50 API. More...

#include "api/argus_def.h"
Include dependency graph for argus_s2pi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef status_t(* s2pi_callback_t) (status_t status, void *param)
 S2PI layer callback function type for the SPI transfer completed event.
 
typedef void(* s2pi_irq_callback_t) (void *param)
 S2PI layer callback function type for the GPIO interrupt event.
 
typedef int32_t s2pi_slave_t
 

Enumerations

enum  s2pi_pin_t {
  S2PI_CLK ,
  S2PI_CS ,
  S2PI_MOSI ,
  S2PI_MISO ,
  S2PI_IRQ
}
 

Functions

status_t S2PI_GetStatus (s2pi_slave_t slave)
 Returns the status of the SPI module.
 
status_t S2PI_TryGetMutex (s2pi_slave_t slave)
 Tries to grab the SPI interface mutex for the next transfer.
 
void S2PI_ReleaseMutex (s2pi_slave_t slave)
 Releases the SPI interface mutex.
 
status_t S2PI_TransferFrame (s2pi_slave_t slave, uint8_t const *txData, uint8_t *rxData, size_t frameSize, s2pi_callback_t callback, void *callbackData)
 Transfers a single SPI frame asynchronously.
 
status_t S2PI_Abort (s2pi_slave_t slave)
 Terminates a currently ongoing asynchronous SPI transfer.
 
status_t S2PI_SetIrqCallback (s2pi_slave_t slave, s2pi_irq_callback_t callback, void *callbackData)
 Set a callback for the GPIO IRQ for a specified S2PI slave.
 
uint32_t S2PI_ReadIrqPin (s2pi_slave_t slave)
 Reads the current interrupt pending status of the IRQ pin.
 
status_t S2PI_CycleCsPin (s2pi_slave_t slave)
 Cycles the chip select line.
 
status_t S2PI_CaptureGpioControl (s2pi_slave_t slave)
 Captures the S2PI pins for GPIO usage.
 
status_t S2PI_ReleaseGpioControl (s2pi_slave_t slave)
 Releases the S2PI pins from GPIO usage and switches back to SPI mode.
 
status_t S2PI_WriteGpioPin (s2pi_slave_t slave, s2pi_pin_t pin, uint32_t value)
 Writes the output for a specified SPI pin in GPIO mode.
 
status_t S2PI_ReadGpioPin (s2pi_slave_t slave, s2pi_pin_t pin, uint32_t *value)
 Reads the input from a specified SPI pin in GPIO mode.
 

Detailed Description

This file is part of the AFBR-S50 API.

This file provides an interface for the required S2PI module.

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.