Skip to content

Commit

Permalink
I SPI with my little eye (#74)
Browse files Browse the repository at this point in the history
* Tested implementation of SPI1 NonDMA/DMA

* Made ISR Simpler

---------

Co-authored-by: AdityaAsGithub <[email protected]>
  • Loading branch information
AdityaAsGithub and AdityaAsGithub authored Dec 6, 2023
1 parent 955c831 commit e4feb67
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 284 deletions.
4 changes: 1 addition & 3 deletions common/phal_F4_F7/dma/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ bool PHAL_initDMA(dma_init_t* init) {

// Set circular mode, direction, transfer error interrupt enable, and transfer complete interrupt enable
init->stream->CR |= (init->circular << DMA_SxCR_CIRC_Pos)
| (init->dir << DMA_SxCR_DIR_Pos) | (init->tx_isr_en << DMA_SxCR_TCIE_Pos) | DMA_SxCR_TEIE;
| (init->dir << DMA_SxCR_DIR_Pos) | (init->tx_isr_en << DMA_SxCR_TCIE_Pos) | (init->tx_isr_en << DMA_SxCR_TEIE_Pos) ;

// Set stream memory configuration
PHAL_DMA_setTxferLength(init, init->tx_size);

// Active the stream
init->stream->CR |= (DMA_SxCR_EN);
return true;
}

Expand Down
Loading

0 comments on commit e4feb67

Please sign in to comment.