Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stm32f469I-discovery notes

Table of Contents

References

LED

HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);  // turn on LED1
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, GPIO_PIN_RESET);  // turn on LED2

HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, GPIO_PIN_SET);  // turn off LED3
HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, GPIO_PIN_SET);  // turn off LED4
#define TURN_ON(n) \
  HAL_GPIO_WritePin(LED ## n ## _GPIO_Port, LED ## n ## _Pin, GPIO_PIN_RESET)

#define TURN_OFF(n) \
  HAL_GPIO_WritePin(LED ## n ## _GPIO_Port, LED ## n ## _Pin, GPIO_PIN_SET)

  int i = 0;
  for(;;)
  {
    i =  (i + 1) & 0x0f;

    if (i&0x1) TURN_ON(1); else TURN_OFF(1);
    if (i&0x2) TURN_ON(2); else TURN_OFF(2);
    if (i&0x4) TURN_ON(3); else TURN_OFF(3);
    if (i&0x8) TURN_ON(4); else TURN_OFF(4);
    osDelay(1000);
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.