Skip to content

Commit 78e2f64

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 4937174 commit 78e2f64

Some content is hidden

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

54 files changed

+4985
-3
lines changed

lib/pico-sdk

Submodule pico-sdk updated 247 files

ports/renesas-ra/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ CMSIS_MCU_CAP = RA6M2
5151
USE_FSP_LPM = 1
5252
endif
5353

54+
ifeq ($(BOARD),VK_RA4W1)
55+
BOARD_LOW = vk_ra4w1
56+
CMSIS_MCU_LOW = ra4w1
57+
CMSIS_MCU_CAP = RA4W1
58+
USE_FSP_LPM = 1
59+
endif
60+
5461
# select use wrapper function of FSP library
5562
USE_FSP_FLASH = 1
5663

@@ -108,7 +115,11 @@ INC += -I$(BOARD_DIR)/ra_cfg/fsp_cfg/bsp
108115
INC += -Idebug
109116

110117
CFLAGS += -D$(CMSIS_MCU)
118+
ifeq ($(BOARD),VK_RA4W1)
119+
CFLAGS += -DRA_HAL_H='<VK_$(CMSIS_MCU)_hal.h>'
120+
else
111121
CFLAGS += -DRA_HAL_H='<$(CMSIS_MCU)_hal.h>'
122+
endif
112123

113124
# Basic Cortex-M flags
114125
CFLAGS_CORTEX_M = -mthumb
@@ -328,6 +339,11 @@ SRC_C += \
328339
$(BOARD_DIR)/src/hal_entry.c \
329340
$(wildcard $(BOARD_DIR)/*.c)
330341

342+
ifeq ($(BOARD),VK_RA4W1)
343+
SRC_C += \
344+
machine_dac.c
345+
endif
346+
331347
SRC_C += $(addprefix $(BOARD_DIR)/ra_gen/,\
332348
common_data.c \
333349
hal_data.c \
@@ -343,10 +359,12 @@ SRC_O += \
343359
SRC_O += \
344360
shared/runtime/gchelper_thumb2.o
345361

362+
ifneq ($(BOARD),VK_RA4W1)
346363
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/board/$(BOARD_LOW)/,\
347364
board_init.c \
348365
board_leds.c \
349366
)
367+
endif
350368

351369
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/fsp/src/bsp/mcu/all/,\
352370
bsp_clocks.c \
@@ -403,6 +421,13 @@ HAL_SRC_C += $(addprefix ra/,\
403421

404422
endif
405423

424+
ifeq ($(BOARD),VK_RA4W1)
425+
HAL_SRC_C += $(addprefix ra/,\
426+
ra_gpt.c \
427+
ra_dac.c \
428+
)
429+
endif
430+
406431
OBJ += $(PY_O)
407432
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
408433
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_ */

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