mirror of
https://github.com/QIDITECH/klipper.git
synced 2026-02-03 17:38:41 +03:00
plus4的klipper版本
This commit is contained in:
@@ -26,11 +26,18 @@ struct can2040;
|
||||
typedef void (*can2040_rx_cb)(struct can2040 *cd, uint32_t notify
|
||||
, struct can2040_msg *msg);
|
||||
|
||||
struct can2040_stats {
|
||||
uint32_t rx_total, tx_total;
|
||||
uint32_t tx_attempt;
|
||||
uint32_t parse_error;
|
||||
};
|
||||
|
||||
void can2040_setup(struct can2040 *cd, uint32_t pio_num);
|
||||
void can2040_callback_config(struct can2040 *cd, can2040_rx_cb rx_cb);
|
||||
void can2040_start(struct can2040 *cd, uint32_t sys_clock, uint32_t bitrate
|
||||
, uint32_t gpio_rx, uint32_t gpio_tx);
|
||||
void can2040_shutdown(struct can2040 *cd);
|
||||
void can2040_stop(struct can2040 *cd);
|
||||
void can2040_get_statistics(struct can2040 *cd, struct can2040_stats *stats);
|
||||
void can2040_pio_irq_handler(struct can2040 *cd);
|
||||
int can2040_check_transmit(struct can2040 *cd);
|
||||
int can2040_transmit(struct can2040 *cd, struct can2040_msg *msg);
|
||||
@@ -56,6 +63,7 @@ struct can2040 {
|
||||
void *pio_hw;
|
||||
uint32_t gpio_rx, gpio_tx;
|
||||
can2040_rx_cb rx_cb;
|
||||
struct can2040_stats stats;
|
||||
|
||||
// Bit unstuffing
|
||||
struct can2040_bitunstuffer unstuf;
|
||||
@@ -63,12 +71,11 @@ struct can2040 {
|
||||
|
||||
// Input data state
|
||||
uint32_t parse_state;
|
||||
uint32_t parse_crc;
|
||||
uint32_t parse_crc, parse_crc_bits, parse_crc_pos;
|
||||
struct can2040_msg parse_msg;
|
||||
|
||||
// Reporting
|
||||
uint32_t report_state;
|
||||
uint32_t report_eof_key;
|
||||
|
||||
// Transmits
|
||||
uint32_t tx_state;
|
||||
|
||||
Reference in New Issue
Block a user