lm4f: Add lm4f support files copied from lm3s
Create lm4f code infrastructure from the lm3s infrastructure. As far as the interrupt table is concerned, don't create an irq.yaml. Just include the LM3S nvic.h. The LM3S vector table seems to be compatible with the LM4F Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
This commit is contained in:
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 -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/lm3s/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