Skip to content

Commit 0f57ccf

Browse files
renesas-ra: Add new port to Renesas RA.
Signed-off-by: Takeo Takahashi <[email protected]>
1 parent 4c9b00b commit 0f57ccf

File tree

272 files changed

+30866
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+30866
-0
lines changed

ports/renesas-ra/Makefile

+540
Large diffs are not rendered by default.

ports/renesas-ra/RA4M1_hal.h

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Renesas Electronics Corporation
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef PORTS_RA_RA4M1_HAL_H_
26+
#define PORTS_RA_RA4M1_HAL_H_
27+
28+
#include <stdio.h>
29+
#include <stdint.h>
30+
#include <stdbool.h>
31+
// #include "hal_data.h"
32+
#include "bsp_api.h"
33+
#include "common_data.h"
34+
35+
#define SCI_CH 0
36+
#define SCI_BAUD 115200
37+
#define UART_CH SCI_CH
38+
#define UART_TxStr sci_tx_str
39+
#define PCLK 48000000
40+
41+
#define RA_PRI_SYSTICK (0)
42+
#define RA_PRI_UART (1)
43+
#define RA_PRI_SDIO (4)
44+
#define RA_PRI_DMA (5)
45+
#define RA_PRI_FLASH (6)
46+
#define RA_PRI_OTG_FS (6)
47+
#define RA_PRI_OTG_HS (6)
48+
#define RA_PRI_TIM5 (6)
49+
#define RA_PRI_CAN (7)
50+
#define RA_PRI_SPI (8)
51+
#define RA_PRI_I2C (8)
52+
#define RA_PRI_TIMX (13)
53+
#define RA_PRI_EXTINT (14)
54+
#define RA_PRI_PENDSV (15)
55+
#define RA_PRI_RTC_WKUP (15)
56+
57+
#include "ra_config.h"
58+
#include "ra_adc.h"
59+
#include "ra_flash.h"
60+
#include "ra_gpio.h"
61+
#include "ra_i2c.h"
62+
#include "ra_icu.h"
63+
#include "ra_init.h"
64+
#include "ra_int.h"
65+
#include "ra_rtc.h"
66+
#include "ra_sci.h"
67+
#include "ra_spi.h"
68+
#include "ra_timer.h"
69+
#include "ra_utils.h"
70+
71+
typedef enum {
72+
HAL_OK = 0x00,
73+
HAL_ERROR = 0x01,
74+
HAL_BUSY = 0x02,
75+
HAL_TIMEOUT = 0x03
76+
} HAL_StatusTypeDef;
77+
78+
#define __IO volatile
79+
80+
#if defined(USE_DBG_PRINT)
81+
#if !defined(DEBUG_CH)
82+
#define DEBUG_CH SCI_CH
83+
#endif
84+
#if (DEBUG_CH == 0)
85+
#define DEBUG_TX_PIN P411
86+
#define DEBUG_RX_PIN P410
87+
#endif
88+
#if (DEBUG_CH == 1)
89+
#define DEBUG_TX_PIN P401
90+
#define DEBUG_RX_PIN P402
91+
#endif
92+
#if (DEBUG_CH == 9)
93+
#define DEBUG_TX_PIN P203
94+
#define DEBUG_RX_PIN P202
95+
#endif
96+
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
97+
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
98+
#else
99+
#define DEBUG_TXSTR(s)
100+
#define DEBUG_TXCH(c)
101+
#endif
102+
103+
#endif /* PORTS_RA_RA4M1_HAL_H_ */

