gr55xx_ll_dspi.h File Reference

Header file containing functions prototypes of DSPI LL library. More...

#include "gr55xx.h"

Go to the source code of this file.

Classes

struct  _ll_dspi_init_t
 DSPI init structures definition. More...
 

Macros

#define LL_DSPI_SR_FFE   DSPI_STAT_FRE
 
#define LL_DSPI_SR_BUSY   DSPI_STAT_BUSY
 
#define LL_DSPI_SR_OVR   DSPI_STAT_OVR
 
#define LL_DSPI_SR_MODF   DSPI_STAT_MODF
 
#define LL_DSPI_SR_TFE   DSPI_STAT_TXE
 
#define LL_DSPI_SR_RFNE   DSPI_STAT_RXNE
 
#define LL_DSPI_SR_ALL
 
#define LL_DSPI_IM_TXE   DSPI_CR2_TXEIE
 
#define LL_DSPI_IM_RXNE   DSPI_CR2_RXNEIE
 
#define LL_DSPI_IM_ER   DSPI_CR2_ERRIE
 
#define LL_DSPI_PROT_MODE_SPI   (0UL << DSPI_MODE_SPIMODE_Pos)
 
#define LL_DSPI_PROT_MODE_3W1L   (1UL << DSPI_MODE_SPIMODE_Pos)
 
#define LL_DSPI_PROT_MODE_4W1L   (2UL << DSPI_MODE_SPIMODE_Pos)
 
#define LL_DSPI_PROT_MODE_4W2L   (3UL << DSPI_MODE_SPIMODE_Pos)
 
#define LL_DSPI_TF_MSB_FIRST   (0x0)
 
#define LL_DSPI_TF_LSB_FIRST   DSPI_CR1_LSBFIRST
 
#define LL_DSPI_DATASIZE_4BIT   (3UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_5BIT   (4UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_6BIT   (5UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_7BIT   (6UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_8BIT   (7UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_9BIT   (8UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_10BIT   (9UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_11BIT   (10UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_12BIT   (11UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_13BIT   (12UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_14BIT   (13UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_15BIT   (14UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_16BIT   (15UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_17BIT   (16UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_18BIT   (17UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_19BIT   (18UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_20BIT   (19UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_21BIT   (20UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_22BIT   (21UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_23BIT   (22UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_24BIT   (23UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_25BIT   (24UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_26BIT   (25UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_27BIT   (26UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_28BIT   (27UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_29BIT   (28UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_30BIT   (29UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_31BIT   (30UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_DATASIZE_32BIT   (31UL << DSPI_CR2_DS_Pos)
 
#define LL_DSPI_BIDIMODE_2L_UNBID   0x00000000UL
 
#define LL_DSPI_BIDIMODE_1L_BID   DSPI_CR1_BIDIDE
 
#define LL_DSPI_2L_FULL_DUPLEX   0x00000000UL
 
#define LL_DSPI_2L_SIMPLEX_RX   DSPI_CR1_RXONLY
 
#define LL_DSPI_1L_SIMPLEX_RX   0x00000000UL
 
#define LL_DSPI_1L_SIMPLEX_TX   DSPI_CR1_BIDIOE
 
#define LL_DSPI_BAUD_RATE_2P1PCLK   (0x0 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_4P1PCLK   (0x1 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_8P1PCLK   (0x2 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_16P1PCLK   (0x3 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_32P1PCLK   (0x4 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_64P1PCLK   (0x5 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_128P1PCLK   (0x6 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_BAUD_RATE_256PCLK   (0x7 << DSPI_CR1_BAUD_Pos)
 
#define LL_DSPI_SCPHA_1EDGE   0x00000000UL
 
#define LL_DSPI_SCPHA_2EDGE   (DSPI_CR1_CPHA)
 
#define LL_DSPI_SCPOL_LOW   0x00000000UL
 
#define LL_DSPI_SCPOL_HIGH   (DSPI_CR1_CPOL)
 
#define LL_DSPI_DMA_TX_DIS   0x00000000UL
 
#define LL_DSPI_DMA_TX_EN   DSPI_CR2_TXDMAEN
 
