Commit f5a3edc4 authored by Papy's avatar Papy Committed by Nicolas Pouillon

mutekh/boards: merge brain

parent 415c27f3
%section bmaaa-brain
%inherit stm32-f107vc
CONFIG_BMAAA
CONFIG_BMAAA_BOARD brain
%section bmaaa-pinky %section bmaaa-pinky
%inherit nrf51-xxac %inherit nrf51-xxac
......
This diff is collapsed.
%set OUTPUT_NAME bmaaa-brain
%append MODULES $(OUTPUT_NAME):$(CONFIGPATH)
CONFIG_LICENSE_APP_BSD
%include bmaaa.build
CONFIG_PTHREAD
CONFIG_PTHREAD_MAIN
#include <device/class/gpio.h>
#include <device/class/timer.h>
#include <arch/stm32/pin.h>
#define FIRST STM32_PE8
#define LAST STM32_PE15
static struct device_gpio_s gpio;
static struct device_timer_s timer;
static dev_timer_delay_t msec;
static uint8_t brain_gpio_init_mask[] = { 0x55, 0x55 };
void main()
{
printk("bmaaa: brain firmware started!\n");
ensure(!device_get_accessor_by_path(&gpio.base, NULL, "/gpio", DRIVER_CLASS_GPIO));
ensure(!device_get_accessor_by_path(&timer.base, NULL, "/timer4", DRIVER_CLASS_TIMER));
ensure(!dev_timer_init_sec(&timer, &msec, 0, 1, 1000));
DEVICE_OP(&gpio, set_output, FIRST, LAST, brain_gpio_init_mask, dev_gpio_mask0);
DEVICE_OP(&gpio, set_mode, FIRST, LAST, dev_gpio_mask1, DEV_PIN_PUSHPULL);
dev_timer_wait_delay(&timer, msec * 100, 0);
DEVICE_OP(&gpio, set_output, FIRST, LAST, dev_gpio_mask0, dev_gpio_mask0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment