Initialize other pheripherals
This commit is contained in:
parent
ec4df11c61
commit
ffec0e2b57
69 changed files with 25802 additions and 620 deletions
|
@ -16,6 +16,12 @@
|
|||
#ifndef DIAG_RX_BUFFER_SWITCH
|
||||
# define DIAG_RX_BUFFER_SWITCH(x)
|
||||
#endif
|
||||
#ifndef DIAG_INTERRUPT_IN
|
||||
# define DIAG_INTERRUPT_IN()
|
||||
#endif
|
||||
#ifndef DIAG_INTERRUPT_OUT
|
||||
# define DIAG_INTERRUPT_OUT()
|
||||
#endif
|
||||
|
||||
|
||||
void InitUartStatus(
|
||||
|
@ -140,6 +146,7 @@ void RxCrcComputedCallback(void *callbackParm, uint32_t calculatedCrc, uint8_t s
|
|||
|
||||
void HandleUsartRxDmaIrq(UARTSTATUS *status)
|
||||
{
|
||||
DIAG_INTERRUPT_IN();
|
||||
StatsIncRcvd(&status->stats);
|
||||
if(*status->rxDmaInfo.isReg & status->rxDmaInfo.tcMask) {
|
||||
*status->rxDmaInfo.ifcReg = status->rxDmaInfo.tcMask;
|
||||
|
@ -163,10 +170,12 @@ void HandleUsartRxDmaIrq(UARTSTATUS *status)
|
|||
if(status->rxBuffers[status->activeRxBuf].busy)
|
||||
StatsIncOverrun(&status->stats);
|
||||
SetupReceive(status);
|
||||
DIAG_INTERRUPT_OUT();
|
||||
}
|
||||
|
||||
void HandleUsartTxDmaIrq(UARTSTATUS *status)
|
||||
{
|
||||
DIAG_INTERRUPT_IN();
|
||||
if(*status->txDmaInfo.isReg & status->txDmaInfo.tcMask) { // DMA transfer complete
|
||||
*status->txDmaInfo.ifcReg = status->txDmaInfo.tcMask;
|
||||
LL_USART_EnableIT_TC(status->uart);
|
||||
|
@ -183,11 +192,12 @@ void HandleUsartTxDmaIrq(UARTSTATUS *status)
|
|||
*status->txDmaInfo.ifcReg = status->txDmaInfo.htMask;
|
||||
if(*status->txDmaInfo.isReg & status->txDmaInfo.dmeMask)
|
||||
*status->txDmaInfo.ifcReg = status->txDmaInfo.dmeMask;
|
||||
|
||||
DIAG_INTERRUPT_OUT();
|
||||
}
|
||||
|
||||
void HandleUsartIrq(UARTSTATUS *status)
|
||||
{
|
||||
DIAG_INTERRUPT_IN();
|
||||
if(LL_USART_IsActiveFlag_IDLE(status->uart) && LL_USART_IsEnabledIT_IDLE(status->uart)) { // receiver idle
|
||||
LL_USART_ClearFlag_IDLE(status->uart);
|
||||
uint16_t rcvdLen = status->rxBuffers[status->activeRxBuf].requestedLength - LL_DMA_GetDataLength(status->rxDmaInfo.dma, status->rxDmaInfo.stream);
|
||||
|
@ -210,5 +220,6 @@ void HandleUsartIrq(UARTSTATUS *status)
|
|||
LL_USART_EnableDirectionTx(status->uart);
|
||||
status->txBuffer.busy = 0;
|
||||
}
|
||||
DIAG_INTERRUPT_OUT();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue