| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- #pragma once
- #include "canard.h"
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- #define VK_WEIGHER_VLS300_DEV_NAME "weigher"
- int vkWeigher_Vls300_OnRecieved(CanardInstance *canardIns,
- CanardRxTransfer *transfer);
- struct _weigher_status {
- uint32_t timestamp; /* [ms] 数据更新时间戳 */
- uint32_t weight; /* g */
- uint16_t weight_dot; /* g/min */
- uint16_t status;
- float gyro[3]; /* rad/s */
- float acce[3]; /* m/s^2 */
- float Q[4]; /* 姿态四元数 */
- };
- struct _weigher_version {
- uint32_t timestamp;
- uint8_t fw_ver[16];
- uint32_t SN_num;
- };
- struct vk_weigher_vls300 {
- // struct weigher_device weigher_dev;
- // rt_device_t can_dev;
- CanardInstance *canard;
- uint8_t iface_mask;
- bool data_got;
- struct _weigher_status status_data;
- struct _weigher_version version;
- // rt_event_t _event;
- uint16_t _fw_update_send_pack_num; // 从1开始
- const char *_fw_file_name;
- };
- enum {
- VLS300_EVENT_GOT_FW_UPDATE_START_ACK = 1,
- VLS300_EVENT_GOT_FW_UPDATE_INFO_ACK = (1 << 1),
- VLS300_EVENT_GOT_FW_UPDATE_DATA_ACK = (1 << 2),
- };
- extern struct vk_weigher_vls300 _vk_vls300;
- bool vkWeigher_Vls300_shouldAcceptTransfer(const CanardInstance *ins,
- uint64_t *out_data_type_signature,
- uint16_t data_type_id,
- CanardTransferType transfer_type,
- uint8_t source_node_id);
- uint8_t vklift_weight_calibrate(uint32_t weight);
- #ifdef __cplusplus
- }
- #endif // __cplusplus
|