drv_sspcc.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. /**************************************************************************//**
  2. *
  3. * @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2022-10-20 Wayne First version
  10. *
  11. ******************************************************************************/
  12. #ifndef __DRV_SSPCC_H__
  13. #define __DRV_SSPCC_H__
  14. #include "rtthread.h"
  15. #define SSPCC_SET_REALM(IP, REALM) \
  16. do { \
  17. rt_kprintf("Set %s realm to %s(%d)\n", #IP, #REALM, REALM); \
  18. SSPCC_SetRealm(IP, REALM); \
  19. rt_kprintf("Get %s realm is %d ....%s\n", #IP, SSPCC_GetRealm(IP), (SSPCC_GetRealm(IP)==REALM)?"Success":"Failure"); \
  20. } while(0)
  21. #define SSPCC_SET_GPIO_REALM(PORT, PIN, REALM) \
  22. do { \
  23. rt_kprintf("Set %s%s realm to %s(%d)\n", #PORT, #PIN, #REALM, REALM); \
  24. SSPCC_SetRealm_GPIO((uint32_t)PORT, PIN, REALM); \
  25. rt_kprintf("Get %s%s realm is %d ....%s\n", #PORT, #PIN, SSPCC_GetRealm_GPIO((uint32_t)PORT, PIN), (SSPCC_GetRealm_GPIO((uint32_t)PORT, PIN)==REALM)?"Success":"Failure"); \
  26. } while(0)
  27. rt_err_t nu_sspcc_init(void);
  28. #endif /* __DRV_SSPCC_H__ */