Skip to content

Commit 6803e22

Browse files
committed
ports/renesas-ra/boards/VK-RA4W1: New board.
ports/renesas-ra/boards: Integration to the existing RA4W1 processor. ports/renesas-ra: Integration to the existing RA family. ports/renesas-ra/ra: PWM & DAC support only for the VK-RA4W1. Signed-off-by: mbedNoobNinja <novoltage@gmail.com>
1 parent 67fac4e commit 6803e22

Some content is hidden

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

52 files changed

+4974
-1
lines changed

lib/micropython-lib

Submodule micropython-lib updated 40 files

ports/renesas-ra/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ CMSIS_MCU_CAP = RA6M2
4545
USE_FSP_LPM = 1
4646
endif
4747

48+
ifeq ($(BOARD),VK_RA4W1)
49+
BOARD_LOW = vk_ra4w1
50+
CMSIS_MCU_LOW = ra4w1
51+
CMSIS_MCU_CAP = RA4W1
52+
USE_FSP_LPM = 1
53+
endif
54+
4855
# select use wrapper function of FSP library
4956
USE_FSP_FLASH = 1
5057

@@ -102,7 +109,11 @@ INC += -I$(BOARD_DIR)/ra_cfg/fsp_cfg/bsp
102109
INC += -Idebug
103110

104111
CFLAGS += -D$(CMSIS_MCU)
112+
ifeq ($(BOARD),VK_RA4W1)
113+
CFLAGS += -DRA_HAL_H='<VK_$(CMSIS_MCU)_hal.h>'
114+
else
105115
CFLAGS += -DRA_HAL_H='<$(CMSIS_MCU)_hal.h>'
116+
endif
106117

107118
# Basic Cortex-M flags
108119
CFLAGS_CORTEX_M = -mthumb
@@ -322,6 +333,11 @@ SRC_C += \
322333
$(BOARD_DIR)/src/hal_entry.c \
323334
$(wildcard $(BOARD_DIR)/*.c)
324335

336+
ifeq ($(BOARD),VK_RA4W1)
337+
SRC_C += \
338+
machine_dac.c
339+
endif
340+
325341
SRC_C += $(addprefix $(BOARD_DIR)/ra_gen/,\
326342
common_data.c \
327343
hal_data.c \
@@ -337,10 +353,12 @@ SRC_O += \
337353
SRC_O += \
338354
shared/runtime/gchelper_m3.o
339355

356+
ifneq ($(BOARD),VK_RA4W1)
340357
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/board/$(BOARD_LOW)/,\
341358
board_init.c \
342359
board_leds.c \
343360
)
361+
endif
344362

345363
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/fsp/src/bsp/mcu/all/,\
346364
bsp_clocks.c \
@@ -397,6 +415,13 @@ HAL_SRC_C += $(addprefix ra/,\
397415

398416
endif
399417

418+
ifeq ($(BOARD),VK_RA4W1)
419+
HAL_SRC_C += $(addprefix ra/,\
420+
ra_gpt.c \
421+
ra_dac.c \
422+
)
423+
endif
424+
400425
OBJ += $(PY_O)
401426
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
402427
OBJ += $(LIBM_O)

ports/renesas-ra/VK_RA4W1_hal.h

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

ports/renesas-ra/boards/VK_RA4W1/.cproject

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy