您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

50 行
782 B

  1. /*
  2. * File: BoardCfg.h
  3. * Author: JF
  4. *
  5. * Created on November 26, 2018, 4:50 PM
  6. */
  7. #ifndef BOARDCFG_H
  8. #define BOARDCFG_H
  9. #include "define.h"
  10. static inline __attribute__((always_inline)) unsigned char SPICalculateBRG(unsigned int pb_clk, unsigned int spi_clk)
  11. {
  12. unsigned int brg;
  13. brg = pb_clk / (2 * spi_clk);
  14. if(pb_clk % (2 * spi_clk))
  15. brg++;
  16. if(brg > 0x100)
  17. brg = 0x100;
  18. if(brg)
  19. brg--;
  20. return (unsigned char) brg;
  21. }
  22. //
  23. #ifdef FUBARINO_BRD
  24. #include "BoardCfg_Fubarino.h"
  25. #endif
  26. //#ifdef PINGUINO_BRD
  27. //#include "BoardCfg_Pinguino.h"
  28. //#endif
  29. #ifdef CHALETDUINO_BRD
  30. #include "BoardCfg_Chaletduino.h"
  31. #endif
  32. #ifdef CHALETDUINO_V2_BRD
  33. #include "BoardCfg_ChaletduinoV2.h"
  34. #endif
  35. int InitBoard();
  36. #endif /* BOARDCFG_H */