#define LL_DSPI_DMA_RX_DIS   0x00000000UL
 
#define LL_DSPI_DMA_RX_EN   DSPI_CR2_RXDMAEN
 
#define LL_DSPI_DMA_LTX_EVEN   0x00000000UL
 
#define LL_DSPI_DMA_LTX_ODD   DSPI_CR2_LDMA_TX
 
#define LL_DSPI_DMA_LRX_EVEN   0x00000000UL
 
#define LL_DSPI_DMA_LRX_ODD   DSPI_CR2_LDMA_RX
 
#define LL_DSPI_FRXTH_1P2   DSPI_CR1_FIFOTH_8
 
#define LL_DSPI_FRXTH_1P4   DSPI_CR1_FIFOTH_4
 
#define LL_DSPI_FRXTH_1P8   DSPI_CR1_FIFOTH_2
 
#define LL_DSPI_FRXTH_1P16   DSPI_CR1_FIFOTH_1
 
#define LL_DSPI_DCX_CMD   0x00000000UL
 
#define LL_DSPI_DCX_DATA   (DSPI_MODE_DCX)
 
#define LL_DSPI_DEFAULT_CONFIG
 LL DSPI InitStrcut default configuartion. More...
 
#define LL_DSPI_WriteReg(__instance__, __REG__, __VALUE__)   WRITE_REG(__instance__->__REG__, (__VALUE__))
 Write a value in DSPI register. More...
 
#define LL_DSPI_ReadReg(__instance__, __REG__)   READ_REG(__instance__->__REG__)
 Read a value in DSPI register. More...
 

Typedefs

typedef struct _ll_dspi_init_t ll_dspi_init_t
 DSPI init structures definition. More...
 

Functions

__STATIC_INLINE void ll_dspi_enable (dspi_regs_t *DSPIx)
 Enable DSPI peripheral. More...
 
__STATIC_INLINE void ll_dspi_disable (dspi_regs_t *DSPIx)
 Disable DSPI peripheral. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_enabled (dspi_regs_t *DSPIx)
 Check if DSPI peripheral is enabled. More...
 
__STATIC_INLINE void ll_dspi_set_clock_polarity (dspi_regs_t *DSPIx, uint32_t clock_polarity)
 Set clock polarity. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_clock_polarity (dspi_regs_t *DSPIx)
 Get clock polarity. More...
 
__STATIC_INLINE void ll_dspi_set_clock_phase (dspi_regs_t *DSPIx, uint32_t clock_phase)
 Set clock phase. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_clock_phase (dspi_regs_t *DSPIx)
 Get clock phase. More...
 
__STATIC_INLINE void ll_dspi_set_frame_format (dspi_regs_t *DSPIx, uint32_t frf)
 Set data frame format for transmitting/receiving the data. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_frame_format (dspi_regs_t *DSPIx)
 Get data frame format for transmitting/receiving the data. More...
 
__STATIC_INLINE void ll_dspi_set_data_size (dspi_regs_t *DSPIx, uint32_t size)
 Set frame data size. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_data_size (dspi_regs_t *DSPIx)
 Get frame data size. More...
 
__STATIC_INLINE void ll_dspi_set_baud_rate (dspi_regs_t *DSPIx, uint32_t baud_rate)
 Set baud rate. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_baud_rate (dspi_regs_t *DSPIx)
 Get baud rate. More...
 
__STATIC_INLINE void ll_dspi_set_bidirectional_mode (dspi_regs_t *DSPIx, uint32_t bid_mode)
 Set bidirectional data mode enable. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_bidirectional_mode (dspi_regs_t *DSPIx)
 Get baud rate. More...
 
__STATIC_INLINE void ll_dspi_set_transfer_direction_bidirectional (dspi_regs_t *DSPIx, uint32_t transfer_direction)
 Set transfer direction mode in bidirectional mode. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_transfer_direction_bidirectional (dspi_regs_t *DSPIx)
 Get transfer direction mode in bidirectional mode. More...
 
