diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/cstimer.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/cstimer.cpp index 83a6dd7a3c667da80785f3eb9425e259b31bb309..c0aa76168d85dc4e5639e34f2b1bc27759b63336 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/cstimer.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/cstimer.cpp @@ -1,3 +1,30 @@ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi, Sasan * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ + #include "interfaces/cstimer.h" #include "kernel/timeconversion.h" #include "cstimer_impl.h" @@ -15,7 +42,7 @@ namespace miosix { } void ContextSwitchTimer::IRQsetNextInterrupt(long long ns){ - pImpl->b.IRQsetNextInterrupt1(tc->ns2tick(ns)); + pImpl->b.IRQsetNextInterruptCS(tc->ns2tick(ns)); } long long ContextSwitchTimer::getNextInterrupt() const{ diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp index 83cfefbcd1951952fb5ee81af029b906bbfc8b84..910070148de72718bae35093014d2be7b6119678 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.cpp @@ -1,9 +1,29 @@ -/* - * File: gpio_timer.cpp - * Author: fabiuz - * - * Created on September 27, 2016, 6:30 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "gpio_timer.h" #include "hwmapping.h" @@ -36,10 +56,6 @@ bool GPIOtimer::absoluteWait(long long tick){ return false; } -bool GPIOtimer::getMode(){ - return isInput; -} - //NOTE: Think about how to set the right ms32chkp related to the captured timestamp long long GPIOtimer::getExtEventTimestamp() const{ return b.IRQgetSetTimeGPIO(); @@ -105,7 +121,6 @@ bool GPIOtimer::waitTrigger(long long tick){ */ bool GPIOtimer::absoluteSyncWaitTrigger(long long tick){ { - expansion::gpio1::high(); FastInterruptDisableLock dLock; if(isInput){ b.setModeGPIOTimer(false); //output timer @@ -116,7 +131,6 @@ bool GPIOtimer::absoluteSyncWaitTrigger(long long tick){ if(b.IRQsetNextGPIOInterrupt(tick)==WaitResult::WAKEUP_IN_THE_PAST){ return true; } - expansion::gpio1::low(); do { tWaiting=Thread::IRQgetCurrentThread(); Thread::IRQwait(); diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.h b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.h index 92b8fdae23c0366f21cca6efb1dd8d4469ad4bb4..95d62455b31805af54bf3caa6584c917c2cb31f3 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.h +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/gpio_timer.h @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: gpio_timer.h - * Author: fabiuz - * - * Created on September 27, 2016, 6:30 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "high_resolution_timer_base.h" #include "hwmapping.h" @@ -59,8 +73,6 @@ namespace miosix { long long tick2ns(long long tick); long long ns2tick(long long ns); - bool getMode(); - private: GPIOtimer(); HighResolutionTimerBase& b; diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.cpp index 426554bf29e792f7ff132970d0b0110912bd6472..b3653848b897310f053127d253d542bf530e4dbf 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.cpp @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: high_resolution_timer_base.cpp - * Author: fabiuz - * - * Created on September 27, 2016, 2:20 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi, Sasan * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "interfaces/arch_registers.h" #include "kernel/kernel.h" @@ -335,7 +349,7 @@ WaitResult HighResolutionTimerBase::IRQsetNextTransceiverInterrupt(long long tic } } -void HighResolutionTimerBase::IRQsetNextInterrupt1(long long tick){ +void HighResolutionTimerBase::IRQsetNextInterruptCS(long long tick){ // First off, disable timers to prevent unnecessary IRQ // when IRQsetNextInterrupt is called multiple times consecutively. TIMER1->IEN &= ~TIMER_IEN_CC1; diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.h b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.h index 925daecf7397468c15ef1153e19c9120b01682cd..f497a84b12b5fc11d0f4195fad3fbca7052522b3 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.h +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/high_resolution_timer_base.h @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: high_resolution_timer_base.h - * Author: fabiuz - * - * Created on September 27, 2016, 2:20 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "miosix.h" @@ -44,19 +58,21 @@ public: * \param tick the time when the interrupt will be fired, in timer ticks */ WaitResult IRQsetNextTransceiverInterrupt(long long tick); - void IRQsetNextInterrupt1(long long tick); + void IRQsetNextInterruptCS(long long tick); WaitResult IRQsetNextGPIOInterrupt(long long tick); /** * \return the time when the next interrupt will be fired. - * That is, the last value passed to setNextInterrupt(). + * That is, the last value passed to setNextInterrupt(), or the value + * captured in input mode. */ long long IRQgetSetTimeTransceiver() const; long long IRQgetSetTimeCS() const; long long IRQgetSetTimeGPIO() const; /* - * Clean buffer in TIMER used by GPIOTimer, necessary when input capture mode is enabled + * Clean buffer in TIMER used by GPIOTimer, necessary when input capture + * mode is enabled */ void cleanBufferGPIO(); void cleanBufferTrasceiver(); @@ -85,7 +101,7 @@ public: * Function to prepare the timers to works in a given mode. For Transceiver, * it use 2 different low channel, so we can set both of them at the * beginning of our code. - * @param input true to set the input/capture mode, false to set the output + * \param input true to set the input/capture mode, false to set the output * mode */ void setModeGPIOTimer(bool input); diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/timer_interface.h b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/timer_interface.h index d5a6b8fda066475745ac15719c8e472537547d5f..2b80ba739a7286df1dfe3a9a11c764df2284f01e 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/timer_interface.h +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/timer_interface.h @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: timer.h - * Author: fabiuz - * - * Created on October 17, 2016, 10:27 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Federico Terraneo, Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #ifndef TIMER_INTERFACE_H #define TIMER_INTERFACE_H diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.cpp b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.cpp index a8c8ef9806608cc5f831d060c664d6e86be1056e..3e113111e91c08f36914b6e8fc132a4ef2a31290 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.cpp +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.cpp @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: radio_timer.cpp - * Author: fabiuz - * - * Created on October 11, 2016, 11:17 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "transceiver_timer.h" diff --git a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.h b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.h index 99250e961a2515839382a84fef3086a983e75595..556e8ba775d04b75dd0991adb1c867fbf66776e1 100644 --- a/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.h +++ b/miosix/arch/cortexM3_efm32gg/efm32gg332f1024_wandstem/interfaces-impl/transceiver_timer.h @@ -1,15 +1,29 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: radio_timer.h - * Author: fabiuz - * - * Created on October 11, 2016, 11:17 AM - */ +/*************************************************************************** + * Copyright (C) 2016 by Fabiano Riccardi * + * * + * 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 * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * As a special exception, if other files instantiate templates or use * + * macros or inline functions from this file, or you compile this file * + * and link it with other works to produce a work based on this file, * + * this file does not by itself cause the resulting work to be covered * + * by the GNU General Public License. However the source code for this * + * file must still be made available in accordance with the GNU General * + * Public License. This exception does not invalidate any other reasons * + * why a work based on this file might be covered by the GNU General * + * Public License. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, see <http://www.gnu.org/licenses/> * + ***************************************************************************/ #include "high_resolution_timer_base.h" #include "timer_interface.h"