1 /*""FILE COMMENT""*******************************************************
2 * System Name	: LPC API for RX62Nxx
3 * File Name		: r_pdl_lpc.h
4 * Version		: 1.02
5 * Contents		: LPC API header
6 * Customer		:
7 * Model			:
8 * Order			:
9 * CPU			: RX
10 * Compiler		: RXC
11 * OS			: Nothing
12 * Programmer	:
13 * Note			:
14 ************************************************************************
15 * Copyright, 2011. Renesas Electronics Corporation
16 * and Renesas Solutions Corporation
17 ************************************************************************
18 * History		: 2011.04.08
19 *				: Ver 1.02
20 *				: CS-5 release.
21 *""FILE COMMENT END""**************************************************/
22 
23 #ifndef R_PDL_LPC_H
24 #define R_PDL_LPC_H
25 
26 #include "r_pdl_common_defs_RX62Nxx.h"
27 
28 /* Function prototypes */
29 bool R_LPC_Create(
30 	uint32_t,
31 	uint32_t
32 );
33 bool R_LPC_Control(
34 	uint16_t
35 );
36 bool R_LPC_WriteBackup(
37 	uint8_t *,
38 	uint8_t
39 );
40 bool R_LPC_ReadBackup(
41 	uint8_t *,
42 	uint8_t
43 );
44 bool R_LPC_GetStatus(
45 	uint16_t *
46 );
47 
48 /* Software and Deep Software Standby mode output port control */
49 #define PDL_LPC_EXT_BUS_ON			0x00000001ul
50 #define PDL_LPC_EXT_BUS_HI_Z		0x00000002ul
51 
52 /* On-chip RAM power / USB resume detection control */
53 #define PDL_LPC_RAM_USB_DETECT_ON	0x00000004ul
54 #define PDL_LPC_RAM_USB_DETECT_OFF	0x00000008ul
55 
56 /* I/O port retention control */
57 #define PDL_LPC_IO_SAME				0x00000010ul
58 #define PDL_LPC_IO_DELAY			0x00000020ul
59 
60 /* Deep software standby cancel control */
61 #define PDL_LPC_CANCEL_IRQ0_DISABLE	0x00000040ul
62 #define PDL_LPC_CANCEL_IRQ0_FALLING	0x00000080ul
63 #define PDL_LPC_CANCEL_IRQ0_RISING	0x00000100ul
64 #define PDL_LPC_CANCEL_IRQ1_DISABLE	0x00000200ul
65 #define PDL_LPC_CANCEL_IRQ1_FALLING	0x00000400ul
66 #define PDL_LPC_CANCEL_IRQ1_RISING	0x00000800ul
67 #define PDL_LPC_CANCEL_IRQ2_DISABLE	0x00001000ul
68 #define PDL_LPC_CANCEL_IRQ2_FALLING	0x00002000ul
69 #define PDL_LPC_CANCEL_IRQ2_RISING	0x00004000ul
70 #define PDL_LPC_CANCEL_IRQ3_DISABLE	0x00008000ul
71 #define PDL_LPC_CANCEL_IRQ3_FALLING	0x00010000ul
72 #define PDL_LPC_CANCEL_IRQ3_RISING	0x00020000ul
73 #define PDL_LPC_CANCEL_NMI_DISABLE	0x00040000ul
74 #define PDL_LPC_CANCEL_NMI_FALLING	0x00080000ul
75 #define PDL_LPC_CANCEL_NMI_RISING	0x00100000ul
76 #define PDL_LPC_CANCEL_LVD_DISABLE	0x00200000ul
77 #define PDL_LPC_CANCEL_LVD_ENABLE	0x00400000ul
78 #define PDL_LPC_CANCEL_RTC_DISABLE	0x00800000ul
79 #define PDL_LPC_CANCEL_RTC_ENABLE	0x01000000ul
80 #define PDL_LPC_CANCEL_USB_DISABLE	0x02000000ul
81 #define PDL_LPC_CANCEL_USB_ENABLE	0x04000000ul
82 
83 /* Software Standby waiting time */
84 #define PDL_LPC_STANDBY_64			0x00000001ul
85 #define PDL_LPC_STANDBY_512			0x00000002ul
86 #define PDL_LPC_STANDBY_1024		0x00000004ul
87 #define PDL_LPC_STANDBY_2048		0x00000008ul
88 #define PDL_LPC_STANDBY_4096		0x00000010ul
89 #define PDL_LPC_STANDBY_16384		0x00000020ul
90 #define PDL_LPC_STANDBY_32768		0x00000040ul
91 #define PDL_LPC_STANDBY_65536		0x00000080ul
92 #define PDL_LPC_STANDBY_131072		0x00000100ul
93 #define PDL_LPC_STANDBY_262144		0x00000200ul
94 #define PDL_LPC_STANDBY_524288		0x00000400ul
95 
96 /* Deep Software Standby waiting time */
97 #define PDL_LPC_DEEP_STANDBY_64		0x00000800ul
98 #define PDL_LPC_DEEP_STANDBY_512	0x00001000ul
99 #define PDL_LPC_DEEP_STANDBY_1024	0x00002000ul
100 #define PDL_LPC_DEEP_STANDBY_2048	0x00004000ul
101 #define PDL_LPC_DEEP_STANDBY_4096	0x00008000ul
102 #define PDL_LPC_DEEP_STANDBY_16384	0x00010000ul
103 #define PDL_LPC_DEEP_STANDBY_32768	0x00020000ul
104 #define PDL_LPC_DEEP_STANDBY_65536	0x00040000ul
105 #define PDL_LPC_DEEP_STANDBY_131072	0x00080000ul
106 #define PDL_LPC_DEEP_STANDBY_262144	0x00100000ul
107 #define PDL_LPC_DEEP_STANDBY_524288	0x00200000ul
108 
109 /* Error monitoring */
110 #define PDL_LPC_MODE_SLEEP					0x0001u
111 #define PDL_LPC_MODE_ALL_MODULE_CLOCK_STOP	0x0002u
112 #define PDL_LPC_MODE_SOFTWARE_STANDBY		0x0004u
113 #define PDL_LPC_MODE_DEEP_SOFTWARE_STANDBY	0x0008u
114 
115 /* All-module clock stop cancellation modification */
116 #define PDL_LPC_TMR_OFF						0x0010u
117 #define PDL_LPC_TMR_UNIT_0					0x0020u
118 #define PDL_LPC_TMR_UNIT_1					0x0040u
119 #define PDL_LPC_TMR_BOTH					0x0080u
120 
121 /* I/O port retention cancellation */
122 #define PDL_LPC_IO_RELEASE					0x0100u
123 
124 #endif
125 /* End of file */
126