Lines Matching full:spi

23 	SPI_TypeDef *spi;  member
75 static inline uint32_t ll_func_dma_get_reg_addr(SPI_TypeDef *spi, uint32_t location) in ll_func_dma_get_reg_addr() argument
80 return (uint32_t)&(spi->TXDR); in ll_func_dma_get_reg_addr()
83 return (uint32_t)&(spi->RXDR); in ll_func_dma_get_reg_addr()
86 return (uint32_t)LL_SPI_DMA_GetRegAddr(spi); in ll_func_dma_get_reg_addr()
90 /* checks that DMA Tx packet is fully transmitted over the SPI */
91 static inline uint32_t ll_func_spi_dma_busy(SPI_TypeDef *spi) in ll_func_spi_dma_busy() argument
94 return LL_SPI_IsActiveFlag_TXC(spi); in ll_func_spi_dma_busy()
96 /* the SPI Tx empty and busy flags are needed */ in ll_func_spi_dma_busy()
97 return (LL_SPI_IsActiveFlag_TXE(spi) && in ll_func_spi_dma_busy()
98 !LL_SPI_IsActiveFlag_BSY(spi)); in ll_func_spi_dma_busy()
103 static inline uint32_t ll_func_tx_is_not_full(SPI_TypeDef *spi) in ll_func_tx_is_not_full() argument
106 return LL_SPI_IsActiveFlag_TXP(spi); in ll_func_tx_is_not_full()
108 return LL_SPI_IsActiveFlag_TXE(spi); in ll_func_tx_is_not_full()
112 static inline uint32_t ll_func_rx_is_not_empty(SPI_TypeDef *spi) in ll_func_rx_is_not_empty() argument
115 return LL_SPI_IsActiveFlag_RXP(spi); in ll_func_rx_is_not_empty()
117 return LL_SPI_IsActiveFlag_RXNE(spi); in ll_func_rx_is_not_empty()
121 static inline void ll_func_enable_int_tx_empty(SPI_TypeDef *spi) in ll_func_enable_int_tx_empty() argument
124 LL_SPI_EnableIT_TXP(spi); in ll_func_enable_int_tx_empty()
126 LL_SPI_EnableIT_TXE(spi); in ll_func_enable_int_tx_empty()
130 static inline void ll_func_enable_int_rx_not_empty(SPI_TypeDef *spi) in ll_func_enable_int_rx_not_empty() argument
133 LL_SPI_EnableIT_RXP(spi); in ll_func_enable_int_rx_not_empty()
135 LL_SPI_EnableIT_RXNE(spi); in ll_func_enable_int_rx_not_empty()
139 static inline void ll_func_enable_int_errors(SPI_TypeDef *spi) in ll_func_enable_int_errors() argument
142 LL_SPI_EnableIT_UDR(spi); in ll_func_enable_int_errors()
143 LL_SPI_EnableIT_OVR(spi); in ll_func_enable_int_errors()
144 LL_SPI_EnableIT_CRCERR(spi); in ll_func_enable_int_errors()
145 LL_SPI_EnableIT_FRE(spi); in ll_func_enable_int_errors()
146 LL_SPI_EnableIT_MODF(spi); in ll_func_enable_int_errors()
148 LL_SPI_EnableIT_ERR(spi); in ll_func_enable_int_errors()
152 static inline void ll_func_disable_int_tx_empty(SPI_TypeDef *spi) in ll_func_disable_int_tx_empty() argument
155 LL_SPI_DisableIT_TXP(spi); in ll_func_disable_int_tx_empty()
157 LL_SPI_DisableIT_TXE(spi); in ll_func_disable_int_tx_empty()
161 static inline void ll_func_disable_int_rx_not_empty(SPI_TypeDef *spi) in ll_func_disable_int_rx_not_empty() argument
164 LL_SPI_DisableIT_RXP(spi); in ll_func_disable_int_rx_not_empty()
166 LL_SPI_DisableIT_RXNE(spi); in ll_func_disable_int_rx_not_empty()
170 static inline void ll_func_disable_int_errors(SPI_TypeDef *spi) in ll_func_disable_int_errors() argument
173 LL_SPI_DisableIT_UDR(spi); in ll_func_disable_int_errors()
174 LL_SPI_DisableIT_OVR(spi); in ll_func_disable_int_errors()
175 LL_SPI_DisableIT_CRCERR(spi); in ll_func_disable_int_errors()
176 LL_SPI_DisableIT_FRE(spi); in ll_func_disable_int_errors()
177 LL_SPI_DisableIT_MODF(spi); in ll_func_disable_int_errors()
179 LL_SPI_DisableIT_ERR(spi); in ll_func_disable_int_errors()
183 static inline uint32_t ll_func_spi_is_busy(SPI_TypeDef *spi) in ll_func_spi_is_busy() argument
186 if (LL_SPI_GetTransferSize(spi) == 0) { in ll_func_spi_is_busy()
187 return LL_SPI_IsActiveFlag_TXC(spi) == 0; in ll_func_spi_is_busy()
189 return LL_SPI_IsActiveFlag_EOT(spi) == 0; in ll_func_spi_is_busy()
192 return LL_SPI_IsActiveFlag_BSY(spi); in ll_func_spi_is_busy()
197 * non-existing LL FIFO functions for SoC without SPI FIFO
200 static inline void ll_func_set_fifo_threshold_8bit(SPI_TypeDef *spi) in ll_func_set_fifo_threshold_8bit() argument
203 LL_SPI_SetFIFOThreshold(spi, LL_SPI_FIFO_TH_01DATA); in ll_func_set_fifo_threshold_8bit()
205 LL_SPI_SetRxFIFOThreshold(spi, LL_SPI_RX_FIFO_TH_QUARTER); in ll_func_set_fifo_threshold_8bit()
209 static inline void ll_func_set_fifo_threshold_16bit(SPI_TypeDef *spi) in ll_func_set_fifo_threshold_16bit() argument
212 LL_SPI_SetFIFOThreshold(spi, LL_SPI_FIFO_TH_02DATA); in ll_func_set_fifo_threshold_16bit()
214 LL_SPI_SetRxFIFOThreshold(spi, LL_SPI_RX_FIFO_TH_HALF); in ll_func_set_fifo_threshold_16bit()
219 static inline void ll_func_disable_spi(SPI_TypeDef *spi) in ll_func_disable_spi() argument
223 while (ll_func_rx_is_not_empty(spi)) { in ll_func_disable_spi()
224 (void) LL_SPI_ReceiveData8(spi); in ll_func_disable_spi()
228 LL_SPI_Disable(spi); in ll_func_disable_spi()
230 while (LL_SPI_IsEnabled(spi)) { in ll_func_disable_spi()