22#ifndef LPC176X_TIMER_DEFS_H
23#define LPC176X_TIMER_DEFS_H
29#define CAN_ACCEPT_BASE_ADDR 0x4003C000
31#define CAN_DRIVER_IS_MINOR_VALID( minor ) ( minor < CAN_DEVICES_NUMBER )
32#define CAN_DEFAULT_BAUD_RATE 1000000u
33#define CAN_DEFAULT_INTERRUPT_CONFIGURATION 0
35#define MAX_NUMBER_OF_CAN_BITS 25u
36#define MIN_NUMBER_OF_CAN_BITS 4u
37#define CAN_BRP_EXTRA_BIT 1u
38#define CAN_TSEG_EXTRA_BITS 3u
39#define MAX_TSEG1_TSEG2_BITS 22u
41#define CAN_GSR_RBS_MASK 1u
42#define CAN_CMR_RRB_MASK 4u
44#define CAN_MAXIMUM_DATA_SIZE 8u
45#define CAN10_MAXIMUM_ID 0x7FFu
56#define CAN_BTR_TSEG1_SHIFT 16u
57#define CAN_BTR_TSEG2_SHIFT 20u
58#define CAN_BTR_SJW_SHIFT 14u
59#define CAN_BTR_BRP_SHIFT 0u
61#define CAN_BTR_TSEG1_MASK 0x000F0000U
62#define CAN_BTR_TSEG2_MASK 0x00700000U
63#define CAN_BTR_SJW_MASK 0x0000C000U
64#define CAN_BTR_BRP_MASK 0x000003FFU
66#define WRONG_BTR_VALUE 0xFFFFFFFF
75 CAN_NUMBER_OF_TRANSMIT_BUFFERS
83 uint32_t can_status_mask;
84 uint32_t not_cc_cmr_value;
89 volatile uint32_t MOD;
90 volatile uint32_t CMR;
91 volatile uint32_t GSR;
92 volatile uint32_t ICR;
93 volatile uint32_t IER;
94 volatile uint32_t BTR;
95 volatile uint32_t EWL;
116 const uint32_t pconp_pin;
117 const uint32_t pins[ NUMBER_OF_CAN_PINS ];
123 volatile uint32_t TX_SR;
124 volatile uint32_t RX_SR;
125 volatile uint32_t
MSR;
130 volatile uint32_t AFMR;
131 volatile uint32_t SFF_SA;
132 volatile uint32_t SFF_GRP_SA;
133 volatile uint32_t EFF_SA;
134 volatile uint32_t EFF_GRP_SA;
135 volatile uint32_t EOT;
136 volatile uint32_t LUT_ERR_ADR;
137 volatile uint32_t LUT_ERR;
138 volatile uint32_t FCANIE;
139 volatile uint32_t FCANIC0;
140 volatile uint32_t FCANIC1;
160#define CAN_INTERRUPT_TYPE_MASK 0x1ffu
167#define CAN_MOD_RM 0x00000001U
169#define CAN_ACCF_AFMR_ACCOF 0x00000001U
170#define CAN_ACCF_AFMR_ACCBP 0x00000002U
171#define CAN_ACCF_AFMR_EFCAN 0x00000004U
173#define CAN_IER_RIE 0x000000001U
174#define CAN_IER_TIE1 0x000000002U
175#define CAN_IER_EIE 0x000000004U
176#define CAN_IER_DOIE 0x000000008U
177#define CAN_IER_WUIE 0x000000010U
178#define CAN_IER_EPIEX 0x000000020U
179#define CAN_IER_ALIEX 0x000000040U
180#define CAN_IER_BEIEX 0x000000080U
181#define CAN_IER_IDIEX 0x000000100U
182#define CAN_IER_TIE2 0x000000200U
183#define CAN_IER_TIE3 0x000000400U
CAN controller for the mbed lpc1768 board.
void(* lpc176x_can_isr)(lpc176x_can_number number)
An isr for a CAN interrupt.
Definition: can.h:94
can_pin_number
A TX or RX pin for each CAN device .
Definition: can-defs.h:104
lpc176x_can_isr lpc176x_can_isr_vector[CAN_IRQ_NUMBER]
The vector with all the callbacks for the CAN isr.
Definition: can-defs.h:165
can_type
The types of message.
Definition: can-defs.h:155
can_format
The possible CAN formats for a message.
Definition: can-defs.h:146
can_transmit_number
The transmit buffers of the CAN device.
Definition: can-defs.h:71
can_tseg_number
The Time segments of a CAN bit.
Definition: can-defs.h:50
Definitions types used by some devices in common.
lpc176x_module
lpc176x module representation.
Definition: common-types.h:46
#define MSR
Modem Status Register.
Definition: uart.h:93
lpc176x_pin_function
Defines the functions according to the pin.
Definition: io-defs.h:70
Represents the acceptance filter registers.
Definition: can-defs.h:129
Represents the CAN centralized registers.
Definition: can-defs.h:122
Represents the CAN controller registers.
Definition: can-defs.h:88
A driver entry for each low level device.
Definition: can-defs.h:113
The CAN status and control masks to send a message for each transmit buffer.
Definition: can-defs.h:82
A CAN message represented for the registers of the device.
Definition: can.h:45