12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef __CAN_H
- #define __CAN_H
- #include "stm32f4xx.h"
- #define CAN_Send_Speed_ID 0x014e5301
- extern u8 CAN_DATA_CNT;
- void CAN_Config(void);
- void Send_Flash_Set(u8 num, u8 flag, float value);
- float Rec_Flash_Set(u8 data[]);
- void Send_CAN_DATA6(void);
- //CAN1接收RX0中断使能
- #define CAN1_RX0_INT_ENABLE 1 //0,不使能;1,使能.
- u8 CAN1_Send_Msg(u8* msg,u32 Can_ID,u8 len); //发送数据
- u8 CAN1_Receive_Msg(u8 *buf, u32 *id);
- void CAN_NVIC_Config(u8 NVIC_IRQChannel, u8 pre, u8 sub);
- void CAN_GPIO_Config(u32 RCC_APBnPeriphn, GPIO_TypeDef* GPIOx, u16 GPIO_Pin, u16 GPIO_PinSource, u8 GPIO_AF);
- void CAN_Mod_Config(u32 RCC_APB1Periph, CAN_TypeDef* CANx, u32 EXTID, u32 MaskID);
- void Send_Flash_Set(u8 num, u8 flag, float value);
- void Send_CAN_MOTOR1DATA(void);
- void Send_CAN_MOTOR2DATA(void);
- void Send_CAN_MOTOR3DATA(void);
- #endif
|