• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MX_GPIO_Init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MX_GPIO_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ MX_GPIO_Init函数的具体用法?C++ MX_GPIO_Init怎么用?C++ MX_GPIO_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MX_GPIO_Init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: startup_task

void startup_task (void *pvParameters)
{

   (void) pvParameters;
   MX_GPIO_Init();

   /* Init Device Library */
   USBD_Init(&hUsbDeviceFS, &VCP_Desc, 0);
   /* Add Supported Class */
   USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC);
   /* Add CDC Interface Class */
   USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS);
   /* Start Device Process */
   USBD_Start(&hUsbDeviceFS);

   xdev_out(putchar);


   MX_SDIO_SD_Init();
   FATFS_LinkDriver(&SD_Driver, SD_Path);
   fsInit();


   vTaskDelete(NULL);
}
开发者ID:timurey,项目名称:oryx_stm32f205,代码行数:25,代码来源:main.c


示例2: SleepMode

void SleepMode(void)
{
  GPIO_InitTypeDef GPIO_InitStruct;

  /* Disable all GPIOs to reduce power */
  MX_GPIO_Deinit();

  /* Configure User push-button as external interrupt generator */
  __HAL_RCC_GPIOC_CLK_ENABLE();
  GPIO_InitStruct.Pin = B1_Pin;
  GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);

  HAL_UART_DeInit(&huart2);

  /* Suspend Tick increment to prevent wakeup by Systick interrupt.
     Otherwise the Systick interrupt will wake up the device within 1ms (HAL time base) */
  HAL_SuspendTick();

  __HAL_RCC_PWR_CLK_ENABLE();
  /* Request to enter SLEEP mode */
  HAL_PWR_EnterSLEEPMode(0, PWR_SLEEPENTRY_WFI);

  /* Resume Tick interrupt if disabled prior to sleep mode entry*/
  HAL_ResumeTick();

  /* Reinitialize GPIOs */
  MX_GPIO_Init();

  /* Reinitialize UART2 */
  MX_USART2_UART_Init();
}
开发者ID:Shreeyak,项目名称:mastering-stm32,代码行数:33,代码来源:main-ex1.c


示例3: main

int main(void)
{

  HAL_Init();
  SystemClock_Config();

  MX_GPIO_Init();
  MX_CAN_Init();
  MX_I2C1_Init();
  MX_USART3_UART_Init();
  MX_USART2_UART_Init();
  MX_USART1_UART_Init();
  MX_TIM1_Init();
  USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS);
  USBD_RegisterClass(&hUsbDeviceFS, &USBD_CUSTOM_HID);
  USBD_CUSTOM_HID_RegisterInterface(&hUsbDeviceFS, &USBD_CustomHID_fops_FS);
  USBD_Start(&hUsbDeviceFS);

  while (1)
  {

  /* USER CODE END WHILE */


  /* USER CODE BEGIN 3 */
	  HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_1);
	  HAL_Delay(blinkingDelay);
  }
  /* USER CODE END 3 */

}
开发者ID:klaus-liebler,项目名称:sensact,代码行数:31,代码来源:main.cpp


