Skip to content

Commit c2354ab

Browse files
committed
hal: renesas: rx: Add CTSU driver support for RX130 target
Add CTSU HAL driver source support for HAL Renesas RX Signed-off-by: Quy Tran <[email protected]>
1 parent d8ee5f1 commit c2354ab

File tree

10 files changed

+9731
-0
lines changed

10 files changed

+9731
-0
lines changed

drivers/rx/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,14 @@ if(CONFIG_USE_RX_RDP_LVD)
136136
rdp/src/r_lvd_rx/src
137137
rdp/src/r_lvd_rx/src/targets/${CONFIG_SOC_SERIES})
138138
endif()
139+
140+
if(CONFIG_USE_RX_RDP_CTSU)
141+
zephyr_library_sources(
142+
rdp/src/r_ctsu_qe/src/r_ctsu_qe.c
143+
rdp/src/r_ctsu_qe/src/r_ctsu_qe_pinset.c
144+
)
145+
zephyr_include_directories(
146+
rdp/src/r_ctsu_qe
147+
rdp/src/r_ctsu_qe/inc
148+
)
149+
endif()

drivers/rx/rdp/src/r_bsp/mcu/all/fsp_common_api.h

Lines changed: 351 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2011 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
/***********************************************************************************************************************
7+
* File Name : r_fsp_error.h
8+
* Description : The user chooses which MCU and board they are developing for in this file. If the board you are using
9+
* is not listed below, please add your own or use the default 'User Board'.
10+
***********************************************************************************************************************/
11+
/***********************************************************************************************************************
12+
* History : DD.MM.YYYY Version Description
13+
* : 23.04.2021 1.00 First Release
14+
* : 26.02.2025 1.01 Changed the disclaimer.
15+
***********************************************************************************************************************/
16+
#ifndef R_FSP_ERROR_H_
17+
#define R_FSP_ERROR_H_
18+
19+
20+
/***********************************************************************************************************************
21+
* Includes
22+
**********************************************************************************************************************/
23+
#include "fsp_common_api.h"
24+
25+
/***********************************************************************************************************************
26+
* Macro definitions
27+
**********************************************************************************************************************/
28+
/** Macro to log and return error without an assertion. */
29+
#ifndef FSP_RETURN
30+
31+
#define FSP_RETURN(err) FSP_ERROR_LOG((err)); \
32+
return err;
33+
#endif
34+
35+
/** This function is called before returning an error code. To stop on a runtime error, define fsp_error_log in
36+
* user code and do required debugging (breakpoints, stack dump, etc) in this function.*/
37+
#define FSP_ERROR_LOG(err)
38+
39+
/** Default assertion calls ::FSP_ERROR_RETURN if condition "a" is false. Used to identify incorrect use of API's in FSP
40+
* functions. */
41+
#define FSP_ASSERT(a) FSP_ERROR_RETURN((a), FSP_ERR_ASSERTION)
42+
43+
/** All FSP error codes are returned using this macro. Calls ::FSP_ERROR_LOG function if condition "a" is false. Used
44+
* to identify runtime errors in FSP functions. */
45+
46+
#define FSP_ERROR_RETURN(a, err) \
47+
{ \
48+
if ((a)) \
49+
{ \
50+
(void) 0; /* Do nothing */ \
51+
} \
52+
else \
53+
{ \
54+
FSP_ERROR_LOG(err); \
55+
return err; \
56+
} \
57+
}
58+
59+
60+
#endif /* R_FSP_ERROR_H_ */

drivers/rx/rdp/src/r_ctsu_qe/inc/r_ctsu_qe.h

Lines changed: 473 additions & 0 deletions
Large diffs are not rendered by default.

drivers/rx/rdp/src/r_ctsu_qe/inc/r_ctsu_qe_api.h

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2018 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/***********************************************************************************************************************
8+
* File Name : r_ctsu_qe_pinset.h
9+
* Version : 1.0.2
10+
* Device(s) : R5F51308AxFP
11+
* Tool-Chain : RXC toolchain
12+
* Description : Setting of port and mpc registers
13+
***********************************************************************************************************************/
14+
15+
#ifndef R_CTSU_QE_H
16+
#define R_CTSU_QE_H
17+
18+
/***********************************************************************************************************************
19+
Includes
20+
***********************************************************************************************************************/
21+
22+
/***********************************************************************************************************************
23+
Global variables and functions
24+
***********************************************************************************************************************/
25+
26+
void R_CTSU_PinSetInit();
27+
void R_Set_CTSU_TSCAP_Discharge();
28+
void R_Set_CTSU_TSCAP_Charge();
29+
30+
#endif
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2018 Renesas Electronics Corporation and/or its affiliates
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
/***********************************************************************************************************************
7+
* File Name : r_ctsu_qe_if.h
8+
* Description : This file contains the CTSU API and should be included by the application which uses this API.
9+
***********************************************************************************************************************/
10+
#ifndef R_CTSU_QE_IF_H
11+
#define R_CTSU_QE_IF_H
12+
13+
#include "r_ctsu_qe.h"
14+
#include "r_ctsu_qe_api.h"
15+
#include "r_ctsu_qe_config.h"
16+
17+
18+
/***********************************************************************************************************************
19+
* Macro definitions
20+
***********************************************************************************************************************/
21+
/* Driver Version Number. */
22+
#define QECTSU_RX_VERSION_MAJOR (1)
23+
#define QECTSU_RX_VERSION_MINOR (20)
24+
25+
26+
/***********************************************************************************************************************
27+
* Typedef definitions
28+
***********************************************************************************************************************/
29+
30+
31+
/***********************************************************************************************************************
32+
* Exported global variables
33+
***********************************************************************************************************************/
34+
35+
36+
/***********************************************************************************************************************
37+
* Exported global functions
38+
***********************************************************************************************************************/
39+
40+
41+
#endif // QETOUCH_RX_IF_H_FILE

0 commit comments

Comments
 (0)