/** * Set up the core clock to something other than the internal 16MHz PIOSC. * Make sure that you use the same clock frequency in systick_setup(). */ static void clock_setup(void) { /* set core clock to 72MHz, generated from external 8MHz crystal */ // rcc_clock_setup_in_hse_8mhz_out_24mhz(); OLD :: MOD rcc_clock_setup_in_hse_8mhz_out_24mhz(); }
/* Set STM32 to 24 MHz. */ static void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Enable GPIOC clock. */ rcc_periph_clock_enable(RCC_GPIOC); }
/* Set STM32 to 24 MHz. */ void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Enable GPIOC clock. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); }
void client_server_board_init(void) { #ifdef STM32_100 rcc_clock_setup_in_hse_8mhz_out_24mhz(); #else rcc_clock_setup_in_hse_8mhz_out_72mhz(); #endif }
void init(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); led_init(); output_init(); }
static void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Enable GPIOC clock. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); /* Enable clocks for GPIO port A (for GPIO_USART1_TX) and USART1. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_USART1EN); }
static void config_clocks(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Set systick timer to strike every 1ms (1kHz), * enable its interrupt and start it. */ systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8); systick_set_reload(rcc_apb2_frequency / 8 / 1000 - 1); systick_interrupt_enable(); systick_counter_enable(); }
void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Enable clocks on all the peripherals we are going to use. */ rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_SPI1EN); rcc_peripheral_enable_clock(&RCC_APB1ENR, RCC_APB1ENR_USART2EN); // GPIOS... spi1 and usart2 are on port A rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN); // reset and interrupts on port C rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN); rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN); }
void clock_init(void) { #ifdef MSP430 WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; #else #ifdef STM32_100 rcc_clock_setup_in_hse_8mhz_out_24mhz(); #else rcc_clock_setup_in_hse_8mhz_out_72mhz(); #endif #endif }
static void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); /* Enable GPIOA, GPIOB, GPIOC clock. */ rcc_periph_clock_enable(RCC_GPIOA); rcc_periph_clock_enable(RCC_GPIOB); rcc_periph_clock_enable(RCC_GPIOC); /* Enable clocks for GPIO port A (for GPIO_USART2_TX) and USART2. */ rcc_periph_clock_enable(RCC_GPIOA); rcc_periph_clock_enable(RCC_AFIO); rcc_periph_clock_enable(RCC_USART2); /* Enable SPI1 Periph and gpio clocks */ rcc_periph_clock_enable(RCC_SPI1); }
/* Set STM32 to 24 MHz. */ static void clock_setup(void) { rcc_clock_setup_in_hse_8mhz_out_24mhz(); }
/** * Setup the system clock to 72MHz; for the stm32-discovery its 24MHz */ void clock_init(void) { //Warning: f_max = 24MHz!!! // rcc_clock_setup_in_hse_8mhz_out_72mhz(); rcc_clock_setup_in_hse_8mhz_out_24mhz(); }