rt-thread/bsp/stm32f10x/drivers/bxcan.h

52 lines
1.5 KiB
C
Raw Normal View History

2015-05-14 15:44:06 +08:00
/*
2018-10-16 13:00:37 +08:00
* Copyright (c) 2006-2018, RT-Thread Development Team
2015-05-14 15:44:06 +08:00
*
2018-10-16 13:00:37 +08:00
* SPDX-License-Identifier: Apache-2.0
2015-05-14 15:44:06 +08:00
*
* Change Logs:
* Date Author Notes
2015-05-14 16:51:47 +08:00
* 2015-05-14 aubrcool@qq.com first version
2015-05-14 15:44:06 +08:00
*/
#ifndef BXCAN_H_
#define BXCAN_H_
2015-10-28 16:26:32 +08:00
/* CAN Master Control Register bits */
#define MCR_DBF ((uint32_t)0x00010000) /* software master reset */
/* CAN Mailbox Transmit Request */
#define TMIDxR_TXRQ ((uint32_t)0x00000001) /* Transmit mailbox request */
/* CAN Filter Master Register bits */
#define FMR_FINIT ((uint32_t)0x00000001) /* Filter init mode */
/* Time out for INAK bit */
#define INAK_TIMEOUT ((uint32_t)0x0000FFFF)
/* Time out for SLAK bit */
#define SLAK_TIMEOUT ((uint32_t)0x0000FFFF)
/* Flags in TSR register */
#define CAN_FLAGS_TSR ((uint32_t)0x08000000)
/* Flags in RF1R register */
#define CAN_FLAGS_RF1R ((uint32_t)0x04000000)
/* Flags in RF0R register */
#define CAN_FLAGS_RF0R ((uint32_t)0x02000000)
/* Flags in MSR register */
#define CAN_FLAGS_MSR ((uint32_t)0x01000000)
/* Flags in ESR register */
#define CAN_FLAGS_ESR ((uint32_t)0x00F00000)
/* Mailboxes definition */
#define CAN_TXMAILBOX_0 ((uint8_t)0x00)
#define CAN_TXMAILBOX_1 ((uint8_t)0x01)
#define CAN_TXMAILBOX_2 ((uint8_t)0x02)
#define CAN_MODE_MASK ((uint32_t) 0x00000003)
void CAN1_RX0_IRQHandler(void);
void CAN1_TX_IRQHandler(void);
2015-05-14 15:44:06 +08:00
#endif /*BXCAN_H_*/