8000 renesas-ra/boards/ARDUINO_PORTENTA_C33: Update WiFi config. · micropython/micropython@5c80990 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c80990

Browse files
iabdalkaderdpgeorge
authored andcommitted
renesas-ra/boards/ARDUINO_PORTENTA_C33: Update WiFi config.
Changes are: - Enable IRQ on WiFi data ready pin. - Fix WiFi SPI clock (an exact 30MHz is not possible). - Update WiFi pins. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 279e256 commit 5c80990

File tree

6 files changed

+44
-3
lines changed

6 files changed

+44
-3
lines changed

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/mpconfigboard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ void PORTENTA_C33_board_enter_bootloader(void);
9898
// WiFi config.
9999
#define MICROPY_HW_WIFI_SPI_ID (1)
100100
#define MICROPY_HW_WIFI_SPI_CS (pin_P104)
101-
#define MICROPY_HW_WIFI_SPI_BAUDRATE (30 * 1000 * 1000)
101+
#define MICROPY_HW_WIFI_SPI_BAUDRATE (25 * 1000 * 1000)
102102
#define MICROPY_HW_WIFI_DATAREADY (pin_P803)
103103
#define MICROPY_HW_WIFI_HANDSHAKE (pin_P806)
104+
#define MICROPY_HW_WIFI_IRQ_PIN (MICROPY_HW_WIFI_DATAREADY)
104105