示例4: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_TIM1_Init();

  HAL_TIM_Base_Start_IT(&htim1);

  /* USER CODE BEGIN 2 */

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {

//	  uint32_t ticksPassed = 0;
//	  if (GPIOA->IDR & 0x01) {
//		  uint32_t ticksPassed = 0;
//		  while (GPIOA->IDR & 0x01) {
//			  ticksPassed++;
//		  }
//		  SysTick_Config(ticksPassed);
//	  }



//	  if (GPIOA->IDR & 0x01) {
//
//	  }
  /* USER CODE END WHILE */
//	  GPIOE->ODR ^= 0x0000FF00;
//	  int i = 0;
//	  while (i < 1000000) {
//		  i++;
//	  }

//	  HAL_GPIO_TogglePin(GPIOE, 0xFF00);
//	  HAL_Delay(1000);
  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:gordonszeto,项目名称:blinky_interrupt_stm32f3,代码行数:59,代码来源:main.c


示例5: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  uint8_t Buf[0x10],Buf1[0x10];
  uint16_t i;
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  trace_printf("Hello\n");
  BSP_UART_Init(115200);

  /* Initialize I2C */
  ASK25_I2C1_Init();

  /* Initialize virtual com port */
  BSP_VCP_Init();

  vgetche(BLOCKING); // Dummy read to get the VCP Connected

  for(i=0;i<sizeof(Buf);i++)
  {
    Buf[i] = i;
  }

  /* Write Array to EEPROM */
  ASK25_AT24C16_Write(0x106,Buf,sizeof(Buf));

  /* Read from EEPROM */
  ASK25_AT24C16_Read(0x106,Buf1,sizeof(Buf1));

  /* Print to virtual Com port */
  ASK25_AT24C16_Display_Array(Buf1,sizeof(Buf1));

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:59,代码来源:main.c


示例6: Nucleo_BSP_Init

void Nucleo_BSP_Init() {
  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART2_UART_Init();
}
开发者ID:nosnav,项目名称:mastering-stm32,代码行数:8,代码来源:nucleo_hal_bsp.c


示例7: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_ADC_Init();
  MX_USART1_UART_Init();

  /* USER CODE BEGIN 2 */
  char ch;
  ch = 'x';
  HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 100);

  sprintf(strbuf,"Hello\n");

  uint32_t adcvals[5];
  HAL_ADC_Start(&hadc);

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
  	HAL_ADC_Start(&hadc);
	for (int i=0;i<3;i++){
		while(HAL_IS_BIT_CLR(hadc.Instance->ISR, (ADC_FLAG_EOC|ADC_FLAG_EOS))){}
		adcvals[i] = hadc.Instance->DR;
	}
	for (int i=0;i<5;i++){
		sprintf(strbuf,"i:%d,adc:%4d	",i,adcvals[i]);
		HAL_UART_Transmit(&huart1,strbuf,strlen(strbuf),1000);
	}
	
	sprintf(strbuf,"\n");
	HAL_UART_Transmit(&huart1,strbuf,strlen(strbuf),1000);
	HAL_Delay(1000);


  }
  /* USER CODE END 3 */

}
开发者ID:xtompok,项目名称:STM32-tests,代码行数:58,代码来源:main.c


示例8: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();

  /* USER CODE BEGIN 2 */
	LCD_Init(2, 20);
	LCD_PrintString(0, 0, "Damogran Labs");
	
	Encoder_Init(&encoder1, ENC1_A_GPIO_Port, ENC1_A_Pin, ENC1_B_GPIO_Port, ENC1_B_Pin);
	Encoder_Init(&encoder2, ENC2_A_GPIO_Port, ENC2_A_Pin, ENC2_B_GPIO_Port, ENC2_B_Pin);
		
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
	LCD_PrintNumber(1, 0, encoder1.abs_rot);
	LCD_PrintNumber(1, 6, encoder2.abs_rot);
	
  while (1)
  {
		if(Encoder_GetState(&encoder1)){
			LCD_PrintString(1, 0, "     ");
			LCD_PrintNumber(1, 0, encoder1.abs_rot);
		}	
		if(Encoder_GetState(&encoder2)){
			LCD_PrintString(1, 6, "     ");
			LCD_PrintNumber(1, 6, encoder2.abs_rot);
		}	
		
		if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0) == GPIO_PIN_SET){
			Encoder_SetAbsToZero(&encoder1);
			Encoder_SetAbsToZero(&encoder2);
		}
		
		HAL_Delay(100);
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:damogranlabs,项目名称:STM32L1,代码行数:58,代码来源:main.c


示例9: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  


  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_I2C2_Init();
  MX_RTC_Init();
  MX_SPI1_Init();
  MX_SPI3_Init();
  MX_USB_OTG_FS_PCD_Init();
  //HAL_SPI_MspInit(&hspi3);

  /* USER CODE BEGIN 2 */


  //begin();
  //setWrap(false);
  //fillRect(0,0,128,20,ColorHSV(1200,255,255));



  // USART_TypeDef USB_UART;
  // HAL_UART_MspInit(&USB_UART);
  // HAL_UART_Init(&USB_UART);

  /* USER CODE END 2 */

  /* Infinite loop */
  char test[5]= "test";
  /* USER CODE BEGIN WHILE */
  while (1)
  {
 //   fillRect(0,0,128,128,ColorHSV(1200,255,255));
    HAL_GPIO_WritePin(RED_GPIO_Port, RED_Pin, GPIO_PIN_SET);
    HAL_Delay(500);
    HAL_GPIO_WritePin(RED_GPIO_Port, RED_Pin, GPIO_PIN_RESET);
    HAL_Delay(500);


  }
  /* USER CODE END 3 */

}
开发者ID:nickmolo,项目名称:ECE477,代码行数:58,代码来源:main.c


