stm32/rcc: add LSE/LSI to all chips, add RTC to more chips.
This commit is contained in:
@ -10,19 +10,19 @@ stm32f103c8 = ["embassy-stm32/stm32f103c8", "not-gpdma"] # Blue Pill
|
||||
stm32f429zi = ["embassy-stm32/stm32f429zi", "chrono", "eth", "stop", "can", "not-gpdma", "dac-adc-pin"] # Nucleo "sdmmc"
|
||||
stm32g071rb = ["embassy-stm32/stm32g071rb", "not-gpdma", "dac-adc-pin"] # Nucleo
|
||||
stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo
|
||||
stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo
|
||||
stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "not-gpdma"] # Nucleo
|
||||
stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac-adc-pin"] # Nucleo
|
||||
stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma", "ble", "mac" ] # Nucleo
|
||||
stm32h563zi = ["embassy-stm32/stm32h563zi", "eth"] # Nucleo
|
||||
stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board
|
||||
stm32wb55rg = ["embassy-stm32/stm32wb55rg", "chrono", "not-gpdma", "ble", "mac" ] # Nucleo
|
||||
stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth"] # Nucleo
|
||||
stm32u585ai = ["embassy-stm32/stm32u585ai", "chrono"] # IoT board
|
||||
stm32l073rz = ["embassy-stm32/stm32l073rz", "not-gpdma"] # Nucleo
|
||||
stm32l152re = ["embassy-stm32/stm32l152re", "not-gpdma"] # Nucleo
|
||||
stm32l4a6zg = ["embassy-stm32/stm32l4a6zg", "not-gpdma"] # Nucleo
|
||||
stm32l4r5zi = ["embassy-stm32/stm32l4r5zi", "not-gpdma"] # Nucleo
|
||||
stm32l152re = ["embassy-stm32/stm32l152re", "chrono", "not-gpdma"] # Nucleo
|
||||
stm32l4a6zg = ["embassy-stm32/stm32l4a6zg", "chrono", "not-gpdma"] # Nucleo
|
||||
stm32l4r5zi = ["embassy-stm32/stm32l4r5zi", "chrono", "not-gpdma"] # Nucleo
|
||||
stm32l552ze = ["embassy-stm32/stm32l552ze", "not-gpdma"] # Nucleo
|
||||
stm32f767zi = ["embassy-stm32/stm32f767zi", "not-gpdma", "eth"] # Nucleo
|
||||
stm32f207zg = ["embassy-stm32/stm32f207zg", "not-gpdma", "eth"] # Nucleo
|
||||
stm32f303ze = ["embassy-stm32/stm32f303ze", "not-gpdma"] # Nucleo
|
||||
stm32f767zi = ["embassy-stm32/stm32f767zi", "chrono", "not-gpdma", "eth"] # Nucleo
|
||||
stm32f207zg = ["embassy-stm32/stm32f207zg", "chrono", "not-gpdma", "eth"] # Nucleo
|
||||
stm32f303ze = ["embassy-stm32/stm32f303ze", "chrono", "not-gpdma"] # Nucleo
|
||||
stm32l496zg = ["embassy-stm32/stm32l496zg", "not-gpdma"] # Nucleo
|
||||
|
||||
eth = []
|
||||
|
@ -10,26 +10,14 @@ use chrono::{NaiveDate, NaiveDateTime};
|
||||
use common::*;
|
||||
use defmt::assert;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::rcc::RtcClockSource;
|
||||
use embassy_stm32::rcc::LsConfig;
|
||||
use embassy_stm32::rtc::{Rtc, RtcConfig};
|
||||
use embassy_time::{Duration, Timer};
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let mut config = config();
|
||||
|
||||
#[cfg(feature = "stm32h755zi")]
|
||||
{
|
||||
use embassy_stm32::rcc::Lse;
|
||||
config.rcc.lse = Some(Lse::Oscillator);
|
||||
config.rcc.rtc_mux = Some(RtcClockSource::LSE);
|
||||
}
|
||||
#[cfg(not(feature = "stm32h755zi"))]
|
||||
{
|
||||
use embassy_stm32::time::Hertz;
|
||||
config.rcc.lse = Some(Hertz(32_768));
|
||||
config.rcc.rtc = Some(RtcClockSource::LSE);
|
||||
}
|
||||
config.rcc.ls = LsConfig::default_lse();
|
||||
|
||||
let p = embassy_stm32::init(config);
|
||||
info!("Hello World!");
|
||||
|
@ -11,9 +11,8 @@ use common::*;
|
||||
use cortex_m_rt::entry;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::low_power::{stop_with_rtc, Executor};
|
||||
use embassy_stm32::rcc::RtcClockSource;
|
||||
use embassy_stm32::rcc::LsConfig;
|
||||
use embassy_stm32::rtc::{Rtc, RtcConfig};
|
||||
use embassy_stm32::time::Hertz;
|
||||
use embassy_stm32::Config;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use static_cell::make_static;
|
||||
@ -49,9 +48,7 @@ async fn async_main(spawner: Spawner) {
|
||||
let _ = config();
|
||||
|
||||
let mut config = Config::default();
|
||||
|
||||
config.rcc.lse = Some(Hertz(32_768));
|
||||
config.rcc.rtc = Some(RtcClockSource::LSE);
|
||||
config.rcc.ls = LsConfig::default_lse();
|
||||
|
||||
let p = embassy_stm32::init(config);
|
||||
info!("Hello World!");
|
||||
|
Reference in New Issue
Block a user