HALcomdef.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef HAL_COMDEF_H
  19. #define HAL_COMDEF_H
  20. #ifndef _ARM_ASM_
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #include "com_dtypes.h"
  25. #ifndef _BOOL32_DEFINED
  26. typedef unsigned long int bool32;
  27. #define _BOOL32_DEFINED
  28. #endif
  29. #define HAL_ENUM_32BITS(x) HAL_##x##_FORCE32BITS = 0x7FFFFFFF
  30. #define inp(port) (*((volatile byte *) (port)))
  31. #define inpw(port) (*((volatile word *) (port)))
  32. #define inpdw(port) (*((volatile dword *)(port)))
  33. #define outp(port, val) (*((volatile byte *) (port)) = ((byte) (val)))
  34. #define outpw(port, val) (*((volatile word *) (port)) = ((word) (val)))
  35. #define outpdw(port, val) (*((volatile dword *) (port)) = ((dword) (val)))
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif
  40. #endif