aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* test-fsmc.cpp: Fix incorrect sram_end.Marti Bolivar2011-09-121-1/+1
|
* test-session.cpp: Fix 'd' command.Marti Bolivar2011-09-061-6/+2
| | | | | Actually read a character each time we ask for one. Put pin 22 back into OUTPUT mode when we're done.
* test-spi-roundtrip.cpp: Remove redundant loop.Marti Bolivar2011-08-311-2/+0
| | | | SerialUSB.read() is already blocking, so no sense looping on available().
* test-session.cpp: Tweak output.Marti Bolivar2011-08-311-3/+3
|
* test-session.cpp: Measure ADC noise sequentially.Marti Bolivar2011-08-311-8/+28
| | | | Measure pins one at a time.
* test-session.cpp: Multiple ADC noise measurements by default.Marti Bolivar2011-08-311-15/+20
| | | | | Each call to measure_adc_noise() now does N_ADC_NOISE_MEASUREMENTS (currently 40) samples, instead of just 1.
* test-session.cpp: Better analog noise readings.Marti Bolivar2011-08-311-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | Update measure_adc_noise() to actually use the Welford online algorithm, instead of accumulating data in an array on the stack. This allows us to increase the number of samples (to 1000). Revised algorithm tested on host PC and compared (in Python) against numpy with a list of 100 values in [0, 1) drawn using random.random(). Results (Python): >>> r = [random.random() for i in xrange(100)] >>> numpy.mean(r) 0.50073064742634854 >>> numpy.var(r) 0.083726090293309297 Results (C++, x86 host PC): n: 100 mean: 0.500731 variance: 0.084572 So this algorithm for variance has some inaccuracies, but it appears to be good to a couple of significant figures.
* fsmc-stress-test.cpp: Eliminating unnecessary variable.Marti Bolivar2011-08-311-2/+1
|
* fsmc-stress-test.cpp: Convert to SerialUSB, don't print so much.Marti Bolivar2011-08-311-2/+1
|
* test-session.cpp: Tweak output.Marti Bolivar2011-08-301-1/+1
| | | | Print input as if it were an ASCII character, not a number.
* test-fsmc.cpp: Tweak output.Marti Bolivar2011-08-301-0/+1
|
* fsmc-stress-test.cpp: Eliminating unnecessary variable.Marti Bolivar2011-08-301-3/+1
|
* fsmc-stress-test.cpp: Eliminate unused variable.Marti Bolivar2011-08-301-2/+0
|
* fsmc-stress-test.cpp: Halt on error, print "all's well" message less often.Marti Bolivar2011-08-301-5/+11
|
* fsmc-stress-test.cpp: Convert to SerialUSB, don't print so much.Marti Bolivar2011-08-301-7/+20
|
* Whitespace tweak.Marti Bolivar2011-08-181-1/+1
|
* freertos-blinky.cpp: Remove executable bit.Marti Bolivar2011-08-181-0/+0
|
* examples/mini-exti-test.cpp: Comment fix.Marti Bolivar2011-08-031-4/+4
|
* Add examples/mini-exti-test.cpp.Marti Bolivar2011-08-031-0/+251
| | | | | | | Nonportable (Maple Mini only) test of external interrupt functionality. When wired properly, this triggers various EXTI lines simultaneously, keeping track of the number of times each handler is invoked.
* test-usart-dma.cpp: Change mistaken "__io" -> "volatile"Marti Bolivar2011-07-061-1/+1
|
* Make FreeRTOS changes comply with the coding standard.Marti Bolivar2011-06-241-3/+8
| | | | | Don't modify the core FreeRTOS code; only change source that's specific to libmaple.
* FreeRTOS: Added FreeRTOS 7.0.1, including hook in libmaple/systick.c and ↵Nis Sarup2011-06-211-0/+38
| | | | example blinky.
* test-usart-dma.cpp: Update to demo working DMA interrupts.Marti Bolivar2011-06-201-11/+7
|
* Update test-print.cpp to exercise new behavior.Marti Bolivar2011-06-081-34/+37
| | | | | | Changes make sure that base arithmetic applies correctly for various integral types, and that floating point numbers can be printed at various precisions.
* Keep it 80-column clean.Marti Bolivar2011-06-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Converting all files to UNIX newlines.Marti Bolivar2011-05-103-234/+234
| | | | | | | Committing the results of running the following on the libmaple root directory: $ fromdos `grep --exclude-dir='[.]git' -Ilsr $'\r$' .`
* Updating VGA examples for use with new timer API.Marti Bolivar2011-05-062-29/+31
|
* Changing integration date of function in examples/test-timer.cpp.Marti Bolivar2011-05-051-1/+1
| | | | | | | It would be nice to have something like a timer_set_period() in libmaple proper that takes the period and the clock rate as parameters, much the same as usart_set_baud_rate() does. No time for that now, though, so punt to 0.1.0.
* examples/test-spi-roundtrip.cpp now uses SerialUSB instead of Serial2.Marti Bolivar2011-05-041-46/+43
|
* /examples/ cleanups.Marti Bolivar2011-05-0411-112/+91
|
* SPI refactor.Marti Bolivar2011-04-281-0/+197
| | | | | | | | | | | | | | | | | 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.
* Trivial test-session.cpp bugfixMarti Bolivar2011-04-271-1/+1
|
* RET6 fixesMarti Bolivar2011-04-271-2/+2
|
* Better debug port support.Marti Bolivar2011-04-251-3/+76
| | | | | | | | | | | - 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 test-session.cpp fixupMarti Bolivar2011-04-251-4/+3
|
* Requiring dac_dev* argument in DAC convenience functions.Marti Bolivar2011-04-211-41/+48
|
* Adding examples/test-print.cpp.Marti Bolivar2011-04-131-0/+181
| | | | | This uses templates, which I don't like, but it's not going into the core library, so I'm okay with it for now.
* DMA checkpoint; dma_attach_interrupt() is broken.Marti Bolivar2011-04-111-0/+127
| | | | | | 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.
* Resolving some FIXMEs.Marti Bolivar2011-04-112-3/+14
|
* Adding button test to examples/test-session.cpp.Marti Bolivar2011-04-111-1/+21
|
* USART refactor.Marti Bolivar2011-04-072-23/+68
|
* SysTick refactor.Marti Bolivar2011-04-051-1/+1
| | | | | | | | For the changelog: * util.h is free of __read(), __write(), etc. macros. * systick_resume() was renamed systick_enable().
* ring_buffer tweaks.Marti Bolivar2011-04-051-0/+114
| | | | | | | Adding basic ring_buffer test (cherry-pick from master). Changing rb_safe_insert()'s type to match that of rb_push_insert(). (Makes it easier to pass around insertion functions.)
* Redid Servo in terms of new timer.h.Marti Bolivar2011-04-011-0/+152
|
* Board-specific values; corresponding QA test generalizations.Marti Bolivar2011-03-302-384/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various board-specific #defines and arrays of pins added. For the changelog (some of this information predates this commit): * wirish/boards.h now declares the following arrays of pin numbers: * boardPWMPins - PWM-capable pins * boardADCPins - ADC-capable pins * boardUsedPins - pins already in use, e.g. BOARD_BUTTON_PIN It also declares a bool boardUsesPin(uint8 pin) function for convenient testing of whether a pin is in use. * wirish/boards/*.h now define: * BOARD_USART1_TX_PIN * BOARD_USART1_RX_PIN * BOARD_USART2_TX_PIN * BOARD_USART2_RX_PIN * BOARD_USART3_TX_PIN * BOARD_USART3_RX_PIN * BOARD_NR_GPIO_PINS (renamed from NR_GPIO_PINS) * BOARD_NR_USARTS (renamed from NR_USARTS) * BOARD_NR_PWM_PINS * BOARD_NR_ADC_PINS * BOARD_NR_USED_PINS * wirish/boards/maple_native.h now defines: * BOARD_UART4_TX_PIN * BOARD_UART4_RX_PIN * BOARD_UART5_TX_PIN * BOARD_UART5_RX_PIN (Unfortunately, wirish/boards/maple_RET6.h cannot, since at least one of the UART4/UART5 pins are used already; this will require layout changes for a wide-release Maple form factor RET6 board). * wirish/boards/*.cpp all include the corresponding array definitions. They all live in flash by default, thanks to the new __FLASH__ macro in wirish/wirish_types.h, which is a synonym for the existing __attr_flash #define in libmaple/libmaple_types.h. The documentation was updated to include this information. It also gained various FIXME/TODO comments related to its generalization across boards. The quality assurance-related examples (examples/qa-slave-shield.cpp and examples/test-session.cpp) now make heavy use of board-specific values to ensure portability.
* Final stm32_pin_info design candidate; ADC3 support on Native.Marti Bolivar2011-03-251-20/+30
| | | | | | | | | | | | | | | | | | | | Added an adc_dev to struct stm32_pin_info. This was necessary to add support for the channels on the Native which are only connected to ADC3, but it does add a bunch of NULLs to the PIN_MAPs. I don't think any other peripherals need representation on a per-pin basis. Each peripheral library will be responsible for keeping track of related GPIO ports and bits, and we can throw #defines in to boards/*.h for other things (e.g. BOARD_SPI1_MISO_PIN). Fleshed out the ADC refactor and brought it more in keeping with the new design as it evolves. A couple of other tweaks. Notably: waitForButtonPress() now takes a default argument meaning "wait forever". Removed Maple-specific documentation from core functions in io.h; this information will need to go into the individual board docs files.
* Adding /wirish/boards/ for easier porting; shrank PIN_MAPs.Marti Bolivar2011-03-241-1/+1
| | | | | | | | | | | | | | | | | /wirish/boards/ contains xxx.h and xxx.cpp (for xxx=maple, maple_native, maple_mini, maple_RET6). The headers contain the board-specific #defines that used to live in boards.h (except BOARD_INIT, which was removed). The CPP files contain the PIN_MAP definitions that used to live in boards.cpp, and a proper boardInit() function to replace the old BOARD_INIT macro. This will make it easier to add new boards in the future. struct PinMapping was renamed struct stm32_pin_info, and was moved into a new wirish_types.h. Its external interrupt field was moved into struct gpio_dev, which saves memory by storing an afio_exti_port per port, rather than one per pin. Also rearranged the stm32_pin_info fields to improve packing. Maple's PIN_MAP is now down to below 500 bytes.
* Initial timer refactor.Marti Bolivar2011-03-242-175/+216
| | | | | | | | | | | | | | | 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.
* FSMC refactor; SRAM test codeMarti Bolivar2011-03-172-98/+326
|
* Maple RET6 edition supportMarti Bolivar2011-03-161-5/+4
|