當前位置: 首頁>>代碼示例>>C++>>正文


C++ DMA_GetFlagStatus函數代碼示例

本文整理匯總了C++中DMA_GetFlagStatus函數的典型用法代碼示例。如果您正苦於以下問題:C++ DMA_GetFlagStatus函數的具體用法?C++ DMA_GetFlagStatus怎麽用?C++ DMA_GetFlagStatus使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DMA_GetFlagStatus函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DMA1_Stream4_IRQHandler

void DMA1_Stream4_IRQHandler(void) {
	if(DMA_GetFlagStatus(DMA1_Stream4, DMA_FLAG_TCIF4) == SET) {
		interruptDmaI2c_Tx();
		DMA_ClearFlag(DMA1_Stream4, DMA_FLAG_TCIF4);
	}
	return;
}
開發者ID:korrav,項目名稱:master_emmiter,代碼行數:7,代碼來源:stm32f4xx_it.c

示例2: DMA1_Stream5_IRQHandler

void DMA1_Stream5_IRQHandler(void) {
	if(DMA_GetFlagStatus(DMA1_Stream5, DMA_FLAG_TCIF5) == SET) {
		interruptDmaSpi();
		DMA_ClearFlag(DMA1_Stream5, DMA_FLAG_TCIF5);
	}
	return;
}
開發者ID:korrav,項目名稱:master_emmiter,代碼行數:7,代碼來源:stm32f4xx_it.c

示例3: WS2812_send2

/* This function sends data bytes out to a string of WS2812s
 * The first argument is a pointer to the first RGB triplet to be sent
 * The seconds argument is the number of LEDs in the chain
 *
 * This will result in the RGB triplet passed by argument 1 being sent to
 * the LED that is the furthest away from the controller (the point where
 * data is injected into the chain)
 */
void WS2812_send2(const uint8_t (*color)[3], const uint16_t _len)
{
	int i, j;
	uint8_t led;
	uint16_t memaddr;
	uint16_t buffersize;
	uint16_t len = _len;

	// Byte order mapping. 0 is red, 1 is green, 2 is blue
	const uint8_t pix_map[3] = {0, 2, 1};

	buffersize = (len*24);	// number of bytes needed is #LEDs * 24 bytes + 42 trailing bytes
	memaddr = 0;				// reset buffer memory index
	led = 0;					// reset led index

	// fill transmit buffer with correct compare values to achieve
	// correct pulse widths according to color values
	while (len)
	{
		for (i = 0; i < 3; i++)
		{
			for (j = 0; j < 8; j++)					// GREEN data
			{
				if ( (color[led][pix_map[i]]<<j) & 0x80 )	// data sent MSB first, j = 0 is MSB j = 7 is LSB
				{
					LED_BYTE_Buffer[memaddr] = TIM_COMPARE_LOGIC_1;	// compare value for logical 1
				}
				else
				{
					LED_BYTE_Buffer[memaddr] = TIM_COMPARE_LOGIC_0;		// compare value for logical 0
				}
				memaddr++;
			}
		}

		led++;
		len--;
	}

	LED_BYTE_Buffer[memaddr++] = 0;
	LED_BYTE_Buffer[memaddr++] = 0;


	DMA_SetCurrDataCounter(DMA_STREAM, buffersize + 2); 	// load number of bytes to be transferred

	// PAP: Clear the timer's counter and set the compare value to 0. This
	// sets the output low on start and gives us a full cycle to set up DMA.
	TIM_SetCounter(PWM_TIMER, 0);
	TIM_SetCompare1(PWM_TIMER, 0);
	TIM_Cmd(PWM_TIMER, ENABLE); 						// enable Timer 3

	// PAP: Start DMA transfer after starting the timer. This prevents the
	// DMA/PWM from dropping the first bit.
	DMA_Cmd(DMA_STREAM, ENABLE); 			// enable DMA channel 6
	while(!DMA_GetFlagStatus(DMA_STREAM, DMA_TCIF)); 	// wait until transfer complete
	TIM_Cmd(PWM_TIMER, DISABLE); 					// disable Timer 3
	DMA_Cmd(DMA_STREAM, DISABLE); 			// disable DMA channel 6
	DMA_ClearFlag(DMA_STREAM, DMA_TCIF); 				// clear DMA1 Channel 6 transfer complete flag
}
開發者ID:pculot,項目名稱:WS2812-STM32F4-timer-dma,代碼行數:67,代碼來源:main.c

