aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* rp2040: Suppress spurious gcc v12 array bounds warningKevin O'Connor2022-09-291-3/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Only shutdown on multiple consecutive sensor errorsKevin O'Connor2022-09-231-4/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* thermocouple: Report fault information in fault fieldKevin O'Connor2022-09-231-12/+6
| | | | | | | Send the fault information explicitly in the query_thermocouple fault field for max6675, max31855, and max31865. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32l4: add stm32l412 support with adc,i2c,spi,usbMatt Baker2022-09-158-32/+305
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* samd21: fix erroneous register bit reference.Matt Baker2022-09-111-2/+0
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* stm32: Fix i2c on stm32g0Kevin O'Connor2022-09-112-0/+34
| | | | | | Fix the gpio function. Also, add buses found only on stm32g0. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add a gpio_valid() helper functionKevin O'Connor2022-09-051-12/+12
| | | | | | Add a function to validate that a gpio pin is valid on the chip. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serial_irq: Support side channel for entering bootloaderKevin O'Connor2022-09-054-0/+7
| | | | | | Add a mechanism to request the bootloader when using serial input. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Move bootloader_request() from usbserial.c to main.cKevin O'Connor2022-09-053-12/+23
| | | | | | | Move bootloader_request() function so that it can be used when not using USB. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f0: implement i2c_read endpointMatt Baker2022-09-011-1/+20
| | | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* stm32: Add Hardware PWM support for STM32G0 processors (#5714)Ben Jackson2022-09-013-4/+66
| | | | | | | | | | | Uses existing common code for STM32. Adds a table for device- specific PWM mappings. Adds support for enabling all TIM timer devices. Makes it a runtime error to enable devices the code doesn't know how to enable. I have verified performance of the fan pins (PC6, PC7, PB15) on the SKR Mini E3 V3. Signed-off-by: Ben Jackson <ben@ben.com>
* stm32: add FDCAN support for STM32H743 (SKR-3 Series) (#5668)BIGTREETECH2022-08-233-8/+85
| | | Signed-off-by: Chen.BJ from BigTreeTech <chenbj@biqu3d.com>
* stm32: Fix the STM32H743 mcu temp on SKR 3 (#5711)adelyser2022-08-191-1/+1
| | | Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
* rp2040: Enabled hw pullups for the I2C pins (#5710)chestwood962022-08-191-2/+2
| | | Signed-off-by: Adrian Joachim <adi.joachim12@gmail.com>
* atsamd: Use CONFIG_USB instead of CONFIG_USBSERIAL during clock initKevin O'Connor2022-08-162-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use new CONFIG_USB to determine if USB needs to be configuredKevin O'Connor2022-08-165-12/+14
| | | | | | | | | | | | Introduce a CONFIG_USB build symbol that is set whenever CONFIG_USBSERIAL or CONFIG_USBCANBUS is set. Use that symbol during setup so that the USB controller is properly initialized for both usb serial and usb canbus bridge configurations. This fixes the clock configuration for usb canbus bridge mode on stm32f446. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canserial: Fix typo in canserial.hKevin O'Connor2022-07-291-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Remove stm32f4 canbus warningKevin O'Connor2022-07-291-1/+0
| | | | | | The canbus code has been successfully tested on stm32f4. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mcu: Delay reset signaling for usb to canbus bridge nodesKevin O'Connor2022-07-291-0/+3
| | | | | | | | An mcu device acting as an "mcu bridge" should only be reset after other normal devices are reset - otherwise the bridge wont be able to pass along the reset message to the downstream mcus. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canserial: Request bootloader via bootloader_request()Kevin O'Connor2022-07-291-2/+1
| | | | | | | Use bootloader_request() instead of try_request_canboot(). This allows the bootloader machanism to work for more bootloaders. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename usb_request_bootloader() to bootloader_request()Kevin O'Connor2022-07-2914-32/+45
| | | | | | | Rename this board API function to a more generic name. This is in preparation for calling the function from the canbus code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serialqueue: Improve canbus timingKevin O'Connor2022-07-291-0/+4
| | | | | | | Adjust timing based on the minimum transmission time of canbus messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add CCRDY check to stm32g0 adcKevin O'Connor2022-07-251-0/+9
| | | | | | | The stm32g0 specification states that it is required to wait for the CCRDY flag to be raised after changing the channel configuration. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add support for USB to CANbus bridge modeKevin O'Connor2022-07-062-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Initial support for CANbusKevin O'Connor2022-07-064-7/+104
| | | | | | | Add support for CANbus on the rp2040 using the can2040 "software canbus" implementation. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: stm32g0/h7 usb_dfu_bootloader support (#5596)BIGTREETECH2022-06-302-1/+34
| | | Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* usb_canbus: Initial support for USB to CAN bridge modeKevin O'Connor2022-06-277-15/+751
| | | | | | | Support a USB interface that shows up as a canbus adapter to linux. Route both local and real canbus packets over that interface. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canserial: Rename canbus.c to canserial.cKevin O'Connor2022-06-279-332/+385
| | | | | | | | | | Rename the canbus.c code to canserial.c and introduce new wrapper functions in canbus.c that connect the low-level canbus hardware code to the high-level canserial.c code. This is in preparation for adding "usb to canbus bridge mode". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc_ep: Change default endpoint numbersKevin O'Connor2022-06-272-3/+3
| | | | | | | Change the default endpoint numbers to make it possible to implement the "gs_usb" canbus protocol. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for disabling the canbus filterKevin O'Connor2022-06-273-7/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add MCU temp for Stm32h7 (#5606)adelyser2022-06-271-2/+11
| | | | | Added mcu temperature to the stm32h7 processor. Signed-off-by: Aaron DeLyser <bluwolf@gmail.com>
* rp2040: Add a Kconfig option for selecting "generic_03H" flash typeKevin O'Connor2022-06-201-0/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add options to Kconfig for "stage2" flash chip optionsKevin O'Connor2022-06-202-2/+17
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add Kconfig option for stm32f103x6 chip (with only 10KiB ram)Kevin O'Connor2022-06-201-1/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: support stm32f401 adc_temperature sensor (#5572)Kamil Trzciński2022-06-201-2/+4
| | | | | | | | | > The temperature sensor is internally connected to the ADC_IN18 > The TSVREFE bit must be set to enable the conversion of both internal channels: the ADC1_IN16 or ADC1_IN18 (temperature sensor) and the ADC1_IN17 (VREFINT). Ref.: https://www.st.com/resource/en/reference_manual/dm00096844-stm32f401xb-c-and-stm32f401xd-e-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf Signed-off-by: Kamil Trzciński <ayufan@ayufan.eu>
* Kconfig: Move SERIAL, USBSERIAL, and CANSERIAL definitions to src/KconfigKevin O'Connor2022-06-166-22/+6
| | | | | | There is no need to define these options in every board Kconfig file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* mpu9250: Adding support for MPU-9250 (and MPU-6050) accelerometerbluesforte2022-06-164-4/+298
| | | | | | Add support for mpu9250 accelerometer over I2C bus. Signed-off-by: Harry Beyel <harry3b9@gmail.com>
* canbus: Move canbus uuid calculation to canbus.cKevin O'Connor2022-06-167-25/+21
| | | | | | | | Move the uuid hash calculation to canbus.c and call canbus_set_uuid() from src/stm32/chipid.c . This simplifies the low-level canbus hardware code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support passing through RTR and EFF canbus framesKevin O'Connor2022-06-163-28/+39
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support PA11/PA12 and PB8/PB9 on fdcanKevin O'Connor2022-06-162-16/+20
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify fdcan tx irq handlingKevin O'Connor2022-06-161-8/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Use single method for reading canbus messagesKevin O'Connor2022-06-164-198/+125
| | | | | | | | | | | | Previously the code had canbus_read() which was called from task context (for admin messages), and canbus_process_data() which was called from irq context (used for data messages). Change that to a single canbus_process_data() function that is called from irq context (used for all messages). This simplifies the low-level hardware specific canbus code and should make it easier to support other hardware implementations. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Move global variables into a structKevin O'Connor2022-06-161-55/+65
| | | | | | | | Create a single CanData global variable to track the canbus state. ARM micro-controllers generally produce better code when global variables are in a struct. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Implement workaround for USB errata "rp2040-e5"Kevin O'Connor2022-06-121-3/+99
| | | | | | | | The rp2040 USB may not connect after a reset. Implementation the recommended workaround. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support 4KiB bootloader on stm32f1 and stm32f0Kevin O'Connor2022-06-101-0/+3
| | | | | | | The CanBoot bootloader can often fit in 4KiB and that may be useful for some devices with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: add support for canboot usbEric Callahan2022-06-101-0/+2
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* ds18b20: Allow some read errorsfunctionpointer2022-06-081-22/+33
| | | | | | | | | | | | | | | | | | | | | Allows a limited number of DS18B20 read failures before stopping the printer. This is designed to tolerate spurious read errors, while still stopping for serious issues. The printer will stop when the sensor fails to report a value five times in a row. Implementation works as follows: The MCU reports any read errors using a new "fault" parameter in its answers. The Python code tracks the number of errors and triggers the shutdown. This paves the way for more sophisticated error handling in the future, as well as an example for other sensors to follow. Signed-off-by: Lorenzo Pfeifer <Lorenzo.Pfeifer+github@googlemail.com>
* stm32: Enable Automatic retransmission feature to avoid data loss caused by ↵BIGTREETECH2022-06-061-2/+0
| | | | | bus conflict for STM32G0B1 fdcan (#5550) Signed-off-by: Alan.Ma from BigTreeTech <tech@biqu3d.com>
* Kconfig: Move CANBUS_FREQUENCY definition from src/stm32/Kconfig to src/KconfigKevin O'Connor2022-06-042-4/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_reset: Add a armcm_reset.h header file for try_request_canboot()Kevin O'Connor2022-06-049-9/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>