Skip to content

add uart callback function config option #8591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 94 additions & 1 deletion bsp/renesas/ra6m3-hmi-board/ra_gen/hal_data.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,103 @@
/* generated HAL source file - do not edit */
#include "hal_data.h"

sci_uart_instance_ctrl_t g_uart4_ctrl;
baud_setting_t g_uart4_baud_setting =
{
/* Baud rate calculated with 0.160% error. */
.abcse = 0,
.abcs = 0,
.bgdm = 1,
.cks = 0,
.brr = 64,
.mddr = (uint8_t) 256,
.brme = false
};

/** UART extended configuration for UARTonSCI HAL driver */
const sci_uart_extended_cfg_t g_uart4_cfg_extend =
{
.clock = SCI_UART_CLOCK_INT,
.rx_edge_start = SCI_UART_START_BIT_FALLING_EDGE,
.noise_cancel = SCI_UART_NOISE_CANCELLATION_DISABLE,
.rx_fifo_trigger = SCI_UART_RX_FIFO_TRIGGER_MAX,
.p_baud_setting = &g_uart4_baud_setting,
.flow_control = SCI_UART_FLOW_CONTROL_RTS,
#if 0xFF != 0xFF
.flow_control_pin = BSP_IO_PORT_FF_PIN_0xFF,
#else
.flow_control_pin = (bsp_io_port_pin_t) UINT16_MAX,
#endif
};

/** UART interface configuration */
const uart_cfg_t g_uart4_cfg =
{
.channel = 16,
.data_bits = UART_DATA_BITS_8,
.parity = UART_PARITY_OFF,
.stop_bits = UART_STOP_BITS_1,
.p_callback = user_uart4_callback,
.p_context = NULL,
.p_extend = &g_uart4_cfg_extend,
#define RA_NOT_DEFINED (1)
#if (RA_NOT_DEFINED == RA_NOT_DEFINED)
.p_transfer_tx = NULL,
#else
.p_transfer_tx = &RA_NOT_DEFINED,
#endif
#if (RA_NOT_DEFINED == RA_NOT_DEFINED)
.p_transfer_rx = NULL,
#else
.p_transfer_rx = &RA_NOT_DEFINED,
#endif
#undef RA_NOT_DEFINED
.rxi_ipl = (12),
.txi_ipl = (12),
.tei_ipl = (12),
.eri_ipl = (12),
#if defined(VECTOR_NUMBER_SCI16_RXI)
.rxi_irq = VECTOR_NUMBER_SCI16_RXI,
#else
.rxi_irq = FSP_INVALID_VECTOR,
#endif
#if defined(VECTOR_NUMBER_SCI16_TXI)
.txi_irq = VECTOR_NUMBER_SCI16_TXI,
#else
.txi_irq = FSP_INVALID_VECTOR,
#endif
#if defined(VECTOR_NUMBER_SCI16_TEI)
.tei_irq = VECTOR_NUMBER_SCI16_TEI,
#else
.tei_irq = FSP_INVALID_VECTOR,
#endif
#if defined(VECTOR_NUMBER_SCI16_ERI)
.eri_irq = VECTOR_NUMBER_SCI16_ERI,
#else
.eri_irq = FSP_INVALID_VECTOR,
#endif
};

/* Instance structure to use this module. */
const uart_instance_t g_uart4 =
{
.p_ctrl = &g_uart4_ctrl,
.p_cfg = &g_uart4_cfg,
.p_api = &g_uart_on_sci
};

sci_uart_instance_ctrl_t g_uart9_ctrl;

baud_setting_t g_uart9_baud_setting =
{
/* Baud rate calculated with 0.160% error. */ .abcse = 0, .abcs = 0, .bgdm = 1, .cks = 0, .brr = 64, .mddr = (uint8_t) 256, .brme = false
/* Baud rate calculated with 0.160% error. */
.abcse = 0,
.abcs = 0,
.bgdm = 1,
.cks = 0,
.brr = 64,
.mddr = (uint8_t) 256,
.brme = false
};

/** UART extended configuration for UARTonSCI HAL driver */
Expand Down
37 changes: 37 additions & 0 deletions bsp/renesas/ra6m3-hmi-board/ra_gen/hal_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,46 @@ FSP_HEADER
extern const uart_cfg_t g_uart9_cfg;
extern const sci_uart_extended_cfg_t g_uart9_cfg_extend;

#ifndef user_uart0_callback
void user_uart0_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart1_callback
void user_uart1_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart2_callback
void user_uart2_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart3_callback
void user_uart3_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart4_callback
void user_uart4_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart5_callback
void user_uart5_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart6_callback
void user_uart6_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart7_callback
void user_uart7_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart8_callback
void user_uart8_callback(uart_callback_args_t * p_args);
#endif

#ifndef user_uart9_callback
void user_uart9_callback(uart_callback_args_t * p_args);
#endif

void hal_entry(void);
void g_hal_init(void);
FSP_FOOTER
Expand Down