Merge branch 'stm32f2' of github.com:fnoble/libopenstm32 into stm32f2
This commit is contained in:
commit
0f6a0276aa
8
Makefile
8
Makefile
@ -17,11 +17,12 @@
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
PREFIX ?= arm-none-eabi
|
||||
# PREFIX ?= arm-elf
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
DESTDIR ?= /usr/local
|
||||
INCDIR = $(DESTDIR)/$(PREFIX)/include
|
||||
LIBDIR = $(DESTDIR)/$(PREFIX)/lib
|
||||
SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
|
||||
INSTALL = install
|
||||
|
||||
TARGETS = stm32f1 stm32f2 lpc13xx lm3s
|
||||
@ -57,11 +58,14 @@ install: lib
|
||||
@printf " INSTALL headers\n"
|
||||
$(Q)$(INSTALL) -d $(INCDIR)/libopencm3
|
||||
$(Q)$(INSTALL) -d $(LIBDIR)
|
||||
$(Q)$(INSTALL) -d $(SHAREDIR)
|
||||
$(Q)cp -r include/libopencm3/* $(INCDIR)/libopencm3
|
||||
@printf " INSTALL libs\n"
|
||||
$(Q)$(INSTALL) -m 0644 lib/*/*.a $(LIBDIR)
|
||||
@printf " INSTALL ldscripts\n"
|
||||
$(Q)$(INSTALL) -m 0644 lib/*/*.ld $(LIBDIR)
|
||||
@printf " INSTALL scripts\n"
|
||||
$(Q)$(INSTALL) -m 0644 scripts/* $(SHAREDIR)
|
||||
|
||||
clean:
|
||||
$(Q)for i in $(addprefix lib/,$(TARGETS)) \
|
||||
|
@ -18,8 +18,8 @@
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
# PREFIX ?= arm-none-eabi
|
||||
PREFIX ?= arm-elf
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
CC = $(PREFIX)-gcc
|
||||
LD = $(PREFIX)-gcc
|
||||
OBJCOPY = $(PREFIX)-objcopy
|
||||
|
@ -18,8 +18,8 @@
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
##
|
||||
|
||||
# PREFIX ?= arm-none-eabi
|
||||
PREFIX ?= arm-elf
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
CC = $(PREFIX)-gcc
|
||||
LD = $(PREFIX)-gcc
|
||||
OBJCOPY = $(PREFIX)-objcopy
|
||||
|
@ -25,12 +25,12 @@ LD = $(PREFIX)-gcc
|
||||
OBJCOPY = $(PREFIX)-objcopy
|
||||
OBJDUMP = $(PREFIX)-objdump
|
||||
# Uncomment this line if you want to use the installed (not local) library.
|
||||
TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||
#TOOLCHAIN_DIR = ../../../..
|
||||
#TOOLCHAIN_DIR := $(shell dirname `which $(CC)`)/../$(PREFIX)
|
||||
TOOLCHAIN_DIR = ../../../..
|
||||
CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include \
|
||||
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD
|
||||
-fno-common -mcpu=cortex-m3 -mthumb -msoft-float -MD -DSTM32F1
|
||||
LDSCRIPT = $(BINARY).ld
|
||||
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32 \
|
||||
LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib -L$(TOOLCHAIN_DIR)/lib/stm32f1 \
|
||||
-T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \
|
||||
-mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
|
||||
OBJS += $(BINARY).o
|
||||
@ -75,13 +75,13 @@ flash: $(BINARY).flash
|
||||
@#printf " OBJDUMP $(*).list\n"
|
||||
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list
|
||||
|
||||
foo.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/libopencm3_stm32.a
|
||||
foo.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32f1/libopencm3_stm32f1.a
|
||||
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
|
||||
$(Q)$(LD) -o foo.elf $(OBJS) -lopencm3_stm32 $(LDFLAGS)
|
||||
$(Q)$(LD) -o foo.elf $(OBJS) -lopencm3_stm32f1 $(LDFLAGS)
|
||||
|
||||
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/libopencm3_stm32.a
|
||||
%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/stm32f1/libopencm3_stm32f1.a
|
||||
@#printf " LD $(subst $(shell pwd)/,,$(@))\n"
|
||||
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32 $(LDFLAGS)
|
||||
$(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_stm32f1 $(LDFLAGS)
|
||||
|
||||
%.o: %.c Makefile
|
||||
@#printf " CC $(subst $(shell pwd)/,,$(@))\n"
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
/* Set STM32 to 72 MHz. */
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
|
||||
|
@ -25,5 +25,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* This file is part of the libopencm3 project.
|
||||
*
|
||||
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
|
||||
* Copyright (C) 2011 Piotr Esden-Tempski <piotr@esden.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,9 +19,10 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
#include <libopencm3/stm32/otg_fs.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/hid.h>
|
||||
|
||||
@ -28,25 +30,25 @@
|
||||
#define INCLUDE_DFU_INTERFACE
|
||||
|
||||
#ifdef INCLUDE_DFU_INTERFACE
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
#endif
|
||||
|
||||
const struct usb_device_descriptor dev = {
|
||||
.bLength = USB_DT_DEVICE_SIZE,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
.bDeviceClass = 0,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = 64,
|
||||
.idVendor = 0x0483,
|
||||
.idProduct = 0x5710,
|
||||
.bcdDevice = 0x0200,
|
||||
.iManufacturer = 1,
|
||||
.iProduct = 2,
|
||||
.iSerialNumber = 3,
|
||||
.bNumConfigurations = 1,
|
||||
.bLength = USB_DT_DEVICE_SIZE,
|
||||
.bDescriptorType = USB_DT_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
.bDeviceClass = 0,
|
||||
.bDeviceSubClass = 0,
|
||||
.bDeviceProtocol = 0,
|
||||
.bMaxPacketSize0 = 64,
|
||||
.idVendor = 0x0483,
|
||||
.idProduct = 0x5710,
|
||||
.bcdDevice = 0x0200,
|
||||
.iManufacturer = 1,
|
||||
.iProduct = 2,
|
||||
.iSerialNumber = 3,
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
/* I have no idea what this means. I haven't read the HID spec. */
|
||||
@ -174,10 +176,10 @@ static int hid_control_request(struct usb_setup_data *req, u8 **buf, u16 *len,
|
||||
{
|
||||
(void)complete;
|
||||
|
||||
if((req->bmRequestType != 0x81) ||
|
||||
if((req->bmRequestType != 0x81) ||
|
||||
(req->bRequest != USB_REQ_GET_DESCRIPTOR) ||
|
||||
(req->wValue != 0x2200))
|
||||
return 0;
|
||||
(req->wValue != 0x2200))
|
||||
return 0;
|
||||
|
||||
/* Handle the HID report descriptor */
|
||||
*buf = (u8*)hid_report_descriptor;
|
||||
@ -192,7 +194,7 @@ static void dfu_detach_complete(struct usb_setup_data *req)
|
||||
(void)req;
|
||||
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15);
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO10);
|
||||
gpio_set(GPIOA, GPIO10);
|
||||
scb_reset_core();
|
||||
@ -201,10 +203,10 @@ static void dfu_detach_complete(struct usb_setup_data *req)
|
||||
static int dfu_control_request(struct usb_setup_data *req, u8 **buf, u16 *len,
|
||||
void (**complete)(struct usb_setup_data *req))
|
||||
{
|
||||
(void)buf;
|
||||
(void)buf;
|
||||
(void)len;
|
||||
|
||||
if((req->bmRequestType != 0x21) || (req->bRequest != DFU_DETACH))
|
||||
if((req->bmRequestType != 0x21) || (req->bRequest != DFU_DETACH))
|
||||
return 0; /* Only accept class request */
|
||||
|
||||
*complete = dfu_detach_complete;
|
||||
@ -230,7 +232,7 @@ static void hid_set_config(u16 wValue)
|
||||
dfu_control_request);
|
||||
#endif
|
||||
|
||||
systick_set_clocksource(STK_CTRL_CLKSOURCE_AHB_DIV8);
|
||||
systick_set_clocksource(STK_CTRL_CLKSOURCE_AHB_DIV8);
|
||||
systick_set_reload(100000);
|
||||
systick_interrupt_enable();
|
||||
systick_counter_enable();
|
||||
@ -238,41 +240,37 @@ static void hid_set_config(u16 wValue)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rcc_clock_setup_in_hsi_out_48mhz();
|
||||
int usb_connect_blink = 0;
|
||||
rcc_clock_setup_in_hse_12mhz_out_72mhz();
|
||||
|
||||
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
|
||||
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
|
||||
|
||||
/* USB_DETECT as input */
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT,
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT,
|
||||
GPIO_CNF_INPUT_FLOAT, GPIO8);
|
||||
|
||||
/* disconnect USB_DISC, as output */
|
||||
gpio_set(GPIOC, GPIO15);
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO15);
|
||||
|
||||
/* green LED off, as output */
|
||||
gpio_clear(GPIOC, GPIO13);
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO13);
|
||||
gpio_set(GPIOC, GPIO2);
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO2);
|
||||
|
||||
|
||||
usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings);
|
||||
usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings);
|
||||
usbd_register_set_config_callback(hid_set_config);
|
||||
|
||||
/* delay some seconds to show that pull-up switch works */
|
||||
{int i; for (i=0;i<0x800000;i++);}
|
||||
{int i; for (i=0;i<0x800000;i++) asm("nop");}
|
||||
|
||||
/* wait for USB Vbus */
|
||||
while(gpio_get(GPIOA, GPIO8) == 0);
|
||||
while(gpio_get(GPIOA, GPIO8) == 0) asm("nop");
|
||||
|
||||
/* green LED on, connect USB */
|
||||
gpio_set(GPIOC, GPIO13);
|
||||
gpio_clear(GPIOC, GPIO15);
|
||||
gpio_clear(GPIOC, GPIO2);
|
||||
//OTG_FS_GCCFG &= ~OTG_FS_GCCFG_VBUSBSEN;
|
||||
|
||||
while (1)
|
||||
while (1)
|
||||
usbd_poll();
|
||||
}
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
void clock_setup(void)
|
||||
{
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
|
||||
// #define COMPARE
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
#include <libopencm3/stm32/can.h>
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
/* Set STM32 to 72 MHz. */
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
|
||||
// #define COMPARE
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
|
||||
void clock_setup(void)
|
||||
@ -47,7 +47,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_RE_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 230400);
|
||||
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
@ -52,7 +52,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RE_RX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 230400);
|
||||
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_parity(USART1, USART_PARITY_NONE);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,11 +17,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/adc.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/adc.h>
|
||||
|
||||
void usart_setup(void)
|
||||
{
|
||||
@ -34,7 +34,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 115200);
|
||||
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,11 +17,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/dma.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/dma.h>
|
||||
|
||||
void usart_setup(void)
|
||||
{
|
||||
@ -34,7 +34,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 115200);
|
||||
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define DOGM128_H
|
||||
|
||||
#include <libopencm3/cm3/common.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/spi.h>
|
||||
|
||||
/* PB10 GPIO - ~RESET
|
||||
|
@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/i2c.h>
|
||||
#include "stts75.h"
|
||||
@ -35,7 +35,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 115200);
|
||||
usart_set_baudrate(USART1, 115200, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX_RX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rtc.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/rtc.h>
|
||||
#include <libopencm3/stm32/pwr.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
@ -43,7 +43,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 38400);
|
||||
usart_set_baudrate(USART1, 38400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/cdc.h>
|
||||
|
||||
|
@ -25,5 +25,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
|
||||
|
@ -25,5 +25,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/hid.h>
|
||||
@ -28,7 +28,7 @@
|
||||
#define INCLUDE_DFU_INTERFACE
|
||||
|
||||
#ifdef INCLUDE_DFU_INTERFACE
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
#endif
|
||||
|
||||
|
@ -25,5 +25,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
u16 exti_line_state;
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
/* Set STM32 to 24 MHz. */
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
void gpio_setup(void)
|
||||
{
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rtc.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/rtc.h>
|
||||
#include <libopencm3/stm32/pwr.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/exti.h>
|
||||
|
||||
u16 exti_line_state;
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/exti.h>
|
||||
|
||||
u16 exti_line_state;
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/exti.h>
|
||||
|
||||
#define FALLING 0
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
/* Set STM32 to 72 MHz. */
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
#define SPI_BANK GPIOB
|
||||
#define SCLK_PIN GPIO13
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
void gpio_setup(void)
|
||||
{
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/exti.h>
|
||||
|
||||
#define FALLING 0
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/spi.h>
|
||||
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,10 +17,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/timer.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/exti.h>
|
||||
|
||||
u16 frequency_sequence[18] = {
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
#include <libopencm3/stm32/dbgmcu.h>
|
||||
#include <libopencm3/cm3/scs.h>
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
|
||||
void clock_setup(void)
|
||||
@ -40,7 +40,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 38400);
|
||||
usart_set_baudrate(USART1, 38400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_mode(USART1, USART_MODE_TX);
|
||||
@ -55,7 +55,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART2, 38400);
|
||||
usart_set_baudrate(USART2, 38400, rcc_ppre1_frequency);
|
||||
usart_set_databits(USART2, 8);
|
||||
usart_set_stopbits(USART2, USART_STOPBITS_1);
|
||||
usart_set_mode(USART2, USART_MODE_TX);
|
||||
@ -70,7 +70,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART3_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART3, 38400);
|
||||
usart_set_baudrate(USART3, 38400, rcc_ppre1_frequency);
|
||||
usart_set_databits(USART3, 8);
|
||||
usart_set_stopbits(USART3, USART_STOPBITS_1);
|
||||
usart_set_mode(USART3, USART_MODE_TX);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
@ -49,7 +49,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 230400);
|
||||
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_parity(USART1, USART_PARITY_NONE);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
@ -145,7 +145,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_INPUT_FLOAT, GPIO_USART1_RX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 230400);
|
||||
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_parity(USART1, USART_PARITY_NONE);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/usart.h>
|
||||
#include <libopencm3/stm32/nvic.h>
|
||||
|
||||
@ -46,7 +46,7 @@ void usart_setup(void)
|
||||
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
|
||||
|
||||
/* Setup UART parameters. */
|
||||
usart_set_baudrate(USART1, 230400);
|
||||
usart_set_baudrate(USART1, 230400, rcc_ppre2_frequency);
|
||||
usart_set_databits(USART1, 8);
|
||||
usart_set_stopbits(USART1, USART_STOPBITS_1);
|
||||
usart_set_parity(USART1, USART_PARITY_NONE);
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/cdc.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
|
||||
|
@ -25,5 +25,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/systick.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/hid.h>
|
||||
@ -28,7 +28,7 @@
|
||||
#define INCLUDE_DFU_INTERFACE
|
||||
|
||||
#ifdef INCLUDE_DFU_INTERFACE
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
#endif
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/flash.h>
|
||||
#include <libopencm3/stm32/scb.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
#include <libopencm3/stm32/f1/flash.h>
|
||||
#include <libopencm3/stm32/f1/scb.h>
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
#include <libopencm3/usb/dfu.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
/* Set STM32 to 72 MHz. */
|
||||
void clock_setup(void)
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <libopencm3/stm32/rcc.h>
|
||||
#include <libopencm3/stm32/gpio.h>
|
||||
#include <libopencm3/stm32/f1/rcc.h>
|
||||
#include <libopencm3/stm32/f1/gpio.h>
|
||||
|
||||
#include <libopencm3/usb/usbd.h>
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f1.ld
|
||||
|
||||
|
@ -27,5 +27,5 @@ MEMORY
|
||||
}
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_stm32.ld
|
||||
INCLUDE libopencm3_stm32f2.ld
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
LIBNAME = libopencm3_lm3s
|
||||
|
||||
PREFIX ?= arm-none-eabi
|
||||
# PREFIX ?= arm-elf
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
CC = $(PREFIX)-gcc
|
||||
AR = $(PREFIX)-ar
|
||||
CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
LIBNAME = libopencm3_lpc13xx
|
||||
|
||||
PREFIX ?= arm-none-eabi
|
||||
# PREFIX ?= arm-elf
|
||||
PREFIX ?= arm-none-eabi
|
||||
#PREFIX ?= arm-elf
|
||||
CC = $(PREFIX)-gcc
|
||||
AR = $(PREFIX)-ar
|
||||
CFLAGS = -Os -g -Wall -Wextra -I../../include -fno-common \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user