DEV_Config.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*****************************************************************************
  2. * | File : DEV_Config.h
  3. * | Author : Waveshare team
  4. * | Function : Hardware underlying interface
  5. * | Info :
  6. *----------------
  7. * | This version: V1.0
  8. * | Date : 2020-02-19
  9. * | Info :
  10. #
  11. # Permission is hereby granted, free of charge, to any person obtaining a copy
  12. # of this software and associated documnetation files (the "Software"), to deal
  13. # in the Software without restriction, including without limitation the rights
  14. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15. # copies of the Software, and to permit persons to whom the Software is
  16. # furished to do so, subject to the following conditions:
  17. #
  18. # The above copyright notice and this permission notice shall be included in
  19. # all copies or substantial portions of the Software.
  20. #
  21. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23. # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  24. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25. # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  26. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  27. # THE SOFTWARE.
  28. #
  29. ******************************************************************************/
  30. #ifndef _DEV_CONFIG_H_
  31. #define _DEV_CONFIG_H_
  32. #include <Arduino.h>
  33. #include <stdint.h>
  34. #include <stdio.h>
  35. /**
  36. * data
  37. **/
  38. #define UBYTE uint8_t
  39. #define UWORD uint16_t
  40. #define UDOUBLE uint32_t
  41. /**
  42. * GPIO config
  43. **/
  44. #define EPD_SCK_PIN 14
  45. #define EPD_MOSI_PIN 13
  46. #define EPD_CS_PIN 15
  47. #define EPD_RST_PIN 2
  48. #define EPD_DC_PIN 4
  49. #define EPD_BUSY_PIN 5
  50. #define GPIO_PIN_SET 1
  51. #define GPIO_PIN_RESET 0
  52. /**
  53. * GPIO read and write
  54. **/
  55. #define DEV_Digital_Write(_pin, _value) digitalWrite(_pin, _value == 0? LOW:HIGH)
  56. #define DEV_Digital_Read(_pin) digitalRead(_pin)
  57. /**
  58. * delay x ms
  59. **/
  60. #define DEV_Delay_ms(__xms) delay(__xms)
  61. /*------------------------------------------------------------------------------------------------------*/
  62. UBYTE DEV_Module_Init(void);
  63. void GPIO_Mode(UWORD GPIO_Pin, UWORD Mode);
  64. void DEV_SPI_WriteByte(UBYTE data);
  65. UBYTE DEV_SPI_ReadByte();
  66. void DEV_SPI_Write_nByte(UBYTE *pData, UDOUBLE len);
  67. void DEV_Module_Exit(void);
  68. #endif