hv_chip_Config.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * @file hv_chip_config.h
  3. * @brief include debug interface, define irq,memory,clk
  4. * @details anyware
  5. * @author HiView SoC Software Team
  6. * @version 1.0.0
  7. * @date 2022-09-05
  8. * @copyright Copyright(c),2022-9, Hiview Software. All rights reserved.
  9. */
  10. #ifndef _HV_CHIP_CONFIG_H
  11. #define _HV_CHIP_CONFIG_H
  12. #include "regs/HV_REGS_HT7315.h"
  13. #include "hv_chip_Clk.h"
  14. #include "hv_chip_Irq.h"
  15. #include "hv_chip_Memory.h"
  16. #include "hv_chip_Debug.h"
  17. #define HV_IRQ_FUNCTION void __attribute__ ((interrupt, keep_interrupts_masked))
  18. #define HV_WT32(addr, value) (*(volatile unsigned int*)((addr) | 0xA0000000) = (value))
  19. #define HV_RD32(addr) (*(volatile unsigned int*)((addr) | 0xA0000000))
  20. /**
  21. * @brief interface to set io group usermode.
  22. * @param[in] none.
  23. * @return none.
  24. */
  25. static void Hv_Chip_SetIOUserMode(void)
  26. {
  27. unsigned int uVal = HV_RD32(RX_SH08_TOP_RX_0X40);
  28. /* set system io group usermode */
  29. uVal |= 1 << 18;
  30. HV_WT32(RX_SH08_TOP_RX_0X40, uVal);
  31. /* set standy io group usermode */
  32. uVal = HV_RD32(STANDBY_SH08_TOP_STBY_CTRL_24);
  33. uVal |= 1 << 18;
  34. HV_WT32(STANDBY_SH08_TOP_STBY_CTRL_24, uVal);
  35. }
  36. #ifdef HV_CONFIG_ENABLE_PRINT
  37. #include "hv_chip_DebugUart.h"
  38. #else
  39. /* 关掉打印编译使用 */
  40. #define Hv_Chip_DebugUartInit(baudrate)
  41. #define Hv_Chip_DebugUartWrite(fd, buf, int)
  42. #define Hv_Chip_DebugUartPuts(c)
  43. static int Hv_Chip_DebugUartGetc(char *ch){return 0;}
  44. #define Hv_Chip_DebugUartPutc(c)
  45. static void Hv_Chip_SwitchQspiRsic(void){return;}
  46. static void Hv_Chip_DebugUartConfig(void){return;}
  47. static inline int Hv_Chip_DebugUartKbhit(){
  48. return 0;
  49. }
  50. #endif
  51. #endif