aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* adxl345: Add support for adxl345 accelerometerKevin O'Connor2020-09-052-1/+180
| | | | | | | Add support for taking measurements from an adxl345 accelerometer via SPI interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* config: Added TronXY X5SA support (#3265)Cabia Rangris2020-08-301-0/+3
| | | | | | | Added printer-tronxy-x5sa-v6 config. Added "chitu" bootloader option to stm32 Kconfig. Added chitu_crypt. Signed-off-by: Vladimir Serov <me@cab404.ru>
* stm32: Improvements to CAN bus ID generation. And added a small fast hash ↵bondus2020-08-092-6/+7
| | | | | | | | library (#3165) Improved CAM bus ID generation, there were issues with ID collisions. Added a small fast hash library. Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
* linux: Set the SPI mode in spidev.cKevin O'Connor2020-07-311-0/+5
| | | | | | Fix omission causing the SPI mode to not be set on the linux mcu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Disable hardware pwm when it is set to zeroKevin O'Connor2020-07-202-13/+12
| | | | | | | | | | | Only write "1" to the "enable" file when a non-zero pwm width is requested. Write "0" to the "enable" file when a zero pwm width is requested. This fixes a problem on the replicape servo lines that prevented them from being fully disabled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Fix spi mode bitsKevin O'Connor2020-07-101-1/+1
| | | | | | | | The lpc176x hardware spi initialization code was swapping the CPOL and CPHA bits. This caused the MAX31865 and MAX31856 chips to not work correctly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Improved CAN support for STM32 (#2976)bondus2020-06-247-279/+493
| | | | | | | | | Reworked the STM32F0 CAN bus implementation. It's more robust and higher performance. Added support for function remapping to different pins. API is emulating an STM32F0. Improved and ported CAN bus to STM32F0, F1 and F4. Signed-off-by: Pontus Borg <glpontus@gmail.com>
* stm32: Initial support for stm32f2 (#3001)combolek2020-06-234-6/+46
| | | | | | | Initial support for stm32f2 in general and STM32F207 in particular. Boots up and communicates on STM32F207VC. Signed-off-by: Boleslaw Ciesielski <combolek@users.noreply.github.com>
* stm32: Support for 20KiB bootloader offset. (#3008)kianusch2020-06-201-0/+3
| | | Signed-off-by: Kianusch Sayah Karadji <kianusch@gmail.com>
* generic: Minor header cleanup to generic/irq.hKevin O'Connor2020-06-071-2/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Wait in timer dispatch for up to 2usKevin O'Connor2020-06-071-2/+2
| | | | | | | Use 2us in the linux timer dispatch code to unify linux timer dispatch logic with the common timer_irq.c code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Ability to use multiple GPIO chips (#2935)Lucio Tarantino2020-06-063-20/+48
| | | Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
* Kconfig: Only show the "usb ids" menu if low-level options are enabledKevin O'Connor2020-05-311-7/+10
| | | | | | It's rare to customize the usb ids, so make it a "low-level" option. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Change the default usb vendor/product idKevin O'Connor2020-05-311-2/+2
| | | | | | | Change the product/vendor id to 0x1d50/0x614e, which has been reserved for Klipper (thanks to the openmoko project). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_hd44780: Only calibrate cmd_wait_ticks on mcus with strict timingKevin O'Connor2020-05-311-0/+5
| | | | | | | The calibration isn't valid on the linux mcu, so make it dependent on CONFIG_HAVE_STRICT_TIMING. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_st7920: Only calibrate wait ticks on mcus with strict timingKevin O'Connor2020-05-311-0/+6
| | | | | | | The calibration isn't valid on the linux mcu, so make it dependent on CONFIG_HAVE_STRICT_TIMING. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Make toggling the step gpio after timer read conditionalKevin O'Connor2020-05-311-1/+5
| | | | | | | On the Linux mcu, toggling the pin after the time is read is not valid. Make that optimization dependent on CONFIG_HAVE_STRICT_TIMING. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add a new CONFIG_HAVE_STRICT_TIMING build definitionKevin O'Connor2020-05-317-0/+9
| | | | | | | | Add a new build definition to note micro-controllers that have strict timing. The Linux mcu code does not have strict timing - all other targets currently do. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix typo causing internal clock to always be used on stm32f042Kevin O'Connor2020-05-281-1/+1
| | | | | | Reported by Pontus Borg. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f4: Add support for HID bootloaderArksine2020-05-282-2/+16
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32f1: Add support for HID BootloaderArksine2020-05-283-4/+16
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* linux: userspace GPIO controlandryblack2020-05-179-22/+186
| | | | | | Allow use host GPIO pins for non-realtime purposes. Signed-off-by: Andrey Kunitsyn <blackicebox@gmail.com>
* stm32: add support for i2c readArksine2020-05-051-3/+39
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* htu21d: Support for HTI21D family sensor on I2C bus (#2803)Lucio Tarantino2020-05-031-1/+2
| | | Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
* stm32: Wait for setup complete to enable ep0 rx in usbotg.cArksine2020-05-031-4/+11
| | | | | | | | Endpoint 0 OUT needs to NAK everything until the core signals that the setup stage is complete. Signed-off-by: Eric Callahan <arksine.code@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Wait for setup complete notification in usbotg.cKevin O'Connor2020-05-031-6/+13
| | | | | | | | A setup packet is only valid after receiving the "setup complete" notification. Signed-off-by: Eric Callahan <arksine.code@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Adapt servo0 channels for beagleboard kernel 4.14.108-ti (#2746)Janne Grunau2020-05-031-12/+29
| | | | | | | | | | | | | | The beagleboard TI kernel 4.14 and 4.19 contain a commit which change the device names ("pwm: Create device class for pwm channels") from pwmN to pwm-${chip}:N. This commit was never merged into the upstream kernel. Decrease the number of pwm channels to a more reasonable 16. Increase the number of pwm chips to 8 since the replicape servo pwm outputs are on pwmchip4. Update replicape code to detect appropriate channel. Signed-off-by: Janne Grunau <janne-gh@jannau.net>
* linux: change clock frequencyandryblack2020-05-021-1/+1
| | | | | | Increase timer resolution for linux mcu Signed-off-by: Andrey Kunitsyn <blackicebox@gmail.com>
* stm32: Slow ADC frequency to 4.5MhzKevin O'Connor2020-04-302-4/+4
| | | | | | | There are reports that SKR mini boards have more stable ADC results when running the ADC at a slower frequency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for additional i2c busesKevin O'Connor2020-04-213-46/+66
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Make sure there is a minimum low duration after a long pulseKevin O'Connor2020-04-211-4/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Allow host software to configure neopixel timingKevin O'Connor2020-04-151-9/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Use names for key timing valuesKevin O'Connor2020-04-151-12/+19
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for 64KiB bootloader on stm32f103Kevin O'Connor2020-03-241-2/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Explicitly reset peripheral clocks on stm32f1Kevin O'Connor2020-03-241-0/+5
| | | | | | It appears some bootloaders do not properly reset some peripherals. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Additional code for broken bootloadersclearchris2020-03-041-0/+9
| | | | | | | | Explicitly disable the SysTick interrupt and explicitly set the stack pointer, as some bootloaders aren't handling this correctly. Signed-off-by: Chris Lombardi <clearchris@hotmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for a bootloader on stm32f0Kevin O'Connor2020-03-043-2/+36
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Revert "stm32: performance improvement for spi on stm32f0"Kevin O'Connor2020-03-041-8/+4
| | | | | | | | | | | This reverts commit a2c309a2b02d16ec15fee5702463621239261266. The above commit is causing crashes on the stm32f103xb chip when spi is in use. It's unclear what the cause of the regression is, but the optimization isn't required so revert it until the root cause can be determined. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add some comments on s->position trackingKevin O'Connor2020-03-041-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix broken clock setup on stm32f1Kevin O'Connor2020-02-291-2/+2
| | | | | | | | | Commit bd6c25c9 introduced a typo that caused the clock divisors to not be set correctly on stm32f1. Reported by @brianrjones69. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* basecmd: No need for finalize_config command to send "config" responseKevin O'Connor2020-02-201-2/+1
| | | | | | | | The host code always issues a get_config command immediately after finalize_config, so there is no need to send the two config response messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: The stm32f1 can only reach 64Mhz when using an internal clockKevin O'Connor2020-02-141-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix typo that broke selection of alternate serial port pinKevin O'Connor2020-02-092-2/+2
| | | | | | Fix a typo in commit aea15250. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reset adc calibration prior to starting calibrationKevin O'Connor2020-01-251-8/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Increase adc sample timeKevin O'Connor2020-01-251-4/+4
| | | | | | | Increase the sample time register from 3 to 4 (which adds about ~1.5us to each adc sample). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only declare alternate usart2 on stm32f0Kevin O'Connor2020-01-233-49/+41
| | | | | | | Also, try to improve the structure of the #if/#else/#endif layout in serial.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Don't export spi1a/spi2a on stm32f1Kevin O'Connor2020-01-231-4/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: add alternate pinout for USART2Arne Jansen2020-01-233-1/+16
| | | | | | Added to both generic stm32 and stm32f0 Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: add alternate pinouts for spi1/2Arne Jansen2020-01-231-3/+9
| | | | | | | In addition to spi3, spi1 and spi2 also have alternate pins. Add them as spi1a and spi2a, similar to spi3. Signed-off-by: Arne Jansen <arne@die-jansens.de>
* stm32: performance improvement for spi on stm32f0Arne Jansen2020-01-231-4/+8
| | | | | | | | | | The stm32 has a small queue for spi tx/rx. The current code only uses the spi with a single byte buffer, effectively waiting for each byte to complete before starting the next transfer. This patch changes the structure of spi_transfer() to make use of the queue and achieve back-to-back transfer of bytes on spi. Signed-off-by: Arne Jansen <arne@die-jansens.de>