xref: /btstack/port/renesas-ek-ra6m4a-da14531/e2-project/ra_gen/hal_data.c (revision c30869498fb8e98c1408c9db0e7624f02f483b73)
1*c3086949SMatthias Ringwald /* generated HAL source file - do not edit */
2*c3086949SMatthias Ringwald #include "hal_data.h"
3*c3086949SMatthias Ringwald 
4*c3086949SMatthias Ringwald flash_hp_instance_ctrl_t g_flash0_ctrl;
5*c3086949SMatthias Ringwald const flash_cfg_t g_flash0_cfg =
6*c3086949SMatthias Ringwald { .data_flash_bgo = false, .p_callback = NULL, .p_context = NULL,
7*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_FCU_FRDYI)
8*c3086949SMatthias Ringwald     .irq                 = VECTOR_NUMBER_FCU_FRDYI,
9*c3086949SMatthias Ringwald #else
10*c3086949SMatthias Ringwald   .irq = FSP_INVALID_VECTOR,
11*c3086949SMatthias Ringwald #endif
12*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_FCU_FIFERR)
13*c3086949SMatthias Ringwald     .err_irq             = VECTOR_NUMBER_FCU_FIFERR,
14*c3086949SMatthias Ringwald #else
15*c3086949SMatthias Ringwald   .err_irq = FSP_INVALID_VECTOR,
16*c3086949SMatthias Ringwald #endif
17*c3086949SMatthias Ringwald   .err_ipl = (BSP_IRQ_DISABLED),
18*c3086949SMatthias Ringwald   .ipl = (BSP_IRQ_DISABLED), };
19*c3086949SMatthias Ringwald /* Instance structure to use this module. */
20*c3086949SMatthias Ringwald const flash_instance_t g_flash0 =
21*c3086949SMatthias Ringwald { .p_ctrl = &g_flash0_ctrl, .p_cfg = &g_flash0_cfg, .p_api = &g_flash_on_flash_hp };
22*c3086949SMatthias Ringwald gpt_instance_ctrl_t g_timer0_ctrl;
23*c3086949SMatthias Ringwald #if 0
24*c3086949SMatthias Ringwald const gpt_extended_pwm_cfg_t g_timer0_pwm_extend =
25*c3086949SMatthias Ringwald {
26*c3086949SMatthias Ringwald     .trough_ipl          = (BSP_IRQ_DISABLED),
27*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_GPT0_COUNTER_UNDERFLOW)
28*c3086949SMatthias Ringwald     .trough_irq          = VECTOR_NUMBER_GPT0_COUNTER_UNDERFLOW,
29*c3086949SMatthias Ringwald #else
30*c3086949SMatthias Ringwald     .trough_irq          = FSP_INVALID_VECTOR,
31*c3086949SMatthias Ringwald #endif
32*c3086949SMatthias Ringwald     .poeg_link           = GPT_POEG_LINK_POEG0,
33*c3086949SMatthias Ringwald     .output_disable      =  GPT_OUTPUT_DISABLE_NONE,
34*c3086949SMatthias Ringwald     .adc_trigger         =  GPT_ADC_TRIGGER_NONE,
35*c3086949SMatthias Ringwald     .dead_time_count_up  = 0,
36*c3086949SMatthias Ringwald     .dead_time_count_down = 0,
37*c3086949SMatthias Ringwald     .adc_a_compare_match = 0,
38*c3086949SMatthias Ringwald     .adc_b_compare_match = 0,
39*c3086949SMatthias Ringwald     .interrupt_skip_source = GPT_INTERRUPT_SKIP_SOURCE_NONE,
40*c3086949SMatthias Ringwald     .interrupt_skip_count  = GPT_INTERRUPT_SKIP_COUNT_0,
41*c3086949SMatthias Ringwald     .interrupt_skip_adc    = GPT_INTERRUPT_SKIP_ADC_NONE,
42*c3086949SMatthias Ringwald     .gtioca_disable_setting = GPT_GTIOC_DISABLE_PROHIBITED,
43*c3086949SMatthias Ringwald     .gtiocb_disable_setting = GPT_GTIOC_DISABLE_PROHIBITED,
44*c3086949SMatthias Ringwald };
45*c3086949SMatthias Ringwald #endif
46*c3086949SMatthias Ringwald const gpt_extended_cfg_t g_timer0_extend =
47*c3086949SMatthias Ringwald         { .gtioca =
48*c3086949SMatthias Ringwald         { .output_enabled = false, .stop_level = GPT_PIN_LEVEL_LOW },
49*c3086949SMatthias Ringwald           .gtiocb =
50*c3086949SMatthias Ringwald           { .output_enabled = false, .stop_level = GPT_PIN_LEVEL_LOW },
51*c3086949SMatthias Ringwald           .start_source = (gpt_source_t) (GPT_SOURCE_NONE), .stop_source = (gpt_source_t) (GPT_SOURCE_NONE), .clear_source =
52*c3086949SMatthias Ringwald                   (gpt_source_t) (GPT_SOURCE_NONE),
53*c3086949SMatthias Ringwald           .count_up_source = (gpt_source_t) (GPT_SOURCE_NONE), .count_down_source = (gpt_source_t) (GPT_SOURCE_NONE), .capture_a_source =
54*c3086949SMatthias Ringwald                   (gpt_source_t) (GPT_SOURCE_NONE),
55*c3086949SMatthias Ringwald           .capture_b_source = (gpt_source_t) (GPT_SOURCE_NONE), .capture_a_ipl = (BSP_IRQ_DISABLED), .capture_b_ipl =
56*c3086949SMatthias Ringwald                   (BSP_IRQ_DISABLED),
57*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_GPT0_CAPTURE_COMPARE_A)
58*c3086949SMatthias Ringwald     .capture_a_irq       = VECTOR_NUMBER_GPT0_CAPTURE_COMPARE_A,
59*c3086949SMatthias Ringwald #else
60*c3086949SMatthias Ringwald           .capture_a_irq = FSP_INVALID_VECTOR,
61*c3086949SMatthias Ringwald #endif
62*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_GPT0_CAPTURE_COMPARE_B)
63*c3086949SMatthias Ringwald     .capture_b_irq       = VECTOR_NUMBER_GPT0_CAPTURE_COMPARE_B,
64*c3086949SMatthias Ringwald #else
65*c3086949SMatthias Ringwald           .capture_b_irq = FSP_INVALID_VECTOR,
66*c3086949SMatthias Ringwald #endif
67*c3086949SMatthias Ringwald           .capture_filter_gtioca = GPT_CAPTURE_FILTER_NONE,
68*c3086949SMatthias Ringwald           .capture_filter_gtiocb = GPT_CAPTURE_FILTER_NONE,
69*c3086949SMatthias Ringwald #if 0
70*c3086949SMatthias Ringwald     .p_pwm_cfg                   = &g_timer0_pwm_extend,
71*c3086949SMatthias Ringwald #else
72*c3086949SMatthias Ringwald           .p_pwm_cfg = NULL,
73*c3086949SMatthias Ringwald #endif
74*c3086949SMatthias Ringwald #if 0
75*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.gtioa  = (0U << 4U) | (0U << 2U) | (0U << 0U),
76*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.oadflt = (uint32_t) GPT_PIN_LEVEL_LOW,
77*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.oahld  = 0U,
78*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.oae    = (uint32_t) false,
79*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.oadf   = (uint32_t) GPT_GTIOC_DISABLE_PROHIBITED,
80*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.nfaen  = ((uint32_t) GPT_CAPTURE_FILTER_NONE & 1U),
81*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.nfcsa  = ((uint32_t) GPT_CAPTURE_FILTER_NONE >> 1U),
82*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.gtiob  = (0U << 4U) | (0U << 2U) | (0U << 0U),
83*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.obdflt = (uint32_t) GPT_PIN_LEVEL_LOW,
84*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.obhld  = 0U,
85*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.obe    = (uint32_t) false,
86*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.obdf   = (uint32_t) GPT_GTIOC_DISABLE_PROHIBITED,
87*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.nfben  = ((uint32_t) GPT_CAPTURE_FILTER_NONE & 1U),
88*c3086949SMatthias Ringwald     .gtior_setting.gtior_b.nfcsb  = ((uint32_t) GPT_CAPTURE_FILTER_NONE >> 1U),
89*c3086949SMatthias Ringwald #else
90*c3086949SMatthias Ringwald           .gtior_setting.gtior = 0U,
91*c3086949SMatthias Ringwald #endif
92*c3086949SMatthias Ringwald         };
93*c3086949SMatthias Ringwald const timer_cfg_t g_timer0_cfg =
94*c3086949SMatthias Ringwald { .mode = TIMER_MODE_PERIODIC,
95*c3086949SMatthias Ringwald /* Actual period: 0.001 seconds. Actual duty: 50%. */.period_counts = (uint32_t) 0x186a0,
96*c3086949SMatthias Ringwald   .duty_cycle_counts = 0xc350, .source_div = (timer_source_div_t) 0, .channel = 0, .p_callback = timer_1ms,
97*c3086949SMatthias Ringwald   /** If NULL then do not add & */
98*c3086949SMatthias Ringwald #if defined(NULL)
99*c3086949SMatthias Ringwald     .p_context           = NULL,
100*c3086949SMatthias Ringwald #else
101*c3086949SMatthias Ringwald   .p_context = &NULL,
102*c3086949SMatthias Ringwald #endif
103*c3086949SMatthias Ringwald   .p_extend = &g_timer0_extend,
104*c3086949SMatthias Ringwald   .cycle_end_ipl = (15),
105*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_GPT0_COUNTER_OVERFLOW)
106*c3086949SMatthias Ringwald     .cycle_end_irq       = VECTOR_NUMBER_GPT0_COUNTER_OVERFLOW,
107*c3086949SMatthias Ringwald #else
108*c3086949SMatthias Ringwald   .cycle_end_irq = FSP_INVALID_VECTOR,
109*c3086949SMatthias Ringwald #endif
110*c3086949SMatthias Ringwald         };
111*c3086949SMatthias Ringwald /* Instance structure to use this module. */
112*c3086949SMatthias Ringwald const timer_instance_t g_timer0 =
113*c3086949SMatthias Ringwald { .p_ctrl = &g_timer0_ctrl, .p_cfg = &g_timer0_cfg, .p_api = &g_timer_on_gpt };
114*c3086949SMatthias Ringwald dtc_instance_ctrl_t g_transfer1_ctrl;
115*c3086949SMatthias Ringwald 
116*c3086949SMatthias Ringwald transfer_info_t g_transfer1_info =
117*c3086949SMatthias Ringwald { .transfer_settings_word_b.dest_addr_mode = TRANSFER_ADDR_MODE_INCREMENTED,
118*c3086949SMatthias Ringwald   .transfer_settings_word_b.repeat_area = TRANSFER_REPEAT_AREA_DESTINATION,
119*c3086949SMatthias Ringwald   .transfer_settings_word_b.irq = TRANSFER_IRQ_END,
120*c3086949SMatthias Ringwald   .transfer_settings_word_b.chain_mode = TRANSFER_CHAIN_MODE_DISABLED,
121*c3086949SMatthias Ringwald   .transfer_settings_word_b.src_addr_mode = TRANSFER_ADDR_MODE_FIXED,
122*c3086949SMatthias Ringwald   .transfer_settings_word_b.size = TRANSFER_SIZE_1_BYTE,
123*c3086949SMatthias Ringwald   .transfer_settings_word_b.mode = TRANSFER_MODE_NORMAL,
124*c3086949SMatthias Ringwald   .p_dest = (void*) NULL,
125*c3086949SMatthias Ringwald   .p_src = (void const*) NULL,
126*c3086949SMatthias Ringwald   .num_blocks = 0,
127*c3086949SMatthias Ringwald   .length = 0, };
128*c3086949SMatthias Ringwald 
129*c3086949SMatthias Ringwald const dtc_extended_cfg_t g_transfer1_cfg_extend =
130*c3086949SMatthias Ringwald { .activation_source = VECTOR_NUMBER_SCI7_RXI, };
131*c3086949SMatthias Ringwald const transfer_cfg_t g_transfer1_cfg =
132*c3086949SMatthias Ringwald { .p_info = &g_transfer1_info, .p_extend = &g_transfer1_cfg_extend, };
133*c3086949SMatthias Ringwald 
134*c3086949SMatthias Ringwald /* Instance structure to use this module. */
135*c3086949SMatthias Ringwald const transfer_instance_t g_transfer1 =
136*c3086949SMatthias Ringwald { .p_ctrl = &g_transfer1_ctrl, .p_cfg = &g_transfer1_cfg, .p_api = &g_transfer_on_dtc };
137*c3086949SMatthias Ringwald dtc_instance_ctrl_t g_transfer0_ctrl;
138*c3086949SMatthias Ringwald 
139*c3086949SMatthias Ringwald transfer_info_t g_transfer0_info =
140*c3086949SMatthias Ringwald { .transfer_settings_word_b.dest_addr_mode = TRANSFER_ADDR_MODE_FIXED,
141*c3086949SMatthias Ringwald   .transfer_settings_word_b.repeat_area = TRANSFER_REPEAT_AREA_SOURCE,
142*c3086949SMatthias Ringwald   .transfer_settings_word_b.irq = TRANSFER_IRQ_END,
143*c3086949SMatthias Ringwald   .transfer_settings_word_b.chain_mode = TRANSFER_CHAIN_MODE_DISABLED,
144*c3086949SMatthias Ringwald   .transfer_settings_word_b.src_addr_mode = TRANSFER_ADDR_MODE_INCREMENTED,
145*c3086949SMatthias Ringwald   .transfer_settings_word_b.size = TRANSFER_SIZE_1_BYTE,
146*c3086949SMatthias Ringwald   .transfer_settings_word_b.mode = TRANSFER_MODE_NORMAL,
147*c3086949SMatthias Ringwald   .p_dest = (void*) NULL,
148*c3086949SMatthias Ringwald   .p_src = (void const*) NULL,
149*c3086949SMatthias Ringwald   .num_blocks = 0,
150*c3086949SMatthias Ringwald   .length = 0, };
151*c3086949SMatthias Ringwald 
152*c3086949SMatthias Ringwald const dtc_extended_cfg_t g_transfer0_cfg_extend =
153*c3086949SMatthias Ringwald { .activation_source = VECTOR_NUMBER_SCI7_TXI, };
154*c3086949SMatthias Ringwald const transfer_cfg_t g_transfer0_cfg =
155*c3086949SMatthias Ringwald { .p_info = &g_transfer0_info, .p_extend = &g_transfer0_cfg_extend, };
156*c3086949SMatthias Ringwald 
157*c3086949SMatthias Ringwald /* Instance structure to use this module. */
158*c3086949SMatthias Ringwald const transfer_instance_t g_transfer0 =
159*c3086949SMatthias Ringwald { .p_ctrl = &g_transfer0_ctrl, .p_cfg = &g_transfer0_cfg, .p_api = &g_transfer_on_dtc };
160*c3086949SMatthias Ringwald sci_uart_instance_ctrl_t g_uart0_ctrl;
161*c3086949SMatthias Ringwald 
162*c3086949SMatthias Ringwald baud_setting_t g_uart0_baud_setting =
163*c3086949SMatthias Ringwald         {
164*c3086949SMatthias Ringwald         /* Baud rate calculated with 0.091% error. */.semr_baudrate_bits_b.abcse = 0,
165*c3086949SMatthias Ringwald           .semr_baudrate_bits_b.abcs = 0, .semr_baudrate_bits_b.bgdm = 1, .cks = 0, .brr = 6, .mddr = (uint8_t) 132, .semr_baudrate_bits_b.brme =
166*c3086949SMatthias Ringwald                   true };
167*c3086949SMatthias Ringwald 
168*c3086949SMatthias Ringwald /** UART extended configuration for UARTonSCI HAL driver */
169*c3086949SMatthias Ringwald const sci_uart_extended_cfg_t g_uart0_cfg_extend =
170*c3086949SMatthias Ringwald { .clock = SCI_UART_CLOCK_INT, .rx_edge_start = SCI_UART_START_BIT_FALLING_EDGE, .noise_cancel =
171*c3086949SMatthias Ringwald           SCI_UART_NOISE_CANCELLATION_DISABLE,
172*c3086949SMatthias Ringwald   .rx_fifo_trigger = SCI_UART_RX_FIFO_TRIGGER_MAX, .p_baud_setting = &g_uart0_baud_setting, .flow_control =
173*c3086949SMatthias Ringwald           SCI_UART_FLOW_CONTROL_RTS,
174*c3086949SMatthias Ringwald #if 0xFF != 0xFF
175*c3086949SMatthias Ringwald                 .flow_control_pin       = BSP_IO_PORT_FF_PIN_0xFF,
176*c3086949SMatthias Ringwald                 #else
177*c3086949SMatthias Ringwald   .flow_control_pin = (bsp_io_port_pin_t) UINT16_MAX,
178*c3086949SMatthias Ringwald #endif
179*c3086949SMatthias Ringwald   .rs485_setting =
180*c3086949SMatthias Ringwald   { .enable = SCI_UART_RS485_DISABLE, .polarity = SCI_UART_RS485_DE_POLARITY_HIGH,
181*c3086949SMatthias Ringwald #if 0xFF != 0xFF
182*c3086949SMatthias Ringwald                     .de_control_pin = BSP_IO_PORT_FF_PIN_0xFF,
183*c3086949SMatthias Ringwald                 #else
184*c3086949SMatthias Ringwald     .de_control_pin = (bsp_io_port_pin_t) UINT16_MAX,
185*c3086949SMatthias Ringwald #endif
186*c3086949SMatthias Ringwald           }, };
187*c3086949SMatthias Ringwald 
188*c3086949SMatthias Ringwald /** UART interface configuration */
189*c3086949SMatthias Ringwald const uart_cfg_t g_uart0_cfg =
190*c3086949SMatthias Ringwald { .channel = 7, .data_bits = UART_DATA_BITS_8, .parity = UART_PARITY_OFF, .stop_bits = UART_STOP_BITS_1, .p_callback =
191*c3086949SMatthias Ringwald           user_uart_callback,
192*c3086949SMatthias Ringwald   .p_context = NULL, .p_extend = &g_uart0_cfg_extend,
193*c3086949SMatthias Ringwald #define RA_NOT_DEFINED (1)
194*c3086949SMatthias Ringwald #if (RA_NOT_DEFINED == g_transfer0)
195*c3086949SMatthias Ringwald                 .p_transfer_tx       = NULL,
196*c3086949SMatthias Ringwald #else
197*c3086949SMatthias Ringwald   .p_transfer_tx = &g_transfer0,
198*c3086949SMatthias Ringwald #endif
199*c3086949SMatthias Ringwald #if (RA_NOT_DEFINED == g_transfer1)
200*c3086949SMatthias Ringwald                 .p_transfer_rx       = NULL,
201*c3086949SMatthias Ringwald #else
202*c3086949SMatthias Ringwald   .p_transfer_rx = &g_transfer1,
203*c3086949SMatthias Ringwald #endif
204*c3086949SMatthias Ringwald #undef RA_NOT_DEFINED
205*c3086949SMatthias Ringwald   .rxi_ipl = (12),
206*c3086949SMatthias Ringwald   .txi_ipl = (12), .tei_ipl = (12), .eri_ipl = (12),
207*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_SCI7_RXI)
208*c3086949SMatthias Ringwald                 .rxi_irq             = VECTOR_NUMBER_SCI7_RXI,
209*c3086949SMatthias Ringwald #else
210*c3086949SMatthias Ringwald   .rxi_irq = FSP_INVALID_VECTOR,
211*c3086949SMatthias Ringwald #endif
212*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_SCI7_TXI)
213*c3086949SMatthias Ringwald                 .txi_irq             = VECTOR_NUMBER_SCI7_TXI,
214*c3086949SMatthias Ringwald #else
215*c3086949SMatthias Ringwald   .txi_irq = FSP_INVALID_VECTOR,
216*c3086949SMatthias Ringwald #endif
217*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_SCI7_TEI)
218*c3086949SMatthias Ringwald                 .tei_irq             = VECTOR_NUMBER_SCI7_TEI,
219*c3086949SMatthias Ringwald #else
220*c3086949SMatthias Ringwald   .tei_irq = FSP_INVALID_VECTOR,
221*c3086949SMatthias Ringwald #endif
222*c3086949SMatthias Ringwald #if defined(VECTOR_NUMBER_SCI7_ERI)
223*c3086949SMatthias Ringwald                 .eri_irq             = VECTOR_NUMBER_SCI7_ERI,
224*c3086949SMatthias Ringwald #else
225*c3086949SMatthias Ringwald   .eri_irq = FSP_INVALID_VECTOR,
226*c3086949SMatthias Ringwald #endif
227*c3086949SMatthias Ringwald         };
228*c3086949SMatthias Ringwald 
229*c3086949SMatthias Ringwald /* Instance structure to use this module. */
230*c3086949SMatthias Ringwald const uart_instance_t g_uart0 =
231*c3086949SMatthias Ringwald { .p_ctrl = &g_uart0_ctrl, .p_cfg = &g_uart0_cfg, .p_api = &g_uart_on_sci };
g_hal_init(void)232*c3086949SMatthias Ringwald void g_hal_init(void)
233*c3086949SMatthias Ringwald {
234*c3086949SMatthias Ringwald     g_common_init ();
235*c3086949SMatthias Ringwald }
236