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 --- .../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 -------- 6 files changed, 264 deletions(-) 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 (limited to 'examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch') diff --git a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/Makefile b/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/Makefile deleted file mode 100644 index d3a1987..0000000 --- a/examples/efm32/tinygecko/efm32-tg-stk3300/lightswitch/Makefile +++ /dev/null @@ -1,22 +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 . -## - -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" -- cgit v1.2.3