1 /*
2 * Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6 
7 #ifndef BSP_MCU_API_H
8 #define BSP_MCU_API_H
9 
10 /** Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */
11 FSP_HEADER
12 
13 typedef struct st_bsp_event_info
14 {
15     IRQn_Type   irq;
16     elc_event_t event;
17 } bsp_event_info_t;
18 
19 typedef enum e_bsp_clocks_octaclk_div
20 {
21     BSP_CLOCKS_OCTACLK_DIV_1 = 0,      ///< Divide OCTA source clock by 1
22     BSP_CLOCKS_OCTACLK_DIV_2,          ///< Divide OCTA source clock by 2
23     BSP_CLOCKS_OCTACLK_DIV_4,          ///< Divide OCTA source clock by 4
24     BSP_CLOCKS_OCTACLK_DIV_6,          ///< Divide OCTA source clock by 6
25     BSP_CLOCKS_OCTACLK_DIV_8,          ///< Divide OCTA source clock by 8
26     BSP_CLOCKS_OCTACLK_DIV_3,          ///< Divide OCTA source clock by 3
27     BSP_CLOCKS_OCTACLK_DIV_5           ///< Divide OCTA source clock by 5
28 } bsp_clocks_octaclk_div_t;
29 
30 typedef enum e_bsp_clocks_source
31 {
32     BSP_CLOCKS_CLOCK_HOCO = 0,         ///< The high speed on chip oscillator.
33     BSP_CLOCKS_CLOCK_MOCO,             ///< The middle speed on chip oscillator.
34     BSP_CLOCKS_CLOCK_LOCO,             ///< The low speed on chip oscillator.
35     BSP_CLOCKS_CLOCK_MAIN_OSC,         ///< The main oscillator.
36     BSP_CLOCKS_CLOCK_SUBCLOCK,         ///< The subclock oscillator.
37     BSP_CLOCKS_CLOCK_PLL,              ///< The PLL oscillator.
38     BSP_CLOCKS_CLOCK_PLL2,             ///< The PLL2 oscillator.
39 } bsp_clocks_source_t;
40 
41 typedef struct st_bsp_octaclk_settings
42 {
43     bsp_clocks_source_t      source_clock; ///< OCTACLK source clock
44     bsp_clocks_octaclk_div_t divider;      ///< OCTACLK divider
45 } bsp_octaclk_settings_t;
46 
47 void      R_BSP_RegisterProtectEnable(bsp_reg_protect_t regs_to_protect);
48 void      R_BSP_RegisterProtectDisable(bsp_reg_protect_t regs_to_unprotect);
49 fsp_err_t R_BSP_GroupIrqWrite(bsp_grp_irq_t irq, void (* p_callback)(bsp_grp_irq_t irq));
50 void      R_BSP_OctaclkUpdate(bsp_octaclk_settings_t * p_octaclk_setting);
51 void      R_BSP_SoftwareDelay(uint32_t delay, bsp_delay_units_t units);
52 
53 /** Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */
54 FSP_FOOTER
55 
56 #endif
57