diff --git a/devices/gd32f425.yaml b/devices/gd32f425.yaml index c2bf2dd95..ec966cf42 100644 --- a/devices/gd32f425.yaml +++ b/devices/gd32f425.yaml @@ -8,3 +8,14 @@ _modify: name: "GD32F425" _include: - common_patches/gd32f425.yaml + - ../peripherals/pmu/pmu_f4.yaml + - ../peripherals/rcu/rcu_f4.yaml + - ../peripherals/ctc/ctc_f4.yaml + - ../peripherals/gpio/gpio_f4.yaml + - ../peripherals/exti/exti.yaml + - ../peripherals/crc/crc.yaml + - ../peripherals/trng/trng.yaml + - ../peripherals/dma/dma_f4.yaml + - ../peripherals/dbg/dbg_f4.yaml + - ../peripherals/iref/iref_f4.yaml + - ../peripherals/adc/adc_f4.yaml diff --git a/peripherals/adc/adc_f4.yaml b/peripherals/adc/adc_f4.yaml new file mode 100644 index 000000000..585950c55 --- /dev/null +++ b/peripherals/adc/adc_f4.yaml @@ -0,0 +1,148 @@ +"ADC?": + STAT: + ROVF: + _read: + NoOverrun: [0, "No overrun occurred in routine data register"] + Overrun: [1, "Overrun overrun occurred in routine data register"] + _write: + Clear: [0, "Clear the routine data register overrun flag"] + STRC: + _read: + NotStarted: [0, "No regular channel conversion started"] + Started: [1, "Regular channel conversion has started"] + _write: + Clear: [0, "Clear the regular channel start flag"] + EOC: + _read: + NotComplete: [0, "Conversion is not complete"] + Complete: [1, "Conversion complete"] + _write: + Clear: [0, "Clear end of group conversion flag"] + WDE: + _read: + NoEvent: [0, "No analog watchdog event occurred"] + Event: [1, "Analog watchdog event occurred"] + _write: + Clear: [0, "Clear the analog watchdog event flag"] + CTL0: + ROVFIE: + Disabled: [0, "ROVF interrupt disabled"] + Enabled: [1, "ROVF interrupt enabled."] + DRES: + Bits12: [0, "12-bit resolution"] + Bits10: [1, "10-bit resolution"] + Bits8: [2, "8-bit resolution"] + Bits6: [3, "6-bit resolution"] + RWDEN: + Disabled: [0, "Analog watchdog disabled"] + Enabled: [1, "Analog watchdog enabled"] + DISNUM: [0, 7] + DISRC: + Disabled: [0, "Discontinuous mode on regular channels disabled"] + Enabled: [1, "Discontinuous mode on regular channels enabled"] + WDSC: + All: [0, "Analog watchdog enabled on all channels"] + Single: [1, "Analog watchdog enabled on a single channel"] + SM: + Disabled: [0, "Scan mode disabled"] + Enabled: [1, "Scan mode enabled"] + WDEIE: + Disabled: [0, "WDE interrupt disabled"] + Enabled: [1, "WDE interrupt enabled"] + EOCIE: + Disabled: [0, "EOC interrupt disabled"] + Enabled: [1, "EOC interrupt enabled"] + # WDCHSEL: + # Channel: [0, 18] + CTL1: + SWRCST: + NoEffect: [0, "No effect"] + Reset: [1, "Start the conversion of a regular channel"] + ETMRC: + Disable: [0, "Disable external trigger conversion of regular channels"] + RisingEdge: [1, "Enable external trigger conversion of regular channels on rising edge"] + FallingEdge: [2, "Enable external trigger conversion of regular channels on falling edge"] + BothEdges: [3, "Enable external trigger conversion of regular channels on both edges"] + ETSRC: + Timer0Ch0: [0, "Timer 0 channel 0 event"] + Timer0Ch1: [1, "Timer 0 channel 1 event"] + Timer0Ch2: [2, "Timer 0 channel 2 event"] + Timer1Ch1: [3, "Timer 1 channel 1 event"] + Timer1Ch2: [4, "Timer 1 channel 2 event"] + Timer1Ch3: [5, "Timer 1 channel 3 event"] + Timer1Trgo: [6, "Timer 1 TRGO event"] + Timer2Ch0: [7, "Timer 2 channel 0 event"] + Timer2Trgo: [8, "Timer 2 TRGO event"] + Timer3Ch3: [9, "Timer 3 channel 3 event"] + Timer4Ch0: [10, "Timer 4 channel 0 event"] + Timer4Ch1: [11, "Timer 4 channel 1 event"] + Timer4Ch2: [12, "Timer 4 channel 2 event"] + Timer7Ch0: [13, "Timer 7 channel 0 event"] + Timer7Trgo: [14, "Timer 7 TRGO event"] + Exti11: [15, "EXTI line 11 event"] + DAL: + Right: [0, "Right alignment"] + Left: [1, "Left alignment"] + EOCM: + EndOfSequence: [0, "EOC bit is set at the end of a sequence of conversions"] + EndOfEach: [1, "EOC bit is set at the end of each conversion"] + DDM: + Disabled: [0, "DMA mode disabled"] + Enabled: [1, "DMA mode enabled"] + DMA: + Disabled: [0, "DMA request disabled"] + Enabled: [1, "DMA request enabled"] + RSTCLB: + _write: + Reset: [1, "Initialize calibration register start."] + _read: + Done: [0, "Calibration register initialized."] + Busy: [1, "Calibration register initializing."] + CLB: + _write: + Start: [1, "Start calibration"] + _read: + Done: [0, "Calibration complete"] + Busy: [1, "Calibration in progress"] + CTN: + Disabled: [0, "Continuous conversion disabled"] + Enabled: [1, "Continuous conversion enabled"] + ADCON: + Disabled: [0, "ADC disabled"] + Enabled: [1, "ADC enabled"] + "SAMPT?": + "SPT*": + Cycles3: [0, "Channel sample time is 3 cycles"] + Cycles15: [1, "Channel sample time is 15 cycles"] + Cycles28: [2, "Channel sample time is 28 cycles"] + Cycles56: [3, "Channel sample time is 56 cycles"] + Cycles84: [4, "Channel sample time is 84 cycles"] + Cycles112: [5, "Channel sample time is 112 cycles"] + Cycles144: [6, "Channel sample time is 144 cycles"] + Cycles480: [7, "Channel sample time is 480 cycles"] + # WDHT: + # WDHT: [0, 0xFFF] + # WDLT: + # WDLT: [0, 0xFFF] + # RSQ0: + # RL: [0, 7] + # "RSQ?": + # "RSQ*": [0, 18] + OVSAMPCTL: + TOVS: + Consecutive: [0, "All oversampled conversaions for a channel are done consecutively"] + Separate: [1, "Oversampled conversions for a channel done wit a separate trigger."] + # OVSS: + # Shift: [0, 0b1000] + OVSR: + Times2: [0b0000, "Oversampling ratio is 2"] + Times4: [0b0001, "Oversampling ratio is 4"] + Times8: [0b0010, "Oversampling ratio is 8"] + Times16: [0b0011, "Oversampling ratio is 16"] + Times32: [0b0100, "Oversampling ratio is 32"] + Times64: [0b0101, "Oversampling ratio is 64"] + Times128: [0b0110, "Oversampling ratio is 128"] + Times256: [0b0111, "Oversampling ratio is 256"] + OVSEN: + Disabled: [0, "Oversampling disabled"] + Enabled: [1, "Oversampling enabled"] diff --git a/peripherals/ctc/ctc_f4.yaml b/peripherals/ctc/ctc_f4.yaml new file mode 100644 index 000000000..6bac343d7 --- /dev/null +++ b/peripherals/ctc/ctc_f4.yaml @@ -0,0 +1,78 @@ +CTC: + CTL0: + SWREFPUL: + "Generate": [1, "Generates a software reference source sync pulse."] + AUTOTRIM: + Disabled: [0, "Hardware automatic trim disabled"] + Enabled: [1, "Hardware automatic trim enabled"] + CNTEN: + Disabled: [0, "CTC trim counter disabled"] + Enabled: [1, "CTC trim counter enabled"] + EREFIE: + Disabled: [0, "EREFIF interrupt disabled"] + Enabled: [1, "EREFIF interrupt enabled"] + ERRIE: + Disabled: [0, "ERRIF interrupt disabled"] + Enabled: [1, "ERRIF interrupt enabled"] + CKWARNIE: + Disabled: [0, "CKWARNIF interrupt disabled"] + Enabled: [1, "CKWARNIF interrupt enabled"] + CKOKIE: + Disabled: [0, "CKOKIF interrupt disabled"] + Enabled: [1, "CKOKIF interrupt enabled"] + CTL1: + REFPOL: + RisingEdge: [0, "Rising edge selected"] + FallingEdge: [1, "Falling edge selected"] + REFSEL: + GPIO: [0, "GPIO (CTC_SYNC) selected"] + LXTAL: [1, "LXTAL clock selected"] + Reserved1: [2, "Reserved"] + Reserved2: [3, "Reserved"] + REFPSC: + DIV1: [0, "Reference signal not divided"] + DIV2: [1, "Reference signal divided by 2"] + DIV4: [2, "Reference signal divided by 4"] + DIV8: [3, "Reference signal divided by 8"] + DIV16: [4, "Reference signal divided by 16"] + DIV32: [5, "Reference signal divided by 32"] + DIV64: [6, "Reference signal divided by 64"] + DIV128: [7, "Reference signal divided by 128"] + STAT: + REFDIR: + Up: [0, "CTC trim counter up-counting"] + Down: [1, "CTC trim counter down-counting"] + TRIMERR: + NoError: [0, "No trim value error occurs"] + ErrorOccurred: [1, "Trim value error occurs"] + REFMISS: + NoMiss: [0, "No reference sync pulse miss occurs"] + MissOccurred: [1, "Reference sync pulse miss occurs"] + CKERR: + NoError: [0, "No clock trim error occurs"] + ErrorOccurred: [1, "Clock trim error occurs"] + EREFIF: + NoReference: [0, "No expected reference occurs"] + ReferenceOccurred: [1, "Expected reference occurs"] + ERRIF: + NoError: [0, "No error occurs"] + ErrorOccurred: [1, "An error occurs"] + CKWARNIF: + NoWarning: [0, "No clock trim warning occurs"] + WarningOccurred: [1, "Clock trim warning occurs"] + CKOKIF: + NotOK: [0, "No clock trim OK occurs"] + OK: [1, "Clock trim OK occurs"] + INTC: + EREFIC: + _write: + Clear: [1, "Clear the EREFIF bit in CTC_STAT register"] + ERRIC: + _write: + Clear: [1, "Clear ERRIF, TRIMERR, REFMISS, and CKERR bits in CTC_STAT register"] + CKWARNIC: + _write: + Clear: [1, "Clear CKWARNIF bit in CTC_STAT register"] + CKOKIC: + _write: + Clear: [1, "Clear CKOKIF bit in CTC_STAT register"] diff --git a/peripherals/dbg/dbg_f4.yaml b/peripherals/dbg/dbg_f4.yaml new file mode 100644 index 000000000..e3a60c58a --- /dev/null +++ b/peripherals/dbg/dbg_f4.yaml @@ -0,0 +1,44 @@ +DBG: + ID: + ID_CODE: [0, 0xFFFFFFFF] + CTL0: + TRACE_IOEN: + Disabled: [0, "Trace pin allocation disabled"] + Enabled: [1, "Trace pin allocation enabled"] + STB_HOLD: + Disabled: [0, "No effect"] + Enabled: + [ + 1, + "In standby mode the AHB clock and system clock are provided by IRC16M, a system reset generated when exiting standby mode.", + ] + DSLP_HOLD: + Disabled: [0, "No effect"] + Enabled: + [ + 1, + "In deep-sleep mode the AHB clock and system clock are provided by IRC16M, a system reset generated when exiting deep-sleep mode.", + ] + SLP_HOLD: + Disabled: [0, "No effect"] + Enabled: [1, "In sleep mode the AHB clock is on"] + CTL1: + "CAN*_HOLD": + Continue: [0, "Continue running the CAN as usual"] + Stop: [1, "Hold the CAN for debug when the core is halted"] + "I2C*_HOLD": + Continue: [0, "Continue running I2C as usual"] + Stop: [1, "Hold the I2C timeout for debug when the core is halted"] + "TIMER*_HOLD": + Continue: [0, "Continue running the timer as usual"] + Stop: [1, "Hold the timer counter for debug when the core is halted"] + FWDGT_HOLD: + Continue: [0, "Continue running the free watchdog timer as usual"] + Stop: [1, "Hold the free watchdog timer for debug when the core is halted"] + RTC_HOLD: + Continue: [0, "Continue running the RTC as usual"] + Stop: [1, "Hold the RTC for debug when the core is halted"] + CTL2: + "TIMER*_HOLD": + Continue: [0, "Continue running the timer as usual"] + Stop: [1, "Hold the timer counter for debug when the core is halted"] diff --git a/peripherals/dma/dma_f4.yaml b/peripherals/dma/dma_f4.yaml new file mode 100644 index 000000000..403c25627 --- /dev/null +++ b/peripherals/dma/dma_f4.yaml @@ -0,0 +1,142 @@ +DMA[1-7]: + INTF*: + FTFIF*: + _read: + NotComplete: [0, "No transfer complete event"] + Complete: [1, "A transfer complete event has occured"] + _write: + Clear: [0, "Clears flag."] + HTFIF*: + _read: + NotHalf: [0, "No half transfer event"] + Half: [1, "A half transfer event has occured"] + _write: + Clear: [0, "Clears the flag."] + TAEIF*: + _read: + NoError: [0, "No transfer error"] + Error: [1, "A transfer error has occured"] + _write: + Clear: [0, "Clears the flag."] + SDEIF*: + _read: + NoError: [0, "No transfer error"] + Error: [1, "A transfer error has occured"] + _write: + Clear: [0, "Clears the flag."] + FEEIF*: + _read: + NoError: [0, "No FIFO error"] + Error: [1, "A FIFO error has occured"] + _write: + Clear: [0, "Clears the flag."] + INTC*: + FTFIFC*: + _write: + Clear: [1, "Clears the FTFIFx flag in INTF."] + HTFIFC*: + _write: + Clear: [1, "Clears the HTFIFx flag in INTF."] + TAEIFC*: + _write: + Clear: [1, "Clears the TAEIFx flag in INTF."] + SDEIFC*: + _write: + Clear: [1, "Clears the SDEIFx flag in INTF."] + FEEIFC*: + _write: + Clear: [1, "Clears the FEEIFx flag in INTF."] + CH*CTL: + PERIEN: + P0: [0, "Enable Peripheral 0"] + P1: [1, "Enable Peripheral 1"] + P2: [2, "Enable Peripheral 2"] + P3: [3, "Enable Peripheral 3"] + P4: [4, "Enable Peripheral 4"] + P5: [5, "Enable Peripheral 5"] + P6: [6, "Enable Peripheral 6"] + P7: [7, "Enable Peripheral 7"] + MBURST: + Single: [0, "Single transfer"] + INCR4: [1, "Incremental burst of 4 beats"] + INCR8: [2, "Incremental burst of 8 beats"] + INCR16: [3, "Incremental burst of 16 beats"] + PBURST: + Single: [0, "Single transfer"] + INCR4: [1, "Incremental burst of 4 beats"] + INCR8: [2, "Incremental burst of 8 beats"] + INCR16: [3, "Incremental burst of 16 beats"] + MBS: + Zero: [0, "Memory 0 is selected as the memory transfer area"] + One: [1, "Memory 1 is selected as the memory transfer area"] + SBMEN: + Disabled: [0, "Switch buffer mode disabled"] + Enabled: [1, "Switch buffer mode enabled"] + PRIO: + Low: [0, "Low priority"] + Medium: [1, "Medium priority"] + High: [2, "High priority"] + VeryHigh: [3, "Ultra high priority"] + PAIF: + PWIDTH: [0, "THe peripheral address increment is determined by the PWIDTH field"] + Fixed: [1, "The peripheral address increment is fixed to 4"] + MWIDTH: + Width8: [0, "8-bit width"] + Width16: [1, "16-bit width"] + Width32: [2, "32-bit width"] + PWIDTH: + Width8: [0, "8-bit width"] + Width16: [1, "16-bit width"] + Width32: [2, "32-bit width"] + PNAGA: + Fixed: [0, "Fixed Address generation mode."] + Increment: [1, "Increment Address generation mode."] + CMEN: + Disabled: [0, "Circular mode disabled"] + Enabled: [1, "Circular mode enabled"] + TM: + Periph2Mem: [0, "Peripheral to memory"] + Mem2Periph: [1, "Memory to peripheral"] + Mem2Mem: [2, "Memory to memory"] + TFCS: + DMA: [0, "DMA is selected as the transfer flow controller"] + Peripheral: [1, "Peripheral is selected as the transfer flow controller"] + FTFIE: + Disabled: [0, "Transfer complete interrupt disabled"] + Enabled: [1, "Transfer complete interrupt enabled"] + HTFIE: + Disabled: [0, "Half transfer interrupt disabled"] + Enabled: [1, "Half transfer interrupt enabled"] + SDEIE: + Disabled: [0, "Single data mode exception interrupt disabled"] + Enabled: [1, "Single data mode exception interrupt enabled"] + CHEN: + Disabled: [0, "Channel disabled"] + Enabled: [1, "Channel enabled"] + "CH*CNT": + CNT: [0, 0xFFFF] + "CH*PADDR": + PADDR: [0, 0xFFFFFFFF] + "CH*M0ADDR": + M0ADDR: [0, 0xFFFFFFFF] + "CH*M1ADDR": + M1ADDR: [0, 0xFFFFFFFF] + "CH*FCTL": + FEEIE: + Disabled: [0, "FIFO error interrupt disabled"] + Enabled: [1, "FIFO error interrupt enabled"] + FCNT: + NoData: [0, "No data in FIFO"] + Words1: [1, "1 word of data in FIFO"] + Words2: [2, "2 words of data in FIFO"] + Words3: [3, "3 words of data in FIFO"] + Empty: [4, "FIFO is empty"] + Full: [5, "FIFO is full"] + MDMEN: + Disabled: [0, "Multi-data mode disabled"] + Enabled: [1, "Multi-data mode enabled"] + FCCV: + Words1: [0, "1 word of data is critical value"] + Words2: [1, "2 words of data is critical value"] + Words3: [2, "3 words of data is critical value"] + Words4: [3, "4 words of data is critical value"] diff --git a/peripherals/gpio/gpio_f4.yaml b/peripherals/gpio/gpio_f4.yaml new file mode 100644 index 000000000..0b6667986 --- /dev/null +++ b/peripherals/gpio/gpio_f4.yaml @@ -0,0 +1,71 @@ +# Copyright 2021 The gd32-rs authors. +# +# SPDX-License-Identifier: MIT OR Apache-2.0 + +"GPIO*": + CTL: + "CTL*": + Input: [0, "Input mode (reset state)"] + Output: [1, "General purpose output mode"] + Alternate: [2, "Alternate function mode"] + Analog: [3, "Analog mode"] + OMODE: + "OM*": + PushPull: [0, "Output push-pull (reset state)"] + OpenDrain: [1, "Output open-drain"] + OSPD: + "OSPD*": + Speed2M: [0, "Max output speed 2 MHz"] + Speed10M: [1, "Max output speed 10 MHz"] + Speed50M: [3, "Max output speed 50 MHz"] + PUD: + "PUD*": + Floating: [0, "No pull-up, pull-down (reset state)"] + PullUp: [1, "Pull-up"] + PullDown: [2, "Pull-down"] + ISTAT: + "ISTAT*": + Low: [0, "Input is logic low"] + High: [1, "Input is logic high"] + OCTL: + "OCTL*": + Low: [0, "Set output to logic low"] + High: [1, "Set output to logic high"] + BOP: + "CR*": + _write: + Reset: [1, "Resets the corresponding OCTLx bit"] + "BOP*": + _write: + Set: [1, "Sets the corresponding OCTLx bit"] + LOCK: + LKK: + NotActive: [0, "Register not locked and port configuration can be changed."] + Active: [1, "Register locked and port configuration can not be changed."] + "LK[0-15]": + Unlocked: [0, "Corresponding bit port configuration not locked"] + Locked: [1, "Corresponding bit port configuration locked"] + BC: + "CR*": + _write: + Reset: [1, "Resets the corresponding OCTLx bit"] + TG: + "TG*": + _write: + Toggle: [1, "Toggles the corresponding OCTLx bit"] + AFSEL[01]: + "SEL*": + AF0: [0, "AF0"] + AF1: [1, "AF1"] + AF2: [2, "AF2"] + AF3: [3, "AF3"] + AF4: [4, "AF4"] + AF5: [5, "AF5"] + AF6: [6, "AF6"] + AF7: [7, "AF7"] + AF9: [9, "AF9"] + AF11: [11, "AF11"] + AF12: [12, "AF12"] + AF13: [13, "AF13"] + AF14: [14, "AF14"] + AF15: [15, "AF15"] diff --git a/peripherals/iref/iref_f4.yaml b/peripherals/iref/iref_f4.yaml new file mode 100644 index 000000000..0c8e766b9 --- /dev/null +++ b/peripherals/iref/iref_f4.yaml @@ -0,0 +1,13 @@ +IREF: + CTL: + CREN: + Disabled: [0, "Current reference disabled"] + Enabled: [1, "Current reference enabled"] + SSEL: + UA1: [0, "Low power, 1uA step."] + UA8: [1, "High current, 8uA step."] + CPT: [0, 0x1F] + SCMOD: + Source: [0, "Source current mode"] + Sink: [1, "Sink current mode"] + CSDT: [0, 0x3F] diff --git a/peripherals/pmu/pmu_f4.yaml b/peripherals/pmu/pmu_f4.yaml new file mode 100644 index 000000000..8456e8223 --- /dev/null +++ b/peripherals/pmu/pmu_f4.yaml @@ -0,0 +1,86 @@ +PMU: + CTL: + BKPWEN: + Disabled: [0, "Access to backup domain registers disabled"] + Enabled: [1, "Access to backup domain registers enabled"] + LVDT: + V2_1: [0, "2.1 V"] + V2_3: [1, "2.3 V"] + V2_4: [2, "2.4 V"] + V2_6: [3, "2.6 V"] + V2_7: [4, "2.7 V"] + V2_9: [5, "2.9 V"] + V3_0: [6, "3.0 V"] + V3_1: [7, "3.1 V"] + LVDEN: + Disabled: [0, "Low voltage detector disabled"] + Enabled: [1, "Low voltage detector enabled"] + STBRST: + _write: + Clear: [1, "Clear the standby flag"] + WURST: + _write: + Clear: [1, "Clear the wakeup flag"] + STBMOD: + DeepSleep: [0, "Enter Deep-sleep mode when the CPU enters deepsleep"] + Standby: [1, "Enter Standby mode when the CPU enters deepsleep"] + LDOLP: + Normal: [0, "LDO operates normally during Deepsleep mode"] + LowPower: [1, "LDO in low-power mode during Deepsleep mode"] + LDOVS: + LowMode: [1, "LDO output voltage low mode"] + MidMode: [2, "LDO output voltage mid mode"] + HighMode: [3, "LDO output voltage high mode"] + LDEN: + Disabled: [0, "Low-driver mode disabled in Deep-sleep mode"] + Enabled: [3, "Low-driver mode enabled in Deep-sleep mode"] + HDS: + NoSwitch: [0, "No high-driver mode switch"] + Switch: [1, "High-driver mode switch enabled"] + HDEN: + Disabled: [0, "High-driver mode disabled"] + Enabled: [1, "High-driver mode enabled"] + LDNP: + NormalDriver: [0, "Normal-driver mode with normal power LDO"] + LowDriver: [1, "Low-driver mode enabled with normal power LDO"] + LDLP: + NormalDriver: [0, "Normal-driver mode with low power LDO"] + LowDriver: [1, "Low-driver mode enabled with low power LDO"] + CS: + LDRF: + NormalDriver: [0, "Normal driver in Deep-sleep mode"] + LowDriver: [3, "Low-driver mode in Deep-sleep mode"] + HDSRF: + _read: + NotReady: [0, "High-driver switch not ready"] + Ready: [1, "High-driver switch ready"] + HDRF: + _read: + NotReady: [0, "High-driver not ready"] + Ready: [1, "High-driver ready"] + LDOVSRF: + _read: + NotReady: [0, "LDO voltage select not ready"] + Ready: [1, "LDO voltage select ready"] + BLDOON: + Closed: [0, "Backup SRAM LDO closed"] + Open: [1, "Open the Backup SRAM LDO"] + WUPEN: + Disabled: [0, "WKUP pin function disabled"] + Enabled: [1, "WKUP pin function enabled"] + BLDORF: + _read: + NotReady: [0, "Backup SRAM LDO not ready"] + Ready: [1, "Backup SRAM LDO ready"] + LVDF: + _read: + NoEvent: [0, "No Low Voltage event occurred (VDD > threshold)"] + EventOccurred: [1, "Low Voltage event occurred (VDD ≤ threshold)"] + STBF: + _read: + NotEntered: [0, "The device has not entered Standby mode"] + Entered: [1, "The device has been in Standby mode"] + WUF: + _read: + NoEvent: [0, "No wakeup event received"] + EventOccurred: [1, "Wakeup event occurred"] diff --git a/peripherals/rcu/rcu_f4.yaml b/peripherals/rcu/rcu_f4.yaml new file mode 100644 index 000000000..6555e3654 --- /dev/null +++ b/peripherals/rcu/rcu_f4.yaml @@ -0,0 +1,349 @@ +RCU: + CTL0: + "PLL*STB": + _read: + NotReady: [0, "PLL is not stable"] + Ready: [1, "PLL is stable"] + "PLL*EN": + "Off": [0, "Clock Off"] + "On": [1, "Clock On"] + CKMEN: + "Off": [0, "Clock monitor disabled"] + "On": [1, "Clock monitor enabled"] + HXTALBPS: + NotBypassed: [0, "HXTAL crystal oscillator not bypassed"] + Bypassed: [1, "HXTAL crystal oscillator bypassed with external clock"] + HXTALSTB: + _read: + NotReady: [0, "HXTAL is not stable"] + Ready: [1, "HXTAL is stable"] + HXTALEN: + "Off": [0, "Clock Off"] + "On": [1, "Clock On"] + IRC16MCALIB: [0, 255] + IRC16MADJ: [0, 31] + IRC16MSTB: + _read: + NotReady: [0, "IRC16M is not stable"] + Ready: [1, "IRC16M is stable"] + IRC16MEN: + "Off": [0, "Clock Off"] + "On": [1, "Clock On"] + PLL: + PLLQ: + DIV2: [2, "PLL divisor Q set to 2."] + DIV3: [3, "PLL divisor Q set to 3."] + DIV4: [4, "PLL divisor Q set to 4."] + DIV5: [5, "PLL divisor Q set to 5."] + DIV6: [6, "PLL divisor Q set to 6."] + DIV7: [7, "PLL divisor Q set to 7."] + DIV8: [8, "PLL divisor Q set to 8."] + DIV9: [9, "PLL divisor Q set to 9."] + DIV10: [10, "PLL divisor Q set to 10."] + DIV11: [11, "PLL divisor Q set to 11."] + DIV12: [12, "PLL divisor Q set to 12."] + DIV13: [13, "PLL divisor Q set to 13."] + DIV14: [14, "PLL divisor Q set to 14."] + DIV15: [15, "PLL divisor Q set to 15."] + PLLSEL: + IRC16M: [0, "IRC16M selected as the source clock of the PLL, PLLSAI, PLLI2S"] + HXTAL: [1, "HXTAL selected as the source clock of PLL, PLLSAI, PLLI2S"] + PLLP: + DIV2: [0, "PLL division factor P set to 2"] + DIV4: [1, "PLL division factor P set to 4"] + DIV8: [2, "PLL division factor P set to 8"] + CFG0: + CKOUT1SEL: + SYSCLK: [0, "System clock selected"] + PLLI2SR: [1, "PLL I2S clock selected"] + HXTAL: [2, "External high speed oscillator clock selected"] + PLLP: [3, "PLL clock selected"] + CKOUT1DIV: + DIV1: [0, "CK_OUT1 is divided by 1"] + DIV2: [4, "CK_OUT1 is divided by 2"] + DIV3: [5, "CK_OUT1 is divided by 3"] + DIV4: [6, "CK_OUT1 is divided by 4"] + DIV5: [7, "CK_OUT1 is divided by 5"] + CKOUT0DIV: + DIV1: [0, "CK_OUT0 is divided by 1"] + DIV2: [4, "CK_OUT0 is divided by 2"] + DIV3: [5, "CK_OUT0 is divided by 3"] + DIV4: [6, "CK_OUT0 is divided by 4"] + DIV5: [7, "CK_OUT0 is divided by 5"] + I2SSEL: + CK_PLLI2S: [0, "PLLI2S output clock selected as the I2S clock source."] + CK_I2S: [1, "External I2S_CKIN pin selected as I2S source clock."] + CKOUT0SEL: + IRC16M: [0, "Internal 16 MHz RC oscillator clock selected"] + LXTAL: [1, "External low speed oscillator clock selected"] + HXTAL: [2, "External high speed oscillator clock selected"] + CK_PLLP: [3, "PLL clock selected"] + RTCDIV: + NoClk: [0, "No clock selected for RTC"] + DIV2: [2, "CK_HXTAL is divided by 2"] + DIV3: [3, "CK_HXTAL is divided by 3"] + DIV4: [4, "CK_HXTAL is divided by 4"] + DIV5: [5, "CK_HXTAL is divided by 5"] + DIV6: [6, "CK_HXTAL is divided by 6"] + DIV7: [7, "CK_HXTAL is divided by 7"] + DIV8: [8, "CK_HXTAL is divided by 8"] + DIV9: [9, "CK_HXTAL is divided by 9"] + DIV10: [10, "CK_HXTAL is divided by 10"] + DIV11: [11, "CK_HXTAL is divided by 11"] + DIV12: [12, "CK_HXTAL is divided by 12"] + DIV13: [13, "CK_HXTAL is divided by 13"] + DIV14: [14, "CK_HXTAL is divided by 14"] + DIV15: [15, "CK_HXTAL is divided by 15"] + DIV16: [16, "CK_HXTAL is divided by 16"] + DIV17: [17, "CK_HXTAL is divided by 17"] + DIV18: [18, "CK_HXTAL is divided by 18"] + DIV19: [19, "CK_HXTAL is divided by 19"] + DIV20: [20, "CK_HXTAL is divided by 20"] + DIV21: [21, "CK_HXTAL is divided by 21"] + DIV22: [22, "CK_HXTAL is divided by 22"] + DIV23: [23, "CK_HXTAL is divided by 23"] + DIV24: [24, "CK_HXTAL is divided by 24"] + DIV25: [25, "CK_HXTAL is divided by 25"] + DIV26: [26, "CK_HXTAL is divided by 26"] + DIV27: [27, "CK_HXTAL is divided by 27"] + DIV28: [28, "CK_HXTAL is divided by 28"] + DIV29: [29, "CK_HXTAL is divided by 29"] + DIV30: [30, "CK_HXTAL is divided by 30"] + DIV31: [31, "CK_HXTAL is divided by 31"] + "APB[12]PSC": + DIV1: [0, "CK_AHB selected"] + DIV2: [4, "CK_AHB/2 selected"] + DIV4: [5, "CK_AHB/4 selected"] + DIV8: [6, "CK_AHB/8 selected"] + DIV16: [7, "CK_AHB/16 selected"] + AHBPSC: + Div1: [0, "CK_SYS"] + Div2: [8, "CK_SYS divided by 2"] + Div4: [9, "CK_SYS divided by 4"] + Div8: [10, "CK_SYS divided by 8"] + Div16: [11, "CK_SYS divided by 16"] + Div64: [12, "CK_SYS divided by 64"] + Div128: [13, "CK_SYS divided by 128"] + Div256: [14, "CK_SYS divided by 256"] + Div512: [15, "CK_SYS divided by 512"] + SCSS: + IRC16M: [0, "IRC16M selected as the system clock"] + HXTAL: [1, "HXTAL selected as the system clock."] + PPLLP: [2, "Select CK_PLLP as the system clock."] + SCS: + IRC16M: [0, "Select IRC16M as the system clock source."] + HXTAL: [1, "Select the HXTAL as the system clock source."] + PLLP: [2, "Select the PLLP as the system clock source."] + INT: + CKMIC: + _write: + Clear: [1, "Clear CKMIF flag"] + CKMIF: + _read: + NotInterrupted: [0, "Clock operating normally"] + Interrupted: [1, "HXTAL clock stuck"] + PLL*STBIC: + _write: + Clear: [1, "Clear PLLSTBIF flag"] + PLL*STBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + PLL*STBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "PLL stabilisation interrupt generated"] + HXTALSTBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + HXTALSTBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "HXTAL stabilisation interrupt generated"] + LXTALSTBIC: + _write: + Clear: [1, "Clear LXTALSTBIF flag"] + LXTALSTBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + LXTALSTBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "LXTAL stabilisation interrupt generated"] + IRC16MSTBIC: + _write: + Clear: [1, "Clear IRC16MSTBIF flag"] + IRC16MSTBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + IRC16MSTBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "IRC16M stabilisation interrupt generated"] + IRC32KSTBIC: + _write: + Clear: [1, "Clear IRC32KSTBIF flag"] + IRC32KSTBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + IRC32KSTBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "IRC32K stabilisation interrupt generated"] + "AHB[123]RST": + "*RST": + Reset: [1, "Reset the selected module."] + "AHB[123]EN": + "*EN": + Disable: [0, "Disable the selected module clock."] + Enable: [1, "Enable the selected module clock."] + "APB[12]RST": + "*RST": + Reset: [1, "Reset the selected module."] + "APB[12]EN": + "*EN": + Disable: [0, "Disable the selected module clock."] + Enable: [1, "Enable the selected module clock."] + "AHB[123]SPEN": + "*EN": + Disable: [0, "Disable the selected module in sleep mode."] + Enable: [1, "Enable the selected module in sleep mode."] + "APB[12]SPEN,ADDAPB1SPEN": + "*EN": + Disable: [0, "Disable the selected module in sleep mode."] + Enable: [1, "Enable the selected module in sleep mode."] + ADDAPB1RST: + "*RST": + Reset: [1, "Reset the selected module"] + ADDAPB1EN: + "*EN": + Disabled: [0, "The selected clock is disabled"] + Enabled: [1, "The selected clock is enabled"] + BDCTL: + BKPRST: + NoReset: [0, "Reset not activated"] + Reset: [1, "Reset the entire RTC domain"] + RTCEN: + Disabled: [0, "RTC clock disabled"] + Enabled: [1, "RTC clock enabled"] + RTCSRC: + NoClock: [0, "No clock"] + LXTAL: [1, "LXTAL oscillator clock used as RTC clock"] + IRC32K: [2, "IRC32K oscillator clock used as RTC clock"] + HXTAL: [3, "HXTAL oscillator / RTCDIV (CFG0) used as RTC clock"] + LXTALDRI: + Low: [0, "Low driving capability (reset value)"] + High: [1, "High driving capability"] + LXTALBPS: + NotBypassed: [0, "LXTAL crystal oscillator not bypassed"] + Bypassed: [1, "LXTAL crystal oscillator bypassed with external clock"] + LXTALSTB: + _read: + NotReady: [0, "LXTAL oscillator not ready"] + Ready: [1, "LXTAL oscillator ready"] + LXTALEN: + "Off": [0, "LXTAL oscillator Off"] + "On": [1, "LXTAL oscillator On"] + RSTSCK: + LPRSTF,WWDGTRSTF,FWDGTRSTF,SWRSTF,PORRSTF,EPRSTF,BORRSTF: + _read: + NoReset: [0, "No reset has occured"] + Reset: [1, "A reset has occured"] + RSTFC: + _write: + Clear: [1, "Clears reset flags"] + IRC32KSTB: + _read: + NotReady: [0, "IRC32K oscillator is not stable"] + Ready: [1, "IRC32K oscillator is stable"] + IRC32KEN: + "Off": [0, "IRC32K oscillator disabled"] + "On": [1, "IRC32K oscillator enabled"] + PLLSSCTL: + SSCGON: + Enable: [0, "Enable the module."] + Disable: [1, "Disable the module."] + SS_TYPE: + CENTER: [0, "Center spread."] + DOWN: [1, "Down spread."] + PLLI2S: + PLLI2SR: + DIV2: [2, "I2S clock frequency divided by 2."] + DIV3: [3, "I2S clock frequency divided by 3."] + DIV4: [4, "I2S clock frequency divided by 4."] + DIV5: [5, "I2S clock frequency divided by 5."] + DIV6: [6, "I2S clock frequency divided by 6."] + DIV7: [7, "I2S clock frequency divided by 7."] + PLLSAI: + PLLSAIR: + DIV2: [2, "TLI clock frequency is PLLSAIVCO divided by 2."] + DIV3: [3, "TLI clock frequency is PLLSAIVCO divided by 3."] + DIV4: [4, "TLI clock frequency is PLLSAIVCO divided by 4."] + DIV5: [5, "TLI clock frequency is PLLSAIVCO divided by 5."] + DIV6: [6, "TLI clock frequency is PLLSAIVCO divided by 6."] + DIV7: [7, "TLI clock frequency is PLLSAIVCO divided by 7."] + PLLSAIP: + DIV2: [0, "PLLSAI P Clock is PLLSAIVCO divided by 2."] + DIV4: [1, "PLLSAI P Clock is PLLSAIVCO divided by 4."] + DIV6: [2, "PLLSAI P Clock is PLLSAIVCO divided by 6."] + DIV8: [3, "PLLSAI P Clock is PLLSAIVCO divided by 8."] + CFG1: + TIMERSEL: + RESET: + [ + 0, + "If APB1PSC/APB2PSC in RCU_CFG0 register is 0b0xx(CK_APBx = CK_AHB) or 0b100(CK_APBx = CK_AHB/2), the TIMER clock is equal to CK_AHB(CK_TIMERx = CK_AHB). Or else, the TIMER clock is twice the corresponding APB clock (TIMER in APB1 domain: CK_TIMERx = 2 x CK_APB1; TIMER in APB2 domain: CK_TIMERx = 2 x CK_APB2).", + ] + SET: + [ + 1, + "If APB1PSC/APB2PSC in RCU_CFG0 register is 0b0xx(CK_APBx = CK_AHB), 0b100(CK_APBx = CK_AHB/2), or 0b101(CK_APBx = CK_AHB/4), the TIMER clock is equal to CK_AHB(CK_TIMERx = CK_AHB). Or else, the TIMER clock is four times the corresponding APB clock (TIMER in APB1 domain: CK_TIMERx = 4x CK_APB1, TIMER in APB2 domain: CK_TIMERx = 4 x CK_APB2).", + ] + PLLSAIRDIV: + DIV2: [0, "TLI clock is CK_PLLSAIR divided by 2."] + DIV4: [1, "TLI clock is CK_PLLSAIR divided by 4."] + DIV8: [2, "TLI clock is CK_PLLSAIR divided by 8."] + DIV16: [3, "TLI clock is CK_PLLSAIR divided by 16."] + ADDCTL: + IRC48MSTB: + _read: + NotReady: [0, "IRC48M oscillator is not stable."] + Ready: [1, "IRC48M oscillator is stable."] + IRC48MEN: + "Off": [0, "IRC48M Clock off."] + "On": [1, "IRC48M Clock on."] + PLL48MSEL: + PLLQ: [0, "Select the PLLQ clock."] + PLLSAIP: [1, "Select the PLLSAIP clock."] + CK48MSEL: + None: + [0, "Don’t select IRC48M clock(use CK_PLLQ clock or CK_PLLSAIP clock select by PLL48MSEL)"] + IRC48M: [1, "Select the IRC48M clock."] + ADDINT: + IRC48MSTBIC: + _write: + Clear: [1, "Clear PLLSTBIF flag"] + IRC48MSTBIE: + Disabled: [0, "Interrupt disabled"] + Enabled: [1, "Interrupt enabled"] + IRC48MSTBIF: + _read: + NotInterrupted: [0, "No interrupt generated"] + Interrupted: [1, "PLL stabilisation interrupt generated"] + DSV: + DSLPVS: + Default: [0, "The core voltage is default value in Deep-sleep mode"] + Default10Pct: + [ + 1, + "The core voltage is (default value-0.1)V in Deep-sleep mode(customers are not recommended to use it)", + ] + Default20Pct: + [ + 2, + "The core voltage is (default value-0.2)V in Deep-sleep mode(customers are not recommended to use it)", + ] + Default30Pct: + [ + 3, + "The core voltage is (default value-0.3)V in Deep-sleep mode(customers are not recommended to use it)", + ] diff --git a/peripherals/trng/trng.yaml b/peripherals/trng/trng.yaml new file mode 100644 index 000000000..42a42a451 --- /dev/null +++ b/peripherals/trng/trng.yaml @@ -0,0 +1,41 @@ +TRNG: + CTL: + IE: + Disable: [0, "Disable TRNG interrupt"] + Enable: [1, "Enable TRNG interrupt"] + TRNGEN: + Disable: [0, "Disable TRNG"] + Enable: [1, "Enable TRNG"] + STAT: + SEIF: + _read: + NoFault: [0, "No fault detected"] + Fault: [1, "Seed error has been detected. The bit is cleared by writing 0."] + _write: + Clear: [0, "Clear the SEIF flag"] + CEIF: + _read: + NoFault: [0, "No fault detected"] + Fault: [1, "Clock error has been detected. The bit is cleared by writing 0."] + _write: + Clear: [0, "Clear the CEIF flag"] + SECS: + _read: + NotReady: [0, "The seed is not ready"] + Ready: [1, "The seed is ready"] + CECS: + _read: + NotReady: + [ + 0, + "Clock error is not detected at current time. In case of CEIF=1 and CECS=0, it means clock error has been detected before but now is recovered.", + ] + Ready: + [ + 1, + "Clock error is detected at current time. TRNG_CLK frequency is lower than 1/HCLK frequency", + ] + DRDY: + _read: + NotReady: [0, "Data is not ready"] + Ready: [1, "Data is ready"]