VSF Documented
|
#include "hal/vsf_hal_cfg.h"
#include "../__device.h"
#include "./vendor/Include/gd32h7xx.h"
#include "hal/driver/common/swi/arm/vsf_swi_template.inc"
#include "service/trace/vsf_trace.h"
Data Structures | |
struct | vsf_hw_clk_t |
Typedefs | |
typedef enum vsf_hw_peripheral_clksel_t | vsf_hw_peripheral_clksel_t |
Enumerations | |
enum | vsf_hw_peripheral_clksel_t { VSF_HW_CLKSEL_HPDF = VSF_HW_CLKRST_REGION(0x23, 31, 1) , VSF_HW_CLKSEL_TIMER = VSF_HW_CLKRST_REGION(0x23, 24, 1) , VSF_HW_CLKSEL_USART5 = VSF_HW_CLKRST_REGION(0x23, 22, 2) , VSF_HW_CLKSEL_USART2 = VSF_HW_CLKRST_REGION(0x23, 20, 2) , VSF_HW_CLKSEL_USART1 = VSF_HW_CLKRST_REGION(0x23, 18, 2) , VSF_HW_CLKSEL_PER = VSF_HW_CLKRST_REGION(0x23, 14, 2) , VSF_HW_CLKSEL_CAN2 = VSF_HW_CLKRST_REGION(0x23, 12, 2) , VSF_HW_CLKSEL_CAN1 = VSF_HW_CLKRST_REGION(0x23, 10, 2) , VSF_HW_CLKSEL_CAN0 = VSF_HW_CLKRST_REGION(0x23, 8, 2) , VSF_HW_CLKSEL_RSPDIF = VSF_HW_CLKRST_REGION(0x23, 4, 2) , VSF_HW_CLKSEL_USART0 = VSF_HW_CLKRST_REGION(0x23, 0, 2) , VSF_HW_CLKSEL_SAI2B1 = VSF_HW_CLKRST_REGION(0x24, 28, 3) , VSF_HW_CLKSEL_SAI2B0 = VSF_HW_CLKRST_REGION(0x24, 24, 3) , VSF_HW_CLKSEL_SAI1 = VSF_HW_CLKRST_REGION(0x24, 20, 3) , VSF_HW_CLKSEL_SAI0 = VSF_HW_CLKRST_REGION(0x24, 16, 3) , VSF_HW_CLKSEL_CKOUT1 = VSF_HW_CLKRST_REGION(0x24, 12, 3) , VSF_HW_CLKSEL_CKOUT0 = VSF_HW_CLKRST_REGION(0x24, 4, 3) , VSF_HW_CLKSEL_ADC2 = VSF_HW_CLKRST_REGION(0x25, 28, 2) , VSF_HW_CLKSEL_ADC1 = VSF_HW_CLKRST_REGION(0x25, 26, 2) , VSF_HW_CLKSEL_DSPWUS = VSF_HW_CLKRST_REGION(0x25, 24, 1) , VSF_HW_CLKSEL_SDIO1 = VSF_HW_CLKRST_REGION(0x25, 12, 1) , VSF_HW_CLKSEL_I2C3 = VSF_HW_CLKRST_REGION(0x25, 4, 2) , VSF_HW_CLKSEL_I2C2 = VSF_HW_CLKRST_REGION(0x25, 2, 2) , VSF_HW_CLKSEL_I2C1 = VSF_HW_CLKRST_REGION(0x25, 0, 2) , VSF_HW_CLKSEL_EXMC = VSF_HW_CLKRST_REGION(0x34, 8, 2) , VSF_HW_CLKSEL_SDIO0 = VSF_HW_CLKRST_REGION(0x34, 0, 1) } |
enum | { VSF_HW_CLK_PRESCALER_NONE = 0 , VSF_HW_CLK_PRESCALER_CONST , VSF_HW_CLK_PRESCALER_DIV , VSF_HW_CLK_PRESCALER_ADD1_DIV , VSF_HW_CLK_PRESCALER_SFT , VSF_HW_CLK_PRESCALER_ADD1_SFT , VSF_HW_CLK_PRESCALER_FUNC } |
enum | { VSF_HW_CLK_TYPE_CONST , VSF_HW_CLK_TYPE_CLK , VSF_HW_CLK_TYPE_SEL } |
typedef enum vsf_hw_peripheral_clksel_t vsf_hw_peripheral_clksel_t |
anonymous enum |
void vsf_hw_clkrst_region_set | ( | uint32_t | region, |
uint_fast8_t | value | ||
) |
uint_fast8_t vsf_hw_clkrst_region_get | ( | uint32_t | region | ) |
void vsf_hw_clkrst_region_set_bit | ( | uint32_t | region | ) |
void vsf_hw_clkrst_region_clear_bit | ( | uint32_t | region | ) |
uint_fast8_t vsf_hw_clkrst_region_get_bit | ( | uint32_t | region | ) |
const vsf_hw_clk_t * vsf_hw_clk_get_src | ( | const vsf_hw_clk_t * | clk | ) |
uint32_t vsf_hw_clk_get_freq_hz | ( | const vsf_hw_clk_t * | clk | ) |
void vsf_hw_clk_enable | ( | const vsf_hw_clk_t * | clk | ) |
void vsf_hw_clk_disable | ( | const vsf_hw_clk_t * | clk | ) |
bool vsf_hw_clk_is_enabled | ( | const vsf_hw_clk_t * | clk | ) |
bool vsf_hw_clk_is_ready | ( | const vsf_hw_clk_t * | clk | ) |
vsf_err_t vsf_hw_clk_config | ( | const vsf_hw_clk_t * | clk, |
const vsf_hw_clk_t * | clksrc, | ||
uint16_t | prescaler, | ||
uint32_t | freq_hz | ||
) |
vsf_err_t vsf_hw_pll_vco_config | ( | const vsf_hw_clk_t * | clk, |
uint_fast8_t | src_prescaler, | ||
uint32_t | vco_freq_hz | ||
) |
configure frequency range of pll input/output clocks
configure VCO clock pll output
[in] | clk | a pointer to PLL_VCO clock VSF_HW_CLK_PLL0_VCO VSF_HW_CLK_PLL1_VCO VSF_HW_CLK_PLL2_VCO |
[in] | src_prescaler | prescaler of clock src, [1 .. 63] |
[in] | vco_freq_hz | VCO frequency in Hz |
void HardFault_Handler | ( | void | ) |
void MemManage_Handler | ( | void | ) |
void BusFault_Handler | ( | void | ) |
void vsf_hw_mpu_add_basic_resgions | ( | void | ) |
bool vsf_driver_init | ( | void | ) |
common hal drivers
none |
true | initialization succeeded. |
false | initialization failed |
initialise interrupt controller;
const vsf_hw_clk_t VSF_HW_CLK_HXTAL |
const vsf_hw_clk_t VSF_HW_CLK_LXTAL |
const vsf_hw_clk_t VSF_HW_CLK_IRC64MDIV |
const vsf_hw_clk_t VSF_HW_CLK_LPIRC4M |
const vsf_hw_clk_t VSF_HW_CLK_IRC32K |
const vsf_hw_clk_t VSF_HW_CLK_PLL0_VCO |
const vsf_hw_clk_t VSF_HW_CLK_PLL1_VCO |
const vsf_hw_clk_t VSF_HW_CLK_PLL2_VCO |
const vsf_hw_clk_t VSF_HW_CLK_PLL0P |
const vsf_hw_clk_t VSF_HW_CLK_PLL0Q |
const vsf_hw_clk_t VSF_HW_CLK_PLL0R |
const vsf_hw_clk_t VSF_HW_CLK_PLL1P |
const vsf_hw_clk_t VSF_HW_CLK_PLL1Q |
const vsf_hw_clk_t VSF_HW_CLK_PLL1R |
const vsf_hw_clk_t VSF_HW_CLK_PLL2P |
const vsf_hw_clk_t VSF_HW_CLK_PLL2Q |
const vsf_hw_clk_t VSF_HW_CLK_PLL2R |
const vsf_hw_clk_t VSF_HW_CLK_RTCDIV |
const vsf_hw_clk_t VSF_HW_CLK_RTC |
const vsf_hw_clk_t VSF_HW_CLK_SYS |
const vsf_hw_clk_t VSF_HW_CLK_PER |
const vsf_hw_clk_t VSF_HW_CLK_AHB |
const vsf_hw_clk_t VSF_HW_CLK_PCLK1 |
const vsf_hw_clk_t VSF_HW_CLK_PCLK2 |
const vsf_hw_clk_t VSF_HW_CLK_PCLK3 |
const vsf_hw_clk_t VSF_HW_CLK_PCLK4 |
const vsf_hw_clk_t VSF_HW_CLK_USART0 |
const vsf_hw_clk_t VSF_HW_CLK_USART1 |
const vsf_hw_clk_t VSF_HW_CLK_USART2 |
const vsf_hw_clk_t VSF_HW_CLK_USART5 |
const vsf_hw_clk_t VSF_HW_CLK_SDIO0 |
const vsf_hw_clk_t VSF_HW_CLK_SDIO1 |
const vsf_hw_clk_t VSF_HW_CLK_TLI |
const vsf_hw_clk_t VSF_HW_CLK_EXMC |