Advertisement
CGallardo

LED_Init

Feb 20th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. void LED_Init ( void ) {
  2.     GPIO_InitTypeDef PORT_InitStruct ; // estructura donde se pone la configuracion deseada
  3.     __HAL_RCC_PORTE_CLK_ENABLE (); // darle reloj al periferico , AHORA VIVE !
  4.     /* Configure the PORT_LED pin */
  5.     PORT_InitStruct.Pin = PORT_PIN_7 ; // pin que desamos configurar
  6.     PORT_InitStruct.Mode = PORT_MODE_OUTPUT_OD ; // lo vamos a usar como salida en open-drain
  7.     PORT_InitStruct.Pull = PORT_NOPULL ; // desactivar pulls
  8.     PORT_InitStruct.Speed = PORT_SPEED_FREQ_LOW ; // actualizacion pin
  9.     HAL_PORT_Init(PORTE,&PORT_InitStruct ); // hacer efectiva configuracion puerto
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement