Lines Matching refs:SpiHandle

29 static SPI_HandleTypeDef SpiHandle[2];  variable
43 SpiHandle[spiId].Instance = ( SPI_TypeDef* )SPI1_BASE; in SpiInit()
56 SpiHandle[spiId].Instance = ( SPI_TypeDef* )SPI2_BASE; in SpiInit()
66 SpiHandle[spiId].Init.NSS = SPI_NSS_SOFT; in SpiInit()
75 HAL_SPI_Init( &SpiHandle[spiId] ); in SpiInit()
82 HAL_SPI_DeInit( &SpiHandle[obj->SpiId] ); in SpiDeInit()
92 SpiHandle[obj->SpiId].Init.Direction = SPI_DIRECTION_2LINES; in SpiFormat()
95 SpiHandle[obj->SpiId].Init.DataSize = SPI_DATASIZE_8BIT; in SpiFormat()
99 SpiHandle[obj->SpiId].Init.DataSize = SPI_DATASIZE_16BIT; in SpiFormat()
101 SpiHandle[obj->SpiId].Init.CLKPolarity = cpol; in SpiFormat()
102 SpiHandle[obj->SpiId].Init.CLKPhase = cpha; in SpiFormat()
103 SpiHandle[obj->SpiId].Init.FirstBit = SPI_FIRSTBIT_MSB; in SpiFormat()
104 SpiHandle[obj->SpiId].Init.TIMode = SPI_TIMODE_DISABLE; in SpiFormat()
105 SpiHandle[obj->SpiId].Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; in SpiFormat()
106 SpiHandle[obj->SpiId].Init.CRCPolynomial = 7; in SpiFormat()
110 SpiHandle[obj->SpiId].Init.Mode = SPI_MODE_MASTER; in SpiFormat()
114 SpiHandle[obj->SpiId].Init.Mode = SPI_MODE_SLAVE; in SpiFormat()
139 SpiHandle[obj->SpiId].Init.BaudRatePrescaler = baudRate; in SpiFrequency()
146 if( ( obj == NULL ) || ( SpiHandle[obj->SpiId].Instance ) == NULL ) in SpiInOut()
151 __HAL_SPI_ENABLE( &SpiHandle[obj->SpiId] ); in SpiInOut()
155 while( __HAL_SPI_GET_FLAG( &SpiHandle[obj->SpiId], SPI_FLAG_TXE ) == RESET ); in SpiInOut()
156 SpiHandle[obj->SpiId].Instance->DR = ( uint16_t ) ( outData & 0xFF ); in SpiInOut()
158 while( __HAL_SPI_GET_FLAG( &SpiHandle[obj->SpiId], SPI_FLAG_RXNE ) == RESET ); in SpiInOut()
159 rxData = ( uint16_t ) SpiHandle[obj->SpiId].Instance->DR; in SpiInOut()