Commit Graph

703 Commits

Author SHA1 Message Date
Matt Shepcar ccaf58a02c
stm32f1: Fix for using 16MHz external crystal (#3814)
Signed-off-by: Matt Shepcar <matt@shepcar.co.uk>
2021-01-24 10:24:11 -05:00
Kevin O'Connor 28bca7da77 stm32: Support setting the stm32f0 internal clock trim value
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-18 12:49:41 -05:00
Kevin O'Connor cc39beba0e stm32: Add support for spi4 bus on stm32f446 chip
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2021-01-04 01:54:41 -05:00
Kevin O'Connor f3c5be0f00 gpiocmds: Merge digital output and soft pwm code
The digital output commands implement a subset of the software pwm
commands.  Change the host code to just use the software pwm commands
and simplify the micro-controller code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-10 12:06:26 -05:00
Kevin O'Connor 39a04eac5f stm32: Only use the HSI48 clock when doing "usb clock recovery"
The HSI48 clock on the stm32f042 isn't as accurate as the main HSI
clock.  So, only use the HSI48 clock when using USB to synchronize
that clock.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-08 09:00:47 -05:00
Kevin O'Connor 9e293be5e0 pca9685: Use move queue for pwm updates
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 19a96346a8 gpiocmds: Use move queue for software pwm
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Pascal Pieper 9cdf9bb6ec gpiocmds: Use move queue for digital output pins
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Pascal Pieper e8ec1801ff pwmcmds: Use move queue for hard PWM
Signed-off-by: Pascal Pieper <accounts@pascalpieper.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 697412d25c stepper: Use a reusable interface to the "move queue"
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 3b9412513e basecmd: Change "move queue empty" error to "move queue overflow"
Use a more clear error message.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 086f0fafde gpiocmds: Send soft pwm cycle_time separately from schedule_soft_pwm_out
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 7b28cdbae5 pru: Disable gpio mux configuration code
The code isn't actually capable of altering the mux registers due to
hardware checks enforced by the chip.  Disable that code to save a few
bytes in the final binary.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-12-04 16:10:13 -05:00
Kevin O'Connor 123908ac7a neopixel: Fix neopixel_result message so that it contains an oid
In order for commit 82156170 to work properly, the neopixel_result
message must contain the oid.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-11-05 11:40:34 -05:00
Kevin O'Connor a560432041 command: Fix handling of buffer passing in args[] on 64bit mcu
If the buffer pointer can't fit in a uint32_t then pass a relative
buffer offset instead.  This fixes buffer handling on 64bit linux
mcus.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-30 14:04:12 -04:00
Kevin O'Connor 473828ca6a command: Add command_decode_ptr() helper
Add a helper function to convert from a string buffer passed in the
args[] parameter to an actual pointer.  This avoids all the callers
needing to perfrom pointer manipulation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-30 14:04:08 -04:00
Kevin O'Connor 2bb30265b5 neopixel: Increase the maximum LED chain length
Rework neopixel updates to use an mcu buffer so that more than 18 LEDs
can be in a chain.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:59:15 -04:00
Kevin O'Connor be4ad29fa3 atsamd: Support reading chip based temperature sensor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor 9142200b3a stm32: Support reading chip based temperature sensor on stm32f0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor a8069e9ba8 stm32: Reduce adc_pins storage size in stm32f0_adc.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor d985b53ccb stm32: Support reading chip based temperature sensor on stm32f1/2/4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor d9b7891133 atsam: Support reading chip based temperature sensor on sam4e
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor 97d49105b7 atsam: Support reading chip based temperature sensor on sam3/sam4s
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-29 11:55:06 -04:00
Kevin O'Connor ed5ce9cb37 linux: Fix spi handling with more than one spi device
Reported by @opensource-alt.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-25 10:14:15 -04:00
Kevin O'Connor 2885a4c728 stm32: Don't default to HID bootloader in Kconfig
Restore the default of an 8KiB bootloader for stm32f103 and a 32KiB
bootloader for stm32f207/stm32f407.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-10-13 14:25:17 -04:00
bondus 387fceb453 stm32: Fixed CAN bus for STM32F4, there were syntax errors that prevented compilation
Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
2020-10-11 11:24:05 -04:00
Guy Shapira 27cefb2b38 gpiocmds: Add soft-pwm frequency modulation support
Signed-off-by: Guy Shapira <gayuha@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-26 20:51:38 -04:00
Kevin O'Connor 1cdf0d474d sensor_adxl345: Remove unused stop_time parameter
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-05 09:18:59 -04:00
Kevin O'Connor 3405095f0a adxl345: Add support for adxl345 accelerometer
Add support for taking measurements from an adxl345 accelerometer via
SPI interface.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-09-05 09:11:04 -04:00
Cabia Rangris 15853da28c
config: Added TronXY X5SA support (#3265)
Added printer-tronxy-x5sa-v6 config.
Added "chitu" bootloader option to stm32 Kconfig.
Added chitu_crypt.

Signed-off-by: Vladimir Serov <me@cab404.ru>
2020-08-30 12:59:28 -04:00
bondus 35d28e880d
stm32: Improvements to CAN bus ID generation. And added a small fast hash library (#3165)
Improved CAM bus ID generation, there were issues with ID collisions.
Added a small fast hash library.

Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
2020-08-09 21:07:59 -04:00
Kevin O'Connor 0f3b1bce66 linux: Set the SPI mode in spidev.c
Fix omission causing the SPI mode to not be set on the linux mcu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-31 23:18:46 -04:00
Kevin O'Connor 5f2cb5436c linux: Disable hardware pwm when it is set to zero
Only write "1" to the "enable" file when a non-zero pwm width is
requested.  Write "0" to the "enable" file when a zero pwm width is
requested.

This fixes a problem on the replicape servo lines that prevented them
from being fully disabled.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-20 22:18:28 -04:00
Kevin O'Connor c83688b7bc lpc176x: Fix spi mode bits
The lpc176x hardware spi initialization code was swapping the CPOL and
CPHA bits.  This caused the MAX31865 and MAX31856 chips to not work
correctly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-07-10 16:08:18 -04:00
bondus 7a8e9591e3
stm32: Improved CAN support for STM32 (#2976)
Reworked the STM32F0 CAN bus implementation. It's more robust and higher performance.

Added support for function remapping to different pins.  API is emulating an STM32F0.

Improved and ported CAN bus to STM32F0, F1 and F4.

Signed-off-by: Pontus Borg <glpontus@gmail.com>
2020-06-24 18:59:38 -04:00
combolek 7cab732ae9
stm32: Initial support for stm32f2 (#3001)
Initial support for stm32f2 in general and STM32F207 in particular.

Boots up and communicates on STM32F207VC.

Signed-off-by: Boleslaw Ciesielski <combolek@users.noreply.github.com>
2020-06-23 10:52:15 -04:00
kianusch a4c31bafb0
stm32: Support for 20KiB bootloader offset. (#3008)
Signed-off-by: Kianusch Sayah Karadji <kianusch@gmail.com>
2020-06-20 13:30:10 -04:00
Kevin O'Connor 722770f62f generic: Minor header cleanup to generic/irq.h
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-07 21:18:04 -04:00
Kevin O'Connor 06437c5892 linux: Wait in timer dispatch for up to 2us
Use 2us in the linux timer dispatch code to unify linux timer dispatch
logic with the common timer_irq.c code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-06-07 09:17:51 -04:00
Lucio Tarantino b7699d374a
linux: Ability to use multiple GPIO chips (#2935)
Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
2020-06-06 12:47:11 -04:00
Kevin O'Connor 38772492f9 Kconfig: Only show the "usb ids" menu if low-level options are enabled
It's rare to customize the usb ids, so make it a "low-level" option.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 21:05:04 -04:00
Kevin O'Connor ea9eac6c38 Kconfig: Change the default usb vendor/product id
Change the product/vendor id to 0x1d50/0x614e, which has been reserved
for Klipper (thanks to the openmoko project).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 21:05:04 -04:00
Kevin O'Connor 634dcc7387 lcd_hd44780: Only calibrate cmd_wait_ticks on mcus with strict timing
The calibration isn't valid on the linux mcu, so make it dependent on
CONFIG_HAVE_STRICT_TIMING.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 14:57:06 -04:00
Kevin O'Connor 0cbb8fdc9a lcd_st7920: Only calibrate wait ticks on mcus with strict timing
The calibration isn't valid on the linux mcu, so make it dependent on
CONFIG_HAVE_STRICT_TIMING.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 14:57:06 -04:00
Kevin O'Connor 98192d710f stepper: Make toggling the step gpio after timer read conditional
On the Linux mcu, toggling the pin after the time is read is not
valid.  Make that optimization dependent on CONFIG_HAVE_STRICT_TIMING.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 14:57:06 -04:00
Kevin O'Connor 835ec3513d Kconfig: Add a new CONFIG_HAVE_STRICT_TIMING build definition
Add a new build definition to note micro-controllers that have strict
timing.  The Linux mcu code does not have strict timing - all other
targets currently do.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-31 14:57:06 -04:00
Kevin O'Connor b80d2f7706 stm32: Fix typo causing internal clock to always be used on stm32f042
Reported by Pontus Borg.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2020-05-28 15:56:22 -04:00
Arksine ab87af90a3 stm32f4: Add support for HID bootloader
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-05-28 14:44:51 -04:00
Arksine 05efccc874 stm32f1: Add support for HID Bootloader
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2020-05-28 14:44:51 -04:00
andryblack 8fd330c54e linux: userspace GPIO control
Allow use host GPIO pins for non-realtime purposes.

Signed-off-by: Andrey Kunitsyn <blackicebox@gmail.com>
2020-05-17 22:17:15 -04:00