es_conf_info_can.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Change Logs:
  3. * Date Author Notes
  4. * 2021-04-20 liuhy the first version
  5. *
  6. * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
  7. *
  8. * SPDX-License-Identifier: Apache-2.0
  9. *
  10. * Licensed under the Apache License, Version 2.0 (the License); you may
  11. * not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. *
  22. */
  23. #ifndef __ES_CONF_INFO_CAN_H__
  24. #define __ES_CONF_INFO_CAN_H__
  25. #include "es_conf_info_map.h"
  26. #include <ald_can.h>
  27. #include <ald_gpio.h>
  28. /*默认的CAN硬件过滤器的编号 0 */
  29. #define ES_C_CAN_DEFAULT_FILTER_NUMBER 0
  30. /*硬件过滤器,过滤帧类型*/
  31. #define ES_C_CAN_FILTER_FRAME_TYPE 0
  32. #define ES_C_CAN_SJW_NUM_1 CAN_SJW_1
  33. #define ES_C_CAN_SJW_NUM_2 CAN_SJW_2
  34. #define ES_C_CAN_SJW_NUM_3 CAN_SJW_3
  35. #define ES_C_CAN_SJW_NUM_4 CAN_SJW_4
  36. /* CAN 配置 */
  37. /* codes_main */
  38. #ifndef ES_DEVICE_NAME_CAN0
  39. #define ES_DEVICE_NAME_CAN0 "can0"
  40. #endif
  41. #ifndef ES_CAN0_AUTO_BAN_RE_T
  42. #define ES_CAN0_AUTO_BAN_RE_T ES_C_DISABLE
  43. #endif
  44. #ifndef ES_CAN0_SPEED
  45. #define ES_CAN0_SPEED 1000000
  46. #endif
  47. #ifndef ES_CAN0_SJW
  48. #define ES_CAN0_SJW ES_C_CAN_SJW_NUM_4
  49. #endif
  50. #define ES_CAN0_CONFIG \
  51. { \
  52. ES_CAN0_SPEED, \
  53. RT_CANMSG_BOX_SZ, \
  54. RT_CANSND_BOX_NUM, \
  55. RT_CAN_MODE_NORMAL, \
  56. };
  57. #endif