本文整理汇总了C++中rcc_periph_clock_enable函数的典型用法代码示例。如果您正苦于以下问题:C++ rcc_periph_clock_enable函数的具体用法?C++ rcc_periph_clock_enable怎么用?C++ rcc_periph_clock_enable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rcc_periph_clock_enable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clock_setup
static void clock_setup(void)
{
/* Enable GPIOG clock for LED & USARTs. */
rcc_periph_clock_enable(RCC_GPIOG);
rcc_periph_clock_enable(RCC_GPIOB);
/* Enable clocks for USART1. */
rcc_periph_clock_enable(RCC_USART3);
}
示例2: i2c_led_platform_init
void i2c_led_platform_init(void)
{
// Enable I2C2
rcc_periph_clock_enable(RCC_I2C2);
rcc_periph_clock_enable(RCC_DMA1);
// Setup I2C port
setup_i2c_port(I2C_400KHz);
}
示例3: clock_setup
static void clock_setup(void)
{
/* Enable GPIOD clock for LED & USARTs. */
rcc_periph_clock_enable(RCC_GPIOD);
rcc_periph_clock_enable(RCC_GPIOA);
/* Enable clocks for USART2. */
rcc_periph_clock_enable(RCC_USART2);
}
示例4: clock_setup
/* Set STM32 to 168 MHz. */
static void clock_setup(void)
{
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
/* Enable GPIOD, GPIOG, and GPIOK clock. */
rcc_periph_clock_enable(RCC_GPIOD);
rcc_periph_clock_enable(RCC_GPIOG);
rcc_periph_clock_enable(RCC_GPIOK);
}
示例5: clock_setup
/*--------------------------------------------------------------------------*/
static void clock_setup(void)
{
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOA, GPIOB, GPIOC clock. */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOB);
rcc_periph_clock_enable(RCC_GPIOC);
}
示例6: gpio_setup
/*--------------------------------------------------------------------*/
void gpio_setup(void)
{
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOC);
rcc_periph_clock_enable(RCC_AFIO);
/* Digital Test outputs PC0 and PC1 */
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO0 | GPIO1);
}
示例7: rcc_setup
static void rcc_setup(void)
{
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
/* Enable GPIOD clock for onboard leds. */
rcc_periph_clock_enable(RCC_GPIOD);
/* Enable rng clock */
rcc_periph_clock_enable(RCC_RNG);
}
示例8: disconnect_usb
void disconnect_usb(void)
{
/* Disconnect USB cable by resetting USB Device and pulling USB_DP low*/
rcc_periph_reset_pulse(RST_USB);
rcc_periph_clock_enable(RCC_USB);
rcc_periph_clock_enable(RCC_GPIOA);
gpio_clear(GPIOA, GPIO12);
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_OPENDRAIN, GPIO12);
}
示例9: gpio_setup
static void gpio_setup(void)
{
/* Enable GPIOB clock. */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOB);
/* set pins to output mode, push pull */
gpio_mode_setup(LED_RED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_RED_PIN);
gpio_mode_setup(LED_GREEN_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_GREEN_PIN);
}
示例10: clock_setup
/* Set STM32 to 72 MHz. */
static void clock_setup(void)
{
rcc_clock_setup_in_hse_12mhz_out_72mhz();
/* Enable GPIOA, GPIOB, GPIOC, and AFIO clocks. */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOB);
rcc_periph_clock_enable(RCC_GPIOC);
rcc_periph_clock_enable(RCC_AFIO);
}
示例11: usb_tmc_setup_pre_arch
void usb_tmc_setup_pre_arch(void)
{
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(USB_RCC);
/* Not sure if we need 9 for ID or even if we need this at all */
gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE,
GPIO9 | GPIO11 | GPIO12);
gpio_set_af(GPIOA, GPIO_AF10, GPIO9 | GPIO11 | GPIO12);
}
示例12: gpio_setup
static void gpio_setup(void)
{
rcc_periph_clock_enable(RCC_GPIOE);
rcc_periph_clock_enable(RCC_GPIOA);
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
GPIO8 | GPIO9 | GPIO10 | GPIO11 | GPIO12 | GPIO13 |
GPIO14 | GPIO15);
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_PULLUP, GPIO0); //ADC_EOC
}
示例13: gpio_setup
static void gpio_setup(void)
{
rcc_periph_clock_enable(RCC_GPIOE);
rcc_periph_clock_enable(RCC_GPIOD); //timer
gpio_set_af(GPIOD, GPIO_AF2, GPIO2); //timer
gpio_mode_setup(GPIOE, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
GPIO8 | GPIO9 | GPIO10 | GPIO11 | GPIO12 | GPIO13 |
GPIO14 | GPIO15);
gpio_mode_setup(GPIOD, GPIO_MODE_AF, GPIO_PUPD_PULLUP,
GPIO2); //timer
}
示例14: gpio_setup
/*--------------------------------------------------------------------*/
static void gpio_setup(void)
{
/* Port A and C are on AHB1 */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_GPIOC);
/* Set the digital test output on PC1 */
gpio_mode_setup(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO1);
gpio_set_output_options(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_2MHZ, GPIO1);
/* Set PA4 for DAC channel 1 to analogue, ignoring drive mode. */
gpio_mode_setup(GPIOA, GPIO_MODE_ANALOG, GPIO_PUPD_NONE, GPIO4);
}
示例15: clock_setup
static void clock_setup(void) {
rcc_clock_setup_in_hse_8mhz_out_72mhz();
/* Enable GPIOC clock (for LED GPIOs). */
rcc_periph_clock_enable(RCC_GPIOC);
/* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_AFIO);
rcc_periph_clock_enable(RCC_USART1);
}