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 
13 #ifndef __DRV_SSPCC_H__
14 #define __DRV_SSPCC_H__
15 
16 #include "rtthread.h"
17 
18 #define SSPCC_SET_REALM(IP, REALM) \
19         do { \
20             rt_kprintf("Set %s realm to %s(%d)\n", #IP, #REALM, REALM); \
21             SSPCC_SetRealm(IP, REALM); \
22             rt_kprintf("Get %s realm is %d ....%s\n", #IP, SSPCC_GetRealm(IP), (SSPCC_GetRealm(IP)==REALM)?"Success":"Failure"); \
23         } while(0)
24 
25 #define SSPCC_SET_GPIO_REALM(PORT, PIN, REALM) \
26         do { \
27             rt_kprintf("Set %s%s realm to %s(%d)\n", #PORT, #PIN, #REALM, REALM); \
28             SSPCC_SetRealm_GPIO((uint32_t)PORT, PIN, REALM); \
29             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"); \
30         } while(0)
31 
32 rt_err_t nu_sspcc_init(void);
33 
34 #endif /* __DRV_SSPCC_H__ */
35