Skip to content

Commit 2ac4913

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 2ac4913

Some content is hidden

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

62 files changed

+5249
-163
lines changed

ports/renesas-ra/Makefile

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,16 @@ endif
1616
# If the build directory is not given, make it reflect the board name.
1717
BUILD ?= build-$(BOARD)
1818

19-
ifeq ($(BOARD),RA4M1_CLICKER)
20-
BOARD_LOW = ra4m1_ek
21-
CMSIS_MCU_LOW = ra4m1
22-
CMSIS_MCU_CAP = RA4M1
23-
USE_FSP_LPM = 0
24-
endif
25-
26-
ifeq ($(BOARD),RA4M1_EK)
27-
BOARD_LOW = ra4m1_ek
28-
CMSIS_MCU_LOW = ra4m1
29-
CMSIS_MCU_CAP = RA4M1
30-
USE_FSP_LPM = 0
31-
endif
32-
33-
ifeq ($(BOARD),RA4W1_EK)
34-
BOARD_LOW = ra4w1_ek
35-
CMSIS_MCU_LOW = ra4w1
36-
CMSIS_MCU_CAP = RA4W1
37-
USE_FSP_LPM = 1
38-
endif
39-
40-
ifeq ($(BOARD),RA6M1_EK)
41-
BOARD_LOW = ra6m1_ek
42-
CMSIS_MCU_LOW = ra6m1
43-
CMSIS_MCU_CAP = RA6M1
44-
USE_FSP_LPM = 1
45-
endif
46-
47-
ifeq ($(BOARD),RA6M2_EK)
48-
BOARD_LOW = ra6m2_ek
49-
CMSIS_MCU_LOW = ra6m2
50-
CMSIS_MCU_CAP = RA6M2
51-
USE_FSP_LPM = 1
52-
endif
53-
5419
# select use wrapper function of FSP library
5520
USE_FSP_FLASH = 1
5621

5722
include ../../py/mkenv.mk
5823
-include mpconfigport.mk
5924
include $(BOARD_DIR)/mpconfigboard.mk
6025

26+
USE_FSP_LPM ?= 1
27+
FSP_BOARD_NAME ?= $(shell echo $(BOARD) | tr '[:upper:]' '[:lower:]')
28+
6129
# Files that are generated and needed before the QSTR build.
6230
#QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h $(BUILD)/modstm_qstr.h
6331
QSTR_GENERATED_HEADERS = $(BUILD)/pins_qstr.h
@@ -109,6 +77,7 @@ INC += -Idebug
10977

11078
CFLAGS += -D$(CMSIS_MCU)
11179
CFLAGS += -DRA_HAL_H='<$(CMSIS_MCU)_hal.h>'
80+
CFLAGS += -DRA_CFG_H='<$(FSP_BOARD_NAME)_conf.h>'
11281

11382
# Basic Cortex-M flags
11483
CFLAGS_CORTEX_M = -mthumb
@@ -312,6 +281,7 @@ SRC_C += \
312281
gccollect.c \
313282
help.c \
314283
machine_adc.c \
284+
machine_dac.c \
315285
machine_i2c.c \
316286
machine_spi.c \
317287
machine_uart.c \
@@ -343,10 +313,13 @@ SRC_O += \
343313
SRC_O += \
344314
shared/runtime/gchelper_thumb2.o
345315

346-
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/board/$(BOARD_LOW)/,\
316+
FSP_BOARD_DIR = $(HAL_DIR)/ra/board/$(FSP_BOARD_NAME)
317+
ifneq ($(wildcard $(TOP)/$(FSP_BOARD_DIR)/.),)
318+
HAL_SRC_C += $(addprefix $(FSP_BOARD_DIR)/,\
347319
board_init.c \
348320
board_leds.c \
349321
)
322+
endif
350323

