Commit graph

262 commits

Author SHA1 Message Date
Marti Bolivar edc97211f6 Finished converting the Arduino docs 2010-11-29 01:49:26 -05:00
Marti Bolivar 88a16d144f arduino language reference nearing completion, properly CC-BY-SA 3.0 attributed 2010-11-17 12:44:28 -05:00
Marti Bolivar 2a73980456 fixed highByte() implementation for when sizeof(argument) > 2 2010-11-16 07:41:03 -05:00
Marti Bolivar abe45fd38e removed arduino/gpl dependency in bits.h; added binary notation for bytes (e.g. B10110011) 2010-11-10 03:22:18 -05:00
Marti Bolivar 8658f090c2 maple mini runs blinky now.
still need usb descriptors to improve, and also nothing else is tested.
2010-10-22 21:13:02 -04:00
Marti Bolivar 850db43290 Merge branch 'master' of github.com:leaflabs/libmaple 2010-10-14 23:31:33 -04:00
Perry Hung ab55cf348e Add selective enabling of channels for pwm channels
pinMode(PWM) turns the channel on, other modes should turn it off

Fixes bug with conflicting timer for spi1 and timer. This is not
well-tested.

Conflicts:
	libmaple/timers.c
2010-10-12 20:59:46 -04:00
Marti Bolivar 1d3f7c7831 more sphinx docs 2010-10-11 23:39:50 -04:00
Michael Hope 76e8745d80 Make systick.h C++ safe. Expose the sys tick count via systick.h and remove other externs. 2010-10-10 19:58:58 +13:00
Michael Hope 6fcd4cd306 Merge remote branch 'upstream/master' 2010-09-29 20:45:57 +13:00
Michael Hope 368e4fc166 Fixed up the build due to a missing header file. 2010-09-29 20:42:18 +13:00
Perry Hung adde11b099 Fix HardwareSPI to pass SPI modes for CPOL and CPHA 2010-09-28 19:21:16 -04:00
Marti Bolivar 994f1f1e36 cleanups 2010-09-27 00:51:11 -04:00
Marti Bolivar 849bc0f8f6 wirish reformatted and code-styled 2010-09-26 21:47:55 -04:00
Perry Hung c13e850abe Enable external interrupts on all Maple GPIOs.
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-22 03:17:45 -04:00
Perry Hung 943006daef Add PWM_OPEN_DRAIN option to pinMode()
Allow for alternate function open drain output mode to be accessed
through the wirish interface. This allows for open drain to be used on
PWM pins.
2010-09-21 20:24:04 -04:00
Marti Bolivar ee5667f54d bugfix MAPLE_RELOAD_VAL, whitespace fixes 2010-09-13 13:32:01 -04:00
bnewbold 5bfeb40e47 systick testing and simplification
ripped out marti's SystemTick for the sake of simplicity and added a
systick_resume function to libmaple. new example program demonstrates
the functionality, also demonstrates micros()/USB bug
2010-09-05 23:48:31 -04:00
bnewbold b6e3624a70 timer refactor (c, not c++)
also removed an old ASSERT()
2010-09-05 22:58:36 -04:00
bnewbold 1c6f9a9b5e Off-by-one in timer setPeriod() function
Thanks CarlO!
2010-09-02 22:29:36 -04:00
bnewbold 6783e66eb1 added 'unused' attribs and reset default target 2010-09-02 19:23:22 -04:00
bnewbold d6a3299168 Various fixes, working with Maple 2010-09-01 00:02:36 -04:00
bnewbold 0ccec95446 Portability fixes
Still not working but fixed a lot of merge errors
2010-08-31 22:05:39 -04:00
Marti Bolivar 9c9d6c1531 added support to enable/disable systick in wirish 2010-08-31 18:28:07 -04:00
bnewbold 02d7b08f04 Merge maple-native changes into portable
This compiles for both maple and maple_native but is untested.
2010-08-31 17:39:46 -04:00
bnewbold e03d58f4da Further wirish portability progress
Sort of ugly changes. Compiles but untested.
2010-08-31 17:17:57 -04:00
bnewbold 01c38f5567 Partial progress on wirish portability
This version throws "defined but unused" warnings which could probably
be squashed with #pragma
2010-08-31 16:28:23 -04:00
Marti Bolivar b10ef4875f fix reset.py to work on OS X,; .gitignore leaves out ~ files; cleanup
support/make/build-rules.mk
2010-08-29 02:07:32 -04:00
bnewbold 12c351d056 inital portability work 2010-08-25 22:57:46 -04:00
Perry Hung f5a28b3084 Removed typedef enum for external interrupts, should function. Note
that there's no LOW option.
2010-08-19 22:50:32 -04:00
bnewbold ccd9833f26 Some refactoring 2010-08-05 21:43:58 -04:00
Perry Hung d249461115 Cleaned up wirish/time, some interrupt handling refactoring:
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-04 08:52:30 -04:00
Perry Hung c58c7dbe18 New usart implementation:
Fixed a bug where the maximum baud rate was incorrectly set to 225000
General cleanup
Use new rcc and nvic APIs
2010-08-04 04:38:58 -04:00
Perry Hung 57df5396fe New reset and clock control api 2010-08-04 04:29:02 -04:00
Perry Hung 2bb8c3fbe3 Basic flash peripheral management api for board bringup 2010-08-04 04:17:16 -04:00
bnewbold 31f9eb2364 last usbserial change... please? 2010-07-22 20:33:53 -04:00
bnewbold 99c251b846 added isConnected() to serialusb 2010-07-22 18:24:51 -04:00
bnewbold f728985846 went with 50ms SerialUSB timeout 2010-07-20 22:03:52 -04:00
bnewbold 895d2a48fa wirish implementation of timers plus test 2010-07-20 15:37:44 -04:00
bnewbold dd52d66d03 timers progress
examples code cleanup, more descriptive comments, more notes
2010-07-20 15:37:09 -04:00
bnewbold f06fcac502 good quality vga leaf logo; usb+systick disabled
refactored timers and added interrupt behavior. see notes and
comments...  also includes a crude vga hack that doesn't use timers.
2010-07-20 15:36:44 -04:00
bnewbold 52cbd2f1a1 working serialUSB with timeout
as a temporary workaround for the fact that SerialUSB is often blocking,
this crude implementation makes the low-level C usbSendBytes function
non-blocking (with a return code of bytes sent) and implements a 2ms
timeout in the wirish write() function.