__STATIC_INLINE void ll_dspi_set_transfer_direction_unbidirectional (dspi_regs_t *DSPIx, uint32_t transfer_direction)
 Set transfer direction mode in unbidirectional mode. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_transfer_direction_unbidirectional (dspi_regs_t *DSPIx)
 Get transfer direction mode in bidirectional mode. More...
 
__STATIC_INLINE void ll_dspi_set_rx_fifo_threshold (dspi_regs_t *DSPIx, uint32_t threshold)
 Set threshold of TXFIFO that triggers an TXE event. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_rx_fifo_threshold (dspi_regs_t *DSPIx)
 Get threshold of TXFIFO that triggers an TXE event. More...
 
__STATIC_INLINE void ll_dspi_flush_fifo (dspi_regs_t *DSPIx)
 FIFO Pointer Reset. More...
 
__STATIC_INLINE void ll_dspi_master_select (dspi_regs_t *DSPIx)
 Master selection. More...
 
__STATIC_INLINE void ll_dspi_set_last_dma_tx_packing (dspi_regs_t *DSPIx, uint32_t bid_mode)
 Last DMA transfer for transmission. More...
 
__STATIC_INLINE void ll_dspi_set_last_dma_rx_packing (dspi_regs_t *DSPIx, uint32_t bid_mode)
 Last DMA transfer for reception. More...
 
__STATIC_INLINE void ll_dspi_enable_dma_tx (dspi_regs_t *DSPIx)
 Enable DMA Tx. More...
 
__STATIC_INLINE void ll_dspi_disable_dma_tx (dspi_regs_t *DSPIx)
 Disable DMA Tx. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_enabled_dma_tx (dspi_regs_t *DSPIx)
 Check if DMA Tx is enabled. More...
 
__STATIC_INLINE void ll_dspi_enable_dma_rx (dspi_regs_t *DSPIx)
 Enable DMA Rx. More...
 
__STATIC_INLINE void ll_dspi_disable_dma_rx (dspi_regs_t *DSPIx)
 Disable DMA Rx. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_enabled_dma_rx (dspi_regs_t *DSPIx)
 Check if DMA Rx is enabled. More...
 
__STATIC_INLINE void ll_dspi_set_dcx (dspi_regs_t *DSPIx, uint32_t dcx)
 Value of Data-Versus-Command information. More...
 
__STATIC_INLINE void ll_dspi_set_mode (dspi_regs_t *DSPIx, uint32_t mode)
 DSPI Protocol Mode. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_mode (dspi_regs_t *DSPIx)
 Get DSPI Protocol Mode. More...
 
__STATIC_INLINE void ll_dspi_ss_out_enable (dspi_regs_t *DSPIx)
 SS output enable. More...
 
__STATIC_INLINE void ll_dspi_enable_it (dspi_regs_t *DSPIx, uint32_t mask)
 Enable interrupt. More...
 
__STATIC_INLINE void ll_dspi_disable_it (dspi_regs_t *DSPIx, uint32_t mask)
 Disable interrupt. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_enabled_it (dspi_regs_t *DSPIx, uint32_t mask)
 Check if interrupt is enabled. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_status (dspi_regs_t *DSPIx)
 Get DSPI status. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_active_flag (dspi_regs_t *DSPIx, uint32_t flag)
 Check active flag. More...
 
__STATIC_INLINE uint32_t ll_dspi_get_it_flag (dspi_regs_t *DSPIx)
 Get DSPI interrupt flags. More...
 
__STATIC_INLINE uint32_t ll_dspi_is_it_flag (dspi_regs_t *DSPIx, uint32_t flag)
 Check interrupt flag. More...
 
error_status_t ll_dspi_deinit (dspi_regs_t *DSPIx)
 De-initialize DSPI registers (Registers restored to their default values). More...
 
error_status_t ll_dspi_init (dspi_regs_t *DSPIx, ll_dspi_init_t *p_dspi_init)
 Initialize DSPI registers according to the specified parameters in p_dspi_init. More...
 
void ll_dspi_struct_init (ll_dspi_init_t *p_dspi_init)
 Set each field of a ll_dspi_init_t type structure to default value. More...
 

Detailed Description

Header file containing functions prototypes of DSPI LL 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.

Definition in file gr55xx_ll_dspi.h.