示例10: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  uint8_t data1[0x10],data2[0x10],i;
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  trace_printf("Hello\n");
  BSP_UART_Init(115200);

  /* Initialize SPI */
  ASK25_SPI1_Init();

  /* Initialize virtual com port */
  BSP_VCP_Init();

  vgetche(BLOCKING); // Dummy read to get the VCP Connected
  ASK25_25AA160A_Write_Status_Reg(0x00);
  for(i=0;i<sizeof(data1);i++)
  {
    data1[i] = i;
  }
  /* Write Array to EEPROM */
  ASK25_25AA160A_Write(0x0000,data1,sizeof(data1));

  /* Read from EEPROM */
  ASK25_25AA160A_Read(0x0000,data2,sizeof(data2));

  /* Print to virtual Com port */
  ASK25_25AA160A_Display_Array(data2,sizeof(data2));

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:57,代码来源:main.c


示例11: main

int main(void)
{

	/* USER CODE BEGIN 1 */

	/* USER CODE END 1 */

	/* MCU Configuration----------------------------------------------------------*/

	/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
	HAL_Init();

	/* Configure the system clock */
	SystemClock_Config();

	/* Initialize all configured peripherals */
	MX_GPIO_Init();
	MX_DMA_Init();
	MX_I2C3_Init();
	MX_TIM1_Init();
	MX_TIM2_Init();
	MX_TIM3_Init();
	MX_TIM4_Init();
	MX_TIM5_Init();
	MX_USART1_UART_Init();
	MX_USART2_UART_Init();
	MX_TIM11_Init();

	/* USER CODE BEGIN 2 */
	HAL_TIM_Base_Start_IT(&htim11); // 100 msec timer
	initSonar( MAX_SONAR);
	initSerOutput();
	/* USER CODE END 2 */

	/* Infinite loop */
	/* USER CODE BEGIN WHILE */
	while (1)
	{
		/* USER CODE END WHILE */

		/* USER CODE BEGIN 3 */
		// >>>>> Sonar reading
		triggerSonar( COUPLE_0_2);
		HAL_Delay(49);
		triggerSonar( COUPLE_1_3);
		HAL_Delay(49);
		// <<<<< Sonar reading

		// >>>>> Serial Output
		convertMeasures();
		sendMeasures();
		// <<<<< Serial Output

	}
	/* USER CODE END 3 */

}
开发者ID:RoboSec,项目名称:rs_sensor_board,代码行数:57,代码来源:main.c


示例12: main

int main(void)
{

  /* USER CODE BEGIN 1 */
	USBD_StatusTypeDef result = USBD_OK;
	uint32_t userSw_old = 0;
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USB_DEVICE_Init();

  /* USER CODE BEGIN 2 */
  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  BSP_PB_Init(BUTTON_USER, BUTTON_MODE_GPIO);

  userSw_old = BSP_PB_GetState(BUTTON_USER);
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */
  /* USER CODE BEGIN 3 */
	  HAL_Delay(40);
	  BSP_LED_Toggle(LED4);

	  if ((BSP_PB_GetState(BUTTON_USER) == GPIO_PIN_SET) && (userSw_old == GPIO_PIN_RESET))
	  {
		  result = CDC_Transmit_FS(USB_TxBufferFS, sizeof(USB_TxBufferFS));
	  }
	  userSw_old = BSP_PB_GetState(BUTTON_USER);


	  /* USB Error */
	  if (result != USBD_OK)
	  {
		  while (1)
		  {
			  BSP_LED_On(LED3);
			  HAL_Delay(100);
		  }
	  }
  }
  /* USER CODE END 3 */

}
开发者ID:s-ciprian,项目名称:f3_disc_usb,代码行数:57,代码来源:main.c


示例13: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_I2S2_Init();
  MX_SDIO_SD_Init();
  MX_FATFS_Init();

  /* USER CODE BEGIN 2 */
	printf("Init complete");
	//WavePlayerStartSample();
	while((res=f_mount (&fatfs, SD_Path, 1))!=FR_OK)
	{
		printf("QQ");
	}
	WavePlayerStart_DMA("0:/akuno.wav");
	//playindex=rand()%6;
	/*switch(playindex)
	{
		case :
			WavePlayerStart_DMA("0:/test.wav");
			break;
		case 1:
			WavePlayerStart_DMA("0:/akuno.wav");
			break;
		default:
			WavePlayerStart_DMA("0:/akuno.wav");
			break;
	}*/
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
		//WavePlayerStart_DMA("0:/test.wav");
  }
  /* USER CODE END 3 */

}
开发者ID:mimihalo,项目名称:audio2015,代码行数:57,代码来源:main.c