also adds begin(), end(), getDTR(), getRTS(), pending(). device is still
initialized the old fashioned way during init() so that, eg, autoreset
will work. includes a simple multi-test program.
2010-07-19 00:38:36 -04:00
bnewbold 432cf91f7d added Serial.flush() 2010-07-19 00:38:00 -04:00
bnewbold a852f8d6a6 added SerialN.end() 2010-07-18 23:25:03 -04:00
Perry Hung 2c043efb66 make: Modularize makefiles, add dependency tracking, build-type tracking
Major build system rewrite. New and exciting:

1. Proper dependency tracking. All source files including header files
should be properly tracked and recompiled as necessary when they are
changed.

2. Build-type tracking. If the target changes from 'ram' to 'flash,'
for example, the build system will force a rebuild rather than
incorrectly link modules to a different address.

3. New targets:
   The old 'ram,' 'flash,' and 'jtag' targets have been replaced with
the environment variable MAPLE_TARGET, which controls the link address.
Users can either export it to their environment, or pass MAPLE_TARGET on
the command-line. Once this is set, sketches can be compiled with 'make
sketch,' or simply 'make.'

Note: the default is MAPLE_TARGET='flash.'

The target 'install' now automagically uploads the sketch to the board
using the appropriate method.

The 'run' target has been renamed to 'debug.' It starts an openocd gdb
server.

4. Odds and ends:
  -Verbose and 'quiet' modes. Set V=1 for verbose compilation, the default
   is quiet.
  -Object file sizes and disassembly information is generated and placed
   in build/$(BOARD).sizes and build/$(BOARD).disas, respectively.
  -Parallel make with -j should speed things up if you have multiple
   cores.
2010-06-25 21:23:04 -04:00
xttocs 70a18f96b6 Support for Arduino's LiquidCrystal lib, which may help for a few other libs too.
Signed-off-by: Perry Hung <iperry@alum.mit.edu>
2010-06-23 19:23:45 -04:00
AJM cb1a6fbc21 added getDTR and getRTS to usb.h, subtly modded how sendBytes checks for connection
flip flopped back and forth on how much work should be done here. For now its like 5 lines of changes
2010-06-11 13:03:09 -04:00
Perry Hung 717060ef8c USB Serial read() fix:
stupid, stupid mistake.
2010-06-05 22:35:43 -04:00
Perry Hung 88d4b095e4 Preliminary wirish USBSerial implementation.
-updated examples
-removed HardwareUSB
-cleaned up a handful of includes
2010-06-04 00:43:21 -04:00
bnewbold cf068bc0ac [for AJ] added new HardwareUsb implementation. hack. 2010-05-27 23:37:48 -04:00
bnewbold c487a9f330 analogWrite is an alias for pwmWrite 2010-05-27 22:38:50 -04:00
bnewbold dc8ecb7649 fastforward of master up the newboot, plus patch of math stuff
Conflicts: copy-to-ide, wirish/WProgram.h
2010-05-26 23:39:10 -04:00
bnewbold f30bc0ea86 get wirish_math stuff going (random, map, etc)
Perry, you might want to look this over... I only include the contents
of wirish_math.h when cpp? It's what arduino does and it works, so...
2010-05-21 16:14:00 -07:00
AJM d44f856baf Finalized the libmaple changes required by newboot. Added setupUSB() to wirish init
this involved some some changes to copy-to-ide, WProgram.h, and the makefile. Separated the reset.py from the wait.py so that the program closes the serial port correctly.
2010-05-21 19:09:35 -04:00
bnewbold fb3f98d165 finish cxxabi-compat refactor
perry forgot to add/edit these...
2010-04-29 07:13:16 -04:00
Perry Hung b5ddce7dc8 Fixed examples, added spi example, moved pure virtual function handler
out of main to cxxabi-compat.cpp.
2010-04-29 01:14:03 -04:00
Perry Hung 2c51cc19cc Merge branch 'spi' 2010-04-29 00:44:29 -04:00
Perry Hung a7031b147c Various SPI changes.
-Read DR after each master send, return the response.
-Added a send function to allow you to pass buffers to the SPI peripheral instead of goin a byte at a time.
2010-04-28 19:19:34 -04:00
bnewbold 3988feb5e6 update copy-to-ide and WProgram.h post-refactoring 2010-04-28 11:54:40 -04:00
Perry Hung 28feb18a8f Added a spi send block function 2010-04-27 18:30:46 -04:00
Perry Hung 3bd0b34803 Fixed two compiler warnings in spi 2010-04-25 18:17:52 -04:00
Perry Hung 62552a6f3f Refactoring:
The 'core' directory has now been renamed to 'wirish.' Wirish is our
version of the Arduino Wiring language.
2010-04-25 18:08:56 -04:00