ns.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. *********************************************************************************************************
  3. * xmk guide
  4. *
  5. * (c) Copyright 2016-2020, hualijidian.com
  6. * All Rights Reserved
  7. *
  8. * @file mns.h
  9. * @author eric
  10. * @brief
  11. * @date 2017年7月22日
  12. * @version V0.0.1
  13. *********************************************************************************************************
  14. */
  15. #ifndef __MNS_H_
  16. #define __MNS_H_
  17. #include "stdint.h"
  18. #include "stdbool.h"
  19. #define NS_MAX 80
  20. typedef struct _NavSenser{
  21. uint32_t CanId;
  22. uint8_t NsType;
  23. uint8_t Data[8];
  24. uint16_t Max;
  25. short (*calcOffset)(struct _NavSenser *Ns, uint16_t branch, uint16_t *Online);
  26. bool (*recvCan)(struct _NavSenser *Ns, uint32_t canId, uint8_t *data);
  27. struct _NavSenser *next;
  28. } NavSenser;
  29. NavSenser* NavSenserNew(uint8_t NsType, uint32_t canId);
  30. bool NavSenserIsOnline(NavSenser * ns);
  31. short NavSenserGetOffset(NavSenser * ns, uint16_t branch, uint16_t *Online);
  32. #endif /* __MNS_H_ */