示例4: DMA1_USART1_SEND

//DMA---USART1傳輸
void DMA1_USART1_SEND(u32 SendBuff,u16 len)
{	
	MYDMA_Config(DMA1_Channel4,(u32)&USART1->DR,(u32)SendBuff,len);//DMA1通道4,外設為串口1,存儲器為SendBuff,長度len.
	USART_DMACmd(USART1, USART_DMAReq_Tx, ENABLE);
	MYDMA_Enable(DMA1_Channel4);	
	while(DMA_GetFlagStatus(DMA1_FLAG_TC4) != SET);
	DMA_ClearFlag(DMA1_FLAG_TC4);  //清除發送完成標誌
}
開發者ID:RichardWei,項目名稱:weizhou_flight_v2.3,代碼行數:9,代碼來源:DMA.c

示例5: DMAx_R1_M2_IRQHandler

/**
  * @brief  This function handles second motor DMAx TC interrupt request. 
  *         Required only for R1 with rep rate > 1
  * @param  None
  * @retval None
  */
void DMAx_R1_M2_IRQHandler(void)
{
  if (DMA_GetFlagStatus(DMAx_R1_M2_Stream,DMAx_R1_M2_Flag) == SET)
  {
    DMA_ClearFlag(DMAx_R1_M2_Stream,DMAx_R1_M2_Flag);
    Exec_IRQ_Handler(MC_IRQ_PWMNCURRFDBK_2,2);
  } 
}
開發者ID:KHIEM2812,項目名稱:auto_quad_fc,代碼行數:14,代碼來源:stm32f2xx_MC_it.c

示例6: ws2811DMAHandler

void ws2811DMAHandler(DMA_Channel_TypeDef *channel)
{
    if (DMA_GetFlagStatus(WS2811_DMA_TC_FLAG)) {
        ws2811LedDataTransferInProgress = 0;
        DMA_Cmd(channel, DISABLE);
        DMA_ClearFlag(WS2811_DMA_TC_FLAG);
    }
}
開發者ID:180jacob,項目名稱:cleanflight,代碼行數:8,代碼來源:light_ws2811strip.c

示例7: DMA1_Channel3_IRQHandler

void DMA1_Channel3_IRQHandler(void)
{
    if (DMA_GetFlagStatus(DMA1_FLAG_TC3)) {
        ws2811LedDataTransferInProgress = 0;
        DMA_Cmd(DMA1_Channel3, DISABLE);            // disable DMA channel 6
        DMA_ClearFlag(DMA1_FLAG_TC3);               // clear DMA1 Channel 6 transfer complete flag
    }
}
開發者ID:nico-dh,項目名稱:cleanflight,代碼行數:8,代碼來源:light_ws2811strip_stm32f30x.c

示例8: oled_wait_dma

// Waits for DMA transfer to complete
static void oled_wait_dma(void) {
  while(!DMA_GetFlagStatus(DMA2_Stream3, DMA_FLAG_TCIF3)) {
    if(!DMA2_Stream3->NDTR) break;
  }
  DMA_ClearITPendingBit(DMA2_Stream3, DMA_IT_TCIF3);
  DMA_Cmd(DMA2_Stream3, DISABLE);
  SPI_I2S_DMACmd(OLED_SPI, SPI_I2S_DMAReq_Tx, DISABLE);
}
開發者ID:KryoStoffer,項目名稱:SmartWatch_Toolchain,代碼行數:9,代碼來源:driver_display.c

示例9: transponderDMAHandler

