Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 3 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /** |
1 | /** |
2 | ****************************************************************************** |
2 | ****************************************************************************** |
3 | * @file stm32f1xx_hal_can_ex_legacy.h |
3 | * @file stm32f1xx_hal_can_ex_legacy.h |
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief Header file of CAN HAL Extension module. |
5 | * @brief Header file of CAN HAL Extension module. |
6 | ****************************************************************************** |
6 | ****************************************************************************** |
7 | * @attention |
7 | * @attention |
8 | * |
8 | * |
9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
9 | * Copyright (c) 2016 STMicroelectronics. |
10 | * All rights reserved.</center></h2> |
10 | * All rights reserved. |
11 | * |
11 | * |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
12 | * This software is licensed under terms that can be found in the LICENSE file |
13 | * the "License"; You may not use this file except in compliance with the |
13 | * in the root directory of this software component. |
14 | * License. You may obtain a copy of the License at: |
14 | * If no LICENSE file comes with this software, it is provided AS-IS. |
15 | * opensource.org/licenses/BSD-3-Clause |
15 | * |
16 | * |
16 | ****************************************************************************** |
17 | ****************************************************************************** |
17 | */ |
18 | */ |
18 | |
19 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ |
|
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | #ifndef __STM32F1xx_HAL_CAN_EX_LEGACY_H |
21 | #ifndef __STM32F1xx_HAL_CAN_EX_LEGACY_H |
21 | #define __STM32F1xx_HAL_CAN_EX_LEGACY_H |
22 | #define __STM32F1xx_HAL_CAN_EX_LEGACY_H |
22 | |
23 | 23 | #ifdef __cplusplus |
|
24 | #ifdef __cplusplus |
24 | extern "C" { |
25 | extern "C" { |
25 | #endif |
26 | #endif |
26 | |
27 | 27 | #if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE) || \ |
|
28 | #if defined(STM32F103x6) || defined(STM32F103xB) || defined(STM32F103xE) || \ |
28 | defined(STM32F103xG) || defined(STM32F105xC) || defined(STM32F107xC) |
29 | defined(STM32F103xG) || defined(STM32F105xC) || defined(STM32F107xC) |
29 | |
30 | 30 | /* Includes ------------------------------------------------------------------*/ |
|
31 | /* Includes ------------------------------------------------------------------*/ |
31 | #include "stm32f1xx_hal_def.h" |
32 | #include "stm32f1xx_hal_def.h" |
32 | |
33 | 33 | /** @addtogroup STM32F1xx_HAL_Driver |
|
34 | /** @addtogroup STM32F1xx_HAL_Driver |
34 | * @{ |
35 | * @{ |
35 | */ |
36 | */ |
36 | |
37 | 37 | /** @defgroup CANEx CANEx |
|
38 | /** @defgroup CANEx CANEx |
38 | * @{ |
39 | * @{ |
39 | */ |
40 | */ |
40 | |
41 | 41 | /* Exported types ------------------------------------------------------------*/ |
|
42 | /* Exported types ------------------------------------------------------------*/ |
42 | |
43 | 43 | /** |
|
44 | /** |
44 | * @brief CAN filter configuration structure definition |
45 | * @brief CAN filter configuration structure definition |
45 | */ |
46 | */ |
46 | /* CAN filter banks differences over STM32F1 devices: */ |
47 | /* CAN filter banks differences over STM32F1 devices: */ |
47 | /* - STM32F1 Connectivity line: 28 filter banks shared between CAN1 and CAN2 */ |
48 | /* - STM32F1 Connectivity line: 28 filter banks shared between CAN1 and CAN2 */ |
48 | /* - Other STM32F10x devices: 14 filter banks */ |
49 | /* - Other STM32F10x devices: 14 filter banks */ |
49 | |
50 | 50 | typedef struct |
|
51 | typedef struct |
51 | { |
52 | { |
52 | uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit |
53 | uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit |
53 | configuration, first one for a 16-bit configuration). |
54 | configuration, first one for a 16-bit configuration). |
54 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
55 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
55 | |
56 | 56 | uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit |
|
57 | uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit |
57 | configuration, second one for a 16-bit configuration). |
58 | configuration, second one for a 16-bit configuration). |
58 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
59 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
59 | |
60 | 60 | uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, |
|
61 | uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, |
61 | according to the mode (MSBs for a 32-bit configuration, |
62 | according to the mode (MSBs for a 32-bit configuration, |
62 | first one for a 16-bit configuration). |
63 | first one for a 16-bit configuration). |
63 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
64 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
64 | |
65 | 65 | uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, |
|
66 | uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, |
66 | according to the mode (LSBs for a 32-bit configuration, |
67 | according to the mode (LSBs for a 32-bit configuration, |
67 | second one for a 16-bit configuration). |
68 | second one for a 16-bit configuration). |
68 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
69 | This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ |
69 | |
70 | 70 | uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter. |
|
71 | uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter. |
71 | This parameter can be a value of @ref CAN_filter_FIFO */ |
72 | This parameter can be a value of @ref CAN_filter_FIFO */ |
72 | #if defined(STM32F105xC) || defined(STM32F107xC) |
73 | #if defined(STM32F105xC) || defined(STM32F107xC) |
73 | uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. |
74 | uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. |
74 | This parameter must be a number between Min_Data = 0 and Max_Data = 27. */ |
75 | This parameter must be a number between Min_Data = 0 and Max_Data = 27. */ |
75 | #else |
76 | #else |
76 | uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. |
77 | uint32_t FilterNumber; /*!< Specifies the filter which will be initialized. |
77 | This parameter must be a number between Min_Data = 0 and Max_Data = 13. */ |
78 | This parameter must be a number between Min_Data = 0 and Max_Data = 13. */ |
78 | #endif /* STM32F105xC || STM32F107xC */ |
79 | #endif /* STM32F105xC || STM32F107xC */ |
79 | uint32_t FilterMode; /*!< Specifies the filter mode to be initialized. |
80 | uint32_t FilterMode; /*!< Specifies the filter mode to be initialized. |
80 | This parameter can be a value of @ref CAN_filter_mode */ |
81 | This parameter can be a value of @ref CAN_filter_mode */ |
81 | |
82 | 82 | uint32_t FilterScale; /*!< Specifies the filter scale. |
|
83 | uint32_t FilterScale; /*!< Specifies the filter scale. |
83 | This parameter can be a value of @ref CAN_filter_scale */ |
84 | This parameter can be a value of @ref CAN_filter_scale */ |
84 | |
85 | 85 | uint32_t FilterActivation; /*!< Enable or disable the filter. |
|
86 | uint32_t FilterActivation; /*!< Enable or disable the filter. |
86 | This parameter can be set to ENABLE or DISABLE. */ |
87 | This parameter can be set to ENABLE or DISABLE. */ |
87 | |
88 | 88 | uint32_t BankNumber; /*!< Select the start slave bank filter |
|
89 | uint32_t BankNumber; /*!< Select the start slave bank filter |
89 | This parameter must be a number between Min_Data = 0 and Max_Data = 28. */ |
90 | This parameter must be a number between Min_Data = 0 and Max_Data = 28. */ |
90 | |
91 | 91 | }CAN_FilterConfTypeDef; |
|
92 | }CAN_FilterConfTypeDef; |
92 | |
93 | 93 | /* Exported constants --------------------------------------------------------*/ |
|
94 | /* Exported constants --------------------------------------------------------*/ |
94 | /* Exported macro ------------------------------------------------------------*/ |
95 | /* Exported macro ------------------------------------------------------------*/ |
95 | /* Private macro -------------------------------------------------------------*/ |
96 | /* Private macro -------------------------------------------------------------*/ |
96 | |
97 | 97 | /** @defgroup CANEx_Private_Macros CAN Extended Private Macros |
|
98 | /** @defgroup CANEx_Private_Macros CAN Extended Private Macros |
98 | * @{ |
99 | * @{ |
99 | */ |
100 | */ |
100 | #if defined(STM32F105xC) || defined(STM32F107xC) |
101 | #if defined(STM32F105xC) || defined(STM32F107xC) |
101 | #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27U) |
102 | #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 27U) |
102 | #else |
103 | #else |
103 | #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 13U) |
104 | #define IS_CAN_FILTER_NUMBER(NUMBER) ((NUMBER) <= 13U) |
104 | #endif /* STM32F105xC || STM32F107xC */ |
105 | #endif /* STM32F105xC || STM32F107xC */ |
105 | |
106 | 106 | /** |
|
107 | /** |
107 | * @} |
108 | * @} |
108 | */ |
109 | */ |
109 | |
110 | 110 | ||
111 | 111 | /** |
|
112 | /** |
112 | * @} |
113 | * @} |
113 | */ |
114 | */ |
114 | |
115 | 115 | /** |
|
116 | /** |
116 | * @} |
117 | * @} |
117 | */ |
118 | */ |
118 | |
119 | 119 | #endif /* STM32F103x6) || STM32F103xB || STM32F103xE || STM32F103xG) || STM32F105xC || STM32F107xC */ |
|
120 | #endif /* STM32F103x6) || STM32F103xB || STM32F103xE || STM32F103xG) || STM32F105xC || STM32F107xC */ |
120 | |
121 | 121 | #ifdef __cplusplus |
|
122 | #ifdef __cplusplus |
122 | } |
123 | } |
123 | #endif |
124 | #endif |
124 | |
125 | 125 | #endif /* __STM32F1xx_HAL_CAN_EX_LEGACY_H */ |
|
126 | #endif /* __STM32F1xx_HAL_CAN_EX_LEGACY_H */ |
- | |
127 | - | ||
128 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
- |