Update stm32-data: rcc regs info comes from yamls now.

This commit is contained in:
Dario Nieuwenhuis
2021-11-29 02:10:06 +01:00
parent 3332c40705
commit b0fabfab5d
8 changed files with 75 additions and 148 deletions

View File

@ -42,11 +42,9 @@ pub struct Package {
pub struct Peripheral {
pub address: u64,
#[serde(default)]
pub kind: Option<String>,
#[serde(default)]
pub block: Option<String>,
#[serde(default)]
pub clock: Option<String>,
pub rcc: Option<PeripheralRcc>,
#[serde(default)]
pub pins: Vec<Pin>,
#[serde(default)]
@ -55,6 +53,26 @@ pub struct Peripheral {
pub interrupts: BTreeMap<String, String>,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
pub struct PeripheralRcc {
pub clock: String,
pub registers: PeripheralRccRegisters,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
pub struct PeripheralRccRegisters {
#[serde(default)]
pub enable: Option<PeripheralRccRegister>,
#[serde(default)]
pub reset: Option<PeripheralRccRegister>,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
pub struct PeripheralRccRegister {
pub register: String,
pub field: String,
}
#[derive(Debug, Eq, PartialEq, Clone, Deserialize)]
pub struct Pin {
pub pin: String,