ports/renesas-ra/RA4W1_hal.h

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Renesas Electronics Corporation
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef PORTS_RA_RA4W1_HAL_H_
26+
#define PORTS_RA_RA4W1_HAL_H_
27+
28+
#include <stdio.h>
29+
#include <stdint.h>
30+
#include <stdbool.h>
31+
// #include "hal_data.h"
32+
#include "bsp_api.h"
33+
#include "common_data.h"
34+
35+
#define SCI_CH 0
36+
#define SCI_BAUD 115200
37+
#define UART_CH SCI_CH
38+
#define UART_TxStr sci_tx_str
39+
#define PCLK 48000000
40+
41+
#define RA_PRI_SYSTICK (0)
42+
#define RA_PRI_UART (1)
43+
#define RA_PRI_SDIO (4)
44+
#define RA_PRI_DMA (5)
45+
#define RA_PRI_FLASH (6)
46+
#define RA_PRI_OTG_FS (6)
47+
#define RA_PRI_OTG_HS (6)
48+
#define RA_PRI_TIM5 (6)
49+
#define RA_PRI_CAN (7)
50+
#define RA_PRI_SPI (8)
51+
#define RA_PRI_I2C (8)
52+
#define RA_PRI_TIMX (13)
53+
#define RA_PRI_EXTINT (14)
54+
#define RA_PRI_PENDSV (15)
55+
#define RA_PRI_RTC_WKUP (15)
56+
57+
#include "ra_config.h"
58+
#include "ra_adc.h"
59+
#include "ra_flash.h"
60+
#include "ra_gpio.h"
61+
#include "ra_i2c.h"
62+
#include "ra_icu.h"
63+
#include "ra_init.h"
64+
#include "ra_int.h"
65+
#include "ra_rtc.h"
66+
#include "ra_sci.h"
67+
#include "ra_spi.h"
68+
#include "ra_timer.h"
69+
#include "ra_utils.h"
70+
71+
typedef enum {
72+
HAL_OK = 0x00,
73+
HAL_ERROR = 0x01,
74+
HAL_BUSY = 0x02,
75+
HAL_TIMEOUT = 0x03
76+
} HAL_StatusTypeDef;
77+
78+
#define __IO volatile
79+
80+
#if defined(USE_DBG_PRINT)
81+
#if !defined(DEBUG_CH)
82+
#define DEBUG_CH SCI_CH
83+
#endif
84+
#if (DEBUG_CH == 0)
85+
#define DEBUG_TX_PIN P411
86+
#define DEBUG_RX_PIN P410
87+
#endif
88+
#if (DEBUG_CH == 1)
89+
#define DEBUG_TX_PIN P401
90+
#define DEBUG_RX_PIN P402
91+
#endif
92+
#if (DEBUG_CH == 9)
93+
#define DEBUG_TX_PIN P203
94+
#define DEBUG_RX_PIN P202
95+
#endif
96+
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
97+
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
98+
#else
99+
#define DEBUG_TXSTR(s)
100+
#define DEBUG_TXCH(c)
101+
#endif
102+
103+
#endif /* PORTS_RA_RA4W1_HAL_H_ */

ports/renesas-ra/RA6M1_hal.h

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Renesas Electronics Corporation
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
#ifndef PORTS_RA_RA6M1_HAL_H_
26+
#define PORTS_RA_RA6M1_HAL_H_
27+
28+
#include <stdio.h>
29+
#include <stdint.h>
30+
#include <stdbool.h>
31+
// #include "hal_data.h"
32+
#include "bsp_api.h"
33+
#include "common_data.h"
34+
35+
#define SCI_CH 0
36+
#define SCI_BAUD 115200
37+
#define UART_CH SCI_CH
38+
#define UART_TxStr sci_tx_str
39+
#define PCLK 120000000
40+
41+
#define RA_PRI_SYSTICK (0)
42+
#define RA_PRI_UART (1)
43+
#define RA_PRI_SDIO (4)
44+
#define RA_PRI_DMA (5)
45+
#define RA_PRI_FLASH (6)
46+
#define RA_PRI_OTG_FS (6)
47+
#define RA_PRI_OTG_HS (6)
48+
#define RA_PRI_TIM5 (6)
49+
#define RA_PRI_CAN (7)
50+
#define RA_PRI_SPI (8)
51+
#define RA_PRI_I2C (8)
52+
#define RA_PRI_TIMX (13)
53+
#define RA_PRI_EXTINT (14)
54+
#define RA_PRI_PENDSV (15)
55+
#define RA_PRI_RTC_WKUP (15)
56+
57+
#include "ra_config.h"
58+
#include "ra_adc.h"
59+
#include "ra_flash.h"
60+
#include "ra_gpio.h"
61+
#include "ra_i2c.h"
62+
#include "ra_icu.h"
63+
#include "ra_init.h"
64+
#include "ra_int.h"
65+
#include "ra_rtc.h"
66+
#include "ra_sci.h"
67+
#include "ra_spi.h"
68+
#include "ra_timer.h"
69+
#include "ra_utils.h"
70+
71+
typedef enum {
72+
HAL_OK = 0x00,
73+
HAL_ERROR = 0x01,
74+
HAL_BUSY = 0x02,
75+
HAL_TIMEOUT = 0x03
76+
} HAL_StatusTypeDef;
77+
78+
#define __IO volatile
79+
80+
#if defined(USE_DBG_PRINT)
81+
#if !defined(DEBUG_CH)
82+
#define DEBUG_CH SCI_CH
83+
#endif
84+
#if (DEBUG_CH == 0)
85+
#define DEBUG_TX_PIN P411
86+
#define DEBUG_RX_PIN P410
87+
#endif
88+
#if (DEBUG_CH == 1)
89+
#define DEBUG_TX_PIN P401
90+
#define DEBUG_RX_PIN P402
91+
#endif
92+
#if (DEBUG_CH == 9)
93+
#define DEBUG_TX_PIN P203
94+
#define DEBUG_RX_PIN P202
95+
#endif
96+
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
97+
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
98+
#else
99+
#define DEBUG_TXSTR(s)
100+
#define DEBUG_TXCH(c)
101+
#endif
102+
103+
#endif /* PORTS_RA_RA6M1_HAL_H_ */

0 commit comments

Comments
 (0)