Nut/OS  5.0.5
API Reference
lpc_can.h
Go to the documentation of this file.
00001 #ifndef _ARCH_CM3_NXP_MACH_LPC_CAN_H_
00002 #define _ARCH_CM3_NXP_MACH_LPC_CAN_H_
00003 
00004 /*
00005  * Copyright 2011 by egnite GmbH
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00024  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  */
00035 
00049 
00050 
00053 #define CAN_AFMR_OFF        0x00000000
00054 #define CAN_AFMR            (LPC_CANAF_BASE + CAN_AFMR_OFF)
00055 
00059 #define CAN_SFF_SA_OFF      0x00000004
00060 #define CAN_SFF_SA          (LPC_CANAF_BASE + CAN_SFF_SA_OFF)
00061 
00065 #define CAN_SFF_GRP_SA_OFF  0x00000008
00066 #define CAN_SFF_GRP_SA      (LPC_CANAF_BASE + CAN_SFF_GRP_SA_OFF)
00067 
00071 #define CAN_EFF_SA_OFF      0x0000000C
00072 #define CAN_EFF_SA          (LPC_CANAF_BASE + CAN_EFF_SA_OFF)
00073 
00077 #define CAN_EFF_GRP_SA_OFF  0x00000010
00078 #define CAN_EFF_GRP_SA      (LPC_CANAF_BASE + CAN_EFF_GRP_SA_OFF)
00079 
00083 #define CAN_ENDOFTABLE_OFF  0x00000014
00084 #define CAN_ENDOFTABLE      (LPC_CANAF_BASE + CAN_ENDOFTABLE_OFF)
00085 
00089 #define CAN_LUTERRAD_OFF    0x00000018
00090 #define CAN_LUTERRAD        (LPC_CANAF_BASE + CAN_LUTERRAD_OFF)
00091 
00095 #define CAN_LUTERR_OFF      0x0000001C
00096 #define CAN_LUTERR          (LPC_CANAF_BASE + CAN_LUTERR_OFF)
00097 
00101 #define CAN_TXSR_OFF        0x00000000
00102 #define CAN_TXSR            (LPC_CANCR_BASE + CAN_TXSR_OFF)
00103 
00107 #define CAN_RXSR_OFF        0x00000004
00108 #define CAN_RXSR            (LPC_CANCR_BASE + CAN_RXSR_OFF)
00109 
00113 #define CAN_MSR_OFF         0x00000008
00114 #define CAN_MSR             (LPC_CANCR_BASE + CAN_MSR_OFF)
00115 
00119 #define CAN_MOD_OFF         0x00000000
00120 
00124 #define CAN_CMR_OFF         0x00000004
00125 
00129 #define CAN_GSR_OFF         0x00000008
00130 
00134 #define CAN_ICR_OFF         0x0000000C
00135 
00139 #define CAN_IER_OFF         0x00000010
00140 
00144 #define CAN_BTR_OFF         0x00000014
00145 
00149 #define CAN_EWL_OFF         0x00000018
00150 
00154 #define CAN_SR_OFF          0x0000001C
00155 
00159 #define CAN_RFS_OFF         0x00000020
00160 
00164 #define CAN_RID_OFF         0x00000024
00165 
00169 #define CAN_RDA_OFF         0x00000028
00170 
00174 #define CAN_RDB_OFF         0x0000002C
00175 
00179 #define CAN_TFI_OFF(x)      (x * 16 + 0x00000020)
00180 
00184 #define CAN_TID_OFF(x)      (x * 16 + 0x00000024)
00185 
00189 #define CAN_TDA_OFF(x)      (x * 16 + 0x00000028)
00190 
00194 #define CAN_TDB_OFF(x)      (x * 16 + 0x0000002C)
00195 
00199 #ifdef LPC_CAN1_BASE
00200 #define CAN1_MOD            (LPC_CAN1_BASE + CAN_MOD_OFF)
00201 #define CAN1_CMR            (LPC_CAN1_BASE + CAN_CMR_OFF)
00202 #define CAN1_GSR            (LPC_CAN1_BASE + CAN_GSR_OFF)
00203 #define CAN1_ICR            (LPC_CAN1_BASE + CAN_ICR_OFF)
00204 #define CAN1_IER            (LPC_CAN1_BASE + CAN_IER_OFF)
00205 #define CAN1_BTR            (LPC_CAN1_BASE + CAN_BTR_OFF)
00206 #define CAN1_EWL            (LPC_CAN1_BASE + CAN_EWL_OFF)
00207 #define CAN1_SR             (LPC_CAN1_BASE + CAN_SR_OFF)
00208 #define CAN1_RFS            (LPC_CAN1_BASE + CAN_RFS_OFF)
00209 #define CAN1_RID            (LPC_CAN1_BASE + CAN_RID_OFF)
00210 #define CAN1_RDA            (LPC_CAN1_BASE + CAN_RDA_OFF)
00211 #define CAN1_RDB            (LPC_CAN1_BASE + CAN_RDB_OFF)
00212 #define CAN1_TFI(x)         (LPC_CAN1_BASE + CAN_TFI_OFF(x))
00213 #define CAN1_TID(x)         (LPC_CAN1_BASE + CAN_TID_OFF(x))
00214 #define CAN1_TDA(x)         (LPC_CAN1_BASE + CAN_TDA_OFF(x))
00215 #define CAN1_TDB(x)         (LPC_CAN1_BASE + CAN_TDB_OFF(x))
00216 #endif
00217 
00221 #ifdef LPC_CAN2_BASE
00222 #define CAN2_MOD            (LPC_CAN2_BASE + CAN_MOD_OFF)
00223 #define CAN2_CMR            (LPC_CAN2_BASE + CAN_CMR_OFF)
00224 #define CAN2_GSR            (LPC_CAN2_BASE + CAN_GSR_OFF)
00225 #define CAN2_ICR            (LPC_CAN2_BASE + CAN_ICR_OFF)
00226 #define CAN2_IER            (LPC_CAN2_BASE + CAN_IER_OFF)
00227 #define CAN2_BTR            (LPC_CAN2_BASE + CAN_BTR_OFF)
00228 #define CAN2_EWL            (LPC_CAN2_BASE + CAN_EWL_OFF)
00229 #define CAN2_SR             (LPC_CAN2_BASE + CAN_SR_OFF)
00230 #define CAN2_RFS            (LPC_CAN2_BASE + CAN_RFS_OFF)
00231 #define CAN2_RID            (LPC_CAN2_BASE + CAN_RID_OFF)
00232 #define CAN2_RDA            (LPC_CAN2_BASE + CAN_RDA_OFF)
00233 #define CAN2_RDB            (LPC_CAN2_BASE + CAN_RDB_OFF)
00234 #define CAN2_TFI(x)         (LPC_CAN2_BASE + CAN_TFI_OFF(x))
00235 #define CAN2_TID(x)         (LPC_CAN2_BASE + CAN_TID_OFF(x))
00236 #define CAN2_TDA(x)         (LPC_CAN2_BASE + CAN_TDA_OFF(x))
00237 #define CAN2_TDB(x)         (LPC_CAN2_BASE + CAN_TDB_OFF(x))
00238 #endif
00239 
00243 #endif