|
TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
|
#include <avr/interrupt.h>#include <avr/io.h>#include <stdint.h>#include <util/delay.h>#include "can.h"#include "log.h"#include "mcp.h"#include "spi.h"Go to the source code of this file.
Functions | |
| LOG_MODULE_DEFINE ("CAN") | |
| int8_t | can_init (struct can_device *dev) |
| Initialize a CAN device. | |
| int8_t | can_write (struct can_device *dev, struct CAN_frame msg) |
| Write a CAN frame to the MCP2515 transmit buffer. | |
| int8_t | can_read_rx0 (struct can_device *dev, struct CAN_frame *out) |
| Read a message from RX buffer 0. | |
| int8_t | can_read_rx1 (struct can_device *dev, struct CAN_frame *out) |
| Read a message from RX buffer 1. | |
| int | can_rxq_add (struct CAN_frame *msg) |
| Add a CAN frame to the internal receive queue. | |
| int | can_rxq_pull (struct CAN_frame *out) |
| Pull a CAN frame from the internal receive queue. | |
| ISR (INT2_vect) | |
| int8_t | MCP2515_init (struct can_device *dev) |
| int8_t | MCP2515_write (struct can_device *dev, uint8_t addr, uint8_t data) |
| int8_t | MCP2515_write_n (struct can_device *dev, uint8_t addr, uint8_t *data) |
| int8_t | MCP2515_read (struct can_device *dev, uint8_t addr, uint8_t *out) |
| int8_t | MCP2515_request_to_send (struct can_device *dev, uint8_t buffer) |
| int8_t | MCP2515_bit_modify (struct can_device *dev, uint8_t reg, uint8_t mask, uint8_t set_val) |
| int8_t | MCP2515_reset (struct can_device *dev) |
| int8_t | MCP2515_read_status (struct can_device *dev, uint8_t *out) |
Variables | |
| struct can_device * | can_irq |
| struct CAN_frame | new_message |
| static volatile uint8_t | rxq_head = 0 |
| static volatile uint8_t | rxq_tail = 0 |
| struct CAN_frame | rxq [CAN_RXQ_SIZE] |
| ISR | ( | INT2_vect | ) |
Definition at line 186 of file can.c.
| LOG_MODULE_DEFINE | ( | "CAN" | ) |
| int8_t MCP2515_write_n | ( | struct can_device * | dev, |
| uint8_t | addr, | ||
| uint8_t * | data ) |
| struct can_device* can_irq |
Definition at line 13 of file can.c.
Referenced by can_init(), and ISR().
| struct CAN_frame rxq[CAN_RXQ_SIZE] |
Definition at line 17 of file can.c.
Referenced by can_rxq_add(), and can_rxq_pull().
|
static |
Definition at line 16 of file can.c.
Referenced by can_rxq_add(), and can_rxq_pull().
|
static |
Definition at line 16 of file can.c.
Referenced by can_rxq_add(), and can_rxq_pull().