Updated libopencm3 to current master. Made all examples compile again.
Be specifically careful with the usb examples. There is likely some breakage to be expected, not sure I updated all the drivers to the correct types for the respective chips.
This commit is contained in:
@@ -244,7 +244,7 @@ int main(void)
|
||||
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, cdcacm_set_config);
|
||||
|
||||
gpio_set(GPIOA, GPIO15);
|
||||
|
||||
@@ -285,7 +285,7 @@ int main(void)
|
||||
AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON;
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev_descr, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev_descr, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, hid_set_config);
|
||||
|
||||
gpio_set(GPIOA, GPIO15);
|
||||
|
||||
@@ -103,7 +103,7 @@ int main(void)
|
||||
* Otherwise enable it with the LSE as clock source and 0x7fff as
|
||||
* prescale value.
|
||||
*/
|
||||
rtc_auto_awake(LSE, 0x7fff);
|
||||
rtc_auto_awake(RCC_LSE, 0x7fff);
|
||||
|
||||
/* Setup the RTC interrupt. */
|
||||
nvic_setup();
|
||||
|
||||
@@ -246,7 +246,7 @@ int main(void)
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, cdcacm_set_config);
|
||||
|
||||
for (i = 0; i < 0x800000; i++)
|
||||
|
||||
@@ -267,7 +267,7 @@ int main(void)
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
|
||||
gpio_set(GPIOC, GPIO11);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 4, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 4, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, usbdfu_set_config);
|
||||
|
||||
gpio_clear(GPIOC, GPIO11);
|
||||
|
||||
@@ -286,7 +286,7 @@ int main(void)
|
||||
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO11);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, hid_set_config);
|
||||
|
||||
for (i = 0; i < 0x80000; i++)
|
||||
|
||||
@@ -268,7 +268,7 @@ int main(void)
|
||||
AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON;
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO15);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 4, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 4, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, usbdfu_set_config);
|
||||
|
||||
gpio_set(GPIOA, GPIO15);
|
||||
|
||||
@@ -257,7 +257,7 @@ int main(void)
|
||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
|
||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO5);
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver, &dev, &config, usb_strings, 3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, cdcacm_set_config);
|
||||
|
||||
for (i = 0; i < 0x800000; i++)
|
||||
|
||||
@@ -108,7 +108,7 @@ int main(void)
|
||||
* Otherwise enable it with the LSE as clock source and 0x7fff as
|
||||
* prescale value.
|
||||
*/
|
||||
rtc_auto_awake(LSE, 0x7fff);
|
||||
rtc_auto_awake(RCC_LSE, 0x7fff);
|
||||
|
||||
/* The above mode will not reset the RTC when you press the RST button.
|
||||
* It will also continue to count while the MCU is held in reset. If
|
||||
|
||||
@@ -251,7 +251,7 @@ int main(void)
|
||||
|
||||
AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON;
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver,
|
||||
usbd_dev = usbd_init(&stm32f107_usb_driver,
|
||||
&dev,
|
||||
&config,
|
||||
usb_strings,
|
||||
|
||||
@@ -134,7 +134,7 @@ static void my_usart_print_int(uint32_t usart, int16_t value)
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_64MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ uint16_t exti_line_state;
|
||||
/* Set STM32 to 64 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_64MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
|
||||
}
|
||||
|
||||
static void gpio_setup(void)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/* Set STM32 to 64 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_64MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
|
||||
|
||||
/* Enable GPIOE clock. */
|
||||
rcc_periph_clock_enable(RCC_GPIOE);
|
||||
|
||||
@@ -127,7 +127,7 @@ static void my_usart_print_int(uint32_t usart, int32_t value)
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_64MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
|
||||
}
|
||||
|
||||
#define I2C_ACC_ADDR 0x19
|
||||
|
||||
@@ -138,7 +138,7 @@ static void my_usart_print_int(uint32_t usart, int32_t value)
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_64MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_64MHZ]);
|
||||
}
|
||||
|
||||
#define GYR_RNW (1 << 7) /* Write when zero */
|
||||
|
||||
@@ -251,10 +251,10 @@ int main(void)
|
||||
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hsi(&hsi_8mhz[CLOCK_48MHZ]);
|
||||
rcc_clock_setup_hsi(&rcc_hsi_8mhz[RCC_CLOCK_48MHZ]);
|
||||
usb_setup();
|
||||
|
||||
usbd_dev = usbd_init(&stm32f103_usb_driver, &dev, &config, usb_strings,
|
||||
usbd_dev = usbd_init(&st_usbfs_v1_usb_driver, &dev, &config, usb_strings,
|
||||
3, usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
usbd_register_set_config_callback(usbd_dev, cdcacm_set_config);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ int _write(int file, char *ptr, int len);
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
/* Enable GPIOD clock for LED & USARTs. */
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
|
||||
@@ -27,7 +27,7 @@ uint16_t exti_line_state;
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
}
|
||||
|
||||
static void gpio_setup(void)
|
||||
|
||||
@@ -33,7 +33,7 @@ uint8_t waveform[256];
|
||||
/*--------------------------------------------------------------------*/
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* Enable GPIOD clock. */
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
static void clock_setup(void)
|
||||
{
|
||||
/* Enable high-speed clock at 120MHz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
/* Enable GPIOD clock for LED & USARTs. */
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
static void rcc_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
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);
|
||||
|
||||
@@ -59,7 +59,7 @@ static void systick_setup(void)
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* Enable GPIOD clock. */
|
||||
rcc_periph_clock_enable(RCC_GPIOD);
|
||||
|
||||
@@ -56,7 +56,7 @@ int debug = 0;
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
}
|
||||
|
||||
static void gpio_setup(void)
|
||||
|
||||
@@ -226,7 +226,7 @@ int main(void)
|
||||
{
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_OTGFS);
|
||||
|
||||
@@ -361,7 +361,7 @@ int main(void)
|
||||
{
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_OTGFS);
|
||||
|
||||
@@ -104,7 +104,7 @@ static uint8_t usbd_control_buffer[128];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_OTGFS);
|
||||
|
||||
@@ -37,7 +37,7 @@ int _write(int file, char *ptr, int len);
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
/* Enable GPIOD clock for LED & USARTs. */
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
|
||||
@@ -27,7 +27,7 @@ uint16_t exti_line_state;
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
}
|
||||
|
||||
static void gpio_setup(void)
|
||||
|
||||
@@ -34,7 +34,7 @@ uint8_t waveform[256];
|
||||
/*--------------------------------------------------------------------*/
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------*/
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* Set STM32 to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* Enable GPIOG clock. */
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
|
||||
@@ -63,7 +63,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -61,7 +61,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* set up the SysTick function (1mS interrupts) */
|
||||
systick_set_clocksource(STK_CSR_CLKSOURCE_AHB);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
static void clock_setup(void)
|
||||
{
|
||||
/* Enable high-speed clock at 120MHz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
/* Enable GPIOG clock for LED & USARTs. */
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
static void rcc_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
/* Enable GPIOG clock for onboard leds. */
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
|
||||
@@ -61,7 +61,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -61,7 +61,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -65,7 +65,7 @@ static void systick_setup(void)
|
||||
/* Set STM32 system clock to 168 MHz. */
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* Enable GPIOG clock. */
|
||||
rcc_periph_clock_enable(RCC_GPIOG);
|
||||
|
||||
@@ -62,7 +62,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -61,7 +61,7 @@ uint32_t mtime(void)
|
||||
void clock_setup(void)
|
||||
{
|
||||
/* Base board frequency, set to 168Mhz */
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_168MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]);
|
||||
|
||||
/* clock rate / 168000 to get 1mS interrupt rate */
|
||||
systick_set_reload(168000);
|
||||
|
||||
@@ -227,7 +227,7 @@ int main(void)
|
||||
{
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
rcc_periph_clock_enable(RCC_OTGHS);
|
||||
|
||||
@@ -362,7 +362,7 @@ int main(void)
|
||||
{
|
||||
usbd_device *usbd_dev;
|
||||
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
|
||||
@@ -105,7 +105,7 @@ static uint8_t usbd_control_buffer[128];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rcc_clock_setup_hse_3v3(&hse_8mhz_3v3[CLOCK_3V3_120MHZ]);
|
||||
rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]);
|
||||
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
rcc_periph_clock_enable(RCC_OTGHS);
|
||||
|
||||
@@ -148,8 +148,8 @@ static int setup_rtc(void)
|
||||
RCC_CSR &= ~RCC_CSR_RTCRST;
|
||||
|
||||
/* We want to use the LSE fitted on the discovery board */
|
||||
rcc_osc_on(LSE);
|
||||
rcc_wait_for_osc_ready(LSE);
|
||||
rcc_osc_on(RCC_LSE);
|
||||
rcc_wait_for_osc_ready(RCC_LSE);
|
||||
|
||||
/* Select the LSE as rtc clock */
|
||||
rcc_rtc_select_clock(RCC_CSR_RTCSEL_LSE);
|
||||
@@ -260,11 +260,11 @@ static int process_state(volatile struct state_t *st)
|
||||
static void reset_clocks(void)
|
||||
{
|
||||
/* 4MHz MSI raw range 2*/
|
||||
clock_scale_t myclock_config = {
|
||||
struct rcc_clock_scale myclock_config = {
|
||||
.hpre = RCC_CFGR_HPRE_SYSCLK_NODIV,
|
||||
.ppre1 = RCC_CFGR_PPRE1_HCLK_NODIV,
|
||||
.ppre2 = RCC_CFGR_PPRE2_HCLK_NODIV,
|
||||
.voltage_scale = RANGE2,
|
||||
.voltage_scale = PWR_SCALE2,
|
||||
.flash_config = FLASH_ACR_LATENCY_0WS,
|
||||
.apb1_frequency = 4194000,
|
||||
.apb2_frequency = 4194000,
|
||||
|
||||
@@ -35,7 +35,7 @@ int _write(int file, char *ptr, int len);
|
||||
|
||||
static void clock_setup(void)
|
||||
{
|
||||
rcc_clock_setup_pll(&clock_config[CLOCK_VRANGE1_HSI_PLL_24MHZ]);
|
||||
rcc_clock_setup_pll(&rcc_clock_config[RCC_CLOCK_VRANGE1_HSI_PLL_24MHZ]);
|
||||
/* Lots of things on all ports... */
|
||||
rcc_periph_clock_enable(RCC_GPIOA);
|
||||
rcc_periph_clock_enable(RCC_GPIOB);
|
||||
|
||||
@@ -49,8 +49,8 @@ static void lcd_init(void)
|
||||
rcc_periph_clock_enable(RCC_PWR);
|
||||
rcc_periph_clock_enable(RCC_LCD);
|
||||
pwr_disable_backup_domain_write_protect ();
|
||||
rcc_osc_on (LSE);
|
||||
rcc_wait_for_osc_ready (LSE);
|
||||
rcc_osc_on(RCC_LSE);
|
||||
rcc_wait_for_osc_ready(RCC_LSE);
|
||||
rcc_rtc_select_clock(RCC_CSR_RTCSEL_LSE);
|
||||
RCC_CSR |= RCC_CSR_RTCEN; /* Enable RTC clock */
|
||||
pwr_enable_backup_domain_write_protect ();
|
||||
|
||||
Submodule libopencm3 updated: 43e66927fc...17f159dec9
Reference in New Issue
Block a user