Skip to content

Commit f9b3e54

Browse files
committed
ports/renesas-ra/boards/VK-RA6M3: New Board.
ports/renesas-ra/boards: New processor RA6M3. ports/renesas-ra: Integration to the existing RA family. Signed-off-by: mbedNoobNinja <novoltage@gmail.com>
1 parent cfcce4b commit f9b3e54

Some content is hidden

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

45 files changed

+4175
-5
lines changed

ports/renesas-ra/Makefile

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ include $(BOARD_DIR)/mpconfigboard.mk
2525

2626
USE_FSP_LPM ?= 1
2727
USE_FSP_QSPI ?= 0
28+
USE_FSP_SDHI ?= 0
29+
USE_FSP_ETH ?= 0
30+
USE_FSP_SCE ?= 0
2831
FSP_BOARD_NAME ?= $(shell echo $(BOARD) | tr '[:upper:]' '[:lower:]')
2932

3033
# Files that are generated and needed before the QSTR build.
@@ -68,9 +71,22 @@ INC += -I$(TOP)/$(HAL_DIR)
6871
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/inc
6972
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/inc/api
7073
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/inc/instances
74+
ifeq ($(CMSIS_MCU),RA6M3)
75+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/private/inc
76+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/public/inc
77+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive
78+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce/common
79+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce
80+
endif
81+
ifeq ($(CMSIS_MCU),RA6M5)
82+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce7/inc/api
83+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce7/inc/instances
84+
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce7/private/inc
85+
endif
7186
INC += -I$(TOP)/$(HAL_DIR)/ra/fsp/src/bsp/cmsis/Device/RENESAS/Include
72-
#INC += -Ilwip_inc
73-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M5))
87+
INC += -Ilwip_inc
88+
INC += -Imbedtls
89+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M3 RA6M5))
7490
INC += -Ira
7591
endif
7692
INC += -I$(BOARD_DIR)/ra_gen
@@ -104,6 +120,7 @@ CFLAGS_MCU_RA4M1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
104120
CFLAGS_MCU_RA4W1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
105121
CFLAGS_MCU_RA6M1 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
106122
CFLAGS_MCU_RA6M2 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
123+
CFLAGS_MCU_RA6M3 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4
107124
CFLAGS_MCU_RA6M5 = $(CFLAGS_CORTEX_M) -mtune=cortex-m33 -mcpu=cortex-m33
108125

109126
ASFLAGS += $(CFLAGS_CORTEX_M) -mcpu=cortex-$(MCU_SERIES)
@@ -279,6 +296,7 @@ SRC_C += \
279296
ra_hal.c \
280297
ra_it.c \
281298
mphalport.c \
299+
mpnetworkport.c \
282300
mpthreadport.c \
283301
irq.c \
284302
pendsv.c \
@@ -301,6 +319,9 @@ SRC_C += \
301319
machine_rtc.c \
302320
machine_sdcard.c \
303321
modmachine.c \
322+
network_lan.c \
323+
eth.c \
324+
rng.c \
304325
extint.c \
305326
usrsw.c \
306327
flash.c \
@@ -356,6 +377,61 @@ HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_sdhi/r_sdhi.c \
356377
$(HAL_DIR)/ra/fsp/src/r_dtc/r_dtc.c
357378
endif
358379

