m3dev

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ffd00c4bb7b9c83bde8586d252ed2533ef8bdc5e
parent ba6597ca8c8b24b0bf7480d91492639c3066912e
Author: Brian Swetland <swetland@frotz.net>
Date:   Wed, 19 Mar 2014 21:28:17 -0700

board: lpcxpresso1549

Diffstat:
Aboard/lpcxpresso1549.c | 29+++++++++++++++++++++++++++++
1 file changed, 29 insertions(+), 0 deletions(-)

diff --git a/board/lpcxpresso1549.c b/board/lpcxpresso1549.c @@ -0,0 +1,29 @@ + +#include <fw/io.h> +#include <fw/lib.h> +#include <arch/hardware.h> + +const u32 gpio_led_red = GPIO_IDX(0, 25); +const u32 gpio_led_grn = GPIO_IDX(0, 3); +const u32 gpio_led_blu = GPIO_IDX(1, 1); + +void board_debug_led(int on) { + gpio_wr(gpio_led_grn, !on); +} + +void board_init(void) { + /* enable GPIO blocks */ + writel(readl(SYSAHBCLKCTRL0) | + AHBCC0_GPIO0 | AHBCC0_GPIO1 | AHBCC0_GPIO2, + SYSAHBCLKCTRL0); + + /* disable LEDs */ + gpio_set(gpio_led_red); + gpio_set(gpio_led_grn); + gpio_set(gpio_led_blu); + + /* LED GPIOs to OUT */ + gpio_cfg_dir(gpio_led_red, GPIO_CFG_OUT); + gpio_cfg_dir(gpio_led_grn, GPIO_CFG_OUT); + gpio_cfg_dir(gpio_led_blu, GPIO_CFG_OUT); +}