hal_data.c 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /* generated HAL source file - do not edit */
  2. #include "hal_data.h"
  3. xspi_hyper_instance_ctrl_t g_hyperbus0_ctrl;
  4. static xspi_hyper_cs_timing_setting_t g_hyperbus0_cs_timing_settings =
  5. {
  6. .transaction_interval = XSPI_HYPER_TRANSACTION_INTERVAL_CLOCKS_8,
  7. .cs_pullup_lag = XSPI_HYPER_CS_PULLUP_CLOCKS_NO_EXTENSION,
  8. .cs_pulldown_lead = XSPI_HYPER_CS_PULLDOWN_CLOCKS_NO_EXTENSION,
  9. };
  10. static xspi_hyper_address_space_t g_hyperbus0_address_space_settings =
  11. {
  12. .unit0_cs0_end_address = XSPI_HYPER_CFG_UNIT_0_CS_0_END_ADDRESS,
  13. .unit0_cs1_start_address = XSPI_HYPER_CFG_UNIT_0_CS_1_START_ADDRESS,
  14. .unit0_cs1_end_address = XSPI_HYPER_CFG_UNIT_0_CS_1_END_ADDRESS,
  15. .unit1_cs0_end_address = XSPI_HYPER_CFG_UNIT_1_CS_0_END_ADDRESS,
  16. .unit1_cs1_start_address = XSPI_HYPER_CFG_UNIT_1_CS_1_START_ADDRESS,
  17. .unit1_cs1_end_address = XSPI_HYPER_CFG_UNIT_1_CS_1_END_ADDRESS,
  18. };
  19. static xspi_hyper_extended_cfg_t g_hyperbus0_extended_cfg =
  20. {
  21. .unit = 0,
  22. .chip_select = XSPI_HYPER_CHIP_SELECT_1,
  23. .memory_size = XSPI_HYPER_MEMORY_SIZE_32MB,
  24. .data_latching_delay_clock = 0x08,
  25. .p_cs_timing_settings = &g_hyperbus0_cs_timing_settings,
  26. .p_autocalibration_preamble_pattern_addr = (uint8_t *) 0x00,
  27. #if 0 == 0
  28. .prefetch_en = (xspi_hyper_prefetch_function_t) XSPI_HYPER_CFG_UNIT_0_PREFETCH_FUNCTION,
  29. #else
  30. .prefetch_en = (xspi_hyper_prefetch_function_t) XSPI_HYPER_CFG_UNIT_1_PREFETCH_FUNCTION,
  31. #endif
  32. #if BSP_FEATURE_XSPI_VOLTAGE_SETTING_SUPPORTED
  33. #if 0 == 0
  34. .io_voltage = (xspi_hyper_io_voltage_t) XSPI_HYPER_CFG_UNIT_0_IOVOLTAGE,
  35. #else
  36. .io_voltage = (xspi_hyper_io_voltage_t) XSPI_HYPER_CFG_UNIT_1_IOVOLTAGE,
  37. #endif
  38. #endif
  39. .p_address_space = &g_hyperbus0_address_space_settings,
  40. };
  41. const hyperbus_cfg_t g_hyperbus0_cfg =
  42. {
  43. .burst_type = HYPERBUS_BURST_TYPE_LINEAR,
  44. .access_space = HYPERBUS_SPACE_SELECT_MEMORY_SPACE,
  45. .read_latency_count = HYPERBUS_LATENCY_COUNT_7,
  46. .memory_write_latency_count = HYPERBUS_LATENCY_COUNT_7,
  47. .register_write_latency_count = HYPERBUS_LATENCY_COUNT_0,
  48. .p_extend = &g_hyperbus0_extended_cfg,
  49. };
  50. /** This structure encompasses everything that is needed to use an instance of this interface. */
  51. const hyperbus_instance_t g_hyperbus0 =
  52. {
  53. .p_ctrl = &g_hyperbus0_ctrl,
  54. .p_cfg = &g_hyperbus0_cfg,
  55. .p_api = &g_hyperbus_on_xspi_hyper,
  56. };
  57. sci_uart_instance_ctrl_t g_uart0_ctrl;
  58. #define FSP_NOT_DEFINED (1)
  59. #if (FSP_NOT_DEFINED) != (FSP_NOT_DEFINED)
  60. /* If the transfer module is DMAC, define a DMAC transfer callback. */
  61. extern void sci_uart_tx_dmac_callback(sci_uart_instance_ctrl_t * p_instance_ctrl);
  62. void g_uart0_tx_transfer_callback (transfer_callback_args_t * p_args)
  63. {
  64. FSP_PARAMETER_NOT_USED(p_args);
  65. sci_uart_tx_dmac_callback(&g_uart0_ctrl);
  66. }
  67. #endif
  68. #if (FSP_NOT_DEFINED) != (FSP_NOT_DEFINED)
  69. /* If the transfer module is DMAC, define a DMAC transfer callback. */
  70. extern void sci_uart_rx_dmac_callback(sci_uart_instance_ctrl_t * p_instance_ctrl);
  71. void g_uart0_rx_transfer_callback (transfer_callback_args_t * p_args)
  72. {
  73. FSP_PARAMETER_NOT_USED(p_args);
  74. sci_uart_rx_dmac_callback(&g_uart0_ctrl);
  75. }
  76. #endif
  77. #undef FSP_NOT_DEFINED
  78. sci_baud_setting_t g_uart0_baud_setting =
  79. {
  80. /* Baud rate calculated with 0.160% error. */ .baudrate_bits_b.abcse = 0, .baudrate_bits_b.abcs = 0, .baudrate_bits_b.bgdm = 1, .baudrate_bits_b.cks = 0, .baudrate_bits_b.brr = 51, .baudrate_bits_b.mddr = (uint8_t) 256, .baudrate_bits_b.brme = false
  81. };
  82. /** UART extended configuration for UARTonSCI HAL driver */
  83. const sci_uart_extended_cfg_t g_uart0_cfg_extend =
  84. {
  85. .clock = SCI_UART_CLOCK_INT,
  86. .rx_edge_start = SCI_UART_START_BIT_FALLING_EDGE,
  87. .noise_cancel = SCI_UART_NOISE_CANCELLATION_DISABLE,
  88. .rx_fifo_trigger = SCI_UART_RX_FIFO_TRIGGER_MAX,
  89. .p_baud_setting = &g_uart0_baud_setting,
  90. #if 1
  91. .clock_source = SCI_UART_CLOCK_SOURCE_SCI0ASYNCCLK,
  92. #else
  93. .clock_source = SCI_UART_CLOCK_SOURCE_PCLKM,
  94. #endif
  95. .flow_control = SCI_UART_FLOW_CONTROL_RTS,
  96. #if 0xFF != 0xFF
  97. .flow_control_pin = BSP_IO_PORT_FF_PIN_0xFF,
  98. #else
  99. .flow_control_pin = (bsp_io_port_pin_t) UINT16_MAX,
  100. #endif
  101. .rs485_setting = {
  102. .enable = SCI_UART_RS485_DISABLE,
  103. .polarity = SCI_UART_RS485_DE_POLARITY_HIGH,
  104. .assertion_time = 1,
  105. .negation_time = 1,
  106. },
  107. };
  108. /** UART interface configuration */
  109. const uart_cfg_t g_uart0_cfg =
  110. {
  111. .channel = 0,
  112. .data_bits = UART_DATA_BITS_8,
  113. .parity = UART_PARITY_OFF,
  114. .stop_bits = UART_STOP_BITS_1,
  115. .p_callback = user_uart0_callback,
  116. .p_context = NULL,
  117. .p_extend = &g_uart0_cfg_extend,
  118. .p_transfer_tx = g_uart0_P_TRANSFER_TX,
  119. .p_transfer_rx = g_uart0_P_TRANSFER_RX,
  120. .rxi_ipl = (12),
  121. .txi_ipl = (12),
  122. .tei_ipl = (12),
  123. .eri_ipl = (12),
  124. #if defined(VECTOR_NUMBER_SCI0_RXI)
  125. .rxi_irq = VECTOR_NUMBER_SCI0_RXI,
  126. #else
  127. .rxi_irq = FSP_INVALID_VECTOR,
  128. #endif
  129. #if defined(VECTOR_NUMBER_SCI0_TXI)
  130. .txi_irq = VECTOR_NUMBER_SCI0_TXI,
  131. #else
  132. .txi_irq = FSP_INVALID_VECTOR,
  133. #endif
  134. #if defined(VECTOR_NUMBER_SCI0_TEI)
  135. .tei_irq = VECTOR_NUMBER_SCI0_TEI,
  136. #else
  137. .tei_irq = FSP_INVALID_VECTOR,
  138. #endif
  139. #if defined(VECTOR_NUMBER_SCI0_ERI)
  140. .eri_irq = VECTOR_NUMBER_SCI0_ERI,
  141. #else
  142. .eri_irq = FSP_INVALID_VECTOR,
  143. #endif
  144. };
  145. /* Instance structure to use this module. */
  146. const uart_instance_t g_uart0 =
  147. {
  148. .p_ctrl = &g_uart0_ctrl,
  149. .p_cfg = &g_uart0_cfg,
  150. .p_api = &g_uart_on_sci
  151. };
  152. void g_hal_init(void) {
  153. g_common_init();
  154. }