DEV_Config.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /******************************************************************************
  2. **************************Hardware interface layer*****************************
  3. * | file : DEV_Config.c
  4. * | version : V1.0
  5. * | date : 2020-06-17
  6. * | function : Provide the hardware underlying interface
  7. ******************************************************************************/
  8. #include "DEV_Config.h"
  9. #include <stdio.h> //printf()
  10. #include <string.h>
  11. #include <stdlib.h>
  12. /********************************************************************************
  13. function: System Init
  14. note:
  15. Initialize the communication method
  16. ********************************************************************************/
  17. uint8_t System_Init(void)
  18. {
  19. return 0;
  20. }
  21. void System_Exit(void)
  22. {
  23. }
  24. /********************************************************************************
  25. function: Hardware interface
  26. note:
  27. SPI4W_Write_Byte(value) :
  28. HAL library hardware SPI
  29. Register hardware SPI
  30. Gpio analog SPI
  31. I2C_Write_Byte(value, cmd):
  32. HAL library hardware I2C
  33. ********************************************************************************/
  34. uint8_t SPI4W_Write_Byte(uint8_t value)
  35. {
  36. return 0;
  37. }
  38. void I2C_Write_Byte(uint8_t value, uint8_t Cmd)
  39. {
  40. }
  41. /********************************************************************************
  42. function: Delay function
  43. note:
  44. Driver_Delay_ms(xms) : Delay x ms
  45. Driver_Delay_us(xus) : Delay x us
  46. ********************************************************************************/
  47. void Driver_Delay_ms(uint32_t xms)
  48. {
  49. HAL_Delay(xms);
  50. }
  51. void Driver_Delay_us(uint32_t xus)
  52. {
  53. int j;
  54. for(j=xus; j > 0; j--);
  55. }