Changeset a0c21e0 in examples-v2


Ignore:
Timestamp:
May 27, 2015, 8:59:57 PM (4 years ago)
Author:
SteveB <sbattazzo@…>
Branches:
4.11, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
d8d8a9c
Parents:
5054217
git-author:
SteveB <sbattazzo@…> (05/27/15 20:59:57)
git-committer:
Joel Sherrill <joel.sherrill@…> (05/28/15 19:13:29)
Message:

Added code to turn on and off LED for STM32F4 Discovery Board

File:
1 edited

Legend:

Unmodified
Added
Removed
  • led/led.h

    r5054217 ra0c21e0  
    8181#define LED_OFF()  do { unsigned int *gpio = (unsigned int *)BCM2835_GPIO_REGS_BASE; GPIO_SET_EXT = 1 << (47 % 32);} while(0)
    8282
     83#elif defined(STM32F4_FAMILY_F4XXXX)
     84
     85#include <bsp/io.h> //Everything we need is in io.h
     86
     87//STM32F4 Discovery Board, LED4: PORTD, 12
     88stm32f4_gpio_config led3config =
     89{
     90        .fields={
     91                .pin_first = STM32F4_GPIO_PIN(3, 12),
     92        .pin_last = STM32F4_GPIO_PIN(3, 12),
     93        .mode = STM32F4_GPIO_MODE_OUTPUT,
     94        .otype = STM32F4_GPIO_OTYPE_PUSH_PULL,
     95        .ospeed = STM32F4_GPIO_OSPEED_2_MHZ,
     96        .pupd = STM32F4_GPIO_NO_PULL,
     97        .output = 1,
     98        .af = 0
     99   }
     100};
     101
     102#define LED_INIT() stm32f4_gpio_set_config(&led3config)
     103#define LED_ON() stm32f4_gpio_set_output(STM32F4_GPIO_PIN(3,12), 1)
     104#define LED_OFF() stm32f4_gpio_set_output(STM32F4_GPIO_PIN(3,12), 0)
     105
    83106#else
    84107/* default case is to print */
Note: See TracChangeset for help on using the changeset viewer.