示例14: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  trace_printf("Hello\n");
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  BSP_PB_Init(BUTTON_KEY,BUTTON_MODE_EXTI);    // initialize on board switch
  BSP_LED_Init(LED5);                          // initialize on baord LED 4 and LED 5
  BSP_LED_Init(LED4);

  /* Check if the system has resumed from WWDG reset */
  if(__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET)
  {
    /* WWDGRST flag set: Turn LED1 on */
    BSP_LED_On(LED5);

    /* Clear reset flags */
    __HAL_RCC_CLEAR_RESET_FLAGS();
  }
  else
  {
    /* WWDGRST flag is not set: Turn LED1 off */
    BSP_LED_Off(LED5);
  }
  /* Initialize and start IWDG */
  BSP_IWDG_Init(2000);
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
    BSP_LED_Toggle(LED4);

    HAL_Delay(1850);
    /* Refresh the IWDG reload count value */
    HAL_IWDG_Refresh(&hiwdg_bsp);
  }
  /* USER CODE END 3 */

}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:57,代码来源:main.c


示例15: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_ADC1_Init();
  MX_USART6_UART_Init();

  /* USER CODE BEGIN 2 */

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
	  HAL_ADC_Start_IT(&hadc1);

	  //Zonder DMA (op interrupt)
	 // while(counter < 2)HAL_GPIO_WritePin(GPIOD,LD6_Pin,GPIO_PIN_SET);
	  //HAL_GPIO_WritePin(GPIOD,LD6_Pin,GPIO_PIN_RESET);
	  if(counter == BUFFER_LENGTH * 2) {
		  	Uart_transmit(BufferPin1);
		  	Uart_transmit(BufferPin2);
		  	counter = 0;
	  }
	  /*if(HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0))
	  {
	   HAL_Delay(500);
	   HAL_GPIO_WritePin(GPIOD,LD3_Pin,GPIO_PIN_SET);//GREEN

	   //zonder DMA Single Scan
	   sprintf(buffer,"pin a1: %05d   ",val1);
	   HAL_UART_Transmit(&huart6,(uint8_t*) buffer,strlen(buffer),HAL_MAX_DELAY);
	   sprintf(buffer,"pin a2: %05d   ",val2);
	   HAL_UART_Transmit(&huart6,(uint8_t*) buffer,strlen(buffer),HAL_MAX_DELAY);
	   HAL_UART_Transmit(&huart6,"\r\n",strlen("\r\n"),HAL_MAX_DELAY);
	  }*/
  }
  /* USER CODE END 3 */

}
开发者ID:NickVermeylen,项目名称:3D-Sound-Impulse-Marker,代码行数:57,代码来源:main.c


示例16: main

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_DMA_Init();
  MX_ADC1_Init();
  MX_I2C1_Init();
  MX_RTC_Init();
  MX_SPI2_Init();
  MX_TIM1_Init();
  MX_TIM2_Init();
  MX_TIM3_Init();
  MX_TIM4_Init();
  MX_USART3_UART_Init();

  /* USER CODE BEGIN 2 */
	encoderInit();
	pwmInit();
//	adcInit();
	uartInit();
	timInterruptInit();
	gyroInit(GYROHIGH);
	calibrateGyro();

//	rotaryRight(800);
//	HAL_Delay(500);
//	rotaryLeft(800);
	drive(VEL);

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:marek848,项目名称:Minotaur2_New,代码行数:56,代码来源:main.c


示例17: main

int main(void)
{
    RCC->AHB1ENR |= 0xFFFFFFFF;
    RCC->AHB2ENR |= 0xFFFFFFFF;
    RCC->AHB3ENR |= 0xFFFFFFFF;
    RCC->APB1ENR |= 0xFFFFFFFF;
    RCC->APB2ENR |= 0xFFFFFFFF;

    /* MCU Configuration----------------------------------------------------------*/

    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
    HAL_Init();

    /* Configure the system clock */
    SystemClock_Config();
    initIGVCCallbackTimer();

    /* Initialize all configured peripherals */
    MX_GPIO_Init();
    MX_DMA_Init();
    MX_ADC2_Init();
    i2cInit();

    commsUsartInit();
    MX_USB_OTG_FS_USB_Init();

    adc_init();

    initSteeringMotor();
    initSteering();
    initSpeedDAC();
    initEncoderInputCapture();
    initAutomanInt();

    addCallbackTimer(1000, led6Toggle, NULL);

    printf("Hello.\r\n");

    while(1)
    {
        serviceTxDma();
        serviceCallbackTimer();
        serviceUSBWrite();
        serviceI2C();
        serviceAutoman();

        consoleProcessBytes();

        uint8_t dataIn;

        while (doubleBuffer_read(&usbReceiveBuffer, &dataIn, 1))
        {
            runCommsFSM((char)dataIn);
        }
    }
}
开发者ID:CalPolyRobotics,项目名称:IGVC-OlympusFirmware,代码行数:56,代码来源:main.c


