Go to the documentation of this file.
38 #if defined (__cplusplus)
57 #include <avr/pgmspace.h>
61 #ifndef CAN_CONFIG_LOADED
62 #ifdef HAS_CAN_CONFIG_H
76 #define ONLY_NON_RTR 2
98 #define CAN_ALL_FILTER 0xff
104 #ifndef SUPPORT_EXTENDED_CANID
105 #define SUPPORT_EXTENDED_CANID 1
113 #ifndef SUPPORT_TIMESTAMPS
114 #define SUPPORT_TIMESTAMPS 0
149 #if defined(__DOXYGEN__)
151 #define MCP2515_FILTER_EXTENDED(id)
152 #define MCP2515_FILTER(id)
156 #if SUPPORT_EXTENDED_CANID
157 #define MCP2515_FILTER_EXTENDED(id) \
158 (uint8_t) ((uint32_t) (id) >> 21), \
159 (uint8_t)((((uint32_t) (id) >> 13) & 0xe0) | (1<<3) | \
160 (((uint32_t) (id) >> 16) & 0x3)), \
161 (uint8_t) ((uint32_t) (id) >> 8), \
162 (uint8_t) ((uint32_t) (id))
165 #define MCP2515_FILTER(id) \
166 (uint8_t)((uint32_t) id >> 3), \
167 (uint8_t)((uint32_t) id << 5), \
179 #if SUPPORT_EXTENDED_CANID
195 #if SUPPORT_TIMESTAMPS
235 #if SUPPORT_EXTENDED_CANID
525 #if defined (__cplusplus)
bool can_check_free_buffer(void)
Ueberprueft ob ein Puffer zum Versenden einer Nachricht frei ist.
@ LOOPBACK_MODE
alle Nachrichten direkt auf die Empfangsregister umleiten ohne sie zu senden
uint8_t can_send_message(const can_t *msg)
Verschickt eine Nachricht über den CAN Bus.
uint8_t length
Anzahl der Datenbytes.
can_mode_t
Modus des CAN Interfaces.
int rtr
Remote-Transmit-Request-Frame?
Datenstruktur zum Aufnehmen von CAN Nachrichten.
uint8_t extended
extended ID
can_bitrate_t
Bitraten fuer den CAN-Bus.
uint32_t id
ID der Nachricht (11 oder 29 Bit)
can_error_register_t can_read_error_register(void)
Reads the Contents of the CAN Error Counter.
Datenstruktur zur Aufnahme von CAN-Filtern.
@ NORMAL_MODE
normaler Modus, CAN Controller ist aktiv
bool can_disable_filter(uint8_t number)
Filter deaktivieren.
void can_set_mode(can_mode_t mode)
Setzt den Operations-Modus.
uint8_t can_get_message(can_t *msg)
Liest eine Nachricht aus den Empfangspuffern des CAN Controllers.
@ LISTEN_ONLY_MODE
der CAN Contoller empfängt nur und verhält sich völlig passiv
void can_reset_bus_off(void)
void can_sleep(void)
Put CAN interface to sleep and wake up.
bool can_check_bus_off(void)
uint8_t tx
Sende-Register.
bool can_set_filter(uint8_t number, const can_filter_t *filter)
Setzen eines Filters.
bool can_check_message(void)
Ueberpruefen ob neue CAN Nachrichten vorhanden sind.
uint8_t can_get_filter(uint8_t number, can_filter_t *filter)
uint8_t rtr
Remote Request Frame.
bool can_init(can_bitrate_t bitrate)
Initialisierung des CAN Interfaces.
uint32_t id
ID der Nachricht (11 oder 29 Bit)
uint8_t rx
Empfangs-Register.
void can_static_filter(const uint8_t *filter_array)
Setzt die Werte für alle Filter.
Inhalt der Fehler-Register.