aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Rename everything significant to Kutter except for docsTomasz Kramkowski2025-08-1520-74/+74
|
* avr: Switch to input state prior to enabling pullup in gpio_in_reset()Kevin O'Connor2025-07-221-4/+8
| | | | | | | | | | | | | | If switching a pin from output low to input with pullup, there is an intermediate state of either driven high or high impedance without a pullup. Similarly, when switching from output high to input without a pullup, there is an intermediate state of either driven low or high impedence with a pullup. In both cases it is preferable for the latter transition. Also, calculate the final setting prior to making any changes to reduce the time in that intermediate state. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Place wires in high impedance state after setupKevin O'Connor2025-07-221-2/+2
| | | | | | | Don't leave the wires in a high output state during setup - leave them in a high-impedance with pullup state. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Implement regular timing even on AVR chipsKevin O'Connor2025-07-221-9/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: make i2c distinguish I2C NACKsTimofey Titovets2025-07-171-22/+38
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* sos_filter: fix overflows_int32 (#6976)Findlay Feng2025-07-111-1/+1
| | | | | | | Modify the inline function overflows_int32 to static inline Inline functions cannot be debugged in -O mode https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653 Signed-off-by: Findlay Feng <i@fengch.me>
* stm32: f0 do not send empty write on readTimofey Titovets2025-07-091-9/+11
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: f0 make i2c distinguish I2C NACKsTimofey Titovets2025-07-091-1/+11
| | | | | | | | | | Some devices can return a read NACK on host retries. When the MCU receives the I2C CMD, reads out data, but fails to deliver a response to the host. The host retries, the device returns NACK, and the MCU goes into the shutdown state. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* load_cell_probe: Fix warnings on avr buildsKevin O'Connor2025-06-181-2/+2
| | | | | | | On AVR, integers are 16bit, so be sure to promote math to 32bit where needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Adding more hardware pwm capable pins for STM32Hx series chips (#6965)jimmyjon7112025-06-181-0/+22
| | | Signed-off-by: Jim Madill <jcmadill1@gmail.com>
* sos_filter: Fix validate_section_index() checkKevin O'Connor2025-06-111-2/+3
| | | | | | A section_idx equal to max_sections is also invalid. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ar100: Convert to or1k-elf toolchainKevin O'Connor2025-06-081-1/+1
| | | | | | | | | The more.musl.cc site is blocking downloads from all github actions, which makes it difficult to use that site for the ar100 cross build toolchain. Convert to the openrisc or1k-elf toolchain as a replacement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Prefer larger postdiv1 on rp2040 chipsKevin O'Connor2025-06-021-2/+2
| | | | | | | The rp2040 uses a pll vco divider of 6. Prefer setting postdiv1=6 and postdiv2=1 (instead of the previous postdiv1=3 and postdiv2=2). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add comments on PLL frequency requirements to clock setup codeKevin O'Connor2025-06-029-0/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Run stm32g431 at 170MhzKevin O'Connor2025-05-313-5/+8
| | | | | | The chip supports 170Mhz, so no need to run at 150Mhz. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix spi overflow issue on stm32h7Kevin O'Connor2025-05-301-8/+6
| | | | | | | | Completely filling the spi transmit fifo could lead to a situation where the rx fifo overflows. Make sure not to write past the rx fifo size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Fix spi overflow issueKevin O'Connor2025-05-301-4/+9
| | | | | | | | | | | Completely filling the spi transmit fifo could lead to a situation where the rx fifo overflows. Make sure not to write past the rx fifo size. Also, be sure to wait for the transmission to fully complete before exiting spi_transfer(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: spi - enable fifoTimofey Titovets2025-05-301-4/+8
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Support using CANBUS on PB5/PB6 on stm32h7 chipsKevin O'Connor2025-05-302-2/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify Kconfig HAVE_STM32_CANBUS checksKevin O'Connor2025-05-301-7/+7
| | | | | | | | | Avoid unnecessary (HAVE_STM32_CANBUS && MACH_STM32xx) checks in Kconfig. The HAVE_STM32_CANBUS is a helper symbol for all the chips that support canbus, there's no need to mix it with a check for a chip that is already known to have canbus. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sos_filter: Improve error checking on section_idxKevin O'Connor2025-05-291-5/+13
| | | | | | | | | | Validate host provided index prior to accessing memory using that index. Also, consistently use a uint8_t for max_sections (to account for integer overflow issues). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_hx71x: Update Sensors to report to load_cell_probeGareth Farrington2025-05-292-0/+32
| | | | Signed-off-by: Gareth Farrington <gareth@waves.ky>
* load_cell_probe: Create load_cell_probe MCU objectGareth Farrington2025-05-294-1/+314
| | | | | | Implement MCU features that enable using an adc to stop an axis Signed-off-by: Gareth Farrington <gareth@waves.ky>
* sos_filter: Second Order Sections MCU FilterGareth Farrington2025-05-294-0/+175
| | | | | | | | | | This is an implementation of the SOS fliltering algorithm that runs on the MCU. The filter opperates on data in fixed point format to avoid use of the FPU as klipper does not support FPU usage. This host object handles duties of initalizing and resetting the filter so client dont have to declare their own commands for these opperations. Clients can select how many integer bits they want to use for both the filter coefficients and the filters output value. An arbitrary number of filter sections can be configured. Filters can be designed on the fly with the SciPy library or loaded from another source. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* stm32: h7 spi - add a delay on SCK polarity changeTimofey Titovets2025-05-261-2/+9
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* 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>