aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/can.c
Commit message (Collapse)AuthorAgeFilesLines
* stm32: Simplify USB/Serial/CANbus Kconfig selectionKevin O'Connor2021-03-181-9/+9
| | | | | | | 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-131-18/+10
| | | | | | | 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>
* stm32: Add STM32F429 variant (#3926)Arek2021-02-181-3/+8
| | | | | | | * 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>
* canbus: Call can_notify_rx() at startup so low-level code does not need toKevin O'Connor2021-02-091-3/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Rename canbus_set_dataport() to canbus_set_filter() and simplifyKevin O'Connor2021-02-091-11/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus: Move high-level CAN code to new src/generic/canbus.cKevin O'Connor2021-02-021-175/+70
| | | | | | | | | | 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>
* stm32: Fixed CAN bus for STM32F4, there were syntax errors that prevented ↵bondus2020-10-111-3/+3
| | | | | | compilation Signed-off-by: Pontus Borg <liquidpontus@yahoo.se>
* stm32: Improvements to CAN bus ID generation. And added a small fast hash ↵bondus2020-08-091-4/+3
| | | | | | | | 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>
* stm32: Improved CAN support for STM32 (#2976)bondus2020-06-241-0/+440
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>