aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* samd21: Add support for ADCKevin O'Connor2018-12-224-0/+131
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Always read SPI receive bufferYannic Schroeder2018-12-141-2/+3
| | | | | | | Otherwise the first byte read via SPI may be the last byte of the previous transfer Signed-off-by: Yannic Schroeder <schroeder@ibr.cs.tu-bs.de>
* samd21: Fix gpio in supportKevin O'Connor2018-11-302-3/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for flashing an application via the bossac toolKevin O'Connor2018-11-301-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for hardware pwmKevin O'Connor2018-11-304-0/+110
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Minor simplification to timer init codeKevin O'Connor2018-11-301-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for SPIKevin O'Connor2018-11-304-0/+102
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for basic i2c support (write only)Kevin O'Connor2018-11-304-0/+125
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Use GPIO() macro when calling gpio_peripheral()Kevin O'Connor2018-11-304-11/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Enable watchdogKevin O'Connor2018-11-301-0/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Try to clarify the "generic clock generator" configurationKevin O'Connor2018-11-301-15/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Validate the i2c addressKevin O'Connor2018-11-301-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Check for an incorrect mode in spicmds.cKevin O'Connor2018-11-306-10/+12
| | | | | | | Check the mode parameter in spicmds.c so that the mcu code does not need to check it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Move ADC and SPI code from gpio.c to spi.c and adc.cKevin O'Connor2018-11-305-217/+238
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for sending I2C messagesKevin O'Connor2018-11-234-0/+114
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Minor whitespace changesKevin O'Connor2018-11-231-1/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Enable full speed peripheral clocks on SPI and I2CKevin O'Connor2018-11-213-2/+8
| | | | | | | | Scale the bus speed within the peripheral instead of on the system bus as scaling on the system bus slows down general register access to the peripheral. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add an enable_peripheral_clock() helper functionKevin O'Connor2018-11-214-5/+23
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Minor comment update in hard_pwm.cKevin O'Connor2018-11-201-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rework hardware pwm pin definitionsKevin O'Connor2018-11-201-56/+48
| | | | | | | Simultaneously define the hardware pin and the timer registers. This makes the table a little easier to understand. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Split gpio.c into gpio.c, adc.c, hard_pwm.c, and spi.cKevin O'Connor2018-11-206-391/+418
| | | | | | | Split up gpio.c into multiple files in an effort to make the code a little more understandable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add initial support for atmega32u4 chipsKevin O'Connor2018-11-203-12/+32
| | | | | Signed-off-by: Trevor Jones <trevorjones141@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Minor update to help text in KconfigKevin O'Connor2018-11-191-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* timer_irq: Increase maximum busy wait time to 2usKevin O'Connor2018-11-161-1/+1
| | | | | | | | | Increase the amount of time to "busy wait" in the timer dispatch loop to 2 micro-seconds. This, in practice, causes stepper step and unstep events to occur within a single hardware interrupt. Doing that helps stabilize the single active stepper performance benchmarks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Convert i2c code to use standard i2ccmds.cKevin O'Connor2018-11-143-10/+28
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for atmega328pKevin O'Connor2018-10-292-5/+8
| | | | | | | The atmega328p is basically the same as the atmega328 - add explicit support for it so that avrdude doesn't complain while flashing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Implement I2C support in the SAM4E8E portFlorian.Heilmann2018-10-275-1/+198
| | | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* Add generic i2c interfaceFlorian.Heilmann2018-10-273-0/+80
| | | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* sam3x8e: Don't report an error if bossac errors during device restartKevin O'Connor2018-10-221-1/+1
| | | | | | | Sometime bossac reports an error during chip restart. It appears this error is spurious - just suppress it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Enable SAM4 cache at startupKevin O'Connor2018-10-221-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Divide system clock within timer; not on system busKevin O'Connor2018-10-181-0/+3
| | | | | | | Scaling the timer on the system bus has a notable impact on performance. So, scale the timer within the timer hardware itself. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Align loops to a 16 byte boundaryKevin O'Connor2018-10-131-1/+1
| | | | | | | | | It appears the sam3x8e has a primitive cache prefetch mechanism (it prefetches 32 bytes at a time aligned to a 16 byte boundary). Aligning the main loop in timer_dispatch_many() to a 16 byte boundary significantly improves performance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Force sched_try_shutdown to be inlinedKevin O'Connor2018-10-131-1/+1
| | | | | | | | | If sched_try_shutdown() is not inlined into timer_dispatch_many() it can have a significant impact on benchmarks. (Even though the function isn't called in practice, the call causes gcc to organize the function differently.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_irq: Fix jump target alignmentKevin O'Connor2018-10-131-2/+2
| | | | | | The jump target needs to be 4 byte aligned (not 2^4 bytes). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use __always_inline on timer_read_timeKevin O'Connor2018-10-111-1/+1
| | | | | | | | Some older versions of gcc need the __always_inline directive in order to inline timer_read_time. Inlining that function is important for performance on the stm32f1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use -O2 optimization and inline timer_read_time()Kevin O'Connor2018-10-112-2/+1
| | | | | | | | As long as timer_read_time() is inlined, I get better performance with gcc -O2 optimization. The binary is also dramatically smaller and O2 better matches the other platforms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use the main lib/cmsis-core directory for cmsis includesKevin O'Connor2018-10-111-2/+2
| | | | | | Use the main cmsis header files with stm32f1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Add support for building with bootloader supportKevin O'Connor2018-10-114-2/+136
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Move assembler build rules togetherKevin O'Connor2018-10-111-10/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Pull the USB D+ line low briefly to signal a device connectKevin O'Connor2018-10-111-0/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Initial support for serial over USBKevin O'Connor2018-10-113-1/+286
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Serial should have a higher irq priority than timersKevin O'Connor2018-10-112-3/+2
| | | | | | | | | It's possible for the code to stay in the timer irq for up to 100ms, so serial irqs should have a higher irq priority to prevent them from being starved. (The timer code disables irqs during event dispatch, so serial irqs would only be permitted between events anyway.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Disable usb serial interrupts while processing dataKevin O'Connor2018-10-021-6/+10
| | | | | | | There's no need to keep taking interrupts if the high-level code is busy processing messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: No need to reset ep0 interrupts on a shutdownKevin O'Connor2018-10-021-7/+0
| | | | | | | The usb_cdc code will arrange to call usb_read_ep0_setup() after a shutdown, so no need to have an explicit shutdown handler. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Try to read new data before processing data blocksKevin O'Connor2018-10-021-9/+12
| | | | | | | | Call usb_read_bulk_out() before calling command_find_and_dispatch() as this optimizes the common case where each usb packet contains a single new message block. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Wake usb_bulk_out_task() on a shutdownKevin O'Connor2018-10-021-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Allow the serial port to be selected on the atmega2560/1280Kevin O'Connor2018-10-011-10/+17
| | | | | | | Allow the serial port to be selected on the atmega2560 and atmega1280 chips in Kconfig. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Clear pressed/last_pressed state on new buttons_query commandKevin O'Connor2018-10-011-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Increase stack size to 256 for all AVR targetsKevin O'Connor2018-10-011-2/+1
| | | | | | | | Recent code additions have increased the stack usage and it is no longer clear that everything will fit in 128 bytes. Increase all targets to 256 bytes (the atmega2560 was already at 256 bytes). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usbstd: Force usb_string_descriptor data field to match unicode stringKevin O'Connor2018-09-301-1/+2
| | | | | | | Fix travis-ci build failure by forcing the data field of the struct usb_string_descriptor to be the same type as a 16bit unicode string. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>