105106
// ESP hosted control pins
106107
#define MICROPY_HW_ESP_HOSTED_RESET (pin_P804)

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra_gen/common_data.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
/* generated common source file - do not edit */
22
#include "common_data.h"
3+
icu_instance_ctrl_t g_external_irq1_ctrl;
4+
const external_irq_cfg_t g_external_irq1_cfg =
5+
{ .channel = 2,
6+
.trigger = EXTERNAL_IRQ_TRIG_RISING,
7+
.filter_enable = false,
8+
.pclk_div = EXTERNAL_IRQ_PCLK_DIV_BY_64,
9+
.p_callback = NULL,
10+
/** If NULL then do not add & */
11+
#if defined(NULL)
12+
.p_context = NULL,
13+
#else
14+
.p_context = &NULL,
15+
#endif
16+
.p_extend = NULL,
17+
.ipl = (12),
18+
#if defined(VECTOR_NUMBER_ICU_IRQ2)
19+
.irq = VECTOR_NUMBER_ICU_IRQ2,
20+
#else
21+
.irq = FSP_INVALID_VECTOR,
22+
#endif
23+
};
24+
/* Instance structure to use this module. */
25+
const external_irq_instance_t g_external_irq1 =
26+
{ .p_ctrl = &g_external_irq1_ctrl, .p_cfg = &g_external_irq1_cfg, .p_api = &g_external_irq_on_icu };
327
sce_instance_ctrl_t sce_ctrl;
428
const sce_cfg_t sce_cfg =
529
{ .lifecycle = SCE_SSD };

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra_gen/common_data.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
33
#define COMMON_DATA_H_
44
#include <stdint.h>
55
#include "bsp_api.h"
6-
#include "r_sce.h"
76
#include "r_icu.h"
87
#include "r_external_irq_api.h"
8+
#include "r_sce.h"
99
#include "r_ioport.h"
1010
#include "bsp_pin_cfg.h"
1111
FSP_HEADER
12+
/** External IRQ on ICU Instance. */
13+
extern const external_irq_instance_t g_external_irq1;
14+
15+
/** Access the ICU instance using these structures when calling API functions directly (::p_api is not used). */
16+
extern icu_instance_ctrl_t g_external_irq1_ctrl;
17+
extern const external_irq_cfg_t g_external_irq1_cfg;
18+
19+
#ifndef NULL
20+
void NULL(external_irq_callback_args_t *p_args);
21+
#endif
1222
extern sce_instance_ctrl_t sce_ctrl;
1323
extern const sce_cfg_t sce_cfg;
1424
/** External IRQ on ICU Instance. */

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra_gen/pin_data.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const ioport_pin_cfg_t g_bsp_pin_cfg_data[] =
3434
| (uint32_t)IOPORT_PERIPHERAL_SCI1_3_5_7_9) },
3535
{ .pin = BSP_IO_PORT_06_PIN_07, .pin_cfg = ((uint32_t)IOPORT_CFG_PERIPHERAL_PIN
3636
| (uint32_t)IOPORT_PERIPHERAL_SCI0_2_4_6_8) },
37+
{ .pin = BSP_IO_PORT_08_PIN_03, .pin_cfg = ((uint32_t)IOPORT_CFG_IRQ_ENABLE
38+
| (uint32_t)IOPORT_CFG_PORT_DIRECTION_INPUT) },
3739
{ .pin = BSP_IO_PORT_10_PIN_00, .pin_cfg = ((uint32_t)IOPORT_CFG_PERIPHERAL_PIN
3840
| (uint32_t)IOPORT_PERIPHERAL_SCI0_2_4_6_8) },
3941
};

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra_gen/vector_data.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ BSP_DONT_REMOVE const fsp_vector_t g_vector_table[BSP_ICU_VECTOR_MAX_ENTRIES] BS
3333
[26] = spi_txi_isr, /* SPI1 TXI (Transmit buffer empty) */
3434
[27] = spi_tei_isr, /* SPI1 TEI (Transmission complete event) */
3535
[28] = spi_eri_isr, /* SPI1 ERI (Error) */
36+
[29] = r_icu_isr, /* ICU IRQ2 (External pin interrupt 2) */
3637
};
3738
const bsp_interrupt_event_t g_interrupt_event_link_select[BSP_ICU_VECTOR_MAX_ENTRIES] =
3839
{
@@ -65,5 +66,6 @@ const bsp_interrupt_event_t g_interrupt_event_link_select[BSP_ICU_VECTOR_MAX_ENT
6566
[26] = BSP_PRV_IELS_ENUM(EVENT_SPI1_TXI), /* SPI1 TXI (Transmit buffer empty) */
6667
[27] = BSP_PRV_IELS_ENUM(EVENT_SPI1_TEI), /* SPI1 TEI (Transmission complete event) */
6768
[28] = BSP_PRV_IELS_ENUM(EVENT_SPI1_ERI), /* SPI1 ERI (Error) */
69+
[29] = BSP_PRV_IELS_ENUM(EVENT_ICU_IRQ2), /* ICU IRQ2 (External pin interrupt 2) */
6870
};
6971
#endif

ports/renesas-ra/boards/ARDUINO_PORTENTA_C33/ra_gen/vector_data.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C" {
66
#endif
77
/* Number of interrupts allocated */
88
#ifndef VECTOR_DATA_IRQ_COUNT
9-
#define VECTOR_DATA_IRQ_COUNT (29)
9+
#define VECTOR_DATA_IRQ_COUNT (30)
1010
#endif
1111
/* ISR prototypes */
1212
void sci_uart_rxi_isr(void);
@@ -92,6 +92,8 @@ void spi_eri_isr(void);
9292
#define SPI1_TEI_IRQn ((IRQn_Type)27) /* SPI1 TEI (Transmission complete event) */
9393
#define VECTOR_NUMBER_SPI1_ERI ((IRQn_Type)28) /* SPI1 ERI (Error) */
9494
#define SPI1_ERI_IRQn ((IRQn_Type)28) /* SPI1 ERI (Error) */
95+
#define VECTOR_NUMBER_ICU_IRQ2 ((IRQn_Type)29) /* ICU IRQ2 (External pin interrupt 2) */
96+
#define ICU_IRQ2_IRQn ((IRQn_Type)29) /* ICU IRQ2 (External pin interrupt 2) */
9597
#ifdef __cplusplus
9698
}
9799
#endif

0 commit comments

Comments
 (0)
0