RTEMS 6.1-rc5
|
CAN controller for the mbed lpc1768 board. More...
Go to the source code of this file.
Data Structures | |
struct | registers_can_message |
A CAN message represented for the registers of the device. More... | |
struct | low_level_can_message |
A CAN message represented with each logical parts. More... | |
struct | can_message |
A CAN message represented of both forms. More... | |
Typedefs | |
typedef void(* | lpc176x_can_isr) (lpc176x_can_number number) |
An isr for a CAN interrupt. | |
typedef unsigned int | can_freq |
A CAN frequency value. | |
Enumerations | |
enum | lpc176x_can_number { CAN_0 , CAN_1 , CAN_DEVICES_NUMBER } |
The CAN devices of the board. | |
enum | can_irq_type { IRQ_RX = 0 , IRQ_TX , IRQ_ERROR , IRQ_OVERRUN , IRQ_WAKEUP , IRQ_PASSIVE , IRQ_ARB , IRQ_BUS , IRQ_READY , CAN_IRQ_NUMBER } |
The possible interrupt sources for CAN. | |
Functions | |
rtems_status_code | can_open (lpc176x_can_number minor, can_freq freq) |
Opens CAN device. | |
rtems_status_code | can_close (lpc176x_can_number minor) |
Closes the passed CAN device and shut it down. | |
rtems_status_code | can_read (const lpc176x_can_number minor, can_message *message) |
Reads the CAN device. | |
rtems_status_code | can_write (const lpc176x_can_number minor, const can_message *const message) |
Writes the passed CAN message into the selected CAN device. | |
rtems_status_code | can_register_isr (const lpc176x_can_number number, const can_irq_type type, const lpc176x_can_isr isr) |
Registers an isr in the driver vector, and enables the interrupt in the device. | |
rtems_status_code | create_can_message (can_message *const msg, const int _id, const char *const _data, const char _len) |
Creates a CAN message. | |
CAN controller for the mbed lpc1768 board.
typedef void(* lpc176x_can_isr) (lpc176x_can_number number) |
An isr for a CAN interrupt.
number | The CAN which rised the interrupt. |
rtems_status_code can_close | ( | lpc176x_can_number | minor | ) |
Closes the passed CAN device and shut it down.
minor | The device to close. |
rtems_status_code can_open | ( | lpc176x_can_number | minor, |
can_freq | freq | ||
) |
Opens CAN device.
It enables the module and gives it a clock, sets the pins, disables the interrupts, sets the frequency and bypasses the acceptance filter.
minor | The device to open. |
freq | The desired frequency. |
rtems_status_code can_read | ( | const lpc176x_can_number | minor, |
can_message * | message | ||
) |
Reads the CAN device.
minor | The CAN device to read. |
message | The read message. |
rtems_status_code can_register_isr | ( | const lpc176x_can_number | number, |
const can_irq_type | type, | ||
const lpc176x_can_isr | isr | ||
) |
Registers an isr in the driver vector, and enables the interrupt in the device.
number | The CAN device to set |
type | The interrupt type. |
isr | The isr to register. |
rtems_status_code can_write | ( | const lpc176x_can_number | minor, |
const can_message *const | message | ||
) |
Writes the passed CAN message into the selected CAN device.
minor | The device to write. |
message | The message to write. |
rtems_status_code create_can_message | ( | can_message *const | msg, |
const int | _id, | ||
const char *const | _data, | ||
const char | _len | ||
) |
Creates a CAN message.
[long description]
msg | The created message. |
_id | The can id for the message. |
_data | The data of the message. |
_len | The length of the message. |