aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* spi_software: add a delay on mode changeTimofey Titovets2025-05-261-5/+8
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* rp2040: add a delay on SCK polarity changeTimofey Titovets2025-05-261-0/+7
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Allow stm32g4 chips to select a bootloaderKevin O'Connor2025-05-191-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: spi enable fifo if supported (#6936)Timofey Titovets2025-05-191-7/+21
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: H7 spi enable use of fifoTimofey Titovets2025-05-191-4/+8
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Avoid read-modify-write register access in stm32h7_spi.cKevin O'Connor2025-05-161-20/+16
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Minor code tweak - remove unneeded parenthesisKevin O'Connor2025-05-091-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Minor code reorg - remove unneeded HAVE_OPTIMIZED_PATH definitionKevin O'Connor2025-05-091-8/+7
| | | | | | | Make it more clear that stepper_load_next() has three separate code paths - one for each of the optimized stepper_event_X() functions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Also ensure minimum time after dir change and next stepKevin O'Connor2025-05-091-3/+11
| | | | | | | | | In practice the host will not schedule any steps immediately after a direction change (due to acceleration limits and the host "step+dir+step filter"). However, there is also no harm in enforcing a minimum duration in the mcu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Ensure minimum time between step pin and dir pin changeKevin O'Connor2025-05-091-0/+4
| | | | | | | | | | | | | | | Commit 8faed8d9 made it possible to utilize stepper_event_full() while utilizing tmc "step on both edges" optimation. That commit would ensure a minimum step pulse duration, but it did not ensure a minimum duration between step pin and dir pin changes. Commits 0d27195f and 554ae78d optimized the gpio handling on stm32h7 chips, which could potentially cause a very small amount of time between step pin and dir pin changes. Enforce a minimum time after a step pin update before updating the dir pin. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Move timer checks from stepper_event_full() to stepper_load_next()Kevin O'Connor2025-05-091-10/+16
| | | | | | | This simplifies the stepper_event_full() and makes it easier to implement more complex checks. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Free stepper_move struct near top of stepper_load_next()Kevin O'Connor2025-05-091-18/+26
| | | | | | | | Move up the freeing of the stepper_move struct and setting of s->position in stepper_load_next(). This simplifies the code and will make it easier to add more logic to this function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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>