Mercurial > nand-ecoscentric
annotate packages/devs/can/arm/lpc2xxx/current/include/can_lpc2xxx_baudrates.h @ 3345:b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
the lpc2xxx driver that only occurs if support for extended 29-bit CAN
identifiers is enabled and support for message filtering is disabled.
[ Bugzilla 1001901 ]
* includes/can_lpc2xxx_baudrates.h: Added baudrate table for CAN clock
of 14.745600 MHz. [ Bugzilla 1001900 ]
| author | sergeig |
|---|---|
| date | Wed, 11 Sep 2013 21:00:16 +0000 |
| parents | 74dbf4c3f2e1 |
| children |
| rev | line source |
|---|---|
| 2409 | 1 #ifndef CYGONCE_CAN_LPC2XXX_BAUDRATES_H |
| 2 #define CYGONCE_CAN_LPC2XXX_BAUDRATES_H | |
| 3 //========================================================================== | |
| 4 // | |
| 5 // devs/can/arm/lpc2xxx/current/include/can_lpc2xxx_baudrates.h | |
| 6 // | |
| 7 // Precalculated values for bit timing register | |
| 8 // | |
| 9 //========================================================================== | |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
10 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
11 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
12 // This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
| 2409 | 14 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
15 // eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
16 // the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
17 // Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
18 // version. |
| 2409 | 19 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
20 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
21 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
22 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
23 // for more details. |
| 2409 | 24 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
25 // You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
26 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
27 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 2409 | 28 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
29 // As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
30 // macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
31 // and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
32 // this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
33 // the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
34 // must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
35 // General Public License v2. |
| 2409 | 36 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
37 // This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
38 // on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
39 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2509
diff
changeset
|
40 // ####ECOSGPLCOPYRIGHTEND#### |
| 2409 | 41 //========================================================================== |
| 42 //#####DESCRIPTIONBEGIN#### | |
| 43 // | |
| 44 // Author(s): Uwe Kindler | |
| 45 // Contributors: Uwe Kindler | |
| 46 // Date: 2007-07-01 | |
| 47 // Purpose: Precalculated bit timing values for various baudrates | |
| 48 // Description: | |
| 49 // | |
| 50 //####DESCRIPTIONEND#### | |
| 51 // | |
| 52 //========================================================================== | |
| 53 | |
| 54 | |
| 55 // | |
| 56 // Macro for creation of CAN_BR value for baudrate tbl | |
| 57 // | |
| 58 #define CAN_BR_TBL_ENTRY(_brp_, _tseg1_, _tseg2_, _sjw_, _sam_) \ | |
| 59 ((_sam_ << 23) | (_tseg2_ << 20) | (_tseg1_ << 16) | (_sjw_ << 14) | (_brp_)) | |
| 60 | |
| 61 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
62 #ifndef CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK |
|
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
63 #error "CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK not defined" |
|
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
64 #endif |
| 2409 | 65 //========================================================================== |
| 66 // BAUDRATES | |
| 67 //========================================================================== | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
68 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 60000000 |
| 2409 | 69 // |
| 70 // Table with register values for baudrates at peripheral clock of 60 MHz | |
| 71 // | |
| 72 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 73 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
74 CAN_BR_TBL_ENTRY(300, 15, 2, 0, 1), // 10 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
75 CAN_BR_TBL_ENTRY(150, 15, 2, 0, 1), // 20 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
76 CAN_BR_TBL_ENTRY(59, 15, 2, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
77 CAN_BR_TBL_ENTRY(39, 11, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
78 CAN_BR_TBL_ENTRY(29, 12, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
79 CAN_BR_TBL_ENTRY(14, 12, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
80 CAN_BR_TBL_ENTRY( 7, 11, 1, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
81 CAN_BR_TBL_ENTRY( 4, 11, 1, 0, 0), // 800 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
82 CAN_BR_TBL_ENTRY( 3, 11, 1, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
83 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 84 }; |
| 85 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
86 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 60000000 |
| 2409 | 87 |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
88 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 30000000 |
| 2409 | 89 // |
| 90 // Table with register values for baudrates at peripheral clock of 30 MHz | |
| 91 // | |
| 92 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 93 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
94 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 10 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
95 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 20 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
96 CAN_BR_TBL_ENTRY(59, 15, 2, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
97 CAN_BR_TBL_ENTRY(39, 11, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
98 CAN_BR_TBL_ENTRY(29, 12, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
99 CAN_BR_TBL_ENTRY(14, 12, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
100 CAN_BR_TBL_ENTRY( 7, 11, 1, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
101 CAN_BR_TBL_ENTRY( 4, 11, 1, 0, 0), // 800 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
102 CAN_BR_TBL_ENTRY( 3, 11, 1, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
103 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 104 }; |
| 105 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
106 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 30000000 |
| 2409 | 107 |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
108 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 15000000 |
| 2409 | 109 // |
| 110 // Table with register values for baudrates at peripheral clock of 15 MHz | |
| 111 // | |
| 112 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 113 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
114 CAN_BR_TBL_ENTRY(59, 15, 7, 0, 1), // 10 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
115 CAN_BR_TBL_ENTRY(49, 11, 1, 0, 1), // 20 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
116 CAN_BR_TBL_ENTRY(19, 11, 1, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
117 CAN_BR_TBL_ENTRY( 9, 11, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
118 CAN_BR_TBL_ENTRY( 7, 11, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
119 CAN_BR_TBL_ENTRY( 3, 11, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
120 CAN_BR_TBL_ENTRY( 1, 11, 1, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
121 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 800 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
122 CAN_BR_TBL_ENTRY( 0, 11, 1, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
123 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 124 }; |
| 125 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
126 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 15000000 |
| 2409 | 127 |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
128 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 48000000 |
| 2409 | 129 // |
| 130 // Table with register values for baudrates at peripheral clock of 48 MHz | |
| 131 // | |
| 132 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 133 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
134 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 10 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
135 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 20 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
136 CAN_BR_TBL_ENTRY(59, 12, 1, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
137 CAN_BR_TBL_ENTRY(29, 12, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
138 CAN_BR_TBL_ENTRY(23, 12, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
139 CAN_BR_TBL_ENTRY(11, 12, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
140 CAN_BR_TBL_ENTRY( 5, 12, 1, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
141 CAN_BR_TBL_ENTRY( 3, 11, 1, 0, 0), // 800 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
142 CAN_BR_TBL_ENTRY( 2, 12, 1, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
143 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 144 }; |
| 145 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
146 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 48000000 |
| 2409 | 147 |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
148 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 24000000 |
| 2409 | 149 // |
| 150 // Table with register values for baudrates at peripheral clock of 24 MHz | |
| 151 // | |
| 152 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 153 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
154 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // 10 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
155 CAN_BR_TBL_ENTRY(59, 15, 2, 0, 1), // 20 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
156 CAN_BR_TBL_ENTRY(29, 12, 1, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
157 CAN_BR_TBL_ENTRY(14, 12, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
158 CAN_BR_TBL_ENTRY(11, 12, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
159 CAN_BR_TBL_ENTRY( 5, 12, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
160 CAN_BR_TBL_ENTRY( 2, 12, 1, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
161 CAN_BR_TBL_ENTRY( 1, 11, 1, 0, 0), // 800 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
162 CAN_BR_TBL_ENTRY( 1, 5, 0, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
163 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 164 }; |
| 165 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
166 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 24000000 |
| 2409 | 167 |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
168 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 12000000 |
| 2409 | 169 // |
| 170 // Table with register values for baudrates at peripheral clock of 12 MHz | |
| 171 // | |
| 172 static const cyg_uint32 lpc2xxx_br_tbl[] = | |
| 173 { | |
|
2417
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
174 CAN_BR_TBL_ENTRY(59, 15, 2, 0, 1), // 10 kbaud - not supported |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
175 CAN_BR_TBL_ENTRY(39, 11, 1, 0, 1), // 20 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
176 CAN_BR_TBL_ENTRY(14, 12, 1, 0, 1), // 50 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
177 CAN_BR_TBL_ENTRY( 7, 11, 1, 0, 1), // 100 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
178 CAN_BR_TBL_ENTRY( 5, 12, 1, 0, 1), // 125 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
179 CAN_BR_TBL_ENTRY( 2, 12, 1, 0, 1), // 250 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
180 CAN_BR_TBL_ENTRY( 2, 05, 0, 0, 0), // 500 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
181 CAN_BR_TBL_ENTRY( 0, 11, 1, 0, 0), // 800 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
182 CAN_BR_TBL_ENTRY( 0, 9, 0, 0, 0), // 1000 kbaud |
|
05280737f180
* include/can_lpc2xxx_baudrates.h: Removed all prefixed zeros from
asl
parents:
2409
diff
changeset
|
183 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
| 2409 | 184 }; |
| 185 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 | |
|
2509
a52d470bc691
* cdl/can_lpc2xxx.cdl: Added CYGOPT_DEVS_CAN_LPC2XXX_ALIE to make
asl
parents:
2417
diff
changeset
|
186 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 12000000 |
| 2409 | 187 |
|
3345
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
188 #if CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 14745600 |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
189 #warning "You can't get exactly the desired CAN bus speeds with the specified CAN clock of 14.7456 MHz" |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
190 // |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
191 // Table with register values for baudrates at peripheral clock of 14.7456 MHz |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
192 // The clock of 14.7456 MHz is not suited for a good CAN bitrate timing because |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
193 // you can't get exactly the desired CAN bus speed with the specified CAN |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
194 // clock frequency. Be sure to check the error values behind the table entries. |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
195 // Settings leading to speed deviations of more than 1.5% should be discarded. |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
196 // |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
197 static const cyg_uint32 lpc2xxx_br_tbl[] = |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
198 { |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
199 //----------brp tseg1 tseg2 sjw sam ------------ |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
200 CAN_BR_TBL_ENTRY(58, 20, 2, 0, 1), // 10 kbaud - Timing Error 0.030% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
201 CAN_BR_TBL_ENTRY(66, 8, 0, 0, 1), // 20 kbaud - Timing Error -0.038% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
202 CAN_BR_TBL_ENTRY(13, 17, 1, 0, 1), // 50 kbaud - Timing Error -0.310% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
203 CAN_BR_TBL_ENTRY( 6, 17, 1, 0, 1), // 100 kbaud - Timing Error -0.310% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
204 CAN_BR_TBL_ENTRY(12, 6, 0, 0, 1), // 125 kbaud - Timing Error -0.825% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
205 CAN_BR_TBL_ENTRY( 5, 7, 0, 0, 1), // 250 kbaud - Timing Error 1.696% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
206 CAN_BR_TBL_ENTRY( 2, 7, 0, 0, 0), // 500 kbaud - Timing Error 1.696% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
207 CAN_BR_TBL_ENTRY( 1, 6, 0, 0, 0), // 800 kbaud - Timing Error -2.4% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
208 CAN_BR_TBL_ENTRY( 0, 11, 1, 0, 0), // 1000 kbaud - Timing Error 1.696% |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
209 CAN_BR_TBL_ENTRY( 0, 0, 0, 0, 0), // Autobaud - not supported |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
210 }; |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
211 #define HAL_LPC2XXX_BAUD_TBL_DEFINED 1 |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
212 #endif // CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK == 14745600 |
|
b06697684f0a
* src/can_accfilt_lpc2xxx.c, src/can_lpc2xxx.c: Fix a compile issue of
sergeig
parents:
2729
diff
changeset
|
213 |
| 2409 | 214 |
| 215 //========================================================================== | |
| 216 // BIT TIMING MACRO | |
| 217 //========================================================================== | |
| 218 // | |
| 219 // Macro fills baudrate register value depending on selected baudrate | |
| 220 // For several LPC2XXX peripheral clock speeds we provide a pre calculated | |
| 221 // baudrate table. If the board uses another clock speed, then the platform | |
| 222 // HAL needs to provide an own HAL_LPC2XXX_GET_CAN_BR() macro that returns | |
| 223 // valid baudrate register values or it needs to patch this file with | |
| 224 // an additional table for the desired clock speed | |
| 225 // | |
| 226 // | |
| 227 // If a certain baudrate is not supported, then this macro shall return | |
| 228 // 0 as the baudrate register value | |
| 229 // | |
| 230 #ifdef HAL_LPC2XXX_BAUD_TBL_DEFINED | |
| 231 #define HAL_LPC2XXX_GET_CAN_BR(_baudrate_, _br_) \ | |
| 232 CYG_MACRO_START \ | |
| 233 _br_ = lpc2xxx_br_tbl[(_baudrate_) - CYGNUM_CAN_KBAUD_10]; \ | |
| 234 CYG_MACRO_END | |
| 235 #endif // HAL_LPC2XXX_BAUD_TBL_DEFINED | |
| 236 | |
| 237 //------------------------------------------------------------------------- | |
| 238 #endif // #ifndef CYGONCE_CAN_LPC2XXX_BAUDRATES_H |
