aboutsummaryrefslogtreecommitdiff
path: root/libmaple/nvic.h
AgeCommit message (Collapse)Author
2012-04-11Move public headers to include directories; related cleanups.Marti Bolivar
Move libmaple/*.h to (new) libmaple/include/libmaple/. The new accepted way to include a libmaple header foo.h is with: #include <libmaple/foo.h> This is more polite in terms of the include namespace. It also allows us to e.g. implement the Arduino SPI library at all (which has header SPI.h; providing it was previously impossible on case-insensitive filesystems due to libmaple's spi.h). Similarly for Wirish. The old include style (#include "header.h") is now deprecated. libmaple/*.h: - Change include guard #defines from _FOO_H_ to _LIBMAPLE_FOO_H_. - Add license headers where they're missing - Add conditional extern "C" { ... } blocks where they're missing (they aren't always necessary, but we might was well do it against the future, while we're at it.). - Change includes from #include "foo.h" to #include <libmaple/foo.h>. - Move includes after extern "C". - Remove extra trailing newlines Note that this doesn't include the headers under libmaple/usb/ or libmaple/usb/usb_lib. These will get fixed later. libmaple/*.c: - Change includes from #include "foo.h" to #include <libmaple/foo.h>. Makefile: - Add I$(LIBMAPLE_PATH)/include/libmaple to GLOBAL_FLAGS. This allows for users (including Wirish) to migrate their code, but should go away ASAP, since it slows down compilation. Wirish: - Move wirish/**/*.h to (new) wirish/include/wirish/. This ignores the USB headers, which, as usual, are getting handled after everything else. - Similarly generify wirish/boards/ structure. For each supported board "foo", move wirish/boards/foo.h and wirish/boards/foo.cpp to wirish/boards/foo/include/board/board.h and wirish/boards/foo/board.cpp, respectively. Also remove the #ifdef hacks around the .cpp files. - wirish/rules.mk: put wirish/boards/foo/include in the include path (and add wirish/boards/foo/board.cpp to the list of sources to be compiled). This allows saying: #include <board/board.h> instead of the hack currently in place. We can allow the user to override this setting later to make adding custom board definitions easier. - Disable -Werror in libmaple/rules.mk, as the current USB warnings don't let the olimex_stm32_h103 board compile. We can re-enable -Werror once we've moved the board-specific bits out of libmaple proper. libraries, examples: - Update includes accordingly. - Miscellaneous cosmetic fixups. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-09-24nvic: Add nvic_sys_reset().Marti Bolivar
This uses the SCB_AIRCR register to force a system reset. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2011-09-13Added more doxygen file level headers. Documented a few more functions.Michael Hope
Signed-off-by: Michael Hope <michaelh@juju.net.nz>
2011-08-22nvic.h: DoxygenMarti Bolivar
2011-06-07Keep it 80-column clean.Marti Bolivar
Go through overlong source code lines and convert as many of them as appropriate to be 80-column clean. This mostly affects license headers. Overlong lines are determined by running following from the libmaple base directory: $ ack-grep --nocolor --nogroup --cpp --cc --ignore-dir=usb -- '.{80}' Note that this excludes libmaple's usb subdirectory, which is still full of ST code that doesn't follow the libmaple source code guidelines. Contents of ~/.ackrc (these won't matter, but are included for completeness): --ignore-dir=docs --ignore-dir=build --type-set ld=.ld --type-set rst=.rst --type-set txt=.txt --type-set mk=.mk
2011-05-26Tweak some register map base pointers.Marti Bolivar
Replace #define XXX_BASE ((xxx_reg_map*)0xDEADBEEF) with #define XXX_BASE ((struct xxx_reg_map*)0xDEADBEEF) for increased GDB-friendliness.
2011-05-12libmaple: Fix warnings in libmaple source filesPerry Hung
-Add -Wall, -Werror to libmaple/* -Fix warnings
2011-04-12Adding guards for negative nvic_irq_num enumerators.Marti Bolivar
nvic_irq_enable() and nvic_irq_disable() previously didn't protect against negative arguments.
2011-04-11DMA checkpoint; dma_attach_interrupt() is broken.Marti Bolivar
Simple USART receiver to SRAM buffer demo partially working. Interrupting when buffer is full fails mysteriously. GDB thinks we ended up in an STM32 reserved exception.
2011-04-07Renaming some nvic_irq_num enumerators for better readability.Marti Bolivar
2011-04-05NVIC and SCB refactorMarti Bolivar
2011-03-24Initial timer refactor.Marti Bolivar
Basic PWM works. Had some problems in testing that might be due to USART bugs. HardwareTimer has been removed from the build for now; I will re-implement it in terms of the new libmaple API, but consider it deprecated. Let's come up with something better. Servo is implemented in terms of HardwareTimer, so it also has been temporarily removed from the build. pwmWrite() likely got a little bit less inefficient due to indirection, but the PIN_MAPs shrank by a pointer per PinMapping.
2011-02-26checkpointPerry Hung
2011-02-15undoing USART[45] -> UART[45] mistakeMarti Bolivar
2011-01-26[WIP] Code review picked up some bugs/issues.Marti Bolivar
2010-12-30Changed nzmichaelh's initial DMA interface to be more flexible.Marti Bolivar
Some bugfixes in the external interrupt code were found along the way. Defines for nonexistent registers removed from nvic interface.
2010-09-29Merge remote branch 'upstream/master'Michael Hope
2010-09-29Fixed up the build due to a missing header file.Michael Hope
2010-09-27whitespace cleanupsMarti Bolivar
2010-09-22Enable external interrupts on all Maple GPIOs.Perry Hung
Extend the wirish attachInterrupt() and detachInterrupt() interface to work with all GPIOs. Note: The STM32 external interrupt lines are multiplexed between GPIO ports. While any GPIO can be used as an external interrupt, not all of them can be used at the same time. Each EXTI[n] line selects between PA[n], PB[n], PC[n], etc. For example, line EXTI5 can be used with STM32 pins PA5, PB5, or PC5, but not all at the same time. See table: EXTI Line Maple Pin STM32 Pin 0 D2 PA0 0 D27 PB0 0 D15 PC0 1 D3 PA1 1 D28 PB1 1 D16 PC1 2 D1 PA2 2 D17 PC2 2 D25 PD2 3 D0 PA3 3 D18 PC3 4 D10 PA4 4 D19 PC4 5 D13 PA5 5 D4 PB5 5 D20 PC5 6 D12 PA6 6 D5 PB6 6 D35 PC6 7 D11 PA7 7 D9 PB7 7 D36 PC7 8 D6 PA8 8 D14 PB8 8 D37 PC8 9 D7 PA9 9 D24 PB9 9 D38 PC9 (BUT) 10 D8 PA10 10 D29 PB10 10 D26 PC10 11 D30 PB11 12 D31 PB12 13 D32 PB13 13 D21 PC13 14 D33 PB14 14 D22 PC14 15 D34 PB15 15 D23 PC15
2010-09-14Fix enable/disable global irqPerry Hung
Oooooops.
2010-09-05timer fixes for maple nativebnewbold
2010-08-31Portability fixesbnewbold
Still not working but fixed a lot of merge errors
2010-08-25inital portability workbnewbold
2010-08-04Cleaned up wirish/time, some interrupt handling refactoring:Perry Hung
Fixed millis(), it was just wrong, before. Added micros(), not extensively tested. New implementation of delayMicroseconds(). Should be more consistent now. Added a handful of nvic routines to enable/disable interrupts. Cleaned up systick
2010-08-04New usart implementation:Perry Hung
Fixed a bug where the maximum baud rate was incorrectly set to 225000 General cleanup Use new rcc and nvic APIs
2010-07-18nvic_disable_interruptbnewbold
2010-04-25Refactoring:Perry Hung
The 'core' directory has now been renamed to 'wirish.' Wirish is our version of the Arduino Wiring language.
2010-03-31Licensing: Relicensed libmaple under the MIT License.Perry Hung
Relicensed the bulk of libmaple under the more permissive MIT License, from GPLv3. Files that were largely or entirely derived from the Arduino, STM, or Lanchon retain their original licenses.
2010-03-30Removed STM32 flash code, replaced with barebones hacks for now.Perry Hung
At this point, there shouldn't be any STM code being compiled and linked against. There are still a bunch of STM header includes, though.
2010-03-31Major hierarchy reorganization; see README.bnewbold
copy-to-ide and Makefile updated to conform; .gitignore added; LICENSE added