Commit Graph

10 Commits

Author SHA1 Message Date
Kevin O'Connor 3bd0be40d5 lib: Update to latest can2040 code
Disable tx state machine before resetting it
Check for rx message with same id as tx but different payload
Do not use canrx line to alter bit timing of cantx line
Improve bit time synchronization with slow transmitters
Implement tx synchronization to faster transmitters

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-05-03 10:45:41 -04:00
Kevin O'Connor 1987742545 lib: Update to latest can2040 code
Fix tx hang after error frame during tx

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-29 11:49:53 -04:00
Kevin O'Connor aa8a6f4cf1 lib: Update to latest can2040 code
Avoid some gcc warnings by using uint32_t for iterators
Better document the fallthough case statement in crc_bytes()
Fix txpending race from report_line_ackdone()
Make can2040_transmit() multi-cpu atomic

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2023-04-11 11:20:57 -04:00
Kevin O'Connor 1b56a63abf lib: Update to latest can2040 code
Clear PIO irq flags in pio_sm_setup()
Set TXPENDING during pio_sm_setup()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-23 11:59:24 -05:00
Kevin O'Connor c51f169c06 lib: Update to latest can2040 code
Fix PIO "sync" register overflow check
Reduce latency of tx scheduling
Clear ackdone irq from report_note_eof_success()
Defer ack inject until after rx fifo drained
Improve passive/dominant bit conflict check on tx reschedule

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-21 09:36:30 -05:00
Kevin O'Connor cfb633a0ec lib: Update to latest can2040 code
Minor comment change to unstuf_pull_bits()
Introduce unstuf_get_raw() helper function
Move crc stuffed bit calculation to data_state_go_crc()
Restore stuffed_bits state on missing ack
Use a single pio_irq_set() function
Reschedule tx if previous tx unexpectedly finished transmit
Simplify report_state handling

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-11-19 10:31:08 -05:00
Kevin O'Connor 6cc104677e lib: Update to latest can2040 code
Fix gpio function selection for PIO1 usage.
Minor variable name changes.
Allow scheduling tx "matched" event after a crc match.
Allow for up to 5 passive bits after unstuf_clear_state().
Pause PIO "rx" bit reception after 10 passive bits.
Signal the CPU to process data every 10 read bits.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-10-13 17:11:57 -04:00
Kevin O'Connor 75c4b1238e lib: Update to latest can2040 code
Simplify tx state tracking.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-16 21:08:58 -04:00
Kevin O'Connor 36887ce6fe lib: Update to the latest can2040 code
Rename to "match" state machine instead of "ack".
Minor simplification to tx_note_crc_start().
Call pio_match_clear() from report functions.
Add pio_match_calc_key() helper function.
Raise irq after 6 passive eof bits for faster rx message notification.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-16 09:57:12 -04:00
Kevin O'Connor f10fd7c2fa lib: Add can2040 code
The "can2040" project implements "software canbus" support on rp2040
micro-controllers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2022-07-06 00:28:48 -04:00