From 4a6f4c0f7d62858a4a9afba18f11289cb0bb8358 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sat, 15 Sep 2012 01:29:31 +0200 Subject: remove the support libraries for efm32 i don't plan to extend or support them, and they'll just grow stale --- examples/efm32/tinygecko/Makefile.include | 97 ----------- .../tinygecko/efm32-tg-stk3300/Makefile.include | 29 ---- examples/efm32/tinygecko/efm32-tg-stk3300/README | 9 - .../tinygecko/efm32-tg-stk3300/lcd_demo/Makefile | 23 --- .../tinygecko/efm32-tg-stk3300/lcd_demo/README | 8 - .../lcd_demo/generate_lcd_mapping.py | 76 -------- .../tinygecko/efm32-tg-stk3300/lcd_demo/lcd_demo.c | 130 -------------- .../efm32-tg-stk3300/lcd_demo/lcd_mapping.yaml | 192 --------------------- .../efm32-tg-stk3300/lightswitch/Makefile | 22 --- .../tinygecko/efm32-tg-stk3300/lightswitch/README | 13 -- .../lightswitch/lightswitch-busywait.c | 40 ----- .../lightswitch/lightswitch-common.c | 88 ---------- .../lightswitch/lightswitch-interrupt.c | 71 -------- .../efm32-tg-stk3300/lightswitch/lightswitch.c | 30 ---- .../tinygecko/efm32-tg-stk3300/miniblink/Makefile | 23 --- .../tinygecko/efm32-tg-stk3300/miniblink/README | 9 - .../efm32-tg-stk3300/miniblink/miniblink.c | 71 -------- 17 files changed, 931 deletions(-) delete mode 100644 examples/efm32/tinygecko/Makefile.include delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/README delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/Makefile delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/README delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/generate_lcd_mapping.py delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/lcd_demo.c delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/lcd_mapping.yaml delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/Makefile delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/README delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-busywait.c delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-common.c delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-interrupt.c delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch.c delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/Makefile delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/README delete mode 100644 examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c (limited to 'examples/efm32/tinygecko') diff --git a/examples/efm32/tinygecko/Makefile.include b/examples/efm32/tinygecko/Makefile.include deleted file mode 100644 index 8c42816..0000000 --- a/examples/efm32/tinygecko/Makefile.include +++ /dev/null @@ -1,97 +0,0 @@ -## -## This file is part of the libopencm3 project. -## -## Copyright (C) 2009 Uwe Hermann -## Copyright (C) 2010 Piotr Esden-Tempski -## Copyright (C) 2012 chrysn -## -## 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 . -## - -PREFIX ?= arm-none-eabi -#PREFIX ?= arm-elf -CC = $(PREFIX)-gcc -LD = $(PREFIX)-gcc -OBJCOPY = $(PREFIX)-objcopy -OBJDUMP = $(PREFIX)-objdump -GDB = $(PREFIX)-gdb -# Uncomment this line if you want to use the installed (not local) library. -#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\ - -D$(FAMILY) -LDSCRIPT ?= ${TOOLCHAIN_DIR}/lib/efm32/tinygecko/$(MCU).ld -LDFLAGS += -lc -lnosys -L$(TOOLCHAIN_DIR)/lib/efm32/tinygecko \ - -T$(LDSCRIPT) -nostartfiles -Wl,--gc-sections \ - -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float -OBJS += $(BINARY).o - -# Be silent per default, but 'make V=1' will show all compiler calls. -ifneq ($(V),1) -Q := @ -NULL := 2>/dev/null -else -LDFLAGS += -Wl,--print-gc-sections -endif - -.SUFFIXES: .elf .bin .hex .srec .list .images -.SECONDEXPANSION: -.SECONDARY: - -all: images - -images: $(BINARY).images -flash: $(BINARY).flash - -%.images: %.bin %.hex %.srec %.list - @#echo "*** $* images generated ***" - -%.bin: %.elf - @#printf " OBJCOPY $(*).bin\n" - $(Q)$(OBJCOPY) -Obinary $(*).elf $(*).bin - -%.hex: %.elf - @#printf " OBJCOPY $(*).hex\n" - $(Q)$(OBJCOPY) -Oihex $(*).elf $(*).hex - -%.srec: %.elf - @#printf " OBJCOPY $(*).srec\n" - $(Q)$(OBJCOPY) -Osrec $(*).elf $(*).srec - -%.list: %.elf - @#printf " OBJDUMP $(*).list\n" - $(Q)$(OBJDUMP) -S $(*).elf > $(*).list - -%.elf: $(OBJS) $(LDSCRIPT) $(TOOLCHAIN_DIR)/lib/efm32/tinygecko/libopencm3_efm32tinygecko.a - @#printf " LD $(subst $(shell pwd)/,,$(@))\n" - $(Q)$(LD) -o $(*).elf $(OBJS) -lopencm3_efm32tinygecko $(LDFLAGS) - -%.o: %.c Makefile - @#printf " CC $(subst $(shell pwd)/,,$(@))\n" - $(Q)$(CC) $(CFLAGS) -o $@ -c $< - -clean: - $(Q)rm -f *.o - $(Q)rm -f *.d - $(Q)rm -f *.elf - $(Q)rm -f *.bin - $(Q)rm -f *.hex - $(Q)rm -f *.srec - $(Q)rm -f *.list - -.PHONY: images clean - --include $(OBJS:.o=.d) - diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include b/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include deleted file mode 100644 index 218abd8..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/Makefile.include +++ /dev/null @@ -1,29 +0,0 @@ -## -## This file is part of the libopencm3 project. -## -## Copyright (C) 2012 chrysn -## -## 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 . -## - -MCU = EFM32TG840F32 -FAMILY = TINYGECKO - -EACOMMANDER = ~/energymicro/energymicro/eACommander.sh - -include $(dir $(lastword $(MAKEFILE_LIST)))../Makefile.include - -upload: $(BINARY).bin - # eacommander is just as nonfree as jlink.sh, but much less of a hasle - $(EACOMMANDER) --flash $< --verify --mode mcu --address 0 --reset diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/README b/examples/efm32/tinygecko/efm32-tg-stk3300/README deleted file mode 100644 index ffa3b59..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/README +++ /dev/null @@ -1,9 +0,0 @@ -========================= -EFM32-TG-STK3300 Examples -========================= - -Examples in this directory are designed to be run on the Energy Micro EFM32 -Tiny Gecko Starter Kit, which is based on the EFM32TG840F32 MCU, has an onboard -USB debug and power management interface, and a bunch of peripherials built in -that demonstrate the chip's low power capabilities (LED, LCD display, light -sensor, touch slider, LC sensor, push buttons). diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/Makefile b/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/Makefile deleted file mode 100644 index 7ef06ad..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -## -## This file is part of the libopencm3 project. -## -## Copyright (C) 2009 Uwe Hermann -## Copyright (C) 2012 chrysn -## -## 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 . -## - -BINARY = lcd_demo - -include ../Makefile.include diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/README b/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/README deleted file mode 100644 index 207ed10..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/README +++ /dev/null @@ -1,8 +0,0 @@ -========================================= -EFM32-TG-STK3300 Examples LCD Demo README -========================================= - -This is an example on how to use the LCD peripherial on Energy Micro Tiny Gecko -chips. - -It's intended for the EFM32-TG-STK3300 eval board. diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/generate_lcd_mapping.py b/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/generate_lcd_mapping.py deleted file mode 100644 index 1b6405f..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lcd_demo/generate_lcd_mapping.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python - -import yaml - -class Font(dict): - def __init__(self, letterdict): - for (k, v) in letterdict.items(): - self[k] = set(v.split()) - -class Display(object): - def __init__(self, data): - self.mapping = {} - - for c, segs in enumerate(data['coms']): - for s, name in enumerate(segs): - self.mapping[name] = (c, s) - - def render_text(self, text, symbols, font): - cursor = 1 - segments = set() - for letter in text: - if letter == '.': - segments.add("a%s_dp"%(cursor-1)) - elif letter == ':': - segments.add("a%s_colon"%(cursor-1)) - elif letter in font: - for segment in font[letter]: - segments.add("a%s_%s"%(cursor, segment)) - cursor += 1 - - for s in symbols: - segments.add(s) - - coms = {} - for segment in segments: - com, seg = self.mapping[segment] - coms[com] = coms.get(com, 0) | (1< - * - * 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 . - */ - -/** @file - * Demo of the LCD display aboard the EFM32-TG-STK330 eval board. - */ - -#include -#include -#include -#include "../lightswitch/lightswitch-common.c" -void led_toggle(void) { gpio_toggle(GPIO_PD, GPIO7); } - -void delay(void) -{ - int x; - - /* Start up delay until we mess with clock stuff, so the debugger can catch up. */ - for(x = 0; x < 10000000; ++x) led_on(); -} - -void lcd_init(void) -{ - /* LCD is a LE module. We're constantly powered on for now, so using - * HFCORECLK/2 */ - CMU_HFCORECLKEN0 |= CMU_HFCORECLKEN0_LE; - CMU_LFCLKSEL = (CMU_LFCLKSEL & ~CMU_LFCLKSEL_LFA_MASK) | CMU_LFCLKSEL_LFA_HFCORECLKLEDIV2; - /* We need to get this down to reasonable 100Hz from 14MHz, 7MHz at - * LFACLK, 70kHz after LFA prescaler, 10kHz after FDIV. Octaplexing - * brings us down to about 500Hz. */ - CMU_LFAPRESC0 |= CMU_LFAPRESC0_LCD_DIV128; - CMU_LCDCTRL |= CMU_LCDCTRL_FDIV_MASK; /* factor 7+1 */ - - /* If we don't wait for the prescaler to become ready, the "Do it" step - * won't pass. */ - while (CMU_SYNCBUSY & CMU_SYNCBUSY_LFAPRESC0); - - CMU_LFACLKEN0 |= CMU_LFACLKEN0_LCD; - - while (CMU_SYNCBUSY & CMU_SYNCBUSY_LFACLKEN0); - - /* Voltage is around 3.3V anyway, we don't need voltage boosting, - * leaving it disabled. I don't fully understand the implications of - * biasing yet, but it seems like he more biased the better, and will - * just affect frame rate negatively. */ - LCD_DISPCTRL = (LCD_DISPCTRL & ~(LCD_DISPCTRL_BIAS_MASK | LCD_DISPCTRL_MUX_MASK)) | LCD_DISPCTRL_BIAS_ONEFOURTH | LCD_DISPCTRL_MUX_OCTAPLEX; - - /* Segments default to disabled, enable the 20 relevant ones */ - LCD_SEGEN = ~(~0<<5); - - /* Do it */ - LCD_CTRL |= LCD_CTRL_EN; - - while (LCD_SYNCBUSY & LCD_SYNCBUSY_CTRL) led_off(); - led_on(); -} - -void set_bank(u8 com, u32 data) -{ - switch(com) - { - case 0: LCD_SEGD0L = data; break; - case 1: LCD_SEGD1L = data; break; - case 2: LCD_SEGD2L = data; break; - case 3: LCD_SEGD3L = data; break; - case 4: LCD_SEGD4L = data; break; - case 5: LCD_SEGD5L = data; break; - case 6: LCD_SEGD6L = data; break; - case 7: LCD_SEGD7L = data; break; - } -} - -int main(void) -{ - u8 active_bit = 0; - u8 active_com = 0; - - gpio_setup(); - -// delay(); - - lcd_init(); - - /* "{FNORD}" with a gecko as generated by current generate_lcd_mapping.py */ -set_bank(0, 0x000a00); -set_bank(1, 0x0031cb); -set_bank(2, 0x004622); -set_bank(3, 0x0012a8); -set_bank(4, 0x00481a); -set_bank(5, 0x001140); -set_bank(6, 0x004642); -set_bank(7, 0x0051ac); - - while(1) - { - if (pb0_get()) - { - while(pb0_get()); - - set_bank(active_com, ~0); - active_bit = (active_bit + 1) % 21; /* one more to see where 0 is */ - set_bank(active_com, ~(1< -## -## 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 . -## - -BINARY = lightswitch - -include ../Makefile.include diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/README b/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/README deleted file mode 100644 index 41943dc..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/README +++ /dev/null @@ -1,13 +0,0 @@ -============================================ -EFM32-TG-STK3300 Examples lightswitch README -============================================ - -This is a small example program for GPIO input and output, and how the device -can be configured to use minimal power (although the example is merely -scratching the surface of what is possible powersaving-wise). - -It's intended for the EFM32-TG-STK3300 eval board. It turn the User LED on when -PB0 is pressed, and off when PB1 is pressed. - -Various implementations are offered (-busywait, -interrupt), and can configured -in lightswitch.c. diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-busywait.c b/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-busywait.c deleted file mode 100644 index d78d0e1..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-busywait.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2012 chrysn - * - * 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 . - */ - -#include -#include - -#define ISER0 MMIO32(0xE000E100) -#define ICER0 MMIO32(0xE000E180) -#define ISPR0 MMIO32(0XE000E200) -#define ICPR0 MMIO32(0XE000E280) - -/** @file Simplest implementation of the lightswitch mechanism. */ - -int main(void) -{ - gpio_setup(); - - while(1) { - if (pb0_get()) - led_on(); - if (pb1_get()) - led_off(); - }; -} diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-common.c b/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-common.c deleted file mode 100644 index dcc5984..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-common.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2012 chrysn - * - * 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 . - */ - -/** @file Common definitions used by all lightswitch implementations */ - -#include -#include - -/** The User LED is connected to PD7 to the plus side of the LED according to - * t0011_efm32_tiny_gecko_stk_user_manual.pdf figures 16.2 and 16.3 (called - * UIF_LED0) - */ -#define LED_PORT GPIO_PD -#define LED_PIN GPIO7 - -#define BUTTON0_PORT GPIO_PD -#define BUTTON0_PORT_EXTIPSEL GPIO_EXTIPSEL_PORTD -#define BUTTON0_PIN_NUMBER 8 -#define BUTTON0_PIN GPIO8 -#define BUTTON1_PORT GPIO_PB -#define BUTTON1_PORT_EXTIPSEL GPIO_EXTIPSEL_PORTB -#define BUTTON1_PIN_NUMBER 11 -#define BUTTON1_PIN GPIO11 - -void gpio_setup(void); -void led_on(void); -void led_off(void); - -bool pb0_get(void); -bool pb1_get(void); - -/** - * Enable GPIO, and set up port D7 as an output pin and D8 and B11 as input. - */ - -void gpio_setup(void) -{ - // Before GPIO works, according to d0034_efm32tg_reference_manual.pdf - // note in section 28.3.7, we'll have to enable GPIO in CMU_HFPERCLKEN0 - - CMU_HFPERCLKEN0 |= CMU_HFPERCLKEN0_GPIO; - - gpio_set_mode(LED_PORT, GPIO_MODE_PUSHPULL, LED_PIN); - - // Button PB0 is connected to pin PD8 and pulled low when pushed, - // Botton PB1 to pin PB11 (sources as for LED). Pullups and debouncing - // are alreay in place in hardware, so no filtering or pullup is - // needed. - - gpio_set_mode(BUTTON0_PORT, GPIO_MODE_INPUT, BUTTON0_PIN); - gpio_set_mode(BUTTON1_PORT, GPIO_MODE_INPUT, BUTTON1_PIN); -} - -void led_on(void) -{ - gpio_set(LED_PORT, LED_PIN); -} - -void led_off(void) -{ - gpio_clear(LED_PORT, LED_PIN); -} - -bool pb0_get(void) -{ - return !gpio_get(GPIO_PD, GPIO8); -} - -bool pb1_get(void) -{ - return !gpio_get(GPIO_PB, GPIO11); -} diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-interrupt.c b/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-interrupt.c deleted file mode 100644 index 71a1008..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/lightswitch-interrupt.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2012 chrysn - * - * 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 . - */ - -#include -#include - -#define ISER0 MMIO32(0xE000E100) - -void interrupt_setup() -{ - // These are the ports the pin interrupts for 8 and 11 are to be - // configured to, and they should trigger on falling edge. - - GPIO_EXTIPSELH = (BUTTON0_PORT_EXTIPSEL << ((BUTTON0_PIN_NUMBER-8)*4)) | - (BUTTON1_PORT_EXTIPSEL << ((BUTTON1_PIN_NUMBER-8)*4)); - - GPIO_EXTIFALL = BUTTON0_PIN | BUTTON1_PIN; - - // Enable interrupts on the GPIO side - - GPIO_INSENSE = GPIO_INSENSE_INT; - GPIO_IEN = BUTTON0_PIN | BUTTON1_PIN; - - // Enable GPIO interrupts in NVIC - - ISER0 = (1< - * - * 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 . - */ - -/** @file - * Example for switching the User LED of the EFM32-TG-STK330 eval board on and - * off using the buttons. - */ - -#include "lightswitch-common.c" - -/** Change this include to -busywait, -interrupt, or -prs (not implemented - * yet). The overall behavior will not change, but different implementations - * will be used. */ -#include "lightswitch-busywait.c" diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/Makefile b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/Makefile deleted file mode 100644 index 760b99b..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -## -## This file is part of the libopencm3 project. -## -## Copyright (C) 2009 Uwe Hermann -## Copyright (C) 2012 chrysn -## -## 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 . -## - -BINARY = miniblink - -include ../Makefile.include diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/README b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/README deleted file mode 100644 index d19e4fe..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/README +++ /dev/null @@ -1,9 +0,0 @@ -========================================== -EFM32-TG-STK3300 Examples miniblink README -========================================== - -This is the smallest-possible example program using libopencm3. - -It's intended for the EFM32-TG-STK3300 eval board. It should blink -the user LED on the board. - diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c b/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c deleted file mode 100644 index 0269847..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/miniblink/miniblink.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2009 Uwe Hermann - * Copyright (C) 2012 chrysn - * - * 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 . - */ - -#include -#include - -void led_setup(void); -void led_toggle(void); - -/** @file - * Minimal example for making the User LED of the EFM32-TG-STK330 eval board blink. - */ - -/** - * Toggle the User LED in an infinite loop, with time between the toggling - * determined by a busy loop stupidly counting up. - */ - -int main(void) -{ - int x; - - led_setup(); - - while(1) { - for(x = 0; x < 200000; ++x) asm("mov r0,r0"); /* no-op, prevent compiler from optimizing this away */ - led_toggle(); - }; -} - -/** - * Enable GPIO, and set up port D7 as an output pin. - */ - -void led_setup(void) -{ - // Before GPIO works, according to d0034_efm32tg_reference_manual.pdf - // note in section 28.3.7, we'll have to enable GPIO in CMU_HFPERCLKEN0 - - CMU_HFPERCLKEN0 |= CMU_HFPERCLKEN0_GPIO; - - // The User LED is connected to PD7 to the plus side of the LED - // according to t0011_efm32_tiny_gecko_stk_user_manual.pdf figures 16.2 - // and 16.3 (called UIF_LED0) - - gpio_set_mode(GPIO_PD, GPIO_MODE_PUSHPULL, GPIO7); - // GPIO_PD_MODEL = GPIO_MODE_PUSHPULL<<(7*4); -} - -void led_toggle(void) -{ - gpio_toggle(GPIO_PD, GPIO7); - // GPIO_PD_DOUTTGL = 1<<7; -} -- cgit v1.2.3