sx1208-state-grid.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. / _____) _ | |
  3. ( (____ _____ ____ _| |_ _____ ____| |__
  4. \____ \| ___ | (_ _) ___ |/ ___) _ \
  5. _____) ) ____| | | || |_| ____( (___| | | |
  6. (______/|_____)_|_|_| \__)_____)\____)_| |_|
  7. (C)2014 Semtech
  8. Description: State Grid CRC, Whitening Method and Reverse Method
  9. License: Revised BSD License, see LICENSE.TXT file include in the project
  10. Maintainer: Jiapeng Li
  11. */
  12. #ifndef __SX1208_STATE_GRID_H
  13. #define __SX1208_STATE_GRID_H
  14. /** use <stdint.h> type */
  15. #include "stdint.h"
  16. #define SX1208_STATE_GRID_GOOD_CRC (0x0F47)
  17. uint16_t sx1208_state_grid_crc_calc(uint8_t *buf, uint8_t len);
  18. uint16_t sx1208_state_grid_crc_check(uint8_t *buf, uint8_t len);
  19. //uint8_t sx1208_state_grid_whitening_data(uint8_t data, uint8_t index);
  20. //void sx1208_state_grid_whitening_buf(uint8_t *buf, uint16_t len, uint8_t start_index);
  21. uint8_t sx1208_state_grid_whitening_reverse_data(uint8_t data, uint8_t index);
  22. void sx1208_state_grid_whitening_reverse_buf(uint8_t *buf, uint16_t len, uint8_t start_index);
  23. uint8_t sx1208_state_grid_reverse_whitening_data(uint8_t data, uint8_t index);
  24. void sx1208_state_grid_reverse_whitening_buf(uint8_t *buf, uint16_t len, uint8_t start_index);
  25. uint8_t sx1208_state_grid_reverse(uint8_t val);
  26. #endif