xref: /btstack/port/renesas-tb-s1ja-cc256x/template/btstack_example/synergy/ssp/src/bsp/mcu/all/bsp_clocks.h (revision 3b5c872a8c45689e8cc17891f01530f5aa5e911c)
1 /***********************************************************************************************************************
2  * Copyright [2015-2017] Renesas Electronics Corporation and/or its licensors. All Rights Reserved.
3  *
4  * This file is part of Renesas SynergyTM Software Package (SSP)
5  *
6  * The contents of this file (the "contents") are proprietary and confidential to Renesas Electronics Corporation
7  * and/or its licensors ("Renesas") and subject to statutory and contractual protections.
8  *
9  * This file is subject to a Renesas SSP license agreement. Unless otherwise agreed in an SSP license agreement with
10  * Renesas: 1) you may not use, copy, modify, distribute, display, or perform the contents; 2) you may not use any name
11  * or mark of Renesas for advertising or publicity purposes or in connection with your use of the contents; 3) RENESAS
12  * MAKES NO WARRANTY OR REPRESENTATIONS ABOUT THE SUITABILITY OF THE CONTENTS FOR ANY PURPOSE; THE CONTENTS ARE PROVIDED
13  * "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT; AND 4) RENESAS SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, OR
15  * CONSEQUENTIAL DAMAGES, INCLUDING DAMAGES RESULTING FROM LOSS OF USE, DATA, OR PROJECTS, WHETHER IN AN ACTION OF
16  * CONTRACT OR TORT, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE CONTENTS. Third-party contents
17  * included in this file may be subject to different terms.
18  **********************************************************************************************************************/
19 /***********************************************************************************************************************
20 * File Name    : bsp_clocks.h
21 * Description  : Calls the CGC module to setup the system clocks. Settings for clocks are based on macros in
22 *                bsp_clock_cfg.h.
23 ***********************************************************************************************************************/
24 
25 #ifndef BSP_CLOCKS_H_
26 #define BSP_CLOCKS_H_
27 
28 /* Common macro for SSP header files. There is also a corresponding SSP_FOOTER macro at the end of this file. */
29 SSP_HEADER
30 /***********************************************************************************************************************
31 Macro definitions
32 ***********************************************************************************************************************/
33 
34 /***********************************************************************************************************************
35 Typedef definitions
36 ***********************************************************************************************************************/
37 typedef enum e_bsp_clock_set_event
38 {
39     BSP_CLOCK_SET_EVENT_PRE_CHANGE,    ///< Called before system clock source is changed
40     BSP_CLOCK_SET_EVENT_POST_CHANGE,   ///< Called after system clock source is changed
41 } bsp_clock_set_event_t;
42 
43 typedef struct e_bsp_clock_set_callback_args
44 {
45     bsp_clock_set_event_t event;       ///< Context of which callback event is called
46     uint32_t requested_freq_hz;        ///< Requested frequency
47     uint32_t current_freq_hz;          ///< Current frequency
48     uint8_t new_rom_wait_state;        ///< The new wait state to be set in the ROMWT register.
49 } bsp_clock_set_callback_args_t;
50 
51 /***********************************************************************************************************************
52 Exported global variables
53 ***********************************************************************************************************************/
54 
55 /***********************************************************************************************************************
56 Exported global functions (to be accessed by other files)
57 ***********************************************************************************************************************/
58 /* Public functions defined in bsp.h */
59 void      bsp_clock_init(void);            // Used internally by BSP
60 uint32_t  bsp_cpu_clock_get(void);         // Used internally by BSP
61 
62 /* Used internally by CGC */
63 ssp_err_t bsp_clock_set_callback(bsp_clock_set_callback_args_t * p_args);
64 
65 /* Common macro for SSP header files. There is also a corresponding SSP_HEADER macro at the top of this file. */
66 SSP_FOOTER
67 
68 #endif /* BSP_CLOCKS_H_ */
69 
70 
71