380+
ifeq ($(USE_FSP_ETH), 1)
381+
CFLAGS += -DUSE_FSP_ETH
382+
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_ether_phy/targets/ICS1894/r_ether_phy_target_ics1894.c \
383+
$(HAL_DIR)/ra/fsp/src/r_ether_phy/r_ether_phy.c \
384+
$(HAL_DIR)/ra/fsp/src/r_ether/r_ether.c
385+
endif
386+
387+
ifeq ($(USE_FSP_SCE), 1)
388+
CFLAGS += -DUSE_FSP_SCE
389+
ifeq ($(CMSIS_MCU),RA6M3)
390+
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/adaptors/r_sce_adapt.c \
391+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_p00.c \
392+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_p01.c \
393+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_p02.c \
394+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_p20.c \
395+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func050.c \
396+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func051.c \
397+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func052.c \
398+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func053.c \
399+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func054.c \
400+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func100.c \
401+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func101.c \
402+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func102.c \
403+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_func103.c \
404+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_subprc01.c \
405+
$(HAL_DIR)/ra/fsp/src/r_sce/crypto_procedures/src/sce7/plainkey/primitive/hw_sce_p_subprc02.c
406+
endif
407+
ifeq ($(CMSIS_MCU),RA6M5)
408+
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/public/r_sce.c \
409+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/public/r_sce_aes.c \
410+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/public/r_sce_sha.c \
411+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/public/r_sce_ecc.c \
412+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/private/r_sce_private.c \
413+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p00.c \
414+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p20.c \
415+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p26.c \
416+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p40.c \
417+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p81.c \
418+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p82.c \
419+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_p92.c \
420+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func040.c \
421+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func048.c \
422+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func050.c \
423+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func051.c \
424+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func052.c \
425+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func053.c \
426+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func054.c \
427+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func100.c \
428+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func101.c \
429+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func102.c \
430+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_func103.c \
431+
$(HAL_DIR)/ra/fsp/src/r_sce_protected/crypto_procedures_protected/src/sce9/primitive/r_sce_subprc01.c
432+
endif
433+
endif
434+
359435
ifeq ($(USE_FSP_LPM), 1)
360436
CFLAGS += -DUSE_FSP_LPM
361437
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_lpm/r_lpm.c
@@ -368,14 +444,14 @@ HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_flash_lp/r_flash_lp.c
368444
endif
369445
endif
370446

371-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M1 RA6M2 RA6M5))
447+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M1 RA6M2 RA6M3 RA6M5))
372448
ifeq ($(USE_FSP_FLASH), 1)
373449
CFLAGS += -DUSE_FSP_FLASH
374450
HAL_SRC_C += $(HAL_DIR)/ra/fsp/src/r_flash_hp/r_flash_hp.c
375451
endif
376452
endif
377453

378-
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M5))
454+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA4M1 RA4W1 RA6M1 RA6M2 RA6M3 RA6M5))
379455
HAL_SRC_C += $(addprefix ra/,\
380456
ra_adc.c \
381457
ra_dac.c \
@@ -392,7 +468,10 @@ HAL_SRC_C += $(addprefix ra/,\
392468
ra_gpt.c \
393469
ra_utils.c \
394470
)
471+
endif
395472

473+
ifeq ($(MICROPY_SSL_MBEDTLS),1)
474+
LIB_SRC_C += mbedtls/mbedtls_port.c
396475
endif
397476

398477
OBJ += $(PY_O)
@@ -485,6 +564,9 @@ endif
485564
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M2))
486565
AF_FILE = boards/ra6m2_af.csv
487566
endif
567+
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M3))
568+
AF_FILE = boards/ra6m3_af.csv
569+
endif
488570
ifeq ($(CMSIS_MCU),$(filter $(CMSIS_MCU),RA6M5))
489571
AF_FILE = boards/ra6m5_af.csv
490572
endif

