aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Run stm32h723 at 520MhzKevin O'Connor2025-05-022-2/+4
| | | | | | Increase speed of stm32h723 chips from 400Mhz to 520Mhz. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support over 400Mhz main clock in stm32h7_adc.cKevin O'Connor2025-05-021-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use 12Mhz nominal internal clock in stm32f0_i2c.cKevin O'Connor2025-05-021-9/+9
| | | | | | | Increase the internal nominal clock from 8Mhz to 12Mhz - this improves support for higher chip frequencies. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Round up in nsecs_to_ticks()Kevin O'Connor2025-04-281-1/+1
| | | | | | | The rp2040 operates at a fast internal clock with a relatively slow external timer and dividing down could result in a too small delay. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable VOS0 power mode on stm32h723 if frequency above 400MhzKevin O'Connor2025-04-281-11/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Don't try to set incorrect PWR->CR3 register on stm32h7Kevin O'Connor2025-04-281-5/+3
| | | | | | It's not valid to set BYPASS and LDOEN at the same time. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Set the PLL frequency equal to CONFIG_CLOCK_FREQ on stm32h723Kevin O'Connor2025-04-281-1/+1
| | | | | | | | There is no reason to use a higher internal PLL frequency. This change also makes it possible to enable higher clock frequencies on the stm32h723. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Avoid read-modify-write register updates in stm32h7 clock_setup()Kevin O'Connor2025-04-281-58/+39
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use enable_pclock() in stm32h7 clock_setup()Kevin O'Connor2025-04-281-5/+4
| | | | | | | Use the helper functions to enable the peripheral clock instead of directly manipulating the clock enable bits. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32h7: Always clear AHB1ENR at startup on stm32h7Kevin O'Connor2025-04-281-5/+1
| | | | | | | Entirely clear the AHB1ENR register. There is no need to modify AHB1LPENR. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* basecmd: Update stats timing check to support 32bit durationKevin O'Connor2025-04-281-1/+8
| | | | | | Use a 32bit duration check instead of the previous 31bit check. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for spi6 on stm32f42x chipsRussell Cloran2025-04-191-0/+7
| | | | Signed-off-by: Russell Cloran <rcloran@gmail.com>
* stm32: Fix pll_base on stm32h7 when using a clock other than 25MhzKevin O'Connor2025-04-191-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add optimized stm32h7_gpio.cKevin O'Connor2025-04-194-5/+176
| | | | | | | Add optimized gpio functions for stm32h7 - caching the ODR register can notably improve the performance of the gpio_out_toggle() code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Add comments on timingKevin O'Connor2025-04-171-4/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Note which chips require software divide operationsKevin O'Connor2025-04-174-0/+8
| | | | | | | Add a new HAVE_SOFTWARE_DIVIDE_REQUIRED that indicates which chips require software divide. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-1/+1
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_st7920: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-6/+6
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_hd44780: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-6/+6
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Change hard_pwm.c MAX_PWM to 257Kevin O'Connor2025-04-172-3/+4
| | | | | | Choose a value for MAX_PWM that avoids an expensive run-time division. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix prescaler overflow check in hard_pwm.cKevin O'Connor2025-04-171-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: pass pulse ticks from hostTimofey Titovets2025-04-171-12/+5
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: reduce gpio calls countTimofey Titovets2025-04-171-10/+12
| | | | | | | | | gpio reset calls are heavy. gpio state are persistent between calls. Drop useless calls. Avoid calls if SDA does not changed. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: allow freq adjustTimofey Titovets2025-04-171-0/+7
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* software_spi: set rate limiting ticks from the hostTimofey Titovets2025-04-171-9/+6
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* spi_software: respect expected rateTimofey Titovets2025-04-171-5/+32
| | | | | | | | On fast MCU software spi may violate maximally supported by TMC driver rate. Add dynamic limits to overcome that. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* Revert "Makefile: Don't disable gcc's use-linker-plugin option"Kevin O'Connor2025-04-161-1/+0
| | | | | | | | This reverts commit 8087200ffe2fbbe62265dd480ce8be67db8349eb. The change can break the build on some versions of gcc. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chipsKevin O'Connor2025-04-162-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add some user visible comments to the optional features menuKevin O'Connor2025-04-161-7/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify MakefileKevin O'Connor2025-04-161-31/+19
| | | | | | Breakout selection of timer and gpioperiph objects. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_ADC option to reduce code sizeKevin O'Connor2025-04-168-18/+28
| | | | | | | Make it possible to not compile in support for ADC on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_I2C option to reduce code sizeKevin O'Connor2025-04-168-33/+43
| | | | | | | Make it possible to not compile in support for I2C on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_SPI option to reduce code sizeKevin O'Connor2025-04-168-27/+34
| | | | | | | Make it possible to not compile in support for SPI on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_HARD_PWM option to reduce code sizeKevin O'Connor2025-04-168-7/+14
| | | | | | | Make it possible to not compile in support for hardware pwm on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_DISPLAYS with individual optionsKevin O'Connor2025-04-162-4/+12
| | | | | | Support setting WANT_ST7920 and WANT_HD44780 individually. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_GPIO_BITBANGING with individual optionsKevin O'Connor2025-04-162-7/+30
| | | | | | | | Support setting individual options instead of one global option ( WANT_BUTTONS, WANT_TMCUART, WANT_NEOPIXEL, WANT_PULSE_COUNTER, WANT_HX71X). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Don't disable gcc's use-linker-plugin optionKevin O'Connor2025-04-161-0/+1
| | | | | | | | | | | | | | | | This option seems to be confusing ld's region usage checks (builds that could fit in small chips are being reported as not fitting). The option was disabled back in commit 4e8674d5 because it showed worse results. However, recent versions of gcc seem to produce the same results even if this option is enabled, so change the build to avoid disabling that option on newer versions of gcc (those that have the -ffat-lto-objects option - which is needed to ensure compile_time_requests sections can be extracted with objcopy). The PRU build is dependent on -fuse-linker-plugin, so enable that option explicitly in its build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Fix i2c_delay()Kevin O'Connor2025-04-081-12/+9
| | | | | | | The i2c_delay() function did not properly handle counter rollovers. It also performed an expensive run-time divide. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Turn on can.c error interruptsKevin O'Connor2025-04-031-1/+1
| | | | | | | | It seems both ERRIE and LECIE must be enabled to get hardware error interrupts. Without this, the rx_error and tx_error reports are likely to always be zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for additional i2c busRussell Cloran2025-04-021-0/+3
| | | | Signed-off-by: Russell Cloran <rcloran@gmail.com>
* stm32: Fix RESERVE_PINS_CAN pin ordering in fdcan.cKevin O'Connor2025-04-011-1/+1
| | | | | | Always report the reserved pins in the same order (rx,tx). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Added PH13/14 CAN pin option for stm32h743 (#6857)FrY Sennberg2025-03-272-0/+14
| | | | | Added the option to select PH13/PH14 as CAN pins. Signed-off-by: Christoph Frei <fryakatkop@gmail.com>
* rp2040: define spi bus on pins 12,11,10Timofey Titovets2025-03-251-0/+3
| | | | | | Mellow FLY SHT36 Pro toolboard uses those pins Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stepper: Support disabling optimized "step on both edges" in "make menuconfig"Kevin O'Connor2025-03-202-9/+24
| | | | | | | Add a new "low level option" to allow users to configure if they want to optimize for Trinamic drivers or traditional stepper motor drivers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support step on both edges with custom minimum pulse durationKevin O'Connor2025-03-209-30/+46
| | | | | | | | | | Add support for "step on both edges" to the main stepper_event_full() code. This makes that mode of operation available even when the micro-controller is not compiled for "optimized step on both edges". It also enables the custom pulse duration support (step_pulse_ticks) when in "step on both edges" mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for USART6 on STM32F401Marius Petcu2025-03-072-2/+28
| | | | | | | | | STM32F401 has USART6 on PA12/PA11 and PC7/PC6 with alternate function mapping AF08. This can be used, for example, to connect to the Elegoo Neptune 3, where PA12/PA11 are wired to an RJ10 plug going to the stock screen. Signed-off-by: Marius Petcu <marius@petcu.me>
* icm20948: Add support for ICM20948 accelerometer (#6756)Paul Hansel2025-03-043-1/+193
| | | Signed-off-by: Paul Hansel <github@paulhansel.com>
* usb_canbus: Send echo frame before processing the frameKevin O'Connor2025-02-271-34/+37
| | | | | | | | | | | The Linux kernel reports a canbus message as transmitted when it gets the echo frame back. Processing the message prior to sending the echo frame can lead to odd looking debugging logs (as the response messages may appear to predate the request messages). This doesn't impact the Klipper code, but it does make analyzing logs harder. Fix by sending the echo frame prior to processing the frame. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>