今天在写STM32程序时,出现了一个小问题,现在记录下来,应该说是自己的C语言基本功不行。加油吧

首先,发送函数的定义:

1 void rs485_put_bytes(uint8 *buf,uint32 len)  

所访问的结构体的定义:

typedef struct
{
  uint32_t StdId;  /*!< Specifies the standard identifier.
                        This parameter can be a value between 0 to 0x7FF. */
  uint32_t ExtId;  /*!< Specifies the extended identifier.
                        This parameter can be a value between 0 to 0x1FFFFFFF. */
  uint8_t IDE;     /*!< Specifies the type of identifier for the message that will be received.
                        This parameter can be a value of @ref CAN_identifier_type */
  uint8_t RTR;     /*!< Specifies the type of frame for the received message.
                        This parameter can be a value of @ref CAN_remote_transmission_request */
  uint8_t DLC;     /*!< Specifies the length of the frame that will be received.
                        This parameter can be a value between 0 to 8 */
  uint8_t Data[8]; /*!< Contains the data to be received. It ranges from 0 to 0xFF. */

  uint8_t FMI;     /*!< Specifies the index of the filter the message stored in the mailbox passes through.
                        This parameter can be a value between 0 to 0xFF */
} CanRxMsg;

定义一个结构体变量:

1 CanRxMsg RxMessage;
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-03-06
  • 2022-12-23
  • 2021-12-01
  • 2022-01-08
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案