device_types.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C) 2017-2020 Alibaba Group Holding Limited
  3. */
  4. /* device_types.h
  5. *
  6. * Driver Framework, Device API, Type Definitions
  7. *
  8. * The document "Driver Framework Porting Guide" contains the detailed
  9. * specification of this API. The information contained in this header file
  10. * is for reference only.
  11. */
  12. #ifndef INCLUDE_GUARD_DEVICE_TYPES_H
  13. #define INCLUDE_GUARD_DEVICE_TYPES_H
  14. /*----------------------------------------------------------------------------
  15. * Device_Handle_t
  16. *
  17. * This handle represents a device, typically one hardware block instance.
  18. *
  19. * The Device API can access the static device resources (registers and RAM
  20. * inside the device) using offsets inside the device. This abstracts memory
  21. * map knowledge and simplifies device instantiation.
  22. *
  23. * Each device has its own configuration, including the endianness swapping
  24. * need for the words transferred. Endianness swapping can thus be performed
  25. * on the fly and transparent to the caller.
  26. *
  27. * The details of the handle are implementation specific and must not be
  28. * relied on, with one exception: NULL is guaranteed to be a non-existing
  29. * handle.
  30. */
  31. typedef void * Device_Handle_t;
  32. /*----------------------------------------------------------------------------
  33. * Device_Reference_t
  34. *
  35. * This is an implementation-specific reference for the device. It can
  36. * be passed from the implementation of the Device API to other modules
  37. * for use, for example, with OS services that require such a reference.
  38. *
  39. * The details of the handle are implementation specific and must not be
  40. * relied on, with one exception: NULL is guaranteed to be a non-existing
  41. * handle.
  42. */
  43. typedef void * Device_Reference_t;
  44. /*----------------------------------------------------------------------------
  45. * Device_Data_t
  46. *
  47. * This is an implementation-specific reference for the device. It can
  48. * be passed from the implementation of the Device API to other modules
  49. * for use, for example, with OS services that require such a reference.
  50. */
  51. typedef struct
  52. {
  53. // Physical address of the device mapped in memory
  54. void * PhysAddr;
  55. } Device_Data_t;
  56. #endif /* Include Guard */
  57. /* end of file device_types.h */