aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* stm32: CAN Kconfig typoOliver2021-04-072-2/+2
| | | | | | Fixed simple typo in the Kconfig and can.c. stm32f4 CAN Pins Signed-off-by: Oliver Walter <oli1111@web.de>
* stm32f1: reset peripherals in enable_pcclock()Arksine2021-04-071-0/+4
| | | | | | Some bootloaders do not disable peripherals in use before jumping to the application. Reset peripherals to assure correct operation. SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
* stm32: Add hardware PWM support for STM32F1Michael Kurz2021-03-265-0/+179
| | | | | | | | | This adds hardware PWM support for STM32F1 processors. This should also work for STM32 F0/F2/F4 processors, but I don't have one of those to test it. Signed-off-by: Michael Kurz <michi.kurz@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add hardware PWM support for LPC176xMichael Kurz2021-03-265-0/+107
| | | | | | This adds hardware PWM support for LPC176x processors. Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* lpc176x: Do not modify PCLKSELx at runtimeKevin O'Connor2021-03-251-8/+1
| | | | | | | | | The lpc176x has an errata that could cause updates to PCLKSELx to not take effect. Rework the code to use the default peripheral clock speed (25Mhz or 30Mhz) so that this register does not need to be updated at runtime. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Introduce get_pclock_frequency()Kevin O'Connor2021-03-256-12/+23
| | | | | | | Add get_pclock_frequency() - a standard way of obtaining the peripheral clock frequency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ds18b20: Segmentation fault on 64bit Raspberry PiEvgeny Chukreev2021-03-191-1/+1
| | | | Signed-off-by: Evgeny Chukreev <Evgeny.Chukreev@gmail.com>
* stm32: Minor optimization to can.c IRQ data readingKevin O'Connor2021-03-181-10/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Support reading CAN packets directly from IRQ handlerKevin O'Connor2021-03-183-17/+67
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Fix Kconfig USB/Serial selectionKevin O'Connor2021-03-181-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Use "communication interface" menu option in KconfigKevin O'Connor2021-03-181-4/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Use "communication interface" menu option in KconfigKevin O'Connor2021-03-181-8/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Use "communication interface" menu option in KconfigKevin O'Connor2021-03-181-4/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use "communication interface" menu option in KconfigKevin O'Connor2021-03-181-12/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify USB/Serial/CANbus Kconfig selectionKevin O'Connor2021-03-185-98/+116
| | | | | | | Combine the various communication options into a single "make menuconfig" menu item. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Rework CAN command protocolKevin O'Connor2021-03-133-73/+94
| | | | | | | Rework the micro-controller command protocol so that it supports direct communication with the serialqueue.c code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Improve ARM Cortex-M control transfer from bootloaders (#4024)Matt Baker2021-03-091-8/+39
| | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* stm32: Add support for STM32F1 I2C1 alternate pin mapping (#4012)Michael Kurz2021-03-022-5/+15
| | | | | | This adds support for the alternate pin mapping of I2C1 on PB8/9 in STM32F1 devices Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* fan: Add tachometer supportAdrian Keet2021-03-012-1/+100
| | | | | | | | | | | | | | This adds new config options for fans: 'tachometer_pin' to specify the GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of signal pulses per revolution. The rpm is also exposed by get_status for command templates and the API server. For fast fans (at least 10000 RPM), the polling interval can be shortened using the 'tachometer_poll_interval' option. There is a new mcu object for a generic edge counter, which repeatedly polls a GPIO pin and periodically reports the count to the host. Signed-off-by: Adrian Keet <arkeet@gmail.com>
* stm32: Add support for 48KiB bootloadersKevin O'Connor2021-02-201-0/+3
| | | | | | Reported by @mks-viva. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Optimize stm32f401 peripheral clockKevin O'Connor2021-02-191-2/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: stm32f401 pll_freq updatesArkadiusz Raj2021-02-191-2/+3
| | | | Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
* stm32: 25MHz clock fixesArkadiusz Raj2021-02-191-1/+2
| | | | Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
* stm32: Fix missing STM32F429 clock initializationArkadiusz Raj2021-02-191-2/+3
| | | | Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
* stm32: F429 shall use 168Mhz to allow easy USB clock configurationArkadiusz Raj2021-02-191-2/+2
| | | | Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
* stm32: Add STM32F429 variant (#3926)Arek2021-02-182-9/+22
| | | | | | | * Add F429 variant; add CAN on PD0,PD1; add 25Mhx clock; move CAN1_RX from PI8 to correct position (PI9) * Add test for STM32F429 Signed-off-by: Arkadiusz Raj <arek.raj@gmail.com>
* stm32: Add support for spi bus on stm32f407 pins PI2,PI3,PI1Kevin O'Connor2021-02-121-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Minor indention change to spi.cKevin O'Connor2021-02-121-10/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Request the host not send more than 496 bytes to the pruKevin O'Connor2021-02-121-0/+3
| | | | | | | | Writes over 496 bytes don't fit in a single "rpmsg" page. Request the host limit the number of bytes outstanding to avoid getting "write: (22)Invalid argument" errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Call can_notify_rx() at startup so low-level code does not need toKevin O'Connor2021-02-092-3/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Rename canbus_set_dataport() to canbus_set_filter() and simplifyKevin O'Connor2021-02-093-13/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Adding support for STM32F031x6 (#3871)Elias Bakken2021-02-033-7/+22
| | | | | | | Add support for alt usart 1 Do not select all functions on 16 K mcu Signed-off-by: Elias Bakken <elias@iagent.no>
* canbus: Move high-level CAN code to new src/generic/canbus.cKevin O'Connor2021-02-026-192/+323
| | | | | | | | | | Separate out the high-level command processing logic from the low-level transmission code. Place the high-level code in src/generic/canbus.c . This also removes the CAN dependency on serial_irq.c . Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify can.c irq handlerKevin O'Connor2021-02-021-127/+130
| | | | | | | Don't perform any heavy tasks in the CAN interrupt handler - just notify a background task to handle anything pending. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use CAN_TSR_CODE to select next tx fifo in can.cKevin O'Connor2021-02-021-6/+2
| | | | | | | | | | The spec states that the TX fifo is transmitted in chronological order if the TXFP bit is set, but it's unclear if the software needs to fill the tx fifo in a particular order to obtain that result. Use the TSR CODE bit field to fill the TX fifo in the order that the hardware reports as next. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Avoid read+write modify instructions in can.cKevin O'Connor2021-02-021-24/+13
| | | | | | | | | Prefer explicitly setting the hardware registers and avoid using C read and modify instructions where possible. This avoids race conditions where an interrupt or hardware change could cause subtle corruption of the register state. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Introduce new can_set_filter() helper function in can.cKevin O'Connor2021-02-021-40/+32
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Update can.c to use more consistent indentationKevin O'Connor2021-02-021-146/+143
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ds18b20: new module for 1-wire temperature sensor (#3462)Alan Lord2021-02-022-1/+276
| | | | | | | | | Initial commit of code to support 1-wire (Dallas) sensors such as the DS18B20. Requires Linux kernel drivers to create a file in /sysfs which is read by this module, and temperature typically returned to a temperature_fan. Signed-off-by: Alan Lord <alanslists@gmail.com> Signed-off-by: Josh Headapohl <joshhead@gmail.com>
* atsamd: Fix bug in sercom_pads mapping on samd21 in sercom.cKevin O'Connor2021-02-011-1/+1
| | | | | | Reported by @tech2077. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support for STM32F401 (#3853)smark-2021-01-313-9/+17
| | | | | This module adds support for the STM32F401 microcontrollers Signed-off-by: Marco D'Alessio <marco@wrecklab.com>
* stm32f1: Fix for using 16MHz external crystal (#3814)Matt Shepcar2021-01-241-2/+7
| | | Signed-off-by: Matt Shepcar <matt@shepcar.co.uk>
* stm32: Support setting the stm32f0 internal clock trim valueKevin O'Connor2021-01-182-1/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for spi4 bus on stm32f446 chipKevin O'Connor2021-01-041-0/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Merge digital output and soft pwm codeKevin O'Connor2020-12-101-233/+119
| | | | | | | | 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>
* stm32: Only use the HSI48 clock when doing "usb clock recovery"Kevin O'Connor2020-12-081-1/+2
| | | | | | | | 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>
* pca9685: Use move queue for pwm updatesKevin O'Connor2020-12-041-13/+58
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Use move queue for software pwmKevin O'Connor2020-12-041-41/+78
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Use move queue for digital output pinsPascal Pieper2020-12-041-11/+57
| | | | | Signed-off-by: Pascal Pieper <accounts@pascalpieper.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwmcmds: Use move queue for hard PWMPascal Pieper2020-12-041-11/+56
| | | | | Signed-off-by: Pascal Pieper <accounts@pascalpieper.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>