sunxi_hal_eise.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * ===========================================================================================
  3. *
  4. * Filename: sunxi_eise.h
  5. *
  6. * Description: EISE HAL definition.
  7. *
  8. * Version: Melis3.0
  9. * Create: 2020-01-09 11:11:56
  10. * Revision: none
  11. * Compiler:
  12. *
  13. * Author: ganqiuye(ganqiuye@allwinnertech.com)
  14. * Organization: SWC-MPD
  15. * Last Modified: 2020-04-02 17:32:52
  16. *
  17. * ===========================================================================================
  18. */
  19. #ifndef SUNXI_HAL_EISE_H
  20. #define SUNXI_HAL_EISE_H
  21. #include <hal_clk.h>
  22. #include "hal_sem.h"
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. #include "sunxi_hal_common.h"
  28. #define DEVICE_NAME "sunxi_eise"
  29. /* system address */
  30. #define PLL_ISE_CTRL_REG (0x00D0)
  31. #define EISE_CLK_REG (0x06D0)
  32. #define MBUS_CLK_GATING_REG (0x0804)
  33. #define EISE_BGR_REG (0x06DC)
  34. /* eise register */
  35. #define EISE_CTRL_REG (0x00)
  36. #define EISE_IN_SIZE (0x28)
  37. #define EISE_OUT_SIZE (0x38)
  38. #define EISE_ICFG_REG (0x04)
  39. #define EISE_OCFG_REG (0x08)
  40. #define EISE_INTERRUPT_EN (0x0c)
  41. #define EISE_TIME_OUT_NUM (0x3c)
  42. #define EISE_INTERRUPT_STATUS (0x10)
  43. #define EISE_ERROR_FLAG (0x14)
  44. #define EISE_RESET_REG (0x88)
  45. struct eise_register{
  46. unsigned int addr;
  47. unsigned int value;
  48. };
  49. typedef struct hal_eise_t{
  50. unsigned int eise_base_addr;
  51. unsigned int ccmu_base_addr;
  52. // unsigned long err_cnt;
  53. //unsigned long interrupt_times;
  54. unsigned int irq_id;
  55. hal_clk_id_t pclk;
  56. hal_clk_id_t mclk;
  57. hal_sem_t hal_sem;
  58. }hal_eise_t;
  59. typedef struct sunxi_hal_driver_eise
  60. {
  61. int32_t (*initialize)(int32_t dev);
  62. int32_t (*uninitialize)(int32_t dev);
  63. int32_t (*send)(int32_t dev, const char *data, uint32_t num);
  64. int32_t (*receive)(int32_t dev, int *data, uint32_t num);
  65. int32_t (*control)(int32_t dev, uint32_t control, void* arg);
  66. sunxi_hal_poll_ops *poll_ops;
  67. } const sunxi_hal_driver_eise_t;
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif