/*
* Copyright (c) Texas Instruments Incorporated 2016
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* \file mcan.c
*
* \brief This file contains the implementation of the APIs present in the
* device abstraction layer file of MCAN.
* This also contains some related macros.
*/
/* ========================================================================== */
/* Include Files */
/* ========================================================================== */
#include <stdint.h>
#include "inc/stw_types.h"
#include "inc/stw_dataTypes.h"
#include "inc/hw_types_mcan.h"
#include "mcan.h"
#include "debug.h"
/* ========================================================================== */
/* Macros & Typedefs */
/* ========================================================================== */
/**
* \brief Mask and shift for Tx Buffers elements.
*/
#define MCANSS_TX_BUFFER_ELEM_ID_SHIFT (0U)
#define MCANSS_TX_BUFFER_ELEM_ID_MASK (0x1FFFFFFFU)
#define MCANSS_TX_BUFFER_ELEM_RTR_SHIFT (29U)
#define MCANSS_TX_BUFFER_ELEM_RTR_MASK (0x20000000U)
#define MCANSS_TX_BUFFER_ELEM_XTD_SHIFT (30U)
#define MCANSS_TX_BUFFER_ELEM_XTD_MASK (0x40000000U)
#define MCANSS_TX_BUFFER_ELEM_ESI_SHIFT (31U)
#define MCANSS_TX_BUFFER_ELEM_ESI_MASK (0x80000000U)
#define MCANSS_TX_BUFFER_ELEM_DLC_SHIFT (16U)
#define MCANSS_TX_BUFFER_ELEM_DLC_MASK (0x000F0000U)
#define MCANSS_TX_BUFFER_ELEM_BRS_SHIFT (20U)
#define MCANSS_TX_BUFFER_ELEM_BRS_MASK (0x00100000U)
#define MCANSS_TX_BUFFER_ELEM_FDF_SHIFT (21U)
#define MCANSS_TX_BUFFER_ELEM_FDF_MASK (0x00200000U)
#define MCANSS_TX_BUFFER_ELEM_EFC_SHIFT (23U)
#define MCANSS_TX_BUFFER_ELEM_EFC_MASK (0x00800000U)
#define MCANSS_TX_BUFFER_ELEM_MM_SHIFT (24U)
#define MCANSS_TX_BUFFER_ELEM_MM_MASK (0xFF000000U)
/**
* \brief Mask and shift for Rx Buffers elements.
*/
#define MCANSS_RX_BUFFER_ELEM_ID_SHIFT (0U)
#define MCANSS_RX_BUFFER_ELEM_ID_MASK (0x1FFFFFFFU)
#define MCANSS_RX_BUFFER_ELEM_RTR_SHIFT (29U)
#define MCANSS_RX_BUFFER_ELEM_RTR_MASK (0x20000000U)
#define MCANSS_RX_BUFFER_ELEM_XTD_SHIFT (30U)
#define MCANSS_RX_BUFFER_ELEM_XTD_MASK (0x40000000U)
#define MCANSS_RX_BUFFER_ELEM_ESI_SHIFT (31U)
#define MCANSS_RX_BUFFER_ELEM_ESI_MASK (0x80000000U)
#define MCANSS_RX_BUFFER_ELEM_RXTS_SHIFT (0U)
#define MCANSS_RX_BUFFER_ELEM_RXTS_MASK (0x0000FFFFU)
#define MCANSS_RX_BUFFER_ELEM_DLC_SHIFT (16U)
#define MCANSS_RX_BUFFER_ELEM_DLC_MASK (0x000F0000U)
#define MCANSS_RX_BUFFER_ELEM_BRS_SHIFT (20U)
#define MCANSS_RX_BUFFER_ELEM_BRS_MASK (0x00100000U)
#define MCANSS_RX_BUFFER_ELEM_FDF_SHIFT (21U)
#define MCANSS_RX_BUFFER_ELEM_FDF_MASK (0x00200000U)
#define MCANSS_RX_BUFFER_ELEM_FIDX_SHIFT (24U)
#define MCANSS_RX_BUFFER_ELEM_FIDX_MASK (0x7F000000U)
#define MCANSS_RX_BUFFER_ELEM_ANMF_SHIFT (31U)
#define MCANSS_RX_BUFFER_ELEM_ANMF_MASK (0x80000000U)
/**
* \brief Mask and shift for Standard Message ID Filter Elements.
*/
#define MCANSS_STD_ID_FILTER_SFID2_SHIFT (0U)
#define MCANSS_STD_ID_FILTER_SFID2_MASK (0x000003FFU)
#define MCANSS_STD_ID_FILTER_SFID1_SHIFT (16U)
#define MCANSS_STD_ID_FILTER_SFID1_MASK (0x03FF0000U)
#define MCANSS_STD_ID_FILTER_SFEC_SHIFT (27U)
#define MCANSS_STD_ID_FILTER_SFEC_MASK (0x38000000U)
#define MCANSS_STD_ID_FILTER_SFT_SHIFT (30U)
#define MCANSS_STD_ID_FILTER_SFT_MASK (0xC0000000U)
/**
* \brief Extended Message ID Filter Element.
*/
#define MCANSS_EXT_ID_FILTER_EFID2_SHIFT (0U)
#define MCANSS_EXT_ID_FILTER_EFID2_MASK (0x1FFFFFFFU)
#define MCANSS_EXT_ID_FILTER_EFID1_SHIFT (0U)
#define MCANSS_EXT_ID_FILTER_EFID1_MASK (0x1FFFFFFFU)
#define MCANSS_EXT_ID_FILTER_EFEC_SHIFT (29U)
#define MCANSS_EXT_ID_FILTER_EFEC_MASK (0xE0000000U)
#define MCANSS_EXT_ID_FILTER_EFT_SHIFT (30U)
#define MCANSS_EXT_ID_FILTER_EFT_MASK (0xC0000000U)
/**
* \brief Mask and shift for Tx Event FIFO elements.
*/
#define MCANSS_TX_EVENT_FIFO_ELEM_ID_SHIFT (0U)
#define MCANSS_TX_EVENT_FIFO_ELEM_ID_MASK (0x1FFFFFFFU)
#define MCANSS_TX_EVENT_FIFO_ELEM_RTR_SHIFT (29U)
#define MCANSS_TX_EVENT_FIFO_ELEM_RTR_MASK (0x20000000U)
#define MCANSS_TX_EVENT_FIFO_ELEM_XTD_SHIFT (30U)
#define MCANSS_TX_EVENT_FIFO_ELEM_XTD_MASK (0x40000000U)
#define MCANSS_TX_EVENT_FIFO_ELEM_ESI_SHIFT (31U)
#define MCANSS_TX_EVENT_FIFO_ELEM_ESI_MASK (0x80000000U)
#define MCANSS_TX_EVENT_FIFO_ELEM_TXTS_SHIFT (0U)
#define MCANSS_TX_EVENT_FIFO_ELEM_TXTS_MASK (0x0000FFFFU)
#define MCANSS_TX_EVENT_FIFO_ELEM_DLC_SHIFT (16U)
#define MCANSS_TX_EVENT_FIFO_ELEM_DLC_MASK (0x000F0000U)
#define MCANSS_TX_EVENT_FIFO_ELEM_BRS_SHIFT (20U)
#define MCANSS_TX_EVENT_FIFO_ELEM_BRS_MASK (0x00100000U)
#define MCANSS_TX_EVENT_FIFO_ELEM_FDF_SHIFT (21U)
#define MCANSS_TX_EVENT_FIFO_ELEM_FDF_MASK (0x00200000U)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip国赛电力电子-PFC练习题库c源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
国赛电力电子-PFC练习题库c源码.zip (279个子文件)
f28003x_codestartbranch.asm 4KB
mcan.c 65KB
sysctl.c 30KB
memcfg.c 30KB
can.c 30KB
board.c 23KB
pmbus.c 23KB
board.c 21KB
dcsm.c 18KB
erad.c 18KB
spi.c 17KB
aes.c 15KB
sdfm.c 14KB
fsi.c 13KB
gpio.c 13KB
epwm.c 13KB
sci.c 11KB
dma.c 11KB
device.c 11KB
dcc.c 10KB
adc.c 10KB
interrupt.c 9KB
xbar.c 7KB
spll_pfc_main.c 7KB
i2c.c 7KB
cmpss.c 7KB
lin.c 6KB
spll_sogi.c 6KB
flash.c 5KB
clb.c 5KB
eqep.c 4KB
launchxl_sci_io_driverlib.c 4KB
c2000ware_libraries.c 3KB
c2000ware_libraries.c 3KB
dac.c 3KB
cla.c 3KB
PID_Controller.c 3KB
cputimer.c 2KB
ecap.c 2KB
epg.c 2KB
version.c 2KB
bsp_debugSCI.c 2KB
hrpwm.c 2KB
asysctl.c 2KB
hic.c 2KB
bgcrc.c 2KB
hrcap.c 2KB
pfc_hal.c 192B
.ccsproject 603B
TMS320F280039C_LaunchPad.ccxml 2KB
28003x_generic_flash_lnk.cmd 6KB
28003x_generic_ram_lnk.cmd 6KB
.cproject 89KB
pinmux.csv 9KB
pinmux.csv 9KB
launchxl_sci_io_driverlib.d 21KB
launchxl_sci_io_driverlib.d 21KB
spll_pfc_main.d 21KB
c2000ware_libraries.d 21KB
spll_pfc_main.d 21KB
c2000ware_libraries.d 20KB
bsp_debugSCI.d 20KB
bsp_debugSCI.d 20KB
empty_driverlib_main.d 20KB
board.d 19KB
board.d 19KB
pfc_hal.d 19KB
device.d 19KB
pfc_hal.d 19KB
device.d 18KB
PID_Controller.d 2KB
spll_sogi.d 104B
spll_sogi.d 57B
epwm.dot 64KB
epwm.dot 64KB
adc.dot 3KB
adc.dot 2KB
c2000ware_libraries.cmd.genlibs 944B
c2000ware_libraries.cmd.genlibs 944B
board.cmd.genlibs 787B
board.cmd.genlibs 787B
.gitignore 53B
epwm.h 258KB
sysctl.h 131KB
hw_gpio.h 124KB
lin.h 113KB
hw_sysctl.h 101KB
fsi.h 96KB
hw_outputxbar.h 94KB
hw_mcanss.h 88KB
hw_clbxbar.h 87KB
sdfm.h 87KB
hw_epwmxbar.h 81KB
adc.h 75KB
hw_mcan.h 73KB
clb.h 73KB
mcan.h 72KB
hw_hrpwm.h 66KB
hw_epwm.h 65KB
can.h 63KB
共 279 条
- 1
- 2
- 3
资源评论
onnx
- 粉丝: 9501
- 资源: 5595
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Kotlin与Java跨平台实现的arc进度条设计源码
- 源代码-仿MOP对开式论坛程序.zip
- 基于Python实现的BGP路由协议本科毕业设计源码
- 基于C语言的GEMM矩阵乘法优化设计源码学习与应用
- 基于Java的电影票出售系统设计源码
- 基于Python和Web技术栈的公文传输系统设计源码
- 基于Kolmogorov-Arnold网络(KAN)的激光选区熔化(LPBF)孔隙缺陷声学监测算法设计与实现源码
- 基于C/C/Python的多功能.hcxtools:.cab转.hc22000格式转换工具源码
- 源代码-仿Google网站AJAX拖曳实例ASP保存数据.zip
- 基于Java语言,支持Python和HTML的Flask框架设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功