aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
Commit message (Collapse)AuthorAgeFilesLines
* USB: API cleanups.Marti Bolivar2011-10-211-2/+2
| | | | | | | | | | Modify usb.h functions (changing their names in some cases) to also take a usblib_dev* argument, to fit in better with the rest of libmaple. Store an rcc_clk_id in struct usblib_dev for the same reason. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Fix micros() bug.Marti Bolivar2011-10-201-1/+1
| | | | | | Thanks to ala42 for the fix. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* wirish: Clean up includes; other fixups.Marti Bolivar2011-10-1812-29/+46
| | | | | | | | | | | | | | | | | | Clean up various core files' includes to fit this pattern: - Header files include what they use. - CPP files include their header first - Include order is libmaple proper headers, then wirish headers (modulo CPP rule above). wirish.h: Move HIGH and LOW to io.h, and the boolean and byte typedefs into wirish_types.h. These don't belong in wirish.h. Add include guards to wirish_debug.h. Oops. wirish_digital.cpp: Use standard bool instead of "boolean". Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* usb: Disentangle CDC ACM functionality.Marti Bolivar2011-10-182-10/+11
| | | | | | | | | | | | | | | | | | | | | Add new usb_cdcacm.h, which provides the virtual serial port API. This file (and new usb_cdcacm.c) consolidate the VCOM support, which was previously distributed through descriptors.[hc], usb.[hc], usb_callbacks.[hc], and usb_config.h. Add usb_init_usblib() to usb.h, as a way of initializing the USB peripheral in terms of the data structures required by usb_lib. This is used by the new usb_cdcacm_enable(). Create new usb_lib_globals.h, with declarations for the usb_lib global state which is most used throughout the rest of the libmaple USB stack. Remove descriptors.c and usb_callbacks.[hc]; they are no longer necessary. Update the USB README accordingly. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* usb: Cleanups and renames.Marti Bolivar2011-10-182-3/+3
| | | | | | | | | Rename setupUSB() and disableUSB() to usb_cdcacm_enable() and usb_cdcacm_disable(), respectively. Remove usbSendHello(). This shouldn't exist. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* usb: Move some board-specific configuration to Wirish.Marti Bolivar2011-10-187-3/+21
| | | | | | | | | Create new BOARD_USB_DISC_DEV and BOARD_USB_DISC_BIT board-specific values. Use these as arguments to setupUSB() and disableUSB(). This helps make the USB stack more generic, and goes towards the resolution of an important FIXME. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Add support for the Olimex STM32 H103 board.David Kiliani2011-09-274-0/+213
| | | | | | | | Pin layout and header files for the STM32 H103 prototype board from Olimex featuring an STM32F103RBT6 chip. This commit contains all necessary changes to compile with BOARD=olimex_stm32_h103. Signed-off-by: David Kiliani <mail@davidkiliani.de>
* maple_native.cpp: Cosmetics.Marti Bolivar2011-09-121-2/+2
| | | | | | Stick FSMC_BCR_MTYP_SRAM among the bitfields assigned to the BCR write. Technically not necessary (SRAM is the default after reset), but good for readability and future-proofing.
* Maple Native: Fix BOARD_NR_USED_PINS, boardUsedPins.Marti Bolivar2011-09-092-8/+4
|
* Update outdated stm32.h usages.Marti Bolivar2011-09-071-5/+5
| | | | | stm32.h has been updated to prefix its definitions. Update the rest of libmaple to take this into account.
* wirish/boards: Move includes into .cpp files.Marti Bolivar2011-09-017-26/+20
| | | | | The headers just #define some numbers, so there's no need for them to be including libmaple headers.
* maple_native.cpp: Add FSMC FIXME to resolve for 0.0.12.Marti Bolivar2011-09-011-0/+1
|
* maple-native.cpp: Comment tweak.Marti Bolivar2011-08-311-1/+1
| | | | | First in what is sure to be a long series of efforts in educating people that you can have GPIOs 56--100 or the SRAM chip, but not both.
* maple_native.cpp: mark initSRAMChip() static.Marti Bolivar2011-08-311-2/+2
|
* maple_native.h: Fix USART pins.Marti Bolivar2011-08-301-8/+8
| | | | | These apparently didn't get updated from an earlier prototype's values.
* HardwareSerial.h: Remove documentation TODO.Marti Bolivar2011-08-161-3/+0
| | | | | | | It's difficult to document HardwareSerial's interface fully in HardwareSerial.h, since most of the methods people care about are inherited from Print, anyway. Stick with documenting this interface by hand for the foreseeable future.
* HardwareSerial.cpp: Respect PCLK1 and PCLK2.Marti Bolivar2011-08-161-6/+6
|
* HardwareSerial: Add pin accessors.Marti Bolivar2011-08-161-0/+4
|
* HardwareSerial: trivial code reorderingMarti Bolivar2011-08-162-11/+23
|
* HardwareSPI.cpp: minor HardwareSPI::send() cleanup.Marti Bolivar2011-08-161-4/+1
|
* HardwareSPI: Add pin accessors.Marti Bolivar2011-08-162-40/+102
|
* HardwareTimer.cpp: fix HardwareTimer::setPeriod()Marti Bolivar2011-06-141-1/+1
|
* Remove reST documentation, attendant updates.Marti Bolivar2011-06-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | The documentation covers topics not specifically relevant to libmaple, so it doesn't make sense for it to be part of the libmaple source distribution. Delete the docs/ tree, and prepare libmaple for use with the new leaflabs-docs repo, which will contain the docs from now on. * README: update to reflect this change * support/doxygen/Doxyfile: This is the old docs/Doxyfile * Makefile: Add a doxygen target * wirish/comm/HardwareSerial.h: fix reference to docs/. The comment informing maintainers that the HardwareSerial interface is documented by hand refers to the docs/ tree, which no longer exists. Update it to refer to the separate leaflabs-docs repository. * support/scripts/copy-to-ide: No longer build the documentation
* Update Print to match Arduino master.Marti Bolivar2011-06-082-60/+51
| | | | | | | | | Add base argument to integral Print methods, defaulting to DEC so as not to break backwards compatibility. Add precision argument to floating-point Print methods. These changes increase compatibility with the Arduino Print implementation.
* Revert "Add wiring_limits.h"Marti Bolivar2011-06-071-49/+0
| | | | | | This reverts commit f960c41b1a50deb3783fb7750a4af86e0cbb0636. Wait until the Wiring spec is complete to merge this into master.
* Add wiring_limits.hMarti Bolivar2011-06-071-0/+49
| | | | | | | | | | | | This file is analogous to the standard C header <limits.h>. It defines various constants within the Wiring language that we consider to be implementation-defined. The current version is a work in progress; more constants may be added as time goes on. The member constants defined in wiring_limits.h are currently limited to the core Wiring language. They do not include implementation-defined values which pertain to the standard Wiring libraries.
* Keep it 80-column clean.Marti Bolivar2011-06-0720-281/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Docs: Fix several board-specific values.Marti Bolivar2011-05-266-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ugh. Fix BOARD_NR_ADC_PINS and boardADCPins on Maple, Maple Mini, and Maple RET6 Edition: Maple and Maple RET6 Ed. don't have ADC on pin 3. Seems likely that the error was due to AIN being missing on the silkscreen. They also have ADC on pin 13. This is not really true due to the voltage drop across the built-in LED. Maple Mini really should not include BOARD_LED_PIN among its ADC pins, since it's not broken out to a header. Fix BOARD_NR_PWM_PINS and boardPWMPins on Maple and RET6 Ed: Both boards falsely include pin 25 as a PWM pin. Maple RET6 Edition also lacks some PWM pins. Fix BOARD_NR_SPI on Maple RET6 Edition: SPI3 uses PB4, which is unusable since it's tied to NRST. This means that SPI3 is not available on the RET6 edition. Decreasing BOARD_NR_SPI to 2 to accomodate this. Leave the BOARD_SPI3_*_PIN defines intact so as not to further clutter the rest of the library with RET6-specific wrinkles.
* Getting rid of the last 0.0.10 TODO.Marti Bolivar2011-05-231-1/+0
| | | | We should be good to go.
* HardwareSerial.h: adding documentation TODO for 0.1.0Marti Bolivar2011-05-201-0/+2
|
* adc.c: adc_init() doesn't set the RCC's ADC prescaler.Marti Bolivar2011-05-191-0/+1
| | | | | You have to call rcc_set_prescaler() yourself now. adc_init() never should have been doing that anyway.
* Punting the fix of Maple Native's boardUsedPins to 0.0.12.Marti Bolivar2011-05-192-2/+2
|
* Fixing HardwareSPI.h mistake for non-LeafLabs boards.Marti Bolivar2011-05-121-1/+1
| | | | "#warn" -> "#warning"; oops.
* i2c: Various fixes, extensions, documentation.Perry Hung2011-05-121-1/+1
| | | | | | | | | | | | -Fix clock calculations for fast-mode support -Add I2C_REMAP option to remap i2c1 (untested) -Add I2C_BUS_RESET option to reset bus on initialization -Add optional timeout parameter -Doxygen comments -Various cleanup 10-bit slave addressing is untested until I have a device that speaks such.
* Adding SPI3 definitions for Maple RET6 Edition.Marti Bolivar2011-05-111-1/+5
|
* Converting all files to UNIX newlines.Marti Bolivar2011-05-102-68/+68
| | | | | | | Committing the results of running the following on the libmaple root directory: $ fromdos `grep --exclude-dir='[.]git' -Ilsr $'\r$' .`
* Putting updated HardwareTimer back into the build.Marti Bolivar2011-05-064-405/+244
| | | | | | | | | | | | | | | HardwareTimer was removed from the build when the timer refactor was done; this redoes it in terms of the new timer.h interface. A variety of conflicting or badly designed bits were deprecated or removed. I'm still not satisfied with this interface, as it's going to make life difficult moving forward to high-density chips, where the addition of basic timers means that the capture/compare methods won't apply in some cases. However, we need to get 0.0.10 out the door, so it'll have to do for now. The docs are up to date, and contain a warning that the Wirish API isn't stable and a recommendation to use libmaple proper.
* Renaming "enum ExtIntTriggerMode_" -> "enum ExtIntTriggerMode".Marti Bolivar2011-05-051-1/+1
| | | | | Done for consistency the rest of the source. Doesn't affect any documented features.
* SPI fixups.Marti Bolivar2011-05-042-25/+10
| | | | | | Initial post-review changes based on thread here: https://github.com/leaflabs/libmaple/commit/77f707d7b87fce284945fc9fe21c824c18c4c93d#comments
* Maple Mini pin map fix.Marti Bolivar2011-05-041-1/+1
| | | | Thanks, Xavier!
* Making micros() counter underrun safe.Marti Bolivar2011-05-041-10/+7
| | | | Thanks, ala42!
* SerialUSB fixups.Marti Bolivar2011-05-044-80/+51
|
* Fixing USBSerial::read(void*, uint32).Marti Bolivar2011-05-041-3/+3
|
* Native and FSMC cleanups.Marti Bolivar2011-05-045-97/+22
| | | | | | | Got rid of native_sram.h (and native_sram.cpp), and pushed their functionality into maple_native.cpp. Fixed includes in maple_native.h. Fixed includes in fsmc.h.
* SPI refactor.Marti Bolivar2011-04-287-115/+454
| | | | | | | | | | | | | | | | | Still a polling driver, but the libmaple proper interface exposes enough that users enable the various interrupts and define their own IRQ handlers if they feel like it. Wirish HardwareSPI interface was largely redone; it's more like the Arduino implementation now, although there are some differences when I didn't like their API. The old methods are still there, but are deprecated and slated for deletion in 0.1.0. New board-specific values: BOARD_NR_SPI, BOARD_SPIx_NSS_PIN, BOARD_SPIx_MOSI_PIN, BOARD_SPIx_MISO_PIN, and BOARD_SPIx_SCK_PIN, for x from 1 to BOARD_NR_SPI. Documentation was updated appropriately.
* maple_native.cpp updates/fixes.Marti Bolivar2011-04-271-9/+9
|
* RET6 fixesMarti Bolivar2011-04-272-4/+19
|
* Removing Maple-specific values from WirinPinMode doxygen comment.Marti Bolivar2011-04-261-11/+0
| | | | Comment changes only.
* Better debug port support.Marti Bolivar2011-04-258-11/+107
| | | | | | | | | | | - gpio.h: afio_mapr_swj_config() renamed afio_cfg_debug_ports() - [new] wirish_debug.h: disableDebugPorts(), enableDebugPorts() - Maple, Maple Native, and Maple RET6 PIN_MAPs are now larger by 5, have mappings for the extra JTAG/SW pins. Documentation was updated appropriately.
* Minor Print cleanups.Marti Bolivar2011-04-252-5/+5
|