示例18: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  uint32_t test;
  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();

  /* USER CODE BEGIN 2 */
  BSP_UART_Init(115200);

  /* Initialize on board LED4 */
  BSP_LED_Init(LED4);

  trace_printf("Hello\n");

  /* Configure MPU region */
  MPU_Config();

  /* Try to access memory region 1 */
  uprintf("Trying to read memory from region 1\n\r");
  test = (*(unsigned int *)0x08000010);
  uprintf("some value at location 0x08000010: %08x \n\r",test );
  uprintf("Read successful!!!\n\r");

  /* Try to access memory region 2 */
  uprintf("Trying to read memory from region 2\n\r");
  uprintf("Memory management fault occur: LED4 will Glow");
  test = (*(unsigned int *)0x20002001);
  uprintf("some value at location 0x20002001: %08x \n\r",test );

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  }
  /* USER CODE END 3 */

}
开发者ID:glocklueng,项目名称:STM32F4-Dev,代码行数:55,代码来源:main.c


示例19: main

int main(void)
{

  /* USER CODE BEGIN 1 */
  /* USER CODE END 1 */
	Task_Info_t TaskState=TASK_INFO_INIT;
  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();

  /* System interrupt init*/
  /* Sets the priority grouping field */
  HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);

  /* Initialize all configured peripherals */
    MX_GPIO_Init();
  MX_DMA_Init();
  MX_USART6_UART_Init();
  MX_USART1_UART_Init();
  MX_USART2_UART_Init();
  MX_USART3_UART_Init();
  MX_TimerDynamixel_Init(&TimHandle2 , TIM2);
  MX_TimerDynamixel_Init(&TimHandle3 , TIM3);
  MX_TimerDynamixel_Init(&TimHandle4 , TIM4);

  Trace_Init();
  HAL_Delay(1000);
  Trace_Raw("Medula control board start...\n\r");
  Dynamixel_Init();
  IO_Data_init();
  while (0)
  {
	  Dynamixel_test(&TaskState);
	  Trace_Task();

  }
  while (1)
  {
	  HAL_Delay(10);
	  IO_Data_Scan_In();
	  Appli(&TaskState);
	  Trace_Task();
	  HAL_Delay(5);
	  IO_Data_Scan_Out();

  }
  /* USER CODE END 3 */

}
开发者ID:bilimenn,项目名称:Medula,代码行数:54,代码来源:main.c


示例20: main

int main(void)
{

  HAL_Init();

  SystemClock_Config();


  MX_GPIO_Init();
  MX_ADC1_Init();
  MX_DMA2D_Init();
  MX_FMC_Init();
  MX_I2C3_Init();
  MX_LTDC_Init();
  MX_RNG_Init();
  MX_SPI5_Init();

	BSP_LCD_Init();
	BSP_LCD_LayerDefaultInit(LCD_BACKGROUND_LAYER, LCD_FRAME_BUFFER);
	BSP_LCD_LayerDefaultInit(LCD_FOREGROUND_LAYER, LCD_FRAME_BUFFER);
	BSP_LCD_SelectLayer(LCD_FOREGROUND_LAYER);
	BSP_LCD_Clear(LCD_COLOR_BLACK);
	BSP_LCD_DisplayOn();
	uint8_t Button_Value;
	GPIO_InitTypeDef GPIO_InitStruct;
  GPIO_InitStruct.Pin |= GPIO_PIN_0;
  GPIO_InitStruct.Mode = 0x00;
  GPIO_InitStruct.Pull = 0x02;
  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
	while (1)
		{
		
		for(uint16_t i = 0; i < SIZE; i+=2) {
			HAL_ADC_Start(&hadc1);
			HAL_ADC_PollForConversion(&hadc1,1000); 
			samples[i] = HAL_ADC_GetValue(&hadc1);
			samples[i+1] = 0;
			HAL_ADC_Stop(&hadc1);
		}
		
		Button_Value = HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0);
		if( Button_Value )
		{		
			fft();
			
		}
		else
		{
		
			display_samples(samples);

		}
	}
}
开发者ID:jifwin,项目名称:auk_project,代码行数:54,代码来源:main.c



注:本文中的MX_GPIO_Init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MX_LABEL函数代码示例发布时间:2022-05-30
下一篇:
C++ MX_BIN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap