aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Remove product names from bootloader choices menuKevin O'Connor2024-01-221-7/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add 36KiB bootloader offset option (#6449)Jakub2024-01-221-0/+3
| | | | | - This offset is used by Anycubic Kobra 2 Neo bootloader Signed-off-by: Jakub Przystasz <jakub.przystasz@gmail.com>
* stm32g0: Disable internal pull-down resistors on UCPDx CCx pins, because ↵BIGTREETECH2024-01-211-0/+2
| | | | | klipper never uses UCPD (#6462) Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* sensor_lis2dw: No need to schedule start of bulk readingKevin O'Connor2024-01-191-42/+11
| | | | | | It's simpler and faster to enable the lis2dw in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: No need to schedule start of bulk readingKevin O'Connor2024-01-191-98/+27
| | | | | | It's simpler and faster to enable the mpu9250 in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_adxl345: No need to schedule start of bulk readingKevin O'Connor2024-01-191-43/+12
| | | | | | It's simpler and faster to enable the adxl345 in the python code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_bulk: New C file with helper code for sending bulk sensor measurementsKevin O'Connor2024-01-198-120/+113
| | | | | | | | | | Refactor the low-level "bulk sensor" management code in the mcu. This updates the sensor_adxl345.c, sensor_mpu9250.c, sensor_lis2dw.c, and sensor_angle.c code to use the same "bulk sensor" messages. All of these sensors will now send "sensor_bulk_data" and "sensor_bulk_status" messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_angle: No need to send messages when stopping queriesKevin O'Connor2024-01-191-5/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_lis2dw: No need to send messages when stopping queriesKevin O'Connor2024-01-191-19/+2
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: No need to send messages when stopping queriesKevin O'Connor2024-01-191-9/+0
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_adxl345: No need to send messages when stopping queriesKevin O'Connor2024-01-191-18/+0
| | | | | | Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: Check for overflows on each query_mpu9250_status commandKevin O'Connor2024-01-071-10/+12
| | | | | | | | | | | | Move overflow detection from mp9250_stop() to command_query_mpu9250_status(). Currently the host ignores any contents returned from a stop request, so overflow reporting at that point has limited utility. In practice, this change will result in one additional i2c transaction to the mpu9250 device every 100ms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: Simplify mp9250_query()Kevin O'Connor2024-01-071-14/+10
| | | | | | | | The mpu9250 code always reads from the sensor in 48 byte chunks and always sends an mpu9250_data message immediately after that. Make that more clear in the querying code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sensor_mpu9250: Fix timing in command_query_mpu9250_status()Kevin O'Connor2024-01-071-8/+9
| | | | | | | | | | | | Commit 80a7744b optimized the fifo tracking code. However, it introduced an error in the time tracking in command_query_mpu9250_status(). The purpose of that function is to provide a precise timestamp of the total number of messages produced at the time of that call. Thus, the returned fifo value needs to be the fifo level in the chip at the time of the call (not the value read during previous checks). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix CAN for STM32G4Alex Maclean2023-12-212-3/+6
| | | | Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* stm32: Fix ADC for STM32G4Alex Maclean2023-12-211-2/+3
| | | | | | | | At least STM32G4 requires four ADC clock cycles between hardware clearing ADCCAL and setting ADEN or the write disappears. Make a tenacious write attempt. Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* stm32: Fix STM32G4 USBAlex Maclean2023-12-211-1/+6
| | | | | | STM32G4 USB controller requires 8 or 16-bit access, not 32-bit Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* hard_pwm: Add pin defs for STM32F070 and STM32F072 (#6409)Will Puckett2023-12-052-2/+65
| | | | | Define hard_pwm pins for STM32F070 and STM32F072, and update KConfig accordingly. Signed-off-by: Will Puckett <willpuckett@gmail.com>
* avr: enable small code size options for 328 and 328p (#6411)CODeRUS2023-11-291-1/+1
| | | Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
* stm32: enable 64KiB bootloader offset for all F4docgalaxyblock2023-11-161-1/+1
| | | | Signed-off-by: Joshua Schlicker <potter-91@web.de>
* atsam: Add support for CAN on atsame70 (#6366)Luke V2023-10-196-5/+359
| | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* atsam: Remove USB endpoint header (#6365)Alex Maclean2023-10-121-10/+0
| | | | | | | | | | The atsam USB hardware only requires that the ACM endpoint be endpoint 3. As of commit 11828387 the atsam chips can therefore use the default USB endpoints. This will allow CAN bridge support for the SAME70 to function (upstream host driver has hardcoded endpoints). Signed-off-by: Alex Maclean <monkeh@monkeh.net>
* stm32: Make sure to limit tx during usbfs startupKevin O'Connor2023-10-051-1/+2
| | | | | | | Wait for two tx packets before startup, and make sure one of those packets is acked before sending a third tx packet. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix usbfs spurious USB packet transmit on startupKevin O'Connor2023-10-041-6/+16
| | | | | | | | | | | Commit cd8d57c2 added USB double buffering mode on transmits. However, when enabling double buffering mode, the hardware seems to always send at least two packets. Spurious transmissions could cause the Linux gs_usb driver to get confused, which could lead to the can0 device becoming unavailable on restarts. Fix by waiting for two USB packets to be available before enabling the endpoint. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only enable one direction on usbfs double buffered end pointsKevin O'Connor2023-10-041-2/+2
| | | | | | | The bulk out endpoint should not be enabled in tx mode, and the bulk in endpoint should not be enabled in rx mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Prioritize local response sending over new host messagesKevin O'Connor2023-10-031-2/+4
| | | | | | | | Prioritize sending responses back to the host over transmitting new messages from the host. Otherwise, the gs_usb host usb acknowledgments could saturate the usb bandwidth for extended periods. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Add a local queue for USB messages received from hostKevin O'Connor2023-10-031-15/+38
| | | | | | | | Read USB messages arriving from the host into a queue. This makes it less likely that USB "bulk out" packets will be NAK'ed on the USB bus, which improves USB bus utilization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Rename UsbCan.queue to UsbCan.canhw_queueKevin O'Connor2023-10-031-14/+14
| | | | | | | Rename the internal variable names. This is in preparation for support of a USB message queue. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add support for double buffering on USB bulk tx packetsKevin O'Connor2023-10-031-4/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add support for double buffering on USB bulk rx packetsKevin O'Connor2023-10-031-6/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Open code usb_read_packet() and usb_write_packet() in callersKevin O'Connor2023-10-031-36/+58
| | | | | | | Copy the code for these two functions to their respective callers. This is in preparation for double buffer support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add helper functions to usbserial.cKevin O'Connor2023-10-031-20/+56
| | | | | | | Add helper functions for manipulating the buffer memory and packet control registers. This is in preparation for double buffer support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add usbfs double buffer support for bulk tx messagesKevin O'Connor2023-10-031-8/+28
| | | | | | | | Implement the usbfs fast buffer switching mechanism on the "bulk in" endpoint. This can improve the overall USB throughput and bus utilization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add usbfs double buffer support for bulk rx messagesKevin O'Connor2023-10-031-14/+49
| | | | | | | | Implement the usbfs fast buffer switching mechanism on the "bulk out" endpoint. This can improve the overall USB throughput and bus utilization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Update usbfs to support setting both buffers for each endpointKevin O'Connor2023-10-031-35/+37
| | | | | | | | | The usbfs device supports two buffers for each endpoint - typically one for rx and one for tx. Add support for explicit handling of both buffers. This is in preparation for improved "double buffering" support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Improve usbfs epr register handlingKevin O'Connor2023-10-031-40/+41
| | | | | | | | Replace the set_stat_x_bits() functions with a single calc_epr_bits() function. This new function supports setting bits other than the stat field in the epr register. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Support Enable/Disable lis2dw on chips with small flash sizebigtreetech2023-08-212-1/+9
| | | | Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
* lis2dw12: Add support for lis2dw12 accelerometerbigtreetech2023-08-212-1/+222
| | | | | | | | lis2dw12 is an accelerometer from STMicroelectronics(https://www.st.com/resource/en/datasheet/lis2dw12.pdf) With better performance than the ADXL345 according to the datasheet. Signed-off-by: XM.Zhou from BigTreeTech zhouxm@biqu3d.com Signed-off-by: Alan.Ma from BigTreeTech tech@biqu3d.com
* hc32f460: Add app address 0x10000Falk Höppner2023-08-131-6/+9
| | | | | | Required for the Anycubic Kobra 2. Signed-off-by: Falk Höppner <falk@hoppner.se>
* atsamd: Add support for SAMD21J18 (Minitronics v2)Bart Meijer2023-07-051-2/+6
| | | | | | Adds a menu entry in menuconfig, allowing you to select the SAMD21J18 as mcu. Signed-off-by: Bart Meijer <brupje@gmail.com>
* hc32f460: Disable JTAG/SWD on pins so they can be used for GPIO/serialBoris-Chengbiao Zhou2023-06-201-0/+6
| | | | | | | | | | | | | This change is required to sucessfully use PA13/PA14 for UART. Otherwise they function as SWDIO/SWCLK. Relevant excerpt from the reference manual (translated): The initial state of PA13, PA14, PA15, PB3, and PB4 ports is that the JTAG/SWD function is valid after reset. When configuring FSEL[5:0] to select the function, you need to write 0 to the corresponding bit of the register PSPCR to invalidate the JTAG/SWD function. Signed-off-by: Boris-Chengbiao Zhou <bobo1239@web.de>
* hc32f460: Use correct USART for PH2/PB10 pinsBoris-Chengbiao Zhou2023-06-201-9/+28
| | | | | | | | | | | This fixes serial communication when selecting the PH2/PB10 pins. The chip datasheet (not reference manual) assigns pins to one of two communication function groups (`Func_Grp1/2`). Pins in group 1 have access to USART1/2 while group 2 has access to USART3/4. PH2/PB10 belong to group 2 so we now correctly use USART3 for them. Signed-off-by: Boris-Chengbiao Zhou <bobo1239@web.de>
* atsamd: Fixes for samc21 and compiler optimizations (#6198)Luke V2023-06-162-4/+26
| | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>
* Kconfig: Support selecting optional features on chips with small flash sizeKevin O'Connor2023-06-0815-36/+70
| | | | | | | | | | | | | Add a new HAVE_LIMITED_CODE_SIZE symbol that enables a menu to select optional features. This symbol is enabled on chips with small build sizes. Replace the HAVE_GPIO_BITBANGING with four new symbols: WANT_GPIO_BITBANGING, WANT_DISPLAYS, WANT_SENSORS, WANT_SOFTWARE_SPI, and WANT_SOFTWARE_I2C. This allows users a little more flexibility when selecting features they need. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Implementation of software i2c (#6141)BIGTREETECH2023-06-076-10/+246
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* hc32f460: update for HC32F460 - clock, flash add, serial (#6235)Steve Gotthardt2023-06-062-9/+44
| | | | | | | | | Add clock speed selection Add Flash App Address selection Add alternate serial connection and remove company specific names Signed-off-by: Steven Gotthardt <gotthardt@gmail.com>
* Kconfig: Change default CANbus frequency to 1000000Kevin O'Connor2023-05-301-1/+1
| | | | | | | | Change the default CANbus frequency from 500000 to 1000000. A higher frequency allows for greater data transfer rates, lower latency of messages, and should overall be more robust. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: add PB5/PB6 as CAN pins - required for BTT U2C v2.xStefan Dej2023-05-202-2/+6
| | | | Signed-off-by: Stefan Dej <meteyou@gmail.com>
* stm32f7: add support for stm32f7 and remram boardFrederic Morin2023-05-0710-11/+217
| | | | Signed-off-by: Frederic Morin <frederic.morin.8@gmail.com>
* atsamd: Add support for SAMC21Wulfsta2023-05-0113-31/+311
| | | | Signed-off-by: Luke Vuksta <wulfstawulfsta@gmail.com>