aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-01-17Move endpoint definitions to include files (they are now needed outside in ↵Manuel Odendahl
usb_serial.cpp) Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Rename misleading ptr functionManuel Odendahl
Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Fix BKP write enableManuel Odendahl
Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Set DCNTR before starting DMA transfer.Manuel Odendahl
I am not sure why this would work for most DMA transfers but I ran into trouble when doing SDIO DMA. Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Refactor setting a USB EP rx countManuel Odendahl
Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Rename USB_EP_EP_KIND to USB_EP_EP_KIND_DBL_BUFManuel Odendahl
Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-17Add double buffering routinesManuel Odendahl
Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2013-01-05Add fix to support Summon/Linaro GCC ARM embedded toolchain.Dmitry Prokhorov
Signed-off-by: Dmitry Prokhorov <dipspb@gmail.com>
2013-01-01examples/blinky.cpp: Use toggleLED() instead of digitalWrite().Marti Bolivar
Keep things simple. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-11-08Merge remote-tracking branch 'wesen/bug/high-density-irqs'Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-11-08usb_cdcacm.c: reenable the endpoint if an empty bulk transfer was received.Manuel Odendahl
It is possible to receive empty bulk transfers. This would lead to the endpoint never being reenabled as this was handled by the read routine. This caused the USB to hang. Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2012-11-07stm32f1/rules.mk: update include path for assembler filesManuel Odendahl
stm32f1/performance: load stm32.h in order to have STM32_HIGH_DENSITY when necessary STM32_HIGH_DENSITY was not defined in isrs.S and vector_table.S for a high density STM32. This was because stm32.h where the flag is now defined (in contrast to being defined on the command line in an earlier version of libmaple) was not included. This led to crashes when using one of the high density peripherals. Updated the ASFLAGS to have the correct include path in rules.mk. Include stm32.h in the assembler files. Signed-off-by: Manuel Odendahl <wesen@ruinwesen.com>
2012-09-05Added I2C slave echo example in examples folder. Using another maple, write ↵Barry Carter
a byte and then read. Slight tidy up. Reformatted CREDITS file to be in correct order. Added a note about buffer overrun Signed-off-by:- Barry Carter <barry.carter@gmail.com>
2012-09-04I2C slave support cleanups.Barry Carter
Added fix for corner case where badly behaving master doesn't NACK and we don't get the callbacks fires. Removed my own name from several places and added attribution to the correct place. Updated include comments to reference the fact it now supports I2C slave Signed-off-by:- Barry Carter <barry.carter@gmail.com>
2012-09-04Add some missing LeafLabs copyright notices.Marti Bolivar
Sigh; Emacs's elide-head feature makes it easy to forget to update these. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-09-03exti.c: Use exti_num enumerators instead of magic values.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-09-03Merge branch 'callback_interrupt_handlers'Marti Bolivar
2012-09-03EXTI examples: whitespace fixups.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-09-03ext_interrupts.cpp: Doxygen fixups.Marti Bolivar
Keep the Doxygen in the header as per Wirish conventions. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-09-03Whitespace fixups to EXTI files.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-09-03"Changed tabs to spaces. Changed some braces placement to match existing ↵Aditya Gaddam
examples Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com>"
2012-09-03"Added two examples for using attachInterrupt. One shows the use of a global ↵Aditya Gaddam
function. While the second shows the use of a static class method as the event handler. Both work on Maple REVC Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com>"
2012-09-03- tx and rx callbacks for each moduleBarry Carter
- Callbacks can be called after each read/write cycle or per byte - Each I2C module can have different callbacks - General call support also working - Supports master and slave at same time. Also works with multimaster Usage: i2c_msg msg; char buffer[255]; main() { i2c_slave_enable(I2C1, I2C_FAST_MODE | I2C_SLAVE_DUAL_ADDRESS | I2C_SLAVE_GENERAL_CALL | I2C_SLAVE_USE_RX_BUFFER); // init slave mode. Enables master too i2c_slave_attach_recv_handler(I2C1, pmsg, funcrx); // attach receive handler i2c_slave_attach_transmit_handler(I2C1, pmsg, functx); // attach transmit handler i2c_slave_set_own_address(I2C1, 0x10); // set addresss 1 i2c_slave_set_own_address2(I2C1, 0x20); // set addresss 2 } void funcrx(i2c_msg *msg) { printf("length is %d.\n", msg->length); char return_data = msg0>data[0]; } void functx(i2c_msg *dev) { msg->data[0] = 0x01; msg->data[1] = 0x02; msg->data[2] = 0x03; msg->data[3] = 0x04; msg->data[4] = 0x05; msg->length = 5; } All code derived from datasheets and libmaple. Signed-off-by:- Barry Carter <barry.carter@gmail.com>
2012-09-02"Callback versions of functions now take voidArgumentFuncPtr. We can ↵Aditya Gaddam
probably use voidFuncPtr instead, but this way people can see that the function expects something different. Existing functions haven't changed in signature. Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com>"
2012-08-31Include <stdint.h> from wirish.h.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-31Fixups for Wire library builds.Marti Bolivar
Add libraries directory to global include path, so Wire sub-headers can be included in a directory-independent way. Tweak Wire global declaration and definition so it builds. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-31"Added ability to set callbacks for interrupts that get an argument. This ↵Aditya Gaddam
argument can be the instance that needs to handle the interrupt, or just a random argument you might find useful later. Suggestions from mbolivar and iperry from pull53 on libmaple were taken into account. Signed-off-by: Aditya Gaddam <adityagaddam@gmail.com>"
2012-08-27HardwareSPI: move warning into .cpp from header.Marti Bolivar
This causes the warning to be emitted at most once. As is, it can be emitted each time HardwareSPI.h is included, which is annoying. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-27usb_serial.cpp: Hackishly silence spurious warnings on VLDiscovery.Marti Bolivar
Guard hooks with BOARD_HAVE_SERIALUSB to keep GCC quiet. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-23notes/interrupts.txt: Fix typos and other errors.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-23Add notes/interrupts.txt.Marti Bolivar
This is a developer's doc explaining how interrupts are handled in libmaple. It's time we exposed this information to enable people who know what they're doing to move around more easily. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-22Revert "Re-work the constraints on delay_us(). Ask GCC to allocate a register"Marti Bolivar
This reverts commit 715a63dccb3a39d7d0502fb39b900c8302a60a87. It fails to build using the 2010 CodeSourcery toolchain, which is still the latest officially supported version. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-22usb_serial.cpp: Neaten up reset signal RX hook.Marti Bolivar
Move magic bytes from stack to Flash. De-magic-number sizeof magic byte buffer. Use uintptr_t instead of unsigned int when casting address of wait_reset(). Based on a patch by Michael Hope. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-22Re-work the constraints on delay_us(). Ask GCC to allocate a registerMichael Hope
instead of forcing r0. Use the same operand as input and output to remove the move. Signed-off-by: Michael Hope <michael.hope@linaro.org>
2012-08-22Merge branch 'reset-script'Marti Bolivar
Weed out non-Maple ttyACMs on Linux. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-22reset.py: Not every Unix is Linux.Marti Bolivar
Move the sysfs tests for Maple out of unix_get_maple_path() and into a new linux_get_maple_path(). This prevents unnecessary probing for a nonexistent /sys on e.g. OS X. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-22Improve Maple device detection in reset.py on LinuxDavid Kiliani
Adds a function to lookup the USB vendor & product id from the udev info in the sysfs tree. This removes invalid choices and reduces user queries for the correct ttyACM device. Signed-off-by: David Kiliani <mail@davidkiliani.de>
2012-08-20reset.py fixups for OS X 10.8.Marti Bolivar
As discussed on this forum thread: http://forums.leaflabs.com/topic.php?id=2451 Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-14Make PRIMASK set/clear functions __always_inline.Marti Bolivar
This is just to ensure that -Os doesn't prevent these from getting inlined. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-14wirish/ext_interrupts.h: DoxygenMarti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-10stm32loader.py: replace obsolete exception catch syntax.Marti Bolivar
For Python 3 support. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-05Makefile: Don't assume Cortex M3.Marti Bolivar
Instead, derive -march and -mcpu from the target MCU in target-config.mk. Also (on STM32F4) add the necessary floating point flags. The CodeSourcery toolchains don't support these, so we'll need to prepare alternative toolchains when F4 support is official. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-05fixup! Add support for ARM's GCC ARM embedded toolchain.Marti Bolivar
Oops. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-05Add support for ARM's GCC ARM embedded toolchain.Marti Bolivar
Based on patches provided by Hanspeter Portner: http://forums.leaflabs.com/topic.php?id=1717#post-11812 Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-05Makefile: move flag settings after build-rules and -templates.Marti Bolivar
We'll need to mess with the linker flags to add support for ARM toolchains other than CodeSourcery's. Since the toolchain is determined in build-rules.mk, decisions that depend on it have to happen after it's included. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-04usb_cdcacm.c: Fix up descriptor definitions.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-04usb_cdcacm.h: Add convenience for declaring device descriptor.Marti Bolivar
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-04<libmaple/usb.h>: Fix usb_descriptor_string.Marti Bolivar
uint16 is the wrong type for the bString array. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-04Move contents of usb_descriptors.h to <libmaple/usb.h>.Marti Bolivar
These form and name of structs etc. is basically determined by the USB spec and the libmaple style guide, so there's little reason for them to change, and less reason for them to stay hidden. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
2012-08-04Prep usb_descriptors.h for removal.Marti Bolivar
Just change names and things to fit the libmaple style. Its contents will move to the top-level <libmaple/usb.h> header next. This API is still unstable, but we need to expose pieces of it in order to get the Maple-specific pieces of usb_cdcacm.c into Wirish. Adjust uses of the API appropriately. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>