351324
HAL_SRC_C += $(addprefix $(HAL_DIR)/ra/fsp/src/bsp/mcu/all/,\
352325
bsp_clocks.c \
@@ -388,6 +361,7 @@ endif
388361
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2))
389362
HAL_SRC_C += $(addprefix ra/,\
390363
ra_adc.c \
364+
ra_dac.c \
391365
ra_flash.c \
392366
ra_gpio.c \
393367
ra_i2c.c \
@@ -398,6 +372,7 @@ HAL_SRC_C += $(addprefix ra/,\
398372
ra_sci.c \
399373
ra_spi.c \
400374
ra_timer.c \
375+
ra_gpt.c \
401376
ra_utils.c \
402377
)
403378

ports/renesas-ra/RA4M1_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA4W1_hal.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* The MIT License (MIT)
33
*
44
* Copyright (c) 2021 Renesas Electronics Corporation
5+
* Copyright (c) 2023 Vekatech Ltd.
56
*
67
* Permission is hereby granted, free of charge, to any person obtaining a copy
78
* of this software and associated documentation files (the "Software"), to deal
@@ -31,6 +32,9 @@
3132
// #include "hal_data.h"
3233
#include "bsp_api.h"
3334
#include "common_data.h"
35+
#if defined(USE_DBG_PRINT)
36+
#include RA_CFG_H
37+
#endif
3438

3539
#define SCI_CH 0
3640
#define SCI_BAUD 115200
@@ -56,8 +60,10 @@
5660

5761
#include "ra_config.h"
5862
#include "ra_adc.h"
63+
#include "ra_dac.h"
5964
#include "ra_flash.h"
6065
#include "ra_gpio.h"
66+
#include "ra_gpt.h"
6167
#include "ra_i2c.h"
6268
#include "ra_icu.h"
6369
#include "ra_init.h"
@@ -82,16 +88,16 @@ typedef enum {
8288
#define DEBUG_CH SCI_CH
8389
#endif
8490
#if (DEBUG_CH == 0)
85-
#define DEBUG_TX_PIN P411
86-
#define DEBUG_RX_PIN P410
91+
#define DEBUG_TX_PIN DBG_TX0
92+
#define DEBUG_RX_PIN DBG_RX0
8793
#endif
8894
#if (DEBUG_CH == 1)
89-
#define DEBUG_TX_PIN P401
90-
#define DEBUG_RX_PIN P402
95+
#define DEBUG_TX_PIN DBG_TX1
96+
#define DEBUG_RX_PIN DBG_RX1
9197
#endif
9298
#if (DEBUG_CH == 9)
93-
#define DEBUG_TX_PIN P203
94-
#define DEBUG_RX_PIN P202
99+
#define DEBUG_TX_PIN DBG_TX9
100+
#define DEBUG_RX_PIN DBG_RX9
95101
#endif
96102
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
97103
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)

ports/renesas-ra/RA6M1_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/RA6M2_hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656

5757
#include "ra_config.h"
5858
#include "ra_adc.h"
59+
#include "ra_dac.h"
5960
#include "ra_flash.h"
6061
#include "ra_gpio.h"
62+
#include "ra_gpt.h"
6163
#include "ra_i2c.h"
6264
#include "ra_icu.h"
6365
#include "ra_init.h"

ports/renesas-ra/boards/RA4M1_CLICKER/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_CLICKER/ra4m1_clicker.ld
44

55
# MicroPython settings
66
MICROPY_VFS_FAT = 1
7+
USE_FSP_LPM = 0
78

89
# Don't include default frozen modules because MCU is tight on flash space
910
FROZEN_MANIFEST ?= boards/RA4M1_CLICKER/manifest.py

ports/renesas-ra/boards/RA4M1_EK/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LD_FILES = boards/RA4M1_EK/ra4m1_ek.ld
44

55
# MicroPython settings
66
MICROPY_VFS_FAT = 1
7+
USE_FSP_LPM = 0
78

89
# Don't include default frozen modules because MCU is tight on flash space
910
FROZEN_MANIFEST ?= boards/RA4M1_EK/manifest.py

ports/renesas-ra/boards/RA4W1_EK/ra4w1_ek_conf.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,13 @@
2727

2828
#define DEBUG_CH 0
2929

30+
#define DBG_TX0 P411
31+
#define DBG_RX0 P410
32+
33+
#define DBG_TX1 P401
34+
#define DBG_RX1 P402
35+
36+
#define DBG_TX9 P203
37+
#define DBG_RX9 P202
38+
3039
#endif /* RA4M1_EK_CONF_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