Go to the documentation of this file.
38 #if defined (__cplusplus)
57 #include <avr/pgmspace.h>
68 #define ONLY_NON_RTR 2
90 #define CAN_ALL_FILTER 0xff
96 #ifndef SUPPORT_EXTENDED_CANID
97 #define SUPPORT_EXTENDED_CANID 1
105 #ifndef SUPPORT_TIMESTAMPS
106 #define SUPPORT_TIMESTAMPS 0
141 #if defined(__DOXYGEN__)
143 #define MCP2515_FILTER_EXTENDED(id)
144 #define MCP2515_FILTER(id)
148 #if SUPPORT_EXTENDED_CANID
149 #define MCP2515_FILTER_EXTENDED(id) \
150 (uint8_t) ((uint32_t) (id) >> 21), \
151 (uint8_t)((((uint32_t) (id) >> 13) & 0xe0) | (1<<3) | \
152 (((uint32_t) (id) >> 16) & 0x3)), \
153 (uint8_t) ((uint32_t) (id) >> 8), \
154 (uint8_t) ((uint32_t) (id))
157 #define MCP2515_FILTER(id) \
158 (uint8_t)((uint32_t) id >> 3), \
159 (uint8_t)((uint32_t) id << 5), \
171 #if SUPPORT_EXTENDED_CANID
187 #if SUPPORT_TIMESTAMPS
227 #if SUPPORT_EXTENDED_CANID
517 #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.
can_mode_t
Modus des CAN Interfaces.
Datenstruktur zum Aufnehmen von CAN Nachrichten.
can_bitrate_t
Bitraten fuer den CAN-Bus.
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)
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)
bool can_init(can_bitrate_t bitrate)
Initialisierung des CAN Interfaces.
void can_static_filter(const uint8_t *filter_array)
Setzt die Werte für alle Filter.
Inhalt der Fehler-Register.