void transponderDMAHandler(DMA_Channel_TypeDef *channel)
{
    if (DMA_GetFlagStatus(TRANSPONDER_DMA_TC_FLAG)) {
        transponderIrDataTransferInProgress = 0;
        DMA_Cmd(channel, DISABLE);
        DMA_ClearFlag(TRANSPONDER_DMA_TC_FLAG);
    }
}
開發者ID:henn1001,項目名稱:cleanflight,代碼行數:8,代碼來源:transponder_ir.c

示例10: USART_DMA_send

void USART_DMA_send(USART_TypeDef* USARTx, DMA_Channel_TypeDef* DMAy_Channelx, char *buf, uint8_t len){
	//
	DMA_InitTypeDef DMA_InitStructure;
	
	// DMA на запись
	DMA_DeInit(DMAy_Channelx); //DMA1_Channel4
	DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t) &(USARTx->DR);
	DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t) buf;
	DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
	DMA_InitStructure.DMA_BufferSize = len;
	DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
	DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
	DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
	DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
	DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
	DMA_InitStructure.DMA_Priority = DMA_Priority_Low;
	DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
	DMA_Init(DMA1_Channel4, &DMA_InitStructure);

	// старт цикла отправки
	USART_ClearFlag(USARTx, USART_FLAG_TC | USART_FLAG_TXE);
	USART_DMACmd(USARTx, USART_DMAReq_Tx, ENABLE);	
	DMA_Cmd(DMAy_Channelx, ENABLE);
	
	// wait until transmission complite from dma 
	if (DMAy_Channelx == DMA1_Channel1) { 	
		while (DMA_GetFlagStatus(DMA1_FLAG_TC1) == RESET) {
		}
	}
	if (DMAy_Channelx == DMA1_Channel2) { 	
		while (DMA_GetFlagStatus(DMA1_FLAG_TC2) == RESET) {
		}
	}
	if (DMAy_Channelx == DMA1_Channel3) { 	
		while (DMA_GetFlagStatus(DMA1_FLAG_TC3) == RESET) {
		}
	}
	if (DMAy_Channelx == DMA1_Channel4) { 	
		while (DMA_GetFlagStatus(DMA1_FLAG_TC4) == RESET) {
		}
	}
	
	DMA_Cmd(DMAy_Channelx, DISABLE);
	USART_DMACmd(USARTx, USART_DMAReq_Tx, DISABLE);
}
開發者ID:tarasii,項目名稱:Humidity,代碼行數:45,代碼來源:uart.c

示例11:

uint8_t i2cMgr_t::CheckManyWriting() {
    // Check if DMA transfer ended
    if (DMA_GetFlagStatus(I2C_DMA_FLAG_TC_TX) == SET)
        if (I2C_GetFlagStatus(I2C1, I2C_FLAG_BUSY) == RESET)
            return I2C_OK;

    if (Delay.Elapsed(&Timer, I2C_TIMEOUT_MS)) return I2C_ERR_TIMEOUT;
    return I2C_WAITING;
}
開發者ID:Kreyl,項目名稱:nute,代碼行數:9,代碼來源:i2c_mgr.cpp

示例12: dmaRcvBytes

