can.h 864 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __CAN_H
  2. #define __CAN_H
  3. #include "stm32f4xx.h"
  4. #define CAN_Send_Speed_ID 0x014e5301
  5. extern u8 CAN_DATA_CNT;
  6. void CAN_Config(void);
  7. void Send_Flash_Set(u8 num, u8 flag, float value);
  8. float Rec_Flash_Set(u8 data[]);
  9. void Send_CAN_DATA6(void);
  10. //CAN1接收RX0中断使能
  11. #define CAN1_RX0_INT_ENABLE 1 //0,不使能;1,使能.
  12. u8 CAN1_Send_Msg(u8* msg,u32 Can_ID,u8 len); //发送数据
  13. u8 CAN1_Receive_Msg(u8 *buf, u32 *id);
  14. void CAN_NVIC_Config(u8 NVIC_IRQChannel, u8 pre, u8 sub);
  15. void CAN_GPIO_Config(u32 RCC_APBnPeriphn, GPIO_TypeDef* GPIOx, u16 GPIO_Pin, u16 GPIO_PinSource, u8 GPIO_AF);
  16. void CAN_Mod_Config(u32 RCC_APB1Periph, CAN_TypeDef* CANx, u32 EXTID, u32 MaskID);
  17. void Send_Flash_Set(u8 num, u8 flag, float value);
  18. void Send_CAN_MOTOR1DATA(void);
  19. void Send_CAN_MOTOR2DATA(void);
  20. void Send_CAN_MOTOR3DATA(void);
  21. #endif