Merging pull request #74 LM4F initial support
Merge remote-tracking branch 'mrnuke/lm4f_initial'
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
#elif defined(LPC43XX)
|
||||
# include "../lpc43xx/vector_nvic.c"
|
||||
|
||||
#elif defined(LM3S)
|
||||
#elif defined(LM3S) || defined(LM4F)
|
||||
/* Yes, we use the same interrupt table for both LM3S and LM4F */
|
||||
# include "../lm3s/vector_nvic.c"
|
||||
|
||||
#else
|
||||
|
||||
35
lib/lm4f/Makefile
Normal file
35
lib/lm4f/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
##
|
||||
## This file is part of the libopencm3 project.
|
||||
##
|
||||
## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
|
||||
##
|
||||
## This library is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU Lesser General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This library is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public License
|
||||
## along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
LIBNAME = libopencm3_lm4f
|
||||
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
CC = $(PREFIX)-gcc
|
||||
AR = $(PREFIX)-ar
|
||||
CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \
|
||||
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -Wstrict-prototypes \
|
||||
-ffunction-sections -fdata-sections -MD -DLM4F
|
||||
# ARFLAGS = rcsv
|
||||
ARFLAGS = rcs
|
||||
OBJS = gpio.o vector.o assert.o
|
||||
|
||||
VPATH += ../cm3
|
||||
|
||||
include ../Makefile.include
|
||||
31
lib/lm4f/gpio.c
Normal file
31
lib/lm4f/gpio.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This file is part of the libopencm3 project.
|
||||
*
|
||||
* Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
|
||||
*
|
||||
* This library is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/lm4f/gpio.h>
|
||||
|
||||
void gpio_set(u32 gpioport, u8 gpios)
|
||||
{
|
||||
/* ipaddr[9:2] mask the bits to be set, hence the array index */
|
||||
GPIO_DATA(gpioport)[gpios] = 0xff;
|
||||
}
|
||||
|
||||
void gpio_clear(u32 gpioport, u8 gpios)
|
||||
{
|
||||
GPIO_DATA(gpioport)[gpios] = 0;
|
||||
}
|
||||
2
lib/lm4f/libopencm3_lm4f.ld
Normal file
2
lib/lm4f/libopencm3_lm4f.ld
Normal file
@@ -0,0 +1,2 @@
|
||||
/* Yes, we can simply use the lm3s linker script */
|
||||
INCLUDE "libopencm3_lm3s.ld"
|
||||
Reference in New Issue
Block a user