aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* atsamd: Add Kconfig definition for SAME51N19 chipKevin O'Connor2024-10-281-2/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Remove references to manufacturers in KconfigKevin O'Connor2024-10-284-17/+17
| | | | | | | | Avoid referring to particular board manufacturers in "make menuconfig". This information becomes rapidly outdated and is sometimes viewed by competing manufacturers as being unfair. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* trsync: Don't require callers of trsync_do_trigger() to disable irqsKevin O'Connor2024-10-261-3/+6
| | | | | | | | | Disable irqs within trsync_do_trigger(). This fixes a bug in ldc1612 - as that code was calling trsync_do_trigger() without first disabling irqs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Improve timer vs task priority checkKevin O'Connor2024-10-266-11/+15
| | | | | | | | | | | | | | | Rename sched_tasks_busy() to sched_check_set_tasks_busy() and change it to only return true if tasks are active (running or requested) for two consecutive calls. This makes it less likely that timers will yield to tasks except when tasks really are notably backlogged. This also makes it less likely that multiple steppers controlling the same rail will be interrupted by tasks mid-step. This should slightly improve the timing, and make it less likely that a halt during homing/probing will occur with these steppers taking a different number of total steps. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu: shutdown on i2c errorsTimofey Titovets2024-10-261-6/+12
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* ldc1612: shutdown on i2c errorsTimofey Titovets2024-10-262-1/+3
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2ccmds: move status checks to functionTimofey Titovets2024-10-262-31/+26
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-13/+23
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* rp2040: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-18/+24
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* linux: forward i2c errors to i2ccmdTimofey Titovets2024-10-261-7/+15
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: forward errors to i2ccmdTimofey Titovets2024-10-261-18/+39
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c: handle errors at i2ccmdsTimofey Titovets2024-10-2620-49/+123
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2ccmds: abstract i2c dev from bus implementationTimofey Titovets2024-10-264-23/+35
| | | | | | | | Added wrapper around sw/hw bus API, pins.py code will ensure that pins will not mix between HW/SW buses. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Add support for USART3 on PC11/PC10 on STM32G474. (#6704)Liam Powell2024-10-242-0/+12
| | | Signed-off-by: Liam Powell <liam@liampwll.com>
* atsam: Enable TCM and cache for atsame70Wulfsta2024-10-215-13/+188
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* atsam: Add data memory barrier to USB driverWulfsta2024-10-211-0/+1
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* stm32: allow 400Khz in stm32f0_i2c.c (#6694)Timofey Titovets2024-10-091-0/+7
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Fix i2c clock speeds for chips with a peripheral clock over 48MhzKevin O'Connor2024-09-221-5/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Reduce peripheral clock speed on stm32g4 chipsKevin O'Connor2024-09-221-2/+2
| | | | | | A 170mhz (or 150mhz) peripheral clock is too fast for some peripherals. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Check for i2c NACK/Start NACK (#6692)Timofey Titovets2024-09-221-0/+22
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* STM32: Check for NACK (#6687)Timofey Titovets2024-09-222-0/+4
| | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c: drop i2c_modify_bitsTimofey Titovets2024-09-221-33/+0
| | | | | | No longer used and niche Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Fix setting USB clock with USB to CANbus mode on stm32g4/stm32l4Kevin O'Connor2024-08-292-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_hx71x: Signal an overflow from the timer handlerKevin O'Connor2024-08-141-10/+18
| | | | | | | | Check for overflows in the timer handler instead of checking the elapsed query time. This should be a better check as it also accounts for task delays that occur before the query starts. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* src: Current code produces warnings for possible value overflows. (#6665)Bevan Weiss2024-08-143-4/+9
| | | | | | | | | | As the input values are uint8_t types, any shift may result in value loss. Explicit promotion to the output type (uint32_t) keeps things safe. Have also changed the int32_t in ads1220_read_adc to uint32_t, type promotion and bit manipulation are a bit 'weird' on signed integers, so keep it as an unsigned to align with following function call parameter type. Have retained the prior explicit sign extension logic however. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
* stm32: Fix getting wrong ADC value on PA0 of STM32G431 (#6660)Nicholas Huskie2024-08-081-21/+23
| | | | | | | * Fix getting wrong ADC value on PA0 * Fix invalid/unused pin being used as adc channel on STM32H7/G431/L4 Signed-off-by: Nicholas Huskie <huskie@idealfuture.org.cn>
* ads1220: Add ADS1220 bulk sensor to load_cellGareth Farrington2024-07-313-1/+171
| | | | | | Add support for the ADS1220 as an alternative to HX71x that supports SPI and higher sample rates. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* hx71x: Load Cell Skeleton and HX71x bulk ADCGareth Farrington2024-07-313-1/+254
| | | | | | | * Create the load_cell host module skeleton to create the sensors and start taking samples. * Add support for the HX717 and HX711 ADC sensors. Signed-off-by: Gareth Farrington <gareth@waves.ky>
* rp2040_link: Explicitly set klipper.elf output section flags to avoid warningKevin O'Connor2024-06-171-5/+15
| | | | | | | Avoid pointless "LOAD segment with RWX permissions" linker warnings during the rp2040 build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_link: Fix build on recent arm gcc/newlibc versionsKevin O'Connor2024-06-178-9/+14
| | | | | | | | It seems recent arm gcc versions no longer build correctly using the "--specs=nano.specs --specs=nosys.specs" linker flags. Replace those linker flags with "-nostdlib -lgcc -lc_nano". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Support 2-byte message idsKevin O'Connor2024-06-103-8/+33
| | | | | | | | Allow command ids, response ids, and output ids to be either 1 or 2 bytes long. This increases the total number of message types from 128 to 16384. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_bulk: Change maximum data size from 52 to 51 bytesKevin O'Connor2024-06-102-3/+3
| | | | | | | | | | | | Reduce the maximum data size from 52 bytes to 51 bytes. This will enable support for 2-byte response ids. This change would alter the behavior of the ldc1612 sensor support. Force an ldc1612 command name change so that users are alerted that they must rebuild the micro-controller code upon update of the host code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: STM32F031 updates (#6607)Elias Bakken2024-05-252-2/+4
| | | | | | | Add support for STM32F031x6 which is the 32 KB version of the STM32F031 MCU. Add new I2C bus variant. Signed-off by: Elias Bakken <elias@iagent.no>
* sensor_ldc1612: Halt homing if sensor reports a warningKevin O'Connor2024-05-211-2/+9
| | | | | | | Explicitly check for sensor warnings during homing and report an error code back to the host. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_ldc1612: Create new check_home() helper functionKevin O'Connor2024-05-211-15/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_ldc1612: Add support for chips with INTB line routed to mcuKevin O'Connor2024-05-211-8/+38
| | | | | | If the INTB line is available it can reduce the MCU load. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_ldc1612: Don't require DRDY bit to be set on data readKevin O'Connor2024-05-211-2/+2
| | | | | | | | It is not clear if DRDY is cleared during a STATUS read (which could occur from command_query_ldc1612_status() ). So, just check the "unread conversion" bit when reading data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add STM32G474 chip to KconfigDropeffect GmbH2024-05-141-0/+7
| | | | Signed-off-by: Amr Elsayed from Dropeffect GmbH <code@dropeffect.com>
* stm32: Add FDCAN2 channel needed for stm32g4 alternate pinsDropeffect GmbH2024-05-142-2/+15
| | | | | | | | Some of the alternate pins defined are routed to FDCAN2 instead of FDCAN1, this commit uses the correct IRQ register and peripheral clock enable bit to enable FDCAN on those pins. Signed-off-by: Amr Elsayed from Dropeffect GmbH <code@dropeffect.com>
* stm32g4: Fix ADC3 common interface registers name to ADC345_COMMONDropeffect GmbH2024-05-141-0/+4
| | | | | | Use ADC345_COMMON instead of ADC3_COMMON for stm32g4 ADC3 channel. Signed-off-by: Amr Elsayed from Dropeffect GmbH <code@dropeffect.com>
* stm32: Add new spi2 on stm32g0 chips (#6569)Donald A. Cupp Jr2024-05-031-15/+27
| | | Signed-off-by: Donald A. Cupp Jr <doncuppjr@yahoo.com>
* pru: BeagleBone Firmware upgrade to Debian 11.7 Bullseye (#6577)Oleg Gavavka2024-04-277-140/+191
| | | | | | | | | | | | | | | * Porting BeagleBone to Kernel 5.10 * Fixing issue with installation for BeagleBone. This fix resolve 2 issue: 1. Conflict with AVR packages. 2. "klipper_pru" script is executed before PRU cores are ready * Adding additional steps to BeagleBone install guide. * Updating BeagleBone documentation, adding different use cases, adding buses configurations SPI, I2C, CAN, UART Signed-off-by: Oleg Gavavka <work@datalink.net.ua>
* rp2040: Add kconfig options for rp2040 uart (#6549)Amken USA2024-04-242-23/+97
| | | | | Modified serial.c and Kconfig to dynamically select all possible UART combinations for RP2040 Signed-off-by: Hriday Keni <info@amken.us>
* config: Artillery Sidewinder X3 (#6534)TheFeralEngineer2024-04-121-1/+1
| | | Signed-off-by: Phil Timpson <theferalengineer@gmail.com>
* sensor_ldc1612: Initial support for bulk reading ldc1612 sensorKevin O'Connor2024-04-093-1/+216
| | | | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Don't use absolute paths for includeMichael 'ASAP' Weinrich2024-04-032-2/+2
| | | | | | | | Not all systems (i.e. Nix) repect the standard Linux filesystem hierarchy, instead relative paths should be used and allowing GCC to rely on it's builtin search paths. Signed-off-by: Michael 'ASAP' Weinrich <michael@a5ap.net>
* stm32: fix support for USARTs on STM32G0B0Robert Cambridge2024-04-031-0/+7
| | | | Signed-off-by: Robert Cambridge <robert@cambridge.me>
* stm32: Add i2c3 bus to STM32H7 (#6541)FOG_Yamato2024-04-021-0/+3
| | | Signed-off-by: Balanuta Simion <simion@fogyamato.dev>
* linux: Allow for more i2c busesCarl Richard Theodor Schneider2024-03-211-1/+1
| | | | | | | | | | | | | | | Similar to commit df79893, this allows klipper to use up to /dev/i2c-14. Similar to before, this limit is arbitrary. This is required for some other SoCs, which have even more i2c buses available, e.g. the rk3399: $ ls -1 /dev/i2c-* /dev/i2c-0 /dev/i2c-3 /dev/i2c-7 Signed-off-by: Carl Richard Theodor Schneider <dev.github@crtified.me>
* hc32f460: Adding support for 100pin version of H32F460 (#6488)Mad Beggar2024-03-192-1/+18
| | | Signed-off-by: Guillaume Giraudon <ggiraudon@prism19.com>