Mercurial > public > ostc4
comparison Small_CPU/Src/spi.c @ 88:3db7389d49cc kittz
revert
author | Dmitry Romanov <kitt@bk.ru> |
---|---|
date | Thu, 22 Nov 2018 12:02:55 +0300 |
parents | 923c4566a2a1 |
children | ff7775cc34c4 |
comparison
equal
deleted
inserted
replaced
87:e746bf846638 | 88:3db7389d49cc |
---|---|
138 hspi1.Init.Direction = SPI_DIRECTION_2LINES; | 138 hspi1.Init.Direction = SPI_DIRECTION_2LINES; |
139 hspi1.Init.DataSize = SPI_DATASIZE_8BIT; | 139 hspi1.Init.DataSize = SPI_DATASIZE_8BIT; |
140 hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; | 140 hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; |
141 hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; | 141 hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; |
142 hspi1.Init.NSS = SPI_NSS_HARD_INPUT;//SPI_NSS_SOFT; | 142 hspi1.Init.NSS = SPI_NSS_HARD_INPUT;//SPI_NSS_SOFT; |
143 hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64; | 143 hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128; |
144 hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; | 144 hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; |
145 hspi1.Init.TIMode = SPI_TIMODE_DISABLED; | 145 hspi1.Init.TIMode = SPI_TIMODE_DISABLED; |
146 hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;//_DISABLED; _ENABLED; | 146 hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;//_DISABLED; _ENABLED; |
147 hspi1.Init.CRCPolynomial = 7; | 147 hspi1.Init.CRCPolynomial = 7; |
148 HAL_SPI_Init(&hspi1); | 148 HAL_SPI_Init(&hspi1); |
186 hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE; | 186 hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE; |
187 hdma_tx.Init.MemInc = DMA_MINC_ENABLE; | 187 hdma_tx.Init.MemInc = DMA_MINC_ENABLE; |
188 hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; | 188 hdma_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; |
189 hdma_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; | 189 hdma_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; |
190 hdma_tx.Init.Mode = DMA_NORMAL; | 190 hdma_tx.Init.Mode = DMA_NORMAL; |
191 hdma_tx.Init.Priority = DMA_PRIORITY_VERY_HIGH; | 191 hdma_tx.Init.Priority = DMA_PRIORITY_LOW; |
192 hdma_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; | 192 hdma_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; |
193 hdma_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; | 193 hdma_tx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; |
194 hdma_tx.Init.MemBurst = DMA_MBURST_INC4; | 194 hdma_tx.Init.MemBurst = DMA_MBURST_INC4; |
195 hdma_tx.Init.PeriphBurst = DMA_PBURST_INC4; | 195 hdma_tx.Init.PeriphBurst = DMA_PBURST_INC4; |
196 | 196 |
367 global.dataSendToSlaveIsValid = 0; | 367 global.dataSendToSlaveIsValid = 0; |
368 global.dataSendToSlaveIsNotValidCount++; | 368 global.dataSendToSlaveIsNotValidCount++; |
369 } | 369 } |
370 global.dataSendToMaster.power_on_reset = 0; | 370 global.dataSendToMaster.power_on_reset = 0; |
371 global.deviceDataSendToMaster.power_on_reset = 0; | 371 global.deviceDataSendToMaster.power_on_reset = 0; |
372 // if(global.dataUpdateIsNeeded) | 372 if(!global.dataSendToSlaveStopEval) |
373 // { | 373 { |
374 scheduleSpecial_Evaluate_DataSendToSlave(); | 374 scheduleSpecial_Evaluate_DataSendToSlave(); |
375 // global.dataUpdateIsNeeded=0; | 375 } |
376 // } | |
377 SPI_Start_single_TxRx_with_Master(); | 376 SPI_Start_single_TxRx_with_Master(); |
378 } | 377 } |
379 } | 378 } |
380 | 379 |
381 | 380 |