ports/renesas-ra/RA6M3_hal.h

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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_RA6M3_HAL_H_
27+
#define PORTS_RA_RA6M3_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+
#if defined(USE_DBG_PRINT)
36+
#include RA_CFG_H
37+
#endif
38+
39+
#define SCI_CH DEFAULT_DBG_CH
40+
#define SCI_BAUD 115200
41+
#define UART_CH SCI_CH
42+
#define UART_TxStr sci_tx_str
43+
#define PCLK 120000000
44+
45+
#define RA_PRI_SYSTICK (0)
46+
#define RA_PRI_UART (1)
47+
#define RA_PRI_SDIO (4)
48+
#define RA_PRI_DMA (5)
49+
#define RA_PRI_FLASH (6)
50+
#define RA_PRI_OTG_FS (6)
51+
#define RA_PRI_OTG_HS (6)
52+
#define RA_PRI_TIM5 (6)
53+
#define RA_PRI_CAN (7)
54+
#define RA_PRI_SPI (8)
55+
#define RA_PRI_I2C (8)
56+
#define RA_PRI_TIMX (13)
57+
#define RA_PRI_EXTINT (14)
58+
#define RA_PRI_PENDSV (15)
59+
#define RA_PRI_RTC_WKUP (15)
60+
61+
#include "ra_config.h"
62+
#include "ra_adc.h"
63+
#include "ra_dac.h"
64+
#include "ra_flash.h"
65+
#include "ra_gpio.h"
66+
#include "ra_gpt.h"
67+
#include "ra_i2c.h"
68+
#include "ra_icu.h"
69+
#include "ra_init.h"
70+
#include "ra_int.h"
71+
#include "ra_rtc.h"
72+
#include "ra_sci.h"
73+
#include "ra_spi.h"
74+
#include "ra_timer.h"
75+
#include "ra_utils.h"
76+
77+
typedef enum {
78+
HAL_OK = 0x00,
79+
HAL_ERROR = 0x01,
80+
HAL_BUSY = 0x02,
81+
HAL_TIMEOUT = 0x03
82+
} HAL_StatusTypeDef;
83+
84+
#define __IO volatile
85+
86+
#if defined(USE_DBG_PRINT)
87+
#if !defined(DEBUG_CH)
88+
#define DEBUG_CH SCI_CH
89+
#endif
90+
#if (DEBUG_CH == 7)
91+
#define DEBUG_TX_PIN P613
92+
#define DEBUG_RX_PIN P614
93+
#endif
94+
#if (DEBUG_CH == 8)
95+
#define DEBUG_TX_PIN P105
96+
#define DEBUG_RX_PIN P104
97+
#endif
98+
#if (DEBUG_CH == 9)
99+
#define DEBUG_TX_PIN P109
100+
#define DEBUG_RX_PIN P110
101+
#endif
102+
#define DEBUG_TXSTR(s) ra_sci_tx_str(DEBUG_CH, (unsigned char *)s)
103+
#define DEBUG_TXCH(c) ra_sci_tx_ch(DEBUG_CH, c)
104+
#else
105+
#define DEBUG_TXSTR(s)
106+
#define DEBUG_TXCH(c)
107+
#endif
108+
109+
#endif /* PORTS_RA_RA6M3_HAL_H_ */
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
In case you need to debug something in `VK_RA6M3` board, make sure the contents of
2+
[project repo](https://github.com/Vekatech/VK_RA6M3) is cloned in to **this** directory.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"deploy": [
3+
"../deploy.md"
4+
],
5+
"docs": "https://vekatech.com/VK-RA6M3_docs/brochures/VK-RA6M3%20Flyer%20R2.pdf",
6+
"features": [
7+
"UART",
8+
"SPI",
9+
"I2C",
10+
"ADC",
11+
"DAC",
12+
"PWM",
13+
"SDCard",
14+
"Ethernet"
15+
],
16+
"id": "VK-RA6M3",
17+
"images": [
18+
"VK-RA6M3.jpg"
19+
],
20+
"mcu": "RA6M3",
21+
"product": "VK-RA6M3",
22+
"thumbnail": "",
23+
"url": "https://vekatech.com",
24+
"vendor": "Vekatech"
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
# Networking
3+
require("bundle-networking")
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// MCU config
2+
#define MICROPY_HW_BOARD_NAME "VK-RA6M3"
3+
#define MICROPY_HW_MCU_NAME "RA6M3"
4+
#define MICROPY_HW_MCU_SYSCLK 120000000
5+
#define MICROPY_HW_MCU_PCLK 120000000
6+
7+
// module config
8+
#define MICROPY_EMIT_THUMB (1)
9+
#define MICROPY_EMIT_INLINE_THUMB (1)
10+
#define MICROPY_PY_BUILTINS_COMPLEX (1)
11+
#define MICROPY_PY_GENERATOR_PEND_THROW (1)
12+
#define MICROPY_PY_MATH (1)
13+
#define MICROPY_PY_UHEAPQ (1)
14+
#define MICROPY_PY_UTIMEQ (1)
15+
#define MICROPY_PY_THREAD (0) // disable ARM_THUMB_FP using vldr due to RA has single float only
16+
17+
// peripheral config
18+
#define MICROPY_HW_ENABLE_RTC (1)
19+
#define MICROPY_HW_RTC_SOURCE (1) // 0: subclock
20+
#define MICROPY_HW_ENABLE_ADC (1)
21+
#define MICROPY_HW_HAS_FLASH (1)
22+
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (1)
23+
#define MICROPY_HW_HAS_QSPI_FLASH (1)
24+
#define MICROPY_HW_HAS_SDHI_CARD (1)
25+
26+
// board config
27+
28+
// UART
29+
#define MICROPY_HW_UART7_TX (pin_P613) // D1
30+
#define MICROPY_HW_UART7_RX (pin_P614) // D0
31+
#define MICROPY_HW_UART8_TX (pin_P105) // Modbus (RS485)
32+
#define MICROPY_HW_UART8_RX (pin_P104) // Modbus (RS485)
33+
#define MICROPY_HW_UART9_TX (pin_P109) // REPL
34+
#define MICROPY_HW_UART9_RX (pin_P110) // REPL
35+
#define MICROPY_HW_UART_REPL HW_UART_9
36+
#define MICROPY_HW_UART_REPL_BAUD 115200
37+
38+
// I2C
39+
#define MICROPY_HW_I2C1_SCL (pin_P205)
40+
#define MICROPY_HW_I2C1_SDA (pin_P206)
41+
42+
// SPI
43+
#define MICROPY_HW_SPI1_SSL (pin_P301) // D10
44+
#define MICROPY_HW_SPI1_RSPCK (pin_P204) // D13
45+
#define MICROPY_HW_SPI1_MISO (pin_P202) // D12
46+
#define MICROPY_HW_SPI1_MOSI (pin_P203) // D11
47+
48+
// PWM
49+
// #define MICROPY_HW_PWM_8A (pin_P107) // D7
50+
#define MICROPY_HW_PWM_8A (pin_P605) // LED_B
51+
#define MICROPY_HW_PWM_2A (pin_P113) // D4
52+
#define MICROPY_HW_PWM_2B (pin_P114) // D5
53+
#define MICROPY_HW_PWM_4A (pin_P115) // D6
54+
// #define MICROPY_HW_PWM_4A (pin_P302) // D9
55+
#define MICROPY_HW_PWM_5B (pin_P202) // D12
56+
#define MICROPY_HW_PWM_5A (pin_P203) // D11
57+
// #define MICROPY_HW_PWM_4B (pin_P204) // D13
58+
// #define MICROPY_HW_PWM_4B (pin_P301) // D10
59+
#define MICROPY_HW_PWM_4B (pin_P608) // LED_Y
60+
#define MICROPY_HW_PWM_7B (pin_P303) // D8
61+
// #define MICROPY_HW_PWM_7B (pin_P602) // PN4_3
62+
// #define MICROPY_HW_PWM_7A (pin_P304) // PN4_8
63+
#define MICROPY_HW_PWM_7A (pin_P603) // LED_R
64+
#define MICROPY_HW_PWM_6B (pin_P600) // PN4_4
65+
#define MICROPY_HW_PWM_6A (pin_P601) // LED_G
66+
#define MICROPY_HW_PWM_8B (pin_P604) // PN4_2
67+
68+
// DAC
69+
#define MICROPY_HW_DAC0 (pin_P014) // A4
70+
#define MICROPY_HW_DAC1 (pin_P015) // A5
71+
72+
// Switch
73+
#define MICROPY_HW_HAS_SWITCH (1)
74+
#define MICROPY_HW_USRSW_PIN (pin_P008)
75+
// #define MICROPY_HW_USRSW_PIN (pin_P009)
76+
#define MICROPY_HW_USRSW_PULL (MP_HAL_PIN_PULL_NONE)
77+
#define MICROPY_HW_USRSW_EXTI_MODE (MP_HAL_PIN_TRIGGER_FALLING)
78+
#define MICROPY_HW_USRSW_PRESSED (0)
79+
80+
// LEDs
81+
#define MICROPY_HW_LED1 (pin_P603)
82+
#define MICROPY_HW_LED2 (pin_P601)
83+
#define MICROPY_HW_LED3 (pin_P605)
84+
#define MICROPY_HW_LED4 (pin_P608)
85+
#define MICROPY_HW_LED_ON(pin) mp_hal_pin_high(pin)
86+
#define MICROPY_HW_LED_OFF(pin) mp_hal_pin_low(pin)
87+
#define MICROPY_HW_LED_TOGGLE(pin) mp_hal_pin_toggle(pin)

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