Data Structures | Macros | Typedefs | Enumerations | Functions
app_spi.h File Reference

Header file containing functions prototypes of SPI app library. More...

`#include "gr55xx_hal.h"`
`#include "app_io.h"`
`#include "app_drv_error.h"`
`#include "app_rtos_cfg.h"`

Go to the source code of this file.

## Data Structures
struct | app_spi_pin_t
| SPI IO Structures. More...
struct | app_spi_pin_cfg_t
| SPI IO configuration Structures. More...
struct | app_spi_mode_t
| SPI operate mode Enumerations definition. More...
struct | app_spi_params_t
| SPI parameters structure definition. More...
struct | app_spi_evt_t
| SPI event structure definition. More...

## Macros
#define | APP_SPI_PIN_ENABLE 1
#define | APP_SPI_PIN_DISABLE 0

## Typedefs
typedef void(* | app_spi_evt_handler_t) (app_spi_evt_t *p_evt)
| SPI event callback definition.

## Enumerations
enum | app_spi_id_t { APP_SPI_ID_SLAVE, APP_SPI_ID_MASTER, APP_SPI_ID_MAX }
| SPI module Enumerations definition. More...
enum | app_spi_type_t { APP_SPI_TYPE_INTERRUPT, APP_SPI_TYPE_POLLING, APP_SPI_TYPE_DMA, APP_SPI_TYPE_MAX }
| SPI operating mode Enumerations definition. More...
enum | app_spi_evt_type_t { APP_SPI_EVT_ERROR, APP_SPI_EVT_TX_CPLT, APP_SPI_EVT_RX_DATA, APP_SPI_EVT_TX_RX }
| SPI event Enumerations definition. More...

## Functions
uint16_t | app_spi_init (app_spi_params_t *p_params, app_spi_evt_handler_t evt_handler)
| Initialize the APP SPI DRIVER according to the specified parameters in the app_spi_params_t and app_spi_evt_handler_t. More...
uint16_t | app_spi_deinit (app_spi_id_t id)
| De-initialize the APP SPI DRIVER peripheral. More...
uint16_t | app_spi_receive_sync (app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
| Receive in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_spi_receive_async (app_spi_id_t id, uint8_t *p_data, uint16_t size)
| Receive in master or slave mode an amount of data in non-blocking mode with Interrupt. More...
uint16_t | app_spi_transmit_sync (app_spi_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
| Transmits in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_spi_transmit_async (app_spi_id_t id, uint8_t *p_data, uint16_t size)
| Transmits in master or slave mode an amount of data in non-blocking mode with Interrupt. More...
uint16_t | app_spi_transmit_receive_sync (app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size, uint32_t timeout)
| Transmits and receive in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_spi_transmit_receive_async (app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t size)
| Transmits and receive in master or slave mode an amount of data in non-blocking mode with Interrupt. More...
uint16_t | app_spi_read_eeprom_sync (app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size, uint32_t timeout)
| Read an amount of data from EEPROM in blocking mode. More...
uint16_t | app_spi_read_eeprom_async (app_spi_id_t id, uint8_t *p_tx_data, uint8_t *p_rx_data, uint32_t tx_size, uint32_t rx_size)
| Read an amount of data from EEPROM in non-blocking mode with Interrupt. More...
uint16_t | app_spi_write_memory_async (app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_tx_data, uint32_t cmd_size, uint32_t tx_size)
| Transmits in master or slave mode an amount of data in non-blocking mode with DMA. More...
uint16_t | app_spi_read_memory_async (app_spi_id_t id, uint8_t *p_cmd_data, uint8_t *p_rx_data, uint32_t cmd_size, uint32_t rx_size)
| Read an amount of data from EEPROM in non-blocking mode with DMA. More...
spi_handle_t * | app_spi_get_handle (app_spi_id_t id)
| Return the SPI handle. More...
uint16_t | app_spi_receive_high_speed_sync (app_spi_id_t id, uint8_t *p_data, uint16_t size)
| [High speed] Receive in master or slave mode an amount of data in blocking mode. More...
uint16_t | app_spi_transmit_high_speed_sync (app_spi_id_t id, uint8_t *p_data, uint16_t size)
| [High speed] Transmit in master or slave mode an amount of data in blocking mode. More...

## Detailed Description

Header file containing functions prototypes of SPI app library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 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. Neither the name of GOODIX 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 COPYRIGHT HOLDERS AND 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.