// READ (done)
int dmaRcvBytes(SPI_TypeDef *SPIx, void *rbuf, unsigned count, int half) {
  DMA_InitTypeDef DMA_InitStructure;
  uint16_t dummy[] = {0xffff};

  DMA_DeInit(DMA1_Channel4);
  DMA_DeInit(DMA1_Channel5);

  // Common to both channels

  DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(&(SPIx->DR));
  DMA_InitStructure.DMA_PeripheralDataSize = (half) ? DMA_PeripheralDataSize_HalfWord : DMA_PeripheralDataSize_Byte;
  
  DMA_InitStructure.DMA_MemoryDataSize = (half) ? DMA_MemoryDataSize_HalfWord : DMA_MemoryDataSize_Byte;
  DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
  DMA_InitStructure.DMA_BufferSize = count;
  DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
  DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
  DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

  // Rx Channel

  DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)rbuf;
  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;

  DMA_Init(DMA1_Channel4, &DMA_InitStructure);

  // Tx channel

  DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t) dummy;
  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Disable;
  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;

  DMA_Init(DMA1_Channel5, &DMA_InitStructure);

  // Enable channels

  DMA_Cmd(DMA1_Channel4, ENABLE);
  DMA_Cmd(DMA1_Channel5, ENABLE);

  // Enable SPI TX/RX request

  SPI_I2S_DMACmd(SPIx, SPI_I2S_DMAReq_Rx | SPI_I2S_DMAReq_Tx, ENABLE);

  // Wait for completion

  while (DMA_GetFlagStatus(DMA1_FLAG_TC4) == RESET);

  // Disable channels

  DMA_Cmd(DMA1_Channel4, DISABLE);
  DMA_Cmd(DMA1_Channel5, DISABLE);

  SPI_I2S_DMACmd(SPIx, SPI_I2S_DMAReq_Rx | SPI_I2S_DMAReq_Tx, DISABLE);

  return count;
}
開發者ID:smarth55,項目名稱:Examples,代碼行數:58,代碼來源:spidma.c

示例13: I2C_RX_DMA_IRQ

/*=====================================================================================================*/
void I2C_RX_DMA_IRQ(void)
{
	if (DMA_GetFlagStatus(DMAx_RX_STREAM, DMAx_RX_FLAG_TCIF) != RESET) {
		I2C_GenerateSTOP(I2Cx, ENABLE);
		DMA_Cmd(DMAx_RX_STREAM, DISABLE);
		DMA_ClearFlag(DMAx_RX_STREAM, DMAx_RX_FLAG_TCIF);
		*I2C_ReadPtr = 0;
	}
}
開發者ID:ElEHsiang,項目名稱:QuadrotorFlightControl,代碼行數:10,代碼來源:i2c.c

示例14: DMA1_Stream5_IRQHandler

void DMA1_Stream5_IRQHandler (void)
{
    if (DMA_GetITStatus(DMA1_Stream5, DMA_IT_TCIF5)
            && DMA_GetFlagStatus(DMA1_Stream5, DMA_FLAG_TCIF5)) {
        DMA_ClearITPendingBit(DMA1_Stream5, DMA_IT_TCIF5);
        DMA_ClearFlag(DMA1_Stream5, DMA_FLAG_TCIF5);
    }
    NVIC_ClearPendingIRQ(DMA1_Stream5_IRQn);
}
開發者ID:mondaugen,項目名稱:eval-daugther-card-14-a,代碼行數:9,代碼來源:midi_lowlevel.c

示例15: halSPI1_Interrupt_RX_Handler

/**
 * Функция обработки прерываний RX
 */
void halSPI1_Interrupt_RX_Handler(void)
{

	if (DMA_GetFlagStatus(channel, SPI1_MASTER_Rx_DMA_FLAG_TC) == SET)
	{
		SPI_error = SPI_TRANSFER_COMPLETE;
		DMA_ClearFlag (channel, SPI1_MASTER_Rx_DMA_FLAG_TC);
		DMA_ClearITPendingBit(channel, SPI1_MASTER_Rx_DMA_FLAG_TC);
		halSPI1_SS_off();
	}
	if (DMA_GetFlagStatus(channel, SPI1_MASTER_Rx_DMA_FLAG_TE) == SET)
	{
		SPI_error = SPI_TRANSFER_ERROR_FAIL;
		DMA_ClearFlag (channel, SPI1_MASTER_Rx_DMA_FLAG_TE);
		DMA_ClearITPendingBit(channel, SPI1_MASTER_Rx_DMA_FLAG_TE);
		halSPI1_SS_off();
	}
}
開發者ID:smart2home,項目名稱:smarthome,代碼行數:21,代碼來源:spi.cpp


注:本文中的DMA